atomic-fns 0.2.0 → 0.2.3

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 (64) hide show
  1. package/.esdoc.json +19 -1
  2. package/.eslintrc.json +1 -0
  3. package/README.md +8 -9
  4. package/package.json +9 -9
  5. package/src/collections/index.d.ts +658 -0
  6. package/src/collections/index.js +1068 -0
  7. package/src/collections/index.ts +1162 -0
  8. package/src/datetime/index.d.ts +6 -0
  9. package/src/datetime/index.js +6 -0
  10. package/src/datetime/index.ts +7 -0
  11. package/src/{functools.d.ts → functools/index.d.ts} +10 -5
  12. package/src/{functools.js → functools/index.js} +9 -4
  13. package/src/{functools.ts → functools/index.ts} +11 -5
  14. package/src/globals/index.d.ts +291 -0
  15. package/src/globals/index.js +391 -0
  16. package/src/globals/index.ts +456 -0
  17. package/src/index.d.ts +8 -7
  18. package/src/index.js +8 -7
  19. package/src/index.ts +8 -7
  20. package/src/itertools/index.d.ts +254 -0
  21. package/src/itertools/index.js +485 -0
  22. package/src/itertools/index.ts +511 -0
  23. package/src/math/index.d.ts +21 -0
  24. package/src/math/index.js +39 -0
  25. package/src/math/index.ts +44 -0
  26. package/src/{operators.d.ts → operators/index.d.ts} +8 -6
  27. package/src/{operators.js → operators/index.js} +69 -26
  28. package/src/{operators.ts → operators/index.ts} +77 -28
  29. package/src/random/index.d.ts +42 -0
  30. package/src/random/index.js +65 -0
  31. package/src/random/index.ts +66 -0
  32. package/tests/collections.spec.ts +119 -30
  33. package/tests/globals.spec.ts +91 -49
  34. package/tests/itertools.spec.ts +207 -14
  35. package/tests/operators.spec.ts +7 -29
  36. package/tests/random.spec.ts +46 -0
  37. package/tsconfig.json +19 -3
  38. package/src/collections.d.ts +0 -224
  39. package/src/collections.js +0 -570
  40. package/src/collections.ts +0 -637
  41. package/src/datetime.d.ts +0 -1
  42. package/src/datetime.js +0 -1
  43. package/src/datetime.ts +0 -1
  44. package/src/globals.d.ts +0 -175
  45. package/src/globals.js +0 -329
  46. package/src/globals.ts +0 -373
  47. package/src/itertools.d.ts +0 -16
  48. package/src/itertools.js +0 -101
  49. package/src/itertools.ts +0 -112
  50. package/src/math.d.ts +0 -16
  51. package/src/math.js +0 -67
  52. package/src/math.ts +0 -73
  53. package/src/objects.d.ts +0 -0
  54. package/src/objects.js +0 -1
  55. package/src/objects.ts +0 -0
  56. package/src/random.d.ts +0 -22
  57. package/src/random.js +0 -48
  58. package/src/random.ts +0 -49
  59. package/src/strings.d.ts +0 -0
  60. package/src/strings.js +0 -1
  61. package/src/strings.ts +0 -0
  62. package/src/util.d.ts +0 -0
  63. package/src/util.js +0 -1
  64. package/src/util.ts +0 -0
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,13 +2,15 @@
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#issuecomment-370295020).
5
+ Stop shipping code built for browsers from 2015. Really though, look at the [issues](https://github.com/lodash/lodash/issues/2930).
6
+
7
+ You may prefer this because it's:
6
8
 
7
9
  * **Modular**: Pick what you need. Works with all bundlers and also supports tree-shaking.
8
10
  * **ESNext**: Uses modern idiomatic syntax, data structures, and control flow techniques.
9
11
  * **Lazy**: Leverage generators, iterators, and functional composition.
10
12
  * **Fluent**: Pure functions and abstract classes. Include only what you need.
11
- * **TypeScript & docs**: Includes both type declaration files and js with JSDocs for best in class experience.
13
+ * **TypeScript & docs**: Includes type declaration files and js with JSDocs for best in class experience.
12
14
 
13
15
  ## Get Started
14
16
 
@@ -20,18 +22,15 @@ npm install atomic-fns
20
22
 
21
23
  ## How to use
22
24
  ```typescript
23
- import { id, reversed, sorted, times, uniqueId } from 'atomic-fns'
25
+ import { reversed, sorted, times, uniqueId } from 'atomic-fns'
24
26
 
25
- reverse([1, 2, 3, 4])
27
+ reversed([1, 2, 3, 4])
26
28
  // -> [4, 3, 2, 1]
27
29
 
28
30
  sorted([4, 3, 2, 1])
29
31
  // -> [1, 2, 3, 4]
30
32
 
31
- times(5, id)
32
- // -> [0, 1, 2, 3, 4]
33
-
34
- times(5, id)
33
+ times(5, (i) => i)
35
34
  // -> [0, 1, 2, 3, 4]
36
35
 
37
36
  uniqueId('user_')
@@ -40,7 +39,7 @@ uniqueId('user_')
40
39
 
41
40
  ## Docs
42
41
 
43
- 🚢 Coming soon at [atomic-fns.dev](https://atomic-fns.dev).
42
+ 🚢 Coming soon at [atomic-fns.dev](https://atomic-fns.dev)
44
43
 
45
44
  💡 See the `src` directory for comments.
46
45
 
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.0",
4
+ "version": "0.2.3",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
7
7
  "devDependencies": {
@@ -23,23 +23,25 @@
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 && npm run tsc",
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",
33
+ "tsc:w": "tsc -p ./tsconfig.xo.json --declaration --watch",
32
34
  "lint": "eslint src/**",
33
35
  "lint:fix": "eslint src/** --fix",
34
- "format": "prettier --write src/**",
35
- "docs": "npm run tsc && esdoc"
36
+ "build": "npm run lint:fix && npm run tsc && npm run docs",
37
+ "docs": "typedoc"
36
38
  },
37
39
  "lint-staged": {
38
- "*.ts": "eslint"
40
+ "*.ts": "eslint --fix"
39
41
  },
40
42
  "husky": {
41
43
  "hooks": {
42
- "precommit": "npm test && lint-staged && pretty-quick --staged"
44
+ "precommit": "lint-staged && pretty-quick --staged"
43
45
  }
44
46
  },
45
47
  "repository": {
@@ -57,9 +59,7 @@
57
59
  "es6",
58
60
  "es7",
59
61
  "es8",
60
- "es2016",
61
- "es2017",
62
- "es2019",
62
+ "es9",
63
63
  "es2020",
64
64
  "es2021",
65
65
  "es2022",