@poppinss/utils 6.5.0 → 6.6.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/build/{chunk-XHQBV7AF.js → chunk-IOBSMUFC.js} +1 -0
- package/build/chunk-IOBSMUFC.js.map +1 -0
- package/build/{chunk-OKRMWJO4.js → chunk-K76IL3UP.js} +2 -1
- package/build/chunk-K76IL3UP.js.map +1 -0
- package/build/{chunk-PWRXO3NF.js → chunk-NKGAOHNN.js} +1 -0
- package/build/chunk-NKGAOHNN.js.map +1 -0
- package/build/index.d.ts +23 -278
- package/build/index.js +8 -3
- package/build/index.js.map +1 -0
- package/build/src/assert.d.ts +3 -5
- package/build/src/assert.js +1 -0
- package/build/src/assert.js.map +1 -0
- package/build/src/base64.d.ts +33 -0
- package/build/src/compose.d.ts +19 -0
- package/build/src/define_static_property.d.ts +10 -0
- package/build/src/exception.d.ts +52 -0
- package/build/src/exceptions/invalid_arguments_exception.d.ts +5 -0
- package/build/src/exceptions/runtime_exception.d.ts +5 -0
- package/build/src/flatten.d.ts +4 -0
- package/build/src/fs_import_all.d.ts +20 -0
- package/build/src/fs_read_all.d.ts +20 -0
- package/build/src/import_default.d.ts +6 -0
- package/build/src/is_script_file.d.ts +5 -0
- package/build/src/json/main.d.ts +3 -15
- package/build/src/json/main.js +2 -1
- package/build/src/json/main.js.map +1 -0
- package/build/src/json/safe_parse.d.ts +5 -0
- package/build/src/json/safe_stringify.d.ts +6 -0
- package/build/src/message_builder.d.ts +17 -0
- package/build/src/natural_sort.d.ts +4 -0
- package/build/src/object_builder.d.ts +58 -0
- package/build/src/safe_equal.d.ts +11 -0
- package/build/src/slash.d.ts +1 -0
- package/build/src/string/bytes.d.ts +11 -0
- package/build/src/string/change_case.d.ts +42 -0
- package/build/src/string/excerpt.d.ts +11 -0
- package/build/src/string/interpolate.d.ts +8 -0
- package/build/src/string/main.d.ts +15 -118
- package/build/src/string/main.js +3 -2
- package/build/src/string/main.js.map +1 -0
- package/build/src/string/milliseconds.d.ts +9 -0
- package/build/src/string/ordinal.d.ts +4 -0
- package/build/src/string/pluralize.d.ts +16 -0
- package/build/src/string/random.d.ts +4 -0
- package/build/src/string/seconds.d.ts +9 -0
- package/build/src/string/sentence.d.ts +8 -0
- package/build/src/string/slugify.d.ts +6 -0
- package/build/src/string/truncate.d.ts +10 -0
- package/build/src/string_builder.d.ts +1 -3
- package/build/src/string_builder.js +3 -2
- package/build/src/string_builder.js.map +1 -0
- package/build/src/types.d.ts +9 -10
- package/build/src/types.js +1 -0
- package/build/src/types.js.map +1 -0
- package/package.json +25 -20
package/build/src/types.d.ts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
type PickKeysByValue<T, V> = {
|
|
2
2
|
[K in keyof T]: T[K] extends V ? K : never;
|
|
3
3
|
}[keyof T];
|
|
4
|
-
type OmitProperties<T, P> = Omit<T, PickKeysByValue<T, P>>;
|
|
4
|
+
export type OmitProperties<T, P> = Omit<T, PickKeysByValue<T, P>>;
|
|
5
5
|
type ScanFsBaseOptions = {
|
|
6
6
|
ignoreMissingRoot?: boolean;
|
|
7
7
|
filter?: (filePath: string, index: number) => boolean;
|
|
8
8
|
sort?: (current: string, next: string) => number;
|
|
9
9
|
};
|
|
10
|
-
type ImportAllFilesOptions = ScanFsBaseOptions & {
|
|
10
|
+
export type ImportAllFilesOptions = ScanFsBaseOptions & {
|
|
11
11
|
/**
|
|
12
12
|
* A custom method to transform collection keys
|
|
13
13
|
*/
|
|
14
14
|
transformKeys?: (keys: string[]) => string[];
|
|
15
15
|
};
|
|
16
|
-
type ReadAllFilesOptions = ScanFsBaseOptions & {
|
|
16
|
+
export type ReadAllFilesOptions = ScanFsBaseOptions & {
|
|
17
17
|
pathType?: 'relative' | 'unixRelative' | 'absolute' | 'unixAbsolute' | 'url';
|
|
18
18
|
};
|
|
19
|
-
type JSONReplacer = (this: any, key: string, value: any) => any;
|
|
20
|
-
type JSONReviver = (this: any, key: string, value: any) => any;
|
|
21
|
-
type Constructor = new (...args: any[]) => any;
|
|
19
|
+
export type JSONReplacer = (this: any, key: string, value: any) => any;
|
|
20
|
+
export type JSONReviver = (this: any, key: string, value: any) => any;
|
|
21
|
+
export type Constructor = new (...args: any[]) => any;
|
|
22
22
|
/**
|
|
23
23
|
* Normalizes constructor to work with mixins. There is an open bug for mixins
|
|
24
24
|
* to allow constructors other than `...args: any[]`
|
|
25
25
|
*
|
|
26
26
|
* https://github.com/microsoft/TypeScript/issues/37142
|
|
27
27
|
*/
|
|
28
|
-
type NormalizeConstructor<T extends Constructor> = {
|
|
28
|
+
export type NormalizeConstructor<T extends Constructor> = {
|
|
29
29
|
new (...args: any[]): InstanceType<T>;
|
|
30
30
|
} & Omit<T, 'constructor'>;
|
|
31
|
-
type Opaque<T, K> = T & {
|
|
31
|
+
export type Opaque<T, K> = T & {
|
|
32
32
|
[' __opaque__']: K;
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
export { Constructor, ImportAllFilesOptions, JSONReplacer, JSONReviver, NormalizeConstructor, OmitProperties, Opaque, ReadAllFilesOptions };
|
|
34
|
+
export {};
|
package/build/src/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poppinss/utils",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "Handy utilities for repetitive work",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"build",
|
|
9
|
+
"!build/tests",
|
|
10
|
+
"!build/test_helpers",
|
|
11
|
+
"!build/bin",
|
|
9
12
|
"lodash"
|
|
10
13
|
],
|
|
11
14
|
"exports": {
|
|
@@ -30,7 +33,8 @@
|
|
|
30
33
|
"quick:test": "node --loader=ts-node/esm bin/test.ts",
|
|
31
34
|
"clean": "del-cli build",
|
|
32
35
|
"typecheck": "tsc --noEmit",
|
|
33
|
-
"
|
|
36
|
+
"precompile": "npm run lint && npm run clean",
|
|
37
|
+
"compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
|
|
34
38
|
"build": "npm run compile && npm run build:lodash",
|
|
35
39
|
"release": "np",
|
|
36
40
|
"version": "npm run build",
|
|
@@ -46,20 +50,20 @@
|
|
|
46
50
|
"author": "virk,poppinss",
|
|
47
51
|
"license": "MIT",
|
|
48
52
|
"devDependencies": {
|
|
49
|
-
"@adonisjs/eslint-config": "^1.1.
|
|
50
|
-
"@adonisjs/prettier-config": "^1.1.
|
|
51
|
-
"@adonisjs/tsconfig": "^1.1.
|
|
52
|
-
"@commitlint/cli": "^
|
|
53
|
-
"@commitlint/config-conventional": "^
|
|
54
|
-
"@japa/assert": "^2.0.
|
|
53
|
+
"@adonisjs/eslint-config": "^1.1.9",
|
|
54
|
+
"@adonisjs/prettier-config": "^1.1.9",
|
|
55
|
+
"@adonisjs/tsconfig": "^1.1.9",
|
|
56
|
+
"@commitlint/cli": "^18.4.3",
|
|
57
|
+
"@commitlint/config-conventional": "^18.4.3",
|
|
58
|
+
"@japa/assert": "^2.0.1",
|
|
55
59
|
"@japa/expect-type": "^2.0.0",
|
|
56
|
-
"@japa/runner": "^3.0
|
|
57
|
-
"@swc/core": "1.3.
|
|
58
|
-
"@types/fs-extra": "^11.0.
|
|
59
|
-
"@types/node": "^20.
|
|
60
|
-
"c8": "^8.0.
|
|
60
|
+
"@japa/runner": "^3.1.0",
|
|
61
|
+
"@swc/core": "^1.3.99",
|
|
62
|
+
"@types/fs-extra": "^11.0.4",
|
|
63
|
+
"@types/node": "^20.10.0",
|
|
64
|
+
"c8": "^8.0.1",
|
|
61
65
|
"del-cli": "^5.1.0",
|
|
62
|
-
"eslint": "^8.
|
|
66
|
+
"eslint": "^8.54.0",
|
|
63
67
|
"fs-extra": "^11.1.1",
|
|
64
68
|
"github-label-sync": "^2.3.1",
|
|
65
69
|
"husky": "^8.0.3",
|
|
@@ -67,15 +71,15 @@
|
|
|
67
71
|
"lodash-cli": "^4.17.5",
|
|
68
72
|
"move-file-cli": "^3.0.0",
|
|
69
73
|
"np": "^8.0.4",
|
|
70
|
-
"prettier": "^3.0
|
|
74
|
+
"prettier": "^3.1.0",
|
|
71
75
|
"ts-node": "^10.9.1",
|
|
72
|
-
"tsup": "^
|
|
73
|
-
"typescript": "
|
|
76
|
+
"tsup": "^8.0.1",
|
|
77
|
+
"typescript": "~5.2.2"
|
|
74
78
|
},
|
|
75
79
|
"dependencies": {
|
|
76
80
|
"@lukeed/ms": "^2.0.1",
|
|
77
|
-
"@types/bytes": "^3.1.
|
|
78
|
-
"@types/pluralize": "^0.0.
|
|
81
|
+
"@types/bytes": "^3.1.4",
|
|
82
|
+
"@types/pluralize": "^0.0.33",
|
|
79
83
|
"bytes": "^3.1.2",
|
|
80
84
|
"case-anything": "^2.1.13",
|
|
81
85
|
"flattie": "^1.1.0",
|
|
@@ -136,7 +140,8 @@
|
|
|
136
140
|
"outDir": "./build",
|
|
137
141
|
"clean": true,
|
|
138
142
|
"format": "esm",
|
|
139
|
-
"dts":
|
|
143
|
+
"dts": false,
|
|
144
|
+
"sourcemap": true,
|
|
140
145
|
"target": "esnext"
|
|
141
146
|
}
|
|
142
147
|
}
|