atomic-fns 0.2.0 → 0.2.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.
- package/.esdoc.json +19 -1
- package/.eslintrc.json +1 -0
- package/README.md +3 -6
- package/package.json +6 -5
- package/src/collections.d.ts +4 -0
- package/src/collections.js +422 -439
- package/src/collections.ts +6 -2
- package/src/datetime.d.ts +4 -0
- package/src/datetime.js +5 -1
- package/src/datetime.ts +5 -0
- package/src/functools.d.ts +4 -0
- package/src/functools.js +45 -46
- package/src/functools.ts +4 -0
- package/src/globals.d.ts +7 -3
- package/src/globals.js +175 -195
- package/src/globals.ts +8 -4
- package/src/index.js +7 -7
- package/src/itertools.d.ts +4 -0
- package/src/itertools.js +51 -54
- package/src/itertools.ts +4 -0
- package/src/math.js +45 -42
- package/src/math.ts +4 -0
- package/src/objects.js +1 -1
- package/src/operators.js +73 -92
- package/src/operators.ts +4 -0
- package/src/random.js +26 -26
- package/src/random.ts +5 -1
- package/src/strings.js +1 -1
- package/src/util.js +1 -1
- package/tests/collections.spec.ts +81 -9
- package/tests/globals.spec.ts +40 -2
- package/tests/itertools.spec.ts +17 -10
- package/tests/operators.spec.ts +8 -5
- package/tsconfig.json +10 -2
package/.esdoc.json
CHANGED
|
@@ -3,7 +3,25 @@
|
|
|
3
3
|
"destination": "./docs",
|
|
4
4
|
"plugins": [
|
|
5
5
|
{
|
|
6
|
-
"name": "esdoc-standard-plugin"
|
|
6
|
+
"name": "esdoc-standard-plugin",
|
|
7
|
+
"option": {
|
|
8
|
+
"test": {
|
|
9
|
+
"source": "./tests/",
|
|
10
|
+
"interfaces": [
|
|
11
|
+
"describe",
|
|
12
|
+
"it",
|
|
13
|
+
"context",
|
|
14
|
+
"suite",
|
|
15
|
+
"test"
|
|
16
|
+
],
|
|
17
|
+
"includes": [
|
|
18
|
+
"(spec|Spec|test|Test)\\.ts$"
|
|
19
|
+
],
|
|
20
|
+
"excludes": [
|
|
21
|
+
"\\.config\\.js$"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
7
25
|
}
|
|
8
26
|
]
|
|
9
27
|
}
|
package/.eslintrc.json
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
27
27
|
"@typescript-eslint/no-dynamic-delete": "off",
|
|
28
28
|
"@typescript-eslint/no-unused-vars": "off",
|
|
29
|
+
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
29
30
|
"@typescript-eslint/restrict-plus-operands": "off",
|
|
30
31
|
"@typescript-eslint/space-before-function-paren": "off",
|
|
31
32
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Like Lodash, but for ESNext and with types.
|
|
4
4
|
|
|
5
|
-
Stop shipping code built for browsers from 2015. Really though, look at the [issues](https://github.com/lodash/lodash/issues/2930
|
|
5
|
+
Stop shipping code built for browsers from 2015. Really though, look at the [issues](https://github.com/lodash/lodash/issues/2930).
|
|
6
6
|
|
|
7
7
|
* **Modular**: Pick what you need. Works with all bundlers and also supports tree-shaking.
|
|
8
8
|
* **ESNext**: Uses modern idiomatic syntax, data structures, and control flow techniques.
|
|
@@ -20,7 +20,7 @@ npm install atomic-fns
|
|
|
20
20
|
|
|
21
21
|
## How to use
|
|
22
22
|
```typescript
|
|
23
|
-
import {
|
|
23
|
+
import { reversed, sorted, times, uniqueId } from 'atomic-fns'
|
|
24
24
|
|
|
25
25
|
reverse([1, 2, 3, 4])
|
|
26
26
|
// -> [4, 3, 2, 1]
|
|
@@ -28,10 +28,7 @@ reverse([1, 2, 3, 4])
|
|
|
28
28
|
sorted([4, 3, 2, 1])
|
|
29
29
|
// -> [1, 2, 3, 4]
|
|
30
30
|
|
|
31
|
-
times(5,
|
|
32
|
-
// -> [0, 1, 2, 3, 4]
|
|
33
|
-
|
|
34
|
-
times(5, id)
|
|
31
|
+
times(5, (i) => i)
|
|
35
32
|
// -> [0, 1, 2, 3, 4]
|
|
36
33
|
|
|
37
34
|
uniqueId('user_')
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomic-fns",
|
|
3
3
|
"description": "Like Lodash, but for ESNext and with types. Stop shipping code built for browsers from 2015.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"devDependencies": {
|
|
@@ -23,23 +23,24 @@
|
|
|
23
23
|
"prettier": "^2.7.1",
|
|
24
24
|
"pretty-quick": "^3.1.3",
|
|
25
25
|
"ts-node": "^10.4.1",
|
|
26
|
+
"typedoc": "^0.23.16",
|
|
26
27
|
"typescript": "^4.8.4"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
|
-
"prepublishOnly": "npm test
|
|
30
|
+
"prepublishOnly": "npm test",
|
|
30
31
|
"test": "NODE_OPTIONS=--loader=ts-node/esm jasmine --config=jasmine.json",
|
|
31
32
|
"tsc": "tsc -p ./tsconfig.xo.json --declaration",
|
|
32
33
|
"lint": "eslint src/**",
|
|
33
34
|
"lint:fix": "eslint src/** --fix",
|
|
34
|
-
"
|
|
35
|
-
"docs": "
|
|
35
|
+
"build": "npm run tsc && npm run lint:fix",
|
|
36
|
+
"docs": "typedoc --mode modules"
|
|
36
37
|
},
|
|
37
38
|
"lint-staged": {
|
|
38
39
|
"*.ts": "eslint"
|
|
39
40
|
},
|
|
40
41
|
"husky": {
|
|
41
42
|
"hooks": {
|
|
42
|
-
"precommit": "
|
|
43
|
+
"precommit": "lint-staged && pretty-quick --staged"
|
|
43
44
|
}
|
|
44
45
|
},
|
|
45
46
|
"repository": {
|