@code-essentials/utils 1.0.4 → 1.0.5
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/object.d.ts +5 -0
- package/dist/object.js +3 -0
- package/package.json +6 -20
package/dist/object.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export type Values<T extends object> = T[keyof T];
|
|
2
|
+
type EntryMap<T> = {
|
|
3
|
+
[K in keyof T]: [K, T[K]];
|
|
4
|
+
};
|
|
5
|
+
export type Entry<T> = EntryMap<T>[keyof T];
|
|
6
|
+
export declare function entries<T extends object>(o: T): Entry<T>[];
|
|
2
7
|
export type PropertyPath<T> = [] | T extends object ? Values<{
|
|
3
8
|
[K in keyof T]: [K] | [K, Values<PropertyPath<T[K]>>];
|
|
4
9
|
}> : [];
|
package/dist/object.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export function entries(o) {
|
|
2
|
+
return Object.entries(o);
|
|
3
|
+
}
|
|
1
4
|
// export type PropertyType<T, Property extends PropertyPath<T> & PropertyKey[]> = PropertyType_<T, Property>
|
|
2
5
|
// type PropertyType_<T, Property extends PropertyKey[], Constructed extends PropertyKey[] = []> =
|
|
3
6
|
// (Property & Constructed) extends never ?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-essentials/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -11,23 +11,9 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@ava/typescript": "^6.0.0",
|
|
13
13
|
"@code-essentials/tsconfig": "^1.0.3",
|
|
14
|
-
"@types/node": "^24.
|
|
14
|
+
"@types/node": "^24.8.1",
|
|
15
15
|
"ava": "^6.4.1",
|
|
16
|
-
"typescript": "^5.9.
|
|
17
|
-
},
|
|
18
|
-
"ava": {
|
|
19
|
-
"files": [
|
|
20
|
-
"src/**/*.spec.ts"
|
|
21
|
-
],
|
|
22
|
-
"typescript": {
|
|
23
|
-
"rewritePaths": {
|
|
24
|
-
"src/": "dist/"
|
|
25
|
-
},
|
|
26
|
-
"extensions": [
|
|
27
|
-
"ts"
|
|
28
|
-
],
|
|
29
|
-
"compile": false
|
|
30
|
-
}
|
|
16
|
+
"typescript": "^5.9.3"
|
|
31
17
|
},
|
|
32
18
|
"author": {
|
|
33
19
|
"name": "Isaac Valdez",
|
|
@@ -37,11 +23,11 @@
|
|
|
37
23
|
"license": "MIT",
|
|
38
24
|
"scripts": {
|
|
39
25
|
"clean": "rm -rf dist",
|
|
40
|
-
"prebuild": "
|
|
41
|
-
"prebuild:debug": "
|
|
26
|
+
"prebuild": "pnpm run clean",
|
|
27
|
+
"prebuild:debug": "pnpm run clean",
|
|
42
28
|
"build": "tsc",
|
|
43
29
|
"build:debug": "tsc -p tsconfig.debug.json",
|
|
44
|
-
"pretest": "
|
|
30
|
+
"pretest": "pnpm run build:debug",
|
|
45
31
|
"test": "ava"
|
|
46
32
|
}
|
|
47
33
|
}
|