@clerc/plugin-strict-flags 0.42.0 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +7 -11
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -8,16 +8,12 @@ const locales$1 = {
8
8
  "utils.and": "%s \u548C %s"
9
9
  }
10
10
  };
11
- function semanticArray(array, { add, t }) {
11
+ function semanticArray(arr, { add, t }) {
12
12
  add(locales$1);
13
- if (array.length <= 1) {
14
- return array[0];
13
+ if (arr.length <= 1) {
14
+ return arr[0];
15
15
  }
16
- return t(
17
- "utils.and",
18
- array.slice(0, -1).join(", "),
19
- array[array.length - 1]
20
- );
16
+ return t("utils.and", arr.slice(0, -1).join(", "), arr[arr.length - 1]);
21
17
  }
22
18
 
23
19
  const locales = {
@@ -37,9 +33,9 @@ const strictFlagsPlugin = () => definePlugin({
37
33
  setup: (cli) => {
38
34
  const { add, t } = cli.i18n;
39
35
  add(locales);
40
- return cli.inspector((context, next) => {
41
- const keys = Object.keys(context.unknownFlags);
42
- if (!context.resolved || keys.length === 0) {
36
+ return cli.inspector((ctx, next) => {
37
+ const keys = Object.keys(ctx.unknownFlags);
38
+ if (!ctx.resolved || keys.length === 0) {
43
39
  next();
44
40
  } else {
45
41
  const error = keys.length > 1 ? new Error(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerc/plugin-strict-flags",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve)",
5
5
  "type": "module",
6
6
  "description": "Clerc plugin strict flags",
@@ -48,8 +48,8 @@
48
48
  "access": "public"
49
49
  },
50
50
  "devDependencies": {
51
- "@clerc/utils": "0.42.0",
52
- "@clerc/core": "0.42.0"
51
+ "@clerc/core": "0.42.1",
52
+ "@clerc/utils": "0.42.1"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@clerc/core": "*"