@beecode/msh-util 1.0.2 → 1.2.0
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.
- package/lib/array-util.d.ts +23 -0
- package/lib/array-util.d.ts.map +1 -0
- package/lib/array-util.js +30 -0
- package/lib/array-util.js.map +1 -0
- package/package.json +19 -19
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const arrayUtil: {
|
|
2
|
+
/**
|
|
3
|
+
* Check if array element is not empty
|
|
4
|
+
* @template T
|
|
5
|
+
* @param {T | null | undefined} value
|
|
6
|
+
* @return {value is T}
|
|
7
|
+
* @example
|
|
8
|
+
* const notEmptyArray = [0, 1, 2, null, undefined, ''].filter(arrayUtil.notEmpty))
|
|
9
|
+
* console.log(notEmptyArray)// [0, 1, 2, '']
|
|
10
|
+
*/
|
|
11
|
+
notEmpty: <T>(value: T | null | undefined) => value is T;
|
|
12
|
+
/**
|
|
13
|
+
* Check if array element is not falsy
|
|
14
|
+
* @template T
|
|
15
|
+
* @param {T | null | undefined} value
|
|
16
|
+
* @return {value is T}
|
|
17
|
+
* @example
|
|
18
|
+
* const notFalsyArray = [0, 1, 2, null, undefined, ''].filter(arrayUtil.notFalsy))
|
|
19
|
+
* console.log(notFalsyArray)// [1, 2]
|
|
20
|
+
*/
|
|
21
|
+
notFalsy: <T_1>(value: T_1 | null | undefined) => value is T_1;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=array-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-util.d.ts","sourceRoot":"","sources":["../src/array-util.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;IACrB;;;;;;;;OAQG;;IAIH;;;;;;;;OAQG;;CAIH,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.arrayUtil = void 0;
|
|
4
|
+
exports.arrayUtil = {
|
|
5
|
+
/**
|
|
6
|
+
* Check if array element is not empty
|
|
7
|
+
* @template T
|
|
8
|
+
* @param {T | null | undefined} value
|
|
9
|
+
* @return {value is T}
|
|
10
|
+
* @example
|
|
11
|
+
* const notEmptyArray = [0, 1, 2, null, undefined, ''].filter(arrayUtil.notEmpty))
|
|
12
|
+
* console.log(notEmptyArray)// [0, 1, 2, '']
|
|
13
|
+
*/
|
|
14
|
+
notEmpty: (value) => {
|
|
15
|
+
return value !== null && value !== undefined;
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Check if array element is not falsy
|
|
19
|
+
* @template T
|
|
20
|
+
* @param {T | null | undefined} value
|
|
21
|
+
* @return {value is T}
|
|
22
|
+
* @example
|
|
23
|
+
* const notFalsyArray = [0, 1, 2, null, undefined, ''].filter(arrayUtil.notFalsy))
|
|
24
|
+
* console.log(notFalsyArray)// [1, 2]
|
|
25
|
+
*/
|
|
26
|
+
notFalsy: (value) => {
|
|
27
|
+
return !!value;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=array-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-util.js","sourceRoot":"","sources":["../src/array-util.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG;IACxB;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAI,KAA2B,EAAc,EAAE;QACxD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;IAC7C,CAAC;IACD;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAI,KAA2B,EAAc,EAAE;QACxD,OAAO,CAAC,CAAC,KAAK,CAAA;IACf,CAAC;CACD,CAAA"}
|
package/package.json
CHANGED
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"date-fns": "2.29.3",
|
|
21
|
-
"joi": "17.
|
|
21
|
+
"joi": "17.9.1",
|
|
22
22
|
"lodash.clonedeep": "4.5.0",
|
|
23
23
|
"rxjs": "7.8.0"
|
|
24
24
|
},
|
|
25
25
|
"description": "",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@commitlint/cli": "17.
|
|
27
|
+
"@commitlint/cli": "17.5.1",
|
|
28
28
|
"@commitlint/config-conventional": "17.4.4",
|
|
29
|
-
"@commitlint/prompt": "17.
|
|
30
|
-
"@semantic-release/changelog": "6.0.
|
|
29
|
+
"@commitlint/prompt": "17.5.0",
|
|
30
|
+
"@semantic-release/changelog": "6.0.3",
|
|
31
31
|
"@semantic-release/commit-analyzer": "9.0.2",
|
|
32
32
|
"@semantic-release/exec": "6.0.3",
|
|
33
33
|
"@semantic-release/git": "10.0.1",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"@semantic-release/release-notes-generator": "10.0.3",
|
|
36
36
|
"@types/jest": "29.5.0",
|
|
37
37
|
"@types/lodash.clonedeep": "4.5.7",
|
|
38
|
-
"@types/node": "18.15.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
40
|
-
"@typescript-eslint/parser": "5.
|
|
38
|
+
"@types/node": "18.15.11",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "5.57.1",
|
|
40
|
+
"@typescript-eslint/parser": "5.57.1",
|
|
41
41
|
"commitizen": "4.3.0",
|
|
42
|
-
"eslint": "8.
|
|
43
|
-
"eslint-config-prettier": "8.
|
|
42
|
+
"eslint": "8.37.0",
|
|
43
|
+
"eslint-config-prettier": "8.8.0",
|
|
44
44
|
"eslint-plugin-import": "2.27.5",
|
|
45
45
|
"eslint-plugin-jest": "27.2.1",
|
|
46
46
|
"eslint-plugin-no-loops": "0.3.0",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"jest-extended": "3.2.4",
|
|
53
53
|
"lint-staged": "13.2.0",
|
|
54
54
|
"markdown-toc": "1.2.0",
|
|
55
|
-
"prettier": "2.8.
|
|
56
|
-
"rimraf": "4.4.
|
|
57
|
-
"semantic-release": "
|
|
55
|
+
"prettier": "2.8.7",
|
|
56
|
+
"rimraf": "4.4.1",
|
|
57
|
+
"semantic-release": "21.0.1",
|
|
58
58
|
"source-map-support": "0.5.21",
|
|
59
|
-
"ts-jest": "29.0
|
|
59
|
+
"ts-jest": "29.1.0",
|
|
60
60
|
"ts-node": "10.9.1",
|
|
61
|
-
"tsc-alias": "1.8.
|
|
61
|
+
"tsc-alias": "1.8.5",
|
|
62
62
|
"tsc-watch": "6.0.0",
|
|
63
|
-
"typedoc": "0.23.
|
|
63
|
+
"typedoc": "0.23.28",
|
|
64
64
|
"typedoc-plugin-markdown": "3.14.0",
|
|
65
65
|
"typescript": "4.9.5"
|
|
66
66
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"audit:fix": "npx --yes npm-force-resolutions",
|
|
89
89
|
"build": "npm run clean && npm run tsc && npm run tsc:alias",
|
|
90
90
|
"build:on-success": "npm run tsc:alias",
|
|
91
|
-
"build:watch": "npm run tsc:watch --preserveWatchOutput --onSuccess
|
|
91
|
+
"build:watch": "npm run tsc:watch --preserveWatchOutput --onSuccess 'npm run tsc:cleaner' --onCompilationComplete 'npm run build:on-success'",
|
|
92
92
|
"bump-version": "npm --no-git-tag-version version",
|
|
93
93
|
"clean": "rimraf ./lib/*",
|
|
94
94
|
"commit": "git-cz",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"semantic-release": "semantic-release",
|
|
112
112
|
"semantic-release:check": "npm run semantic-release --dry-run --no-ci",
|
|
113
113
|
"test": "npm run test:unit && npm run test:int ",
|
|
114
|
-
"test:int": "#TZ=utc jest --config=./
|
|
115
|
-
"test:unit": "TZ=utc jest",
|
|
114
|
+
"test:int": "# TZ=utc jest --config=./jest-int.config.js",
|
|
115
|
+
"test:unit": "TZ=utc jest --config=./jest-unit.config.js",
|
|
116
116
|
"test:unit:coverage": "npm run test:unit --coverage",
|
|
117
117
|
"test:unit:coverage:publish": "codecov",
|
|
118
118
|
"tsc": "tsc -p ./tsconfig-build.json",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"tsc:watch": "tsc-watch -p tsconfig-build.json"
|
|
126
126
|
},
|
|
127
127
|
"types": "lib/index.d.ts",
|
|
128
|
-
"version": "1.0
|
|
128
|
+
"version": "1.2.0"
|
|
129
129
|
}
|