功能新增: - OSS 存储使用情况显示(文件页面) - OSS 当日流量统计(阿里云云监控API) - 分享页面路由修复(/s/xxx 格式支持) Bug修复: - 修复分享页面资源路径(相对路径改绝对路径) - 修复分享码获取逻辑(支持路径格式) - 修复OSS配额undefined显示问题 - 修复登录流程OSS配置检查 - 修复文件数为null时的显示问题 依赖更新: - 添加 @alicloud/cms20190101 云监控SDK - 添加 @alicloud/openapi-client Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
71 lines
986 B
Markdown
71 lines
986 B
Markdown
# has-flag [](https://travis-ci.org/sindresorhus/has-flag)
|
|
|
|
> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
|
|
|
|
Correctly stops looking after an `--` argument terminator.
|
|
|
|
|
|
## Install
|
|
|
|
```
|
|
$ npm install has-flag
|
|
```
|
|
|
|
|
|
## Usage
|
|
|
|
```js
|
|
// foo.js
|
|
const hasFlag = require('has-flag');
|
|
|
|
hasFlag('unicorn');
|
|
//=> true
|
|
|
|
hasFlag('--unicorn');
|
|
//=> true
|
|
|
|
hasFlag('f');
|
|
//=> true
|
|
|
|
hasFlag('-f');
|
|
//=> true
|
|
|
|
hasFlag('foo=bar');
|
|
//=> true
|
|
|
|
hasFlag('foo');
|
|
//=> false
|
|
|
|
hasFlag('rainbow');
|
|
//=> false
|
|
```
|
|
|
|
```
|
|
$ node foo.js -f --unicorn --foo=bar -- --rainbow
|
|
```
|
|
|
|
|
|
## API
|
|
|
|
### hasFlag(flag, [argv])
|
|
|
|
Returns a boolean for whether the flag exists.
|
|
|
|
#### flag
|
|
|
|
Type: `string`
|
|
|
|
CLI flag to look for. The `--` prefix is optional.
|
|
|
|
#### argv
|
|
|
|
Type: `string[]`<br>
|
|
Default: `process.argv`
|
|
|
|
CLI arguments.
|
|
|
|
|
|
## License
|
|
|
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|