wisdom 13.0.5 → 13.1.2

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 (3) hide show
  1. package/ChangeLog +18 -0
  2. package/lib/parser.js +12 -9
  3. package/package.json +1 -2
package/ChangeLog CHANGED
@@ -1,3 +1,21 @@
1
+ 2022.06.17, v13.1.2
2
+
3
+ fix:
4
+ - wisdom: private
5
+
6
+
7
+ 2022.05.24, v13.1.1
8
+
9
+ feature:
10
+ - package: rm useless async
11
+
12
+
13
+ 2022.05.24, v13.1.0
14
+
15
+ feature:
16
+ - wisdom: parser: simplify
17
+
18
+
1
19
  2022.05.24, v13.0.5
2
20
 
3
21
  fix:
package/lib/parser.js CHANGED
@@ -1,11 +1,16 @@
1
1
  import jessy from 'jessy';
2
2
 
3
- const {isArray} = Array;
4
-
5
- const maybeArray = (a) => isArray(a) ? a : [a];
6
-
7
3
  const isUndefined = (a) => typeof a === 'undefined';
8
4
 
5
+ /*
6
+ Determine if value should be used according to conditional prefixes:
7
+ ^ exist
8
+ ! disabled
9
+ : always
10
+ - not exist, or disabled
11
+ not exist, or enabled
12
+ */
13
+
9
14
  const paths = [
10
15
  '^scripts.wisdom',
11
16
  '^scripts.wisdom:type',
@@ -21,20 +26,18 @@ const paths = [
21
26
  '^scripts.wisdom:done',
22
27
  ];
23
28
 
24
- const check = (info) => (data) => {
25
- const [path] = maybeArray(data);
26
-
29
+ const check = (info) => (path) => {
27
30
  if (path.startsWith(':'))
28
31
  return true;
29
32
 
30
- const cleanPath = path.replace(/[!^:]/, '');
33
+ const cleanPath = path.replace(/[!^:-]/, '');
31
34
  const result = jessy(cleanPath, info);
32
35
 
33
36
  if (path.startsWith('-'))
34
37
  return !result || isUndefined(result);
35
38
 
36
39
  if (path.startsWith('!'))
37
- return result === false;
40
+ return !result && !isUndefined(result);
38
41
 
39
42
  if (path.startsWith('^'))
40
43
  return Boolean(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wisdom",
3
- "version": "13.0.5",
3
+ "version": "13.1.2",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "configurable publish releases to github and npm",
6
6
  "homepage": "http://github.com/coderaiser/wisdom",
@@ -33,7 +33,6 @@
33
33
  "url": "git://github.com/coderaiser/wisdom.git"
34
34
  },
35
35
  "dependencies": {
36
- "async": "^3.1.0",
37
36
  "changelog-io": "^7.0.0",
38
37
  "currify": "^4.0.0",
39
38
  "envir": "^2.0.0",