@ezez/utils 1.2.0 → 1.5.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/.github/workflows/docs.yml +50 -0
- package/CHANGELOG.md +18 -0
- package/README.md +7 -1
- package/dist/compareArrays.d.ts +7 -0
- package/dist/compareArrays.d.ts.map +1 -0
- package/dist/compareArrays.js +12 -0
- package/dist/compareArrays.js.map +1 -0
- package/dist/ensureError.d.ts.map +1 -1
- package/dist/ensureError.js.map +1 -1
- package/dist/escapeRegExp.d.ts +3 -0
- package/dist/escapeRegExp.d.ts.map +1 -0
- package/dist/escapeRegExp.js +8 -0
- package/dist/escapeRegExp.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/isPlainObject.d.ts.map +1 -1
- package/dist/isPlainObject.js.map +1 -1
- package/dist/replace.d.ts +3 -0
- package/dist/replace.d.ts.map +1 -0
- package/dist/replace.js +10 -0
- package/dist/replace.js.map +1 -0
- package/dist/safe.d.ts +4 -0
- package/dist/safe.d.ts.map +1 -0
- package/dist/safe.js +13 -0
- package/dist/safe.js.map +1 -0
- package/dist/sortProps.d.ts +3 -0
- package/dist/sortProps.d.ts.map +1 -0
- package/dist/sortProps.js +19 -0
- package/dist/sortProps.js.map +1 -0
- package/dist/unique.d.ts +3 -0
- package/dist/unique.d.ts.map +1 -0
- package/dist/unique.js +8 -0
- package/dist/unique.js.map +1 -0
- package/docs/assets/highlight.css +14 -0
- package/docs/assets/main.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +4 -5
- package/docs/functions/cap.html +13 -6
- package/docs/functions/capitalize.html +13 -6
- package/docs/functions/coalesce.html +15 -9
- package/docs/functions/compareArrays.html +146 -0
- package/docs/functions/ensureArray.html +14 -7
- package/docs/functions/ensureDate.html +13 -6
- package/docs/functions/ensureError.html +23 -6
- package/docs/functions/ensurePrefix.html +13 -6
- package/docs/functions/ensureSuffix.html +13 -6
- package/docs/functions/ensureTimestamp.html +13 -6
- package/docs/functions/escapeRegExp.html +129 -0
- package/docs/functions/get.html +13 -6
- package/docs/functions/getMultiple.html +13 -6
- package/docs/functions/insertSeparator.html +13 -6
- package/docs/functions/isEmpty.html +13 -6
- package/docs/functions/isNumericString.html +13 -6
- package/docs/functions/isPlainObject.html +28 -6
- package/docs/functions/last.html +13 -6
- package/docs/functions/mapAsync.html +13 -6
- package/docs/functions/mapValues.html +13 -6
- package/docs/functions/match.html +13 -6
- package/docs/functions/merge.html +21 -14
- package/docs/functions/mostFrequent.html +13 -6
- package/docs/functions/noop.html +13 -6
- package/docs/functions/occurrences.html +13 -6
- package/docs/functions/omit.html +13 -6
- package/docs/functions/pick.html +13 -6
- package/docs/functions/pull.html +13 -6
- package/docs/functions/remove.html +13 -6
- package/docs/functions/replace.html +135 -0
- package/docs/functions/rethrow.html +13 -6
- package/docs/functions/safe.html +173 -0
- package/docs/functions/scale.html +13 -6
- package/docs/functions/seq.html +13 -6
- package/docs/functions/seqEarlyBreak.html +13 -6
- package/docs/functions/set.html +13 -6
- package/docs/functions/setImmutable.html +13 -6
- package/docs/functions/sortBy.html +13 -6
- package/docs/functions/sortProps.html +138 -0
- package/docs/functions/stripPrefix.html +13 -6
- package/docs/functions/stripSuffix.html +13 -6
- package/docs/functions/throttle.html +13 -6
- package/docs/functions/truthy.html +13 -6
- package/docs/functions/unique.html +133 -0
- package/docs/functions/wait.html +13 -6
- package/docs/functions/waitFor.html +13 -6
- package/docs/functions/waitSync.html +13 -6
- package/docs/index.html +20 -7
- package/docs/interfaces/GetMultipleSource.html +13 -6
- package/docs/interfaces/GetSource.html +13 -6
- package/docs/interfaces/IsNumericStringOptions.html +11 -10
- package/docs/interfaces/OccurencesOptions.html +8 -7
- package/docs/interfaces/SetImmutableSource.html +13 -6
- package/docs/interfaces/SetSource.html +13 -6
- package/docs/interfaces/ThrottleOptions.html +9 -8
- package/docs/interfaces/ThrottledFunctionExtras.html +9 -8
- package/docs/modules.html +18 -5
- package/docs/pages/CHANGELOG.html +778 -0
- package/docs/pages/Introduction.html +12 -5
- package/docs/types/MapValuesFn.html +13 -6
- package/docs/types/MatchCallback.html +13 -6
- package/docs/types/SeqEarlyBreaker.html +13 -6
- package/docs/types/SeqFn.html +13 -6
- package/docs/types/SeqFunctions.html +13 -6
- package/docs/types/SetImmutablePath.html +13 -6
- package/docs/types/ThrottledFunction.html +13 -6
- package/docs/variables/mapValuesUNSET.html +13 -6
- package/docs/variables/mergeUNSET.html +13 -6
- package/esm/compareArrays.d.ts +7 -0
- package/esm/compareArrays.d.ts.map +1 -0
- package/esm/compareArrays.js +9 -0
- package/esm/compareArrays.js.map +1 -0
- package/esm/ensureError.d.ts.map +1 -1
- package/esm/ensureError.js.map +1 -1
- package/esm/escapeRegExp.d.ts +3 -0
- package/esm/escapeRegExp.d.ts.map +1 -0
- package/esm/escapeRegExp.js +5 -0
- package/esm/escapeRegExp.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +6 -0
- package/esm/index.js.map +1 -1
- package/esm/isPlainObject.d.ts.map +1 -1
- package/esm/isPlainObject.js.map +1 -1
- package/esm/replace.d.ts +3 -0
- package/esm/replace.d.ts.map +1 -0
- package/esm/replace.js +7 -0
- package/esm/replace.js.map +1 -0
- package/esm/safe.d.ts +4 -0
- package/esm/safe.d.ts.map +1 -0
- package/esm/safe.js +10 -0
- package/esm/safe.js.map +1 -0
- package/esm/sortProps.d.ts +3 -0
- package/esm/sortProps.d.ts.map +1 -0
- package/esm/sortProps.js +16 -0
- package/esm/sortProps.js.map +1 -0
- package/esm/unique.d.ts +3 -0
- package/esm/unique.d.ts.map +1 -0
- package/esm/unique.js +5 -0
- package/esm/unique.js.map +1 -0
- package/package.json +23 -23
- package/src/coalesce.ts +2 -2
- package/src/compareArrays.spec.ts +38 -0
- package/src/compareArrays.ts +22 -0
- package/src/ensureArray.ts +1 -1
- package/src/ensureError.ts +7 -0
- package/src/escapeRegExp.spec.ts +31 -0
- package/src/escapeRegExp.ts +17 -0
- package/src/index.ts +6 -0
- package/src/isPlainObject.spec.ts +0 -7
- package/src/isPlainObject.ts +5 -0
- package/src/replace.spec.ts +22 -0
- package/src/replace.ts +19 -0
- package/src/safe.spec.ts +52 -0
- package/src/safe.ts +24 -0
- package/src/sortProps.spec.ts +20 -0
- package/src/sortProps.ts +21 -0
- package/src/unique.spec.ts +10 -0
- package/src/unique.ts +12 -0
- package/typedoc.cjs +5 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Build docs and push to ezez.dev
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
PROJECT_NAME: utils
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
|
|
20
|
+
- name: Build documentation
|
|
21
|
+
run: |
|
|
22
|
+
VER=$(cat ./package.json | jq -r .version)
|
|
23
|
+
echo Detected version: $VER
|
|
24
|
+
if [[ "$VER" == *"+"* ]]; then echo "WIP/+ version detected, skipping"; exit 1; fi
|
|
25
|
+
yarn
|
|
26
|
+
yarn docs
|
|
27
|
+
echo "APP_VERSION=$VER" >> "$GITHUB_ENV"
|
|
28
|
+
cat $GITHUB_ENV
|
|
29
|
+
|
|
30
|
+
- name: Deploy versioned documentation
|
|
31
|
+
uses: easingthemes/ssh-deploy@main
|
|
32
|
+
env:
|
|
33
|
+
SSH_PRIVATE_KEY: ${{ secrets.DOCS_SERVER_PRIVATE_KEY }}
|
|
34
|
+
REMOTE_HOST: ${{ secrets.DOCS_SERVER_HOST }}
|
|
35
|
+
REMOTE_USER: ${{ secrets.DOCS_SERVER_USER }}
|
|
36
|
+
REMOTE_PORT: ${{ secrets.DOCS_SERVER_PORT }}
|
|
37
|
+
SOURCE: "docs/"
|
|
38
|
+
TARGET: "/docs/${{ env.PROJECT_NAME }}/${{ env.APP_VERSION }}"
|
|
39
|
+
|
|
40
|
+
- name: Deploy latest documentation
|
|
41
|
+
uses: easingthemes/ssh-deploy@main
|
|
42
|
+
env:
|
|
43
|
+
SSH_PRIVATE_KEY: ${{ secrets.DOCS_SERVER_PRIVATE_KEY }}
|
|
44
|
+
REMOTE_HOST: ${{ secrets.DOCS_SERVER_HOST }}
|
|
45
|
+
REMOTE_USER: ${{ secrets.DOCS_SERVER_USER }}
|
|
46
|
+
REMOTE_PORT: ${{ secrets.DOCS_SERVER_PORT }}
|
|
47
|
+
ARGS: "-rlgoDzvc -i --delete"
|
|
48
|
+
SOURCE: "docs/"
|
|
49
|
+
TARGET: "/docs/${{ env.PROJECT_NAME }}/latest"
|
|
50
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
4
4
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [1.5.0] - 2023-05-12
|
|
7
|
+
### Added
|
|
8
|
+
- `compareArrays` method
|
|
9
|
+
- `unique` method
|
|
10
|
+
|
|
11
|
+
## [1.4.0] - 2023-05-11
|
|
12
|
+
### Added
|
|
13
|
+
- `escapeRegExp` method
|
|
14
|
+
- `replace` method
|
|
15
|
+
- `sortProps` method
|
|
16
|
+
|
|
17
|
+
## [1.3.0] - 2023-05-07
|
|
18
|
+
### Added
|
|
19
|
+
- `safe` method
|
|
20
|
+
### Dev
|
|
21
|
+
- upgraded some jsdocs
|
|
22
|
+
- upgraded deps
|
|
23
|
+
|
|
6
24
|
## [1.2.0] - 2023-03-01
|
|
7
25
|
### Added
|
|
8
26
|
- `ensureDate` method
|
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ object, with just some properties copied. Easy, right? Few lines of code? Lodash
|
|
|
35
35
|
- `capitalize` - capitalize a string, optionally lower casing the rest
|
|
36
36
|
- `isNumericString` - check if given value is a numeric string, features configurable
|
|
37
37
|
- `occurrences` - count occurrences of a substring in a string, optionally allow overlapping
|
|
38
|
+
- `replace` - replace all occurrences of a substring using a map of replacements
|
|
38
39
|
- `stripPrefix` - strip prefix from a string
|
|
39
40
|
- `stripSuffix` - strip suffix from a string
|
|
40
41
|
|
|
@@ -43,6 +44,7 @@ object, with just some properties copied. Easy, right? Few lines of code? Lodash
|
|
|
43
44
|
- `scale` - scale given value from old range to new range
|
|
44
45
|
|
|
45
46
|
### Array related
|
|
47
|
+
- `compareArrays` - compare two arrays
|
|
46
48
|
- `ensureArray` - ensure that given value is an array
|
|
47
49
|
- `insertSeparator` - insert a separator between every character in an array
|
|
48
50
|
- `last` - get last element of an array
|
|
@@ -51,6 +53,7 @@ object, with just some properties copied. Easy, right? Few lines of code? Lodash
|
|
|
51
53
|
- `pull` - remove values from an array (by mutating)
|
|
52
54
|
- `remove` - remove values from an array (by mutating) using predicate function and return removed values
|
|
53
55
|
- `sortBy` - sort an array by given property (create callback function for `Array.prototype.sort`)
|
|
56
|
+
- `unique` - get unique values from an array
|
|
54
57
|
|
|
55
58
|
### Object related
|
|
56
59
|
- `isPlainObject` - check if given value is a plain object
|
|
@@ -58,14 +61,17 @@ object, with just some properties copied. Easy, right? Few lines of code? Lodash
|
|
|
58
61
|
- `merge` - merge two objects shallowly, allowing to remove properties while doing so
|
|
59
62
|
- `omit` - omit properties from an object
|
|
60
63
|
- `pick` - pick some properties from an object
|
|
64
|
+
- `sortProps` - sort object properties by key
|
|
61
65
|
|
|
62
66
|
### Date related
|
|
63
67
|
- `ensureDate` - ensure that given value is a Date instance
|
|
64
68
|
- `ensureTimestamp` - ensure that given value is a numeric timestamp
|
|
65
69
|
|
|
66
|
-
### Type safety
|
|
70
|
+
### Type/data safety
|
|
67
71
|
- `coalesce` - return first non-nullish value
|
|
68
72
|
- `ensureError` - ensure that given value is an error
|
|
73
|
+
- `escapeRegExp` - escape a string to be used in a regular expression
|
|
74
|
+
- `safe` - runs function and returns its result or default value if function throws an error
|
|
69
75
|
|
|
70
76
|
### Flow related
|
|
71
77
|
- `mapAsync` - map an array asynchronously if sync version blocks your event loop for too long
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareArrays.d.ts","sourceRoot":"","sources":["../src/compareArrays.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,aAAa;;;;CAMlB,CAAC;AAEF,OAAO,EACH,aAAa,GAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compareArrays = void 0;
|
|
4
|
+
const unique_js_1 = require("./unique.js");
|
|
5
|
+
const compareArrays = (arrayA, arrayB) => {
|
|
6
|
+
const onlyA = (0, unique_js_1.unique)(arrayA.filter((item) => !arrayB.includes(item)));
|
|
7
|
+
const onlyB = (0, unique_js_1.unique)(arrayB.filter((item) => !arrayA.includes(item)));
|
|
8
|
+
const both = (0, unique_js_1.unique)(arrayA.filter((item) => arrayB.includes(item)));
|
|
9
|
+
return { onlyA, onlyB, both };
|
|
10
|
+
};
|
|
11
|
+
exports.compareArrays = compareArrays;
|
|
12
|
+
//# sourceMappingURL=compareArrays.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareArrays.js","sourceRoot":"","sources":["../src/compareArrays.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAWrC,MAAM,aAAa,GAAG,CAAsB,MAAS,EAAE,MAAS,EAAmC,EAAE;IACjG,MAAM,KAAK,GAAG,IAAA,kBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,IAAA,kBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,IAAA,kBAAM,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEpE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAqC,CAAC;AACrE,CAAC,CAAC;AAGE,sCAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureError.d.ts","sourceRoot":"","sources":["../src/ensureError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ensureError.d.ts","sourceRoot":"","sources":["../src/ensureError.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,WAAW,MAAO,OAAO,UAK9B,CAAC;AAEF,OAAO,EACH,WAAW,GACd,CAAC"}
|
package/dist/ensureError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureError.js","sourceRoot":"","sources":["../src/ensureError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ensureError.js","sourceRoot":"","sources":["../src/ensureError.ts"],"names":[],"mappings":";;;AAYA,MAAM,WAAW,GAAG,CAAC,CAAU,EAAE,EAAE;IAC/B,IAAI,CAAC,YAAY,KAAK,EAAE;QACpB,OAAO,CAAC,CAAC;KACZ;IACD,OAAO,IAAI,KAAK,CAAC,+CAA+C,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC;AAGE,kCAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeRegExp.d.ts","sourceRoot":"","sources":["../src/escapeRegExp.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,YAAY,WAAY,MAAM,WAEnC,CAAC;AAEF,OAAO,EACH,YAAY,GACf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.escapeRegExp = void 0;
|
|
4
|
+
const escapeRegExp = (string) => {
|
|
5
|
+
return string.replace(/[/\-\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
6
|
+
};
|
|
7
|
+
exports.escapeRegExp = escapeRegExp;
|
|
8
|
+
//# sourceMappingURL=escapeRegExp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escapeRegExp.js","sourceRoot":"","sources":["../src/escapeRegExp.ts"],"names":[],"mappings":";;;AAUA,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,EAAE;IACpC,OAAO,MAAM,CAAC,OAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC,CAAC;AAGE,oCAAY"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export * from "./ensureSuffix.js";
|
|
|
3
3
|
export * from "./cap.js";
|
|
4
4
|
export * from "./capitalize.js";
|
|
5
5
|
export * from "./coalesce.js";
|
|
6
|
+
export * from "./compareArrays.js";
|
|
6
7
|
export * from "./ensureArray.js";
|
|
7
8
|
export * from "./ensureDate.js";
|
|
8
9
|
export * from "./ensureError.js";
|
|
9
10
|
export * from "./ensureTimestamp.js";
|
|
11
|
+
export * from "./escapeRegExp.js";
|
|
10
12
|
export * from "./get.js";
|
|
11
13
|
export * from "./getMultiple.js";
|
|
12
14
|
export * from "./insertSeparator.js";
|
|
@@ -25,16 +27,20 @@ export * from "./omit.js";
|
|
|
25
27
|
export * from "./pick.js";
|
|
26
28
|
export * from "./pull.js";
|
|
27
29
|
export * from "./remove.js";
|
|
30
|
+
export * from "./replace.js";
|
|
28
31
|
export * from "./rethrow.js";
|
|
32
|
+
export * from "./safe.js";
|
|
29
33
|
export * from "./scale.js";
|
|
30
34
|
export * from "./seq.js";
|
|
31
35
|
export * from "./set.js";
|
|
32
36
|
export * from "./setImmutable.js";
|
|
33
37
|
export * from "./sortBy.js";
|
|
38
|
+
export * from "./sortProps.js";
|
|
34
39
|
export * from "./stripPrefix.js";
|
|
35
40
|
export * from "./stripSuffix.js";
|
|
36
41
|
export * from "./throttle.js";
|
|
37
42
|
export * from "./truthy.js";
|
|
43
|
+
export * from "./unique.js";
|
|
38
44
|
export * from "./wait.js";
|
|
39
45
|
export * from "./waitFor.js";
|
|
40
46
|
export * from "./waitSync.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,10 +19,12 @@ __exportStar(require("./ensureSuffix.js"), exports);
|
|
|
19
19
|
__exportStar(require("./cap.js"), exports);
|
|
20
20
|
__exportStar(require("./capitalize.js"), exports);
|
|
21
21
|
__exportStar(require("./coalesce.js"), exports);
|
|
22
|
+
__exportStar(require("./compareArrays.js"), exports);
|
|
22
23
|
__exportStar(require("./ensureArray.js"), exports);
|
|
23
24
|
__exportStar(require("./ensureDate.js"), exports);
|
|
24
25
|
__exportStar(require("./ensureError.js"), exports);
|
|
25
26
|
__exportStar(require("./ensureTimestamp.js"), exports);
|
|
27
|
+
__exportStar(require("./escapeRegExp.js"), exports);
|
|
26
28
|
__exportStar(require("./get.js"), exports);
|
|
27
29
|
__exportStar(require("./getMultiple.js"), exports);
|
|
28
30
|
__exportStar(require("./insertSeparator.js"), exports);
|
|
@@ -41,16 +43,20 @@ __exportStar(require("./omit.js"), exports);
|
|
|
41
43
|
__exportStar(require("./pick.js"), exports);
|
|
42
44
|
__exportStar(require("./pull.js"), exports);
|
|
43
45
|
__exportStar(require("./remove.js"), exports);
|
|
46
|
+
__exportStar(require("./replace.js"), exports);
|
|
44
47
|
__exportStar(require("./rethrow.js"), exports);
|
|
48
|
+
__exportStar(require("./safe.js"), exports);
|
|
45
49
|
__exportStar(require("./scale.js"), exports);
|
|
46
50
|
__exportStar(require("./seq.js"), exports);
|
|
47
51
|
__exportStar(require("./set.js"), exports);
|
|
48
52
|
__exportStar(require("./setImmutable.js"), exports);
|
|
49
53
|
__exportStar(require("./sortBy.js"), exports);
|
|
54
|
+
__exportStar(require("./sortProps.js"), exports);
|
|
50
55
|
__exportStar(require("./stripPrefix.js"), exports);
|
|
51
56
|
__exportStar(require("./stripSuffix.js"), exports);
|
|
52
57
|
__exportStar(require("./throttle.js"), exports);
|
|
53
58
|
__exportStar(require("./truthy.js"), exports);
|
|
59
|
+
__exportStar(require("./unique.js"), exports);
|
|
54
60
|
__exportStar(require("./wait.js"), exports);
|
|
55
61
|
__exportStar(require("./waitFor.js"), exports);
|
|
56
62
|
__exportStar(require("./waitSync.js"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,oDAAkC;AAClC,oDAAkC;AAClC,2CAAyB;AACzB,kDAAgC;AAChC,gDAA8B;AAC9B,mDAAiC;AACjC,kDAAgC;AAChC,mDAAiC;AACjC,uDAAqC;AACrC,2CAAyB;AACzB,mDAAiC;AACjC,uDAAqC;AACrC,+CAA6B;AAC7B,uDAAqC;AACrC,qDAAmC;AACnC,4CAA0B;AAC1B,gDAA8B;AAC9B,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,oDAAkC;AAClC,4CAA0B;AAC1B,mDAAiC;AACjC,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,oDAAkC;AAClC,8CAA4B;AAC5B,mDAAiC;AACjC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,4CAA0B;AAC1B,+CAA6B;AAC7B,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,oDAAkC;AAClC,oDAAkC;AAClC,2CAAyB;AACzB,kDAAgC;AAChC,gDAA8B;AAC9B,qDAAmC;AACnC,mDAAiC;AACjC,kDAAgC;AAChC,mDAAiC;AACjC,uDAAqC;AACrC,oDAAkC;AAClC,2CAAyB;AACzB,mDAAiC;AACjC,uDAAqC;AACrC,+CAA6B;AAC7B,uDAAqC;AACrC,qDAAmC;AACnC,4CAA0B;AAC1B,gDAA8B;AAC9B,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,oDAAkC;AAClC,4CAA0B;AAC1B,mDAAiC;AACjC,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,oDAAkC;AAClC,8CAA4B;AAC5B,iDAA+B;AAC/B,mDAAiC;AACjC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,8CAA4B;AAC5B,4CAA0B;AAC1B,+CAA6B;AAC7B,gDAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../src/isPlainObject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isPlainObject.d.ts","sourceRoot":"","sources":["../src/isPlainObject.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,aAAa,UAAW,OAAO,YAQpC,CAAC;AAEF,OAAO,EACH,aAAa,GAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPlainObject.js","sourceRoot":"","sources":["../src/isPlainObject.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"isPlainObject.js","sourceRoot":"","sources":["../src/isPlainObject.ts"],"names":[],"mappings":";;;AASA,MAAM,aAAa,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,OAAO,CAC7C,KAAK;OACF,OAAO,KAAK,KAAK,QAAQ;OACzB,CACC,KAAK,CAAC,WAAW,KAAK,MAAM;WACzB,CAAC,CAAC,aAAa,IAAI,KAAK,CAAC;WACzB,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAC/D,CACJ,CAAC;AAGE,sCAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../src/replace.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,OAAO,WAAY,MAAM,cAAc,OAAO,MAAM,EAAE,MAAM,CAAC,WAIlE,CAAC;AAEF,OAAO,EACH,OAAO,GACV,CAAC"}
|
package/dist/replace.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replace = void 0;
|
|
4
|
+
const escapeRegExp_js_1 = require("./escapeRegExp.js");
|
|
5
|
+
const replace = (source, replaceMap) => {
|
|
6
|
+
const regex = new RegExp(Object.keys(replaceMap).map(escapeRegExp_js_1.escapeRegExp).join("|"), "g");
|
|
7
|
+
return source.replace(regex, (matched) => replaceMap[matched]);
|
|
8
|
+
};
|
|
9
|
+
exports.replace = replace;
|
|
10
|
+
//# sourceMappingURL=replace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace.js","sourceRoot":"","sources":["../src/replace.ts"],"names":[],"mappings":";;;AACA,uDAAiD;AASjD,MAAM,OAAO,GAAG,CAAC,MAAc,EAAE,UAAkC,EAAE,EAAE;IAEnE,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACnF,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC;AAGE,0BAAO"}
|
package/dist/safe.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../src/safe.ts"],"names":[],"mappings":"AAAA,iBAAS,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;AAC7C,iBAAS,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAsBhD,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/safe.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.safe = void 0;
|
|
4
|
+
function safe(fn, def) {
|
|
5
|
+
try {
|
|
6
|
+
return fn();
|
|
7
|
+
}
|
|
8
|
+
catch (_a) {
|
|
9
|
+
return def;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.safe = safe;
|
|
13
|
+
//# sourceMappingURL=safe.js.map
|
package/dist/safe.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe.js","sourceRoot":"","sources":["../src/safe.ts"],"names":[],"mappings":";;;AAaA,SAAS,IAAI,CAAO,EAAW,EAAE,GAAO;IAEpC,IAAI;QACA,OAAO,EAAE,EAAE,CAAC;KACf;IACD,WAAM;QACF,OAAO,GAAG,CAAC;KACd;AACL,CAAC;AAEQ,oBAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortProps.d.ts","sourceRoot":"","sources":["../src/sortProps.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,SAAS,oEASd,CAAC;AAEF,OAAO,EACH,SAAS,GACZ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sortProps = void 0;
|
|
4
|
+
const sortProps = (object, asc = true) => {
|
|
5
|
+
const sorted = {};
|
|
6
|
+
const keys = Object.keys(object);
|
|
7
|
+
if (asc) {
|
|
8
|
+
keys.sort();
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
keys.sort().reverse();
|
|
12
|
+
}
|
|
13
|
+
for (const key of keys) {
|
|
14
|
+
sorted[key] = object[key];
|
|
15
|
+
}
|
|
16
|
+
return sorted;
|
|
17
|
+
};
|
|
18
|
+
exports.sortProps = sortProps;
|
|
19
|
+
//# sourceMappingURL=sortProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortProps.js","sourceRoot":"","sources":["../src/sortProps.ts"],"names":[],"mappings":";;;AAOA,MAAM,SAAS,GAAG,CAAoC,MAAS,EAAE,GAAG,GAAG,IAAI,EAAK,EAAE;IAC9E,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,GAAG,EAAE;QAAE,IAAI,CAAC,IAAI,EAAE,CAAC;KAAE;SACpB;QAAE,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;KAAE;IAC/B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACpB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;KAC7B;IACD,OAAO,MAAW,CAAC;AACvB,CAAC,CAAC;AAGE,8BAAS"}
|
package/dist/unique.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique.d.ts","sourceRoot":"","sources":["../src/unique.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,oCAEX,CAAC;AAEF,OAAO,EACH,MAAM,GACT,CAAC"}
|
package/dist/unique.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique.js","sourceRoot":"","sources":["../src/unique.ts"],"names":[],"mappings":";;;AAKA,MAAM,MAAM,GAAG,CAAsB,GAAM,EAAK,EAAE;IAC9C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAM,CAAC;AAClC,CAAC,CAAC;AAGE,wBAAM"}
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
--dark-hl-6: #6A9955;
|
|
16
16
|
--light-hl-7: #A31515;
|
|
17
17
|
--dark-hl-7: #CE9178;
|
|
18
|
+
--light-hl-8: #0070C1;
|
|
19
|
+
--dark-hl-8: #4FC1FF;
|
|
20
|
+
--light-hl-9: #000000FF;
|
|
21
|
+
--dark-hl-9: #D4D4D4;
|
|
18
22
|
--light-code-background: #FFFFFF;
|
|
19
23
|
--dark-code-background: #1E1E1E;
|
|
20
24
|
}
|
|
@@ -28,6 +32,8 @@
|
|
|
28
32
|
--hl-5: var(--light-hl-5);
|
|
29
33
|
--hl-6: var(--light-hl-6);
|
|
30
34
|
--hl-7: var(--light-hl-7);
|
|
35
|
+
--hl-8: var(--light-hl-8);
|
|
36
|
+
--hl-9: var(--light-hl-9);
|
|
31
37
|
--code-background: var(--light-code-background);
|
|
32
38
|
} }
|
|
33
39
|
|
|
@@ -40,6 +46,8 @@
|
|
|
40
46
|
--hl-5: var(--dark-hl-5);
|
|
41
47
|
--hl-6: var(--dark-hl-6);
|
|
42
48
|
--hl-7: var(--dark-hl-7);
|
|
49
|
+
--hl-8: var(--dark-hl-8);
|
|
50
|
+
--hl-9: var(--dark-hl-9);
|
|
43
51
|
--code-background: var(--dark-code-background);
|
|
44
52
|
} }
|
|
45
53
|
|
|
@@ -52,6 +60,8 @@
|
|
|
52
60
|
--hl-5: var(--light-hl-5);
|
|
53
61
|
--hl-6: var(--light-hl-6);
|
|
54
62
|
--hl-7: var(--light-hl-7);
|
|
63
|
+
--hl-8: var(--light-hl-8);
|
|
64
|
+
--hl-9: var(--light-hl-9);
|
|
55
65
|
--code-background: var(--light-code-background);
|
|
56
66
|
}
|
|
57
67
|
|
|
@@ -64,6 +74,8 @@
|
|
|
64
74
|
--hl-5: var(--dark-hl-5);
|
|
65
75
|
--hl-6: var(--dark-hl-6);
|
|
66
76
|
--hl-7: var(--dark-hl-7);
|
|
77
|
+
--hl-8: var(--dark-hl-8);
|
|
78
|
+
--hl-9: var(--dark-hl-9);
|
|
67
79
|
--code-background: var(--dark-code-background);
|
|
68
80
|
}
|
|
69
81
|
|
|
@@ -75,4 +87,6 @@
|
|
|
75
87
|
.hl-5 { color: var(--hl-5); }
|
|
76
88
|
.hl-6 { color: var(--hl-6); }
|
|
77
89
|
.hl-7 { color: var(--hl-7); }
|
|
90
|
+
.hl-8 { color: var(--hl-8); }
|
|
91
|
+
.hl-9 { color: var(--hl-9); }
|
|
78
92
|
pre, code { background: var(--code-background); }
|