map-anything 2.1.0 → 2.1.1
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/dist/index.cjs +0 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +14 -14
package/dist/index.cjs
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
export declare function mapObject<T extends Record<string | number | symbol, unknown>, MapFunction extends (value: T[keyof T], propName: keyof T, array: T[keyof T][]) => any>(target: T, mapFunction: MapFunction): {
|
|
5
5
|
[key in keyof T]: ReturnType<typeof mapFunction>;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type KeyOfMap<M extends Map<unknown, unknown>> = M extends Map<infer K, unknown> ? K : never;
|
|
8
|
+
export type ValueOfMap<M extends Map<unknown, unknown>> = M extends Map<unknown, infer V> ? V : never;
|
|
9
9
|
/**
|
|
10
10
|
* Map each value of a map with provided function, just like `Array.map`
|
|
11
11
|
*/
|
package/package.json
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
"name": "map-anything",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "2.1.
|
|
5
|
+
"version": "2.1.1",
|
|
6
6
|
"description": "Array.map but for objects with good TypeScript support. A small and simple integration.",
|
|
7
7
|
"module": "./dist/index.es.js",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
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": [
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "vitest run",
|
|
25
25
|
"lint": "tsc --noEmit && eslint ./src --ext .ts",
|
|
26
|
-
"build": "rollup -c ./scripts/build.js",
|
|
26
|
+
"build": "rollup --bundleConfigAsCjs -c ./scripts/build.js",
|
|
27
27
|
"release": "npm run lint && del dist && npm run build && np"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
31
|
-
"@typescript-eslint/parser": "^5.
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
31
|
+
"@typescript-eslint/parser": "^5.59.2",
|
|
32
32
|
"del-cli": "^4.0.1",
|
|
33
|
-
"eslint": "^8.
|
|
34
|
-
"eslint-config-prettier": "^8.
|
|
33
|
+
"eslint": "^8.40.0",
|
|
34
|
+
"eslint-config-prettier": "^8.8.0",
|
|
35
35
|
"eslint-plugin-tree-shaking": "^1.10.0",
|
|
36
|
-
"np": "^7.
|
|
37
|
-
"prettier": "^2.
|
|
38
|
-
"rollup": "^
|
|
39
|
-
"rollup-plugin-typescript2": "^0.
|
|
40
|
-
"typescript": "^4.
|
|
41
|
-
"vitest": "^0.
|
|
36
|
+
"np": "^7.7.0",
|
|
37
|
+
"prettier": "^2.8.8",
|
|
38
|
+
"rollup": "^3.21.5",
|
|
39
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
40
|
+
"typescript": "^4.9.5",
|
|
41
|
+
"vitest": "^0.31.0"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"map-object",
|