@poppinss/utils 7.0.0-next.6 → 7.0.0
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 +2 -0
- package/build/index.js +6 -6
- package/build/is_script_file-CbSEfxE_.js +20 -0
- package/build/lodash/main.cjs +43 -34
- package/build/modules/base64.js +2 -2
- package/build/modules/exception.js +1 -1
- package/build/modules/fs/main.js +4 -5
- package/build/modules/json/main.js +1 -2
- package/build/{main-aO4h7ygK.js → safe_stringify-DenlQd3-.js} +54 -33
- package/lodash/lodash.types.d.ts +59 -2
- package/package.json +21 -13
- package/build/chunk-BNZ4_A-W.js +0 -23
- package/build/exception-L7vjh-Gv.js +0 -2
- package/build/main-CdreHl1_.js +0 -694
package/lodash/lodash.types.d.ts
CHANGED
|
@@ -7,8 +7,14 @@
|
|
|
7
7
|
* file that was distributed with this source code.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
type PartialShallow<T> = {
|
|
11
|
+
[P in keyof T]?: T[P] extends object ? object : T[P]
|
|
12
|
+
}
|
|
10
13
|
type PropertyName = string | number | symbol
|
|
11
14
|
type PropertyNames = PropertyName | ReadonlyArray<PropertyName>
|
|
15
|
+
type ValueKeyIterateeTypeGuard<T, S extends T> = (value: T, key: string) => value is S
|
|
16
|
+
type IterateeShorthand<T> = PropertyName | [PropertyName, any] | PartialShallow<T>
|
|
17
|
+
type ValueKeyIteratee<T> = ((value: T, key: string) => NotVoid) | IterateeShorthand<T>
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
20
|
* Instead of using lodash as a dependency (which is around 4MB), we create a
|
|
@@ -23,10 +29,61 @@ type PropertyNames = PropertyName | ReadonlyArray<PropertyName>
|
|
|
23
29
|
declare module '@poppinss/utils/lodash' {
|
|
24
30
|
type LodashMethods = {
|
|
25
31
|
pick: <T>(object: T | null | undefined, ...props: Array<PropertyNames>) => Partial<T>
|
|
32
|
+
pickBy<T, S extends T>(
|
|
33
|
+
object: Record<string, T> | null | undefined,
|
|
34
|
+
predicate: ValueKeyIterateeTypeGuard<T, S>
|
|
35
|
+
): Record<string, S>
|
|
36
|
+
/**
|
|
37
|
+
* @see _.pickBy
|
|
38
|
+
*/
|
|
39
|
+
pickBy<T, S extends T>(
|
|
40
|
+
object: Record<number, T> | null | undefined,
|
|
41
|
+
predicate: ValueKeyIterateeTypeGuard<T, S>
|
|
42
|
+
): Record<number, S>
|
|
43
|
+
/**
|
|
44
|
+
* @see _.pickBy
|
|
45
|
+
*/
|
|
46
|
+
pickBy<T>(
|
|
47
|
+
object: Record<string, T> | null | undefined,
|
|
48
|
+
predicate?: ValueKeyIteratee<T>
|
|
49
|
+
): Record<string, T>
|
|
50
|
+
/**
|
|
51
|
+
* @see _.pickBy
|
|
52
|
+
*/
|
|
53
|
+
pickBy<T>(
|
|
54
|
+
object: Record<number, T> | null | undefined,
|
|
55
|
+
predicate?: ValueKeyIteratee<T>
|
|
56
|
+
): Record<number, T>
|
|
57
|
+
/**
|
|
58
|
+
* @see _.pickBy
|
|
59
|
+
*/
|
|
60
|
+
pickBy<T extends object>(
|
|
61
|
+
object: T | null | undefined,
|
|
62
|
+
predicate?: ValueKeyIteratee<T[keyof T]>
|
|
63
|
+
): PartialObject<T>
|
|
64
|
+
|
|
26
65
|
omit: <T extends object>(
|
|
27
66
|
object: T | null | undefined,
|
|
28
67
|
...paths: Array<PropertyNames>
|
|
29
68
|
) => Partial<T>
|
|
69
|
+
omitBy<T>(
|
|
70
|
+
object: Record<string, T> | null | undefined,
|
|
71
|
+
predicate?: ValueKeyIteratee<T>
|
|
72
|
+
): Record<string, T>
|
|
73
|
+
/**
|
|
74
|
+
* @see _.omitBy
|
|
75
|
+
*/
|
|
76
|
+
omitBy<T>(
|
|
77
|
+
object: Record<number, T> | null | undefined,
|
|
78
|
+
predicate?: ValueKeyIteratee<T>
|
|
79
|
+
): Record<number, T>
|
|
80
|
+
/**
|
|
81
|
+
* @see _.omitBy
|
|
82
|
+
*/
|
|
83
|
+
omitBy<T extends object>(
|
|
84
|
+
object: T | null | undefined,
|
|
85
|
+
predicate: ValueKeyIteratee<T[keyof T]>
|
|
86
|
+
): PartialObject<T>
|
|
30
87
|
has: <T>(object: T, path: PropertyNames) => boolean
|
|
31
88
|
get: (object: any, path: PropertyNames, defaultValue?: any) => any
|
|
32
89
|
set: (object: any, path: PropertyNames, value: any) => any
|
|
@@ -40,7 +97,7 @@ declare module '@poppinss/utils/lodash' {
|
|
|
40
97
|
customizer: (
|
|
41
98
|
value: any,
|
|
42
99
|
key: number | string | undefined,
|
|
43
|
-
object:
|
|
100
|
+
object: T | undefined,
|
|
44
101
|
stack: any
|
|
45
102
|
) => T | undefined
|
|
46
103
|
) => T
|
|
@@ -50,7 +107,7 @@ declare module '@poppinss/utils/lodash' {
|
|
|
50
107
|
customizer: (
|
|
51
108
|
value: any,
|
|
52
109
|
key: number | string | undefined,
|
|
53
|
-
object:
|
|
110
|
+
object: T | undefined,
|
|
54
111
|
stack: any
|
|
55
112
|
) => T | undefined
|
|
56
113
|
) => T
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poppinss/utils",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Handy utilities for repetitive work",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"pretest": "npm run lint",
|
|
31
31
|
"test": "npm run build:lodash && npm run quick:test",
|
|
32
|
-
"build:lodash": "lodash include=\"pick,omit,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath\" --production && move-file ./lodash.custom.min.js build/lodash/main.cjs",
|
|
32
|
+
"build:lodash": "lodash include=\"pick,pickBy,omit,omitBy,has,get,set,unset,mergeWith,merge,size,clone,cloneWith,cloneDeep,cloneDeepWith,toPath\" --production && move-file ./lodash.custom.min.js build/lodash/main.cjs",
|
|
33
33
|
"lint": "eslint",
|
|
34
34
|
"format": "prettier --write .",
|
|
35
35
|
"typecheck": "tsc --noEmit",
|
|
@@ -42,28 +42,28 @@
|
|
|
42
42
|
"quick:test": "node --import=@poppinss/ts-exec bin/test.ts"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@adonisjs/eslint-config": "^3.0.0
|
|
45
|
+
"@adonisjs/eslint-config": "^3.0.0",
|
|
46
46
|
"@adonisjs/logger": "^6.0.7",
|
|
47
47
|
"@adonisjs/prettier-config": "^1.4.5",
|
|
48
|
-
"@adonisjs/tsconfig": "^2.0.0
|
|
48
|
+
"@adonisjs/tsconfig": "^2.0.0",
|
|
49
49
|
"@japa/assert": "^4.2.0",
|
|
50
50
|
"@japa/expect-type": "^2.0.4",
|
|
51
|
-
"@japa/runner": "^5.
|
|
52
|
-
"@poppinss/ts-exec": "^1.4.
|
|
53
|
-
"@release-it/conventional-changelog": "^10.0.
|
|
51
|
+
"@japa/runner": "^5.3.0",
|
|
52
|
+
"@poppinss/ts-exec": "^1.4.4",
|
|
53
|
+
"@release-it/conventional-changelog": "^10.0.5",
|
|
54
54
|
"@types/fs-extra": "^11.0.4",
|
|
55
|
-
"@types/node": "^25.0
|
|
55
|
+
"@types/node": "^25.3.0",
|
|
56
56
|
"c8": "^10.1.3",
|
|
57
|
-
"eslint": "^
|
|
57
|
+
"eslint": "^10.0.2",
|
|
58
58
|
"fs-extra": "^11.3.3",
|
|
59
|
-
"lodash": "^4.17.
|
|
59
|
+
"lodash": "^4.17.23",
|
|
60
60
|
"lodash-cli": "^4.17.5",
|
|
61
61
|
"move-file-cli": "^3.0.0",
|
|
62
|
-
"prettier": "^3.
|
|
63
|
-
"release-it": "^19.2.
|
|
62
|
+
"prettier": "^3.8.1",
|
|
63
|
+
"release-it": "^19.2.4",
|
|
64
64
|
"safe-stable-stringify": "^2.5.0",
|
|
65
65
|
"secure-json-parse": "^4.1.0",
|
|
66
|
-
"tsdown": "^0.
|
|
66
|
+
"tsdown": "^0.20.3",
|
|
67
67
|
"typescript": "^5.9.3"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
@@ -103,6 +103,14 @@
|
|
|
103
103
|
"./modules/exception.ts",
|
|
104
104
|
"./modules/types.ts"
|
|
105
105
|
],
|
|
106
|
+
"external": [
|
|
107
|
+
"@poppinss/utils/lodash"
|
|
108
|
+
],
|
|
109
|
+
"inlineOnly": false,
|
|
110
|
+
"noExternal": [
|
|
111
|
+
"secure-json-parse",
|
|
112
|
+
"safe-stable-stringify"
|
|
113
|
+
],
|
|
106
114
|
"outDir": "./build",
|
|
107
115
|
"clean": true,
|
|
108
116
|
"format": "esm",
|
package/build/chunk-BNZ4_A-W.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
-
get: ((k) => from[k]).bind(null, key),
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
-
value: mod,
|
|
21
|
-
enumerable: true
|
|
22
|
-
}) : target, mod));
|
|
23
|
-
export { __toESM as n, __commonJSMin as t };
|