getorset-anything 0.0.3 → 0.0.4

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/README.md CHANGED
@@ -40,7 +40,7 @@ import { mapGetOrSet } from 'getorset-anything'
40
40
 
41
41
  const map = new Map<string, number[]>()
42
42
 
43
- const arr = mapGetOrSet(map, 'abc', () => [])
43
+ const arr = mapGetOrSet(map, 'abc', (): number[] => [])
44
44
 
45
45
  arr.push(100) // OK!
46
46
  ```
@@ -52,7 +52,7 @@ import { objGetOrSet } from 'getorset-anything'
52
52
 
53
53
  const obj: Record<string, number[]> = {}
54
54
 
55
- const arr = objGetOrSet(obj, 'abc', () => [])
55
+ const arr = objGetOrSet(obj, 'abc', (): number[] => [])
56
56
 
57
57
  arr.push(100) // OK!
58
58
  ```
@@ -73,12 +73,17 @@ arr.push(100) // OK!
73
73
  arr.push('100') // NG! ⛔️
74
74
  ```
75
75
 
76
- ## Meet the family
76
+ ## Meet the family (more tiny utils with TS support)
77
77
 
78
+ - [is-what 🙉](https://github.com/mesqueeb/is-what)
79
+ - [is-where 🙈](https://github.com/mesqueeb/is-where)
78
80
  - [merge-anything 🥡](https://github.com/mesqueeb/merge-anything)
81
+ - [check-anything 👁](https://github.com/mesqueeb/check-anything)
82
+ - [remove-anything ✂️](https://github.com/mesqueeb/remove-anything)
83
+ - [getorset-anything 🐊](https://github.com/mesqueeb/getorset-anything)
84
+ - [map-anything 🗺](https://github.com/mesqueeb/map-anything)
79
85
  - [filter-anything ⚔️](https://github.com/mesqueeb/filter-anything)
80
- - [find-and-replace-anything 🎣](https://github.com/mesqueeb/find-and-replace-anything)
81
- - [compare-anything 🛰](https://github.com/mesqueeb/compare-anything)
82
86
  - [copy-anything 🎭](https://github.com/mesqueeb/copy-anything)
87
+ - [case-anything 🐫](https://github.com/mesqueeb/case-anything)
83
88
  - [flatten-anything 🏏](https://github.com/mesqueeb/flatten-anything)
84
- - [is-what 🙉](https://github.com/mesqueeb/is-what)
89
+ - [nestify-anything 🧅](https://github.com/mesqueeb/nestify-anything)
package/dist/index.cjs CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  /**
6
4
  * Retrieve the value in a map, or if it wasn't found, set an initial value and return that.
7
5
  *
@@ -1,5 +1,5 @@
1
- declare type KeyOfMap<M extends Map<unknown, unknown>> = M extends Map<infer K, unknown> ? K : never;
2
- declare type ValueOfMap<M extends Map<unknown, unknown>> = M extends Map<unknown, infer V> ? V : never;
1
+ type KeyOfMap<M extends Map<unknown, unknown>> = M extends Map<infer K, unknown> ? K : never;
2
+ type ValueOfMap<M extends Map<unknown, unknown>> = M extends Map<unknown, infer V> ? V : never;
3
3
  /**
4
4
  * Retrieve the value in a map, or if it wasn't found, set an initial value and return that.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getorset-anything",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "description": "Gets a value from a Map/Obj or sets an initial value when not found and returns that. TypeScript supported.",
@@ -9,9 +9,9 @@
9
9
  "types": "./dist/types/index.d.ts",
10
10
  "exports": {
11
11
  ".": {
12
+ "types": "./dist/types/index.d.ts",
12
13
  "import": "./dist/index.es.js",
13
- "require": "./dist/index.cjs",
14
- "types": "./dist/types/index.d.ts"
14
+ "require": "./dist/index.cjs"
15
15
  }
16
16
  },
17
17
  "files": [
@@ -24,8 +24,8 @@
24
24
  "clean": "del ./dist",
25
25
  "lint": "tsc --noEmit && eslint ./src --ext .ts",
26
26
  "test": "vitest run",
27
- "build": "npm run clean && rollup -c ./scripts/build.js",
28
- "release": "npm run lint && del dist && npm run build && np"
27
+ "build": "rollup --bundleConfigAsCjs -c ./scripts/build.js",
28
+ "release": "npm run lint && npm run clean && npm run build && np"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -60,18 +60,18 @@
60
60
  "homepage": "https://github.com/mesqueeb/getorset-anything#readme",
61
61
  "dependencies": {},
62
62
  "devDependencies": {
63
- "@typescript-eslint/eslint-plugin": "^5.10.1",
64
- "@typescript-eslint/parser": "^5.10.1",
63
+ "@typescript-eslint/eslint-plugin": "^5.59.2",
64
+ "@typescript-eslint/parser": "^5.59.2",
65
65
  "del-cli": "^4.0.1",
66
- "eslint": "^8.7.0",
67
- "eslint-config-prettier": "^8.3.0",
66
+ "eslint": "^8.40.0",
67
+ "eslint-config-prettier": "^8.8.0",
68
68
  "eslint-plugin-tree-shaking": "^1.10.0",
69
- "np": "^7.6.0",
70
- "prettier": "^2.5.1",
71
- "rollup": "^2.66.1",
72
- "rollup-plugin-typescript2": "^0.31.1",
73
- "typescript": "^4.5.5",
74
- "vitest": "^0.2.3"
69
+ "np": "^7.7.0",
70
+ "prettier": "^2.8.8",
71
+ "rollup": "^3.21.5",
72
+ "rollup-plugin-typescript2": "^0.34.1",
73
+ "typescript": "^4.9.5",
74
+ "vitest": "^0.31.0"
75
75
  },
76
76
  "np": {
77
77
  "yarn": false,