@puq/type 0.4.3 → 0.4.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/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/common/decorator-param.d.ts +25 -0
- package/dist/lib/common/decorator-param.d.ts.map +1 -0
- package/dist/lib/common/decorator-param.js +3 -0
- package/dist/lib/common/decorator-param.js.map +1 -0
- package/dist/lib/utils/entries.d.ts +7 -0
- package/dist/lib/utils/entries.d.ts.map +1 -0
- package/dist/lib/utils/entries.js +5 -0
- package/dist/lib/utils/entries.js.map +1 -0
- package/dist/lib/utils/keys.d.ts +8 -0
- package/dist/lib/utils/keys.d.ts.map +1 -0
- package/dist/lib/utils/keys.js +5 -0
- package/dist/lib/utils/keys.js.map +1 -0
- package/dist/lib/utils/values.d.ts +7 -0
- package/dist/lib/utils/values.d.ts.map +1 -0
- package/dist/lib/utils/values.js +5 -0
- package/dist/lib/utils/values.js.map +1 -0
- package/dist/package.json +1 -1
- package/package.json +86 -86
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
export * from './lib/common/decorator-param.js';
|
1
2
|
export * from './lib/common/object-literal.js';
|
2
3
|
export * from './lib/common/package-json.js';
|
3
4
|
export * from './lib/common/puq-options.js';
|
@@ -29,9 +30,12 @@ export * from './lib/property/string-format.js';
|
|
29
30
|
export * from './lib/property/string.js';
|
30
31
|
export * from './lib/ui/icon.js';
|
31
32
|
export * from './lib/ui/input-type.js';
|
33
|
+
export * from './lib/utils/entries.js';
|
32
34
|
export * from './lib/utils/key-of.js';
|
35
|
+
export * from './lib/utils/keys.js';
|
33
36
|
export * from './lib/utils/optional.js';
|
34
37
|
export * from './lib/utils/pick-optional.js';
|
35
38
|
export * from './lib/utils/pick-required.js';
|
36
39
|
export * from './lib/utils/type.js';
|
40
|
+
export * from './lib/utils/values.js';
|
37
41
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gCAAgC,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
export * from './lib/common/decorator-param.js';
|
1
2
|
export * from './lib/common/object-literal.js';
|
2
3
|
export * from './lib/common/package-json.js';
|
3
4
|
export * from './lib/common/puq-options.js';
|
@@ -29,10 +30,13 @@ export * from './lib/property/string-format.js';
|
|
29
30
|
export * from './lib/property/string.js';
|
30
31
|
export * from './lib/ui/icon.js';
|
31
32
|
export * from './lib/ui/input-type.js';
|
33
|
+
export * from './lib/utils/entries.js';
|
32
34
|
export * from './lib/utils/key-of.js';
|
35
|
+
export * from './lib/utils/keys.js';
|
33
36
|
export * from './lib/utils/optional.js';
|
34
37
|
export * from './lib/utils/pick-optional.js';
|
35
38
|
export * from './lib/utils/pick-required.js';
|
36
39
|
export * from './lib/utils/type.js';
|
40
|
+
export * from './lib/utils/values.js';
|
37
41
|
|
38
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)\nexport * from './lib/common/object-literal.js'
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @index(['./**/*.ts', '!./**/*.{spec,test}.ts','!./**/index.ts'], f => `export * from '${f.path}.js'`)\nexport * from './lib/common/decorator-param.js';\nexport * from './lib/common/object-literal.js';\nexport * from './lib/common/package-json.js';\nexport * from './lib/common/puq-options.js';\nexport * from './lib/dto/count-result.js';\nexport * from './lib/dto/delete-result.js';\nexport * from './lib/dto/relation-param.js';\nexport * from './lib/dto/update-result.js';\nexport * from './lib/dto/validation-error.js';\nexport * from './lib/model/base.js';\nexport * from './lib/model/id.js';\nexport * from './lib/model/timestamp.js';\nexport * from './lib/property/array.js';\nexport * from './lib/property/big-integer.js';\nexport * from './lib/property/boolean.js';\nexport * from './lib/property/common-number.js';\nexport * from './lib/property/common.js';\nexport * from './lib/property/database-type.js';\nexport * from './lib/property/date.js';\nexport * from './lib/property/integer-format.js';\nexport * from './lib/property/integer.js';\nexport * from './lib/property/model.js';\nexport * from './lib/property/number-format.js';\nexport * from './lib/property/number.js';\nexport * from './lib/property/object.js';\nexport * from './lib/property/property-type.js';\nexport * from './lib/property/property.js';\nexport * from './lib/property/relation-options.js';\nexport * from './lib/property/string-format.js';\nexport * from './lib/property/string.js';\nexport * from './lib/ui/icon.js';\nexport * from './lib/ui/input-type.js';\nexport * from './lib/utils/entries.js';\nexport * from './lib/utils/key-of.js';\nexport * from './lib/utils/keys.js';\nexport * from './lib/utils/optional.js';\nexport * from './lib/utils/pick-optional.js';\nexport * from './lib/utils/pick-required.js';\nexport * from './lib/utils/type.js';\nexport * from './lib/utils/values.js';\n"],"names":[],"mappings":"AACA,cAAc,kCAAkC;AAChD,cAAc,iCAAiC;AAC/C,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,4BAA4B;AAC1C,cAAc,6BAA6B;AAC3C,cAAc,8BAA8B;AAC5C,cAAc,6BAA6B;AAC3C,cAAc,gCAAgC;AAC9C,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,2BAA2B;AACzC,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,4BAA4B;AAC1C,cAAc,kCAAkC;AAChD,cAAc,2BAA2B;AACzC,cAAc,kCAAkC;AAChD,cAAc,yBAAyB;AACvC,cAAc,mCAAmC;AACjD,cAAc,4BAA4B;AAC1C,cAAc,0BAA0B;AACxC,cAAc,kCAAkC;AAChD,cAAc,2BAA2B;AACzC,cAAc,2BAA2B;AACzC,cAAc,kCAAkC;AAChD,cAAc,6BAA6B;AAC3C,cAAc,qCAAqC;AACnD,cAAc,kCAAkC;AAChD,cAAc,2BAA2B;AACzC,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,0BAA0B;AACxC,cAAc,+BAA+B;AAC7C,cAAc,+BAA+B;AAC7C,cAAc,sBAAsB;AACpC,cAAc,wBAAwB"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Decorator param `(...args:PropertyDecoratorParam)=>`
|
3
|
+
*/
|
4
|
+
export type PropertyDecoratorParam = [Object, string | symbol];
|
5
|
+
/**
|
6
|
+
* Decorator param `(...args:ClassDecoratorParam)=>`
|
7
|
+
*/
|
8
|
+
export type ClassDecoratorParam = [Function];
|
9
|
+
/**
|
10
|
+
* Decorator param `(...args:MethodDecoratorParam)=>`
|
11
|
+
*/
|
12
|
+
export type MethodDecoratorParam<T> = [
|
13
|
+
Object,
|
14
|
+
string | symbol,
|
15
|
+
TypedPropertyDescriptor<T>
|
16
|
+
];
|
17
|
+
/**
|
18
|
+
* Decorator param `(...args:ParameterDecoratorParam)=>`
|
19
|
+
*/
|
20
|
+
export type ParameterDecoratorParam = [
|
21
|
+
Object,
|
22
|
+
string | symbol | undefined,
|
23
|
+
number
|
24
|
+
];
|
25
|
+
//# sourceMappingURL=decorator-param.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"decorator-param.d.ts","sourceRoot":"","sources":["../../../src/lib/common/decorator-param.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,QAAQ,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,MAAM;IACN,MAAM,GAAG,MAAM;IACf,uBAAuB,CAAC,CAAC,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM;IACN,MAAM,GAAG,MAAM,GAAG,SAAS;IAC3B,MAAM;CACP,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/common/decorator-param.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* Extracts the enumerable key-value pairs of an object as a typed array of tuples.
|
3
|
+
* @param instance - The object to extract entries from.
|
4
|
+
* @returns An array of `[key, value]` tuples, where `key` is a string and `value` is the corresponding value from `instance`.
|
5
|
+
*/
|
6
|
+
export declare function entries<T extends Record<any, any>>(instance: T): Array<[key: string, value: T[keyof T]]>;
|
7
|
+
//# sourceMappingURL=entries.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/entries.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAChD,QAAQ,EAAE,CAAC,GACV,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAEzC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils/entries.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\r\n/**\r\n * Extracts the enumerable key-value pairs of an object as a typed array of tuples.\r\n * @param instance - The object to extract entries from.\r\n * @returns An array of `[key, value]` tuples, where `key` is a string and `value` is the corresponding value from `instance`.\r\n */\r\nexport function entries<T extends Record<any, any>>(\r\n instance: T,\r\n): Array<[key: string, value: T[keyof T]]> {\r\n return Object.entries(instance) as Array<[key: string, value: T[keyof T]]>;\r\n}\r\n"],"names":["entries","instance","Object"],"mappings":"AAOA,OAAO,SAASA,QACdC,CAAW;IAEX,OAAOC,OAAOF,OAAO,CAACC;AACxB"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { Keys } from './key-of.js';
|
2
|
+
/**
|
3
|
+
* Extract the keys of the object
|
4
|
+
* @param instance - the object value that the keys are extracted from
|
5
|
+
* @returns the keys of the object as `string[]`
|
6
|
+
*/
|
7
|
+
export declare function keys<T extends Record<any, any>>(instance: T): Keys<T>;
|
8
|
+
//# sourceMappingURL=keys.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/keys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAErE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils/keys.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport { Keys } from './key-of.js';\r\n\r\n/**\r\n * Extract the keys of the object\r\n * @param instance - the object value that the keys are extracted from\r\n * @returns the keys of the object as `string[]`\r\n */\r\nexport function keys<T extends Record<any, any>>(instance: T): Keys<T> {\r\n return Object.keys(instance) as Keys<T>;\r\n}\r\n"],"names":["keys","instance","Object"],"mappings":"AAQA,OAAO,SAASA,KAAiCC,CAAW;IAC1D,OAAOC,OAAOF,IAAI,CAACC;AACrB"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* Extract the values of an object
|
3
|
+
* @param instance - the object value to extract the values from
|
4
|
+
* @returns Array of values of the object
|
5
|
+
*/
|
6
|
+
export declare function values<T extends Record<any, any>>(instance: T): any[];
|
7
|
+
//# sourceMappingURL=values.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/values.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,GAAG,EAAE,CAErE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils/values.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\n\r\n/**\r\n * Extract the values of an object\r\n * @param instance - the object value to extract the values from\r\n * @returns Array of values of the object\r\n */\r\nexport function values<T extends Record<any, any>>(instance: T): any[] {\r\n return Object.values(instance);\r\n}\r\n"],"names":["values","instance","Object"],"mappings":"AAOA,OAAO,SAASA,OAAmCC,CAAW;IAC5D,OAAOC,OAAOF,MAAM,CAACC;AACvB"}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
@@ -1,87 +1,87 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
1
|
+
{
|
2
|
+
"name": "@puq/type",
|
3
|
+
"version": "0.4.4",
|
4
|
+
"license": "MIT",
|
5
|
+
"publishConfig": {
|
6
|
+
"access": "public",
|
7
|
+
"tag": "latest"
|
8
|
+
},
|
9
|
+
"description": "Common model and utility types",
|
10
|
+
"author": {
|
11
|
+
"email": "robert.brightline@gmail.com",
|
12
|
+
"name": "Robert Brightline",
|
13
|
+
"url": "https://rbrightline.github.io"
|
14
|
+
},
|
15
|
+
"keywords": [
|
16
|
+
"type",
|
17
|
+
"model",
|
18
|
+
"type-utility"
|
19
|
+
],
|
20
|
+
"repository": {
|
21
|
+
"directory": "libs/type",
|
22
|
+
"url": "https://github.com/rbrightline/puq/tree/main",
|
23
|
+
"type": "github"
|
24
|
+
},
|
25
|
+
"homepage": "https://rbrightline.github.io/puq/type",
|
26
|
+
"bugs": {
|
27
|
+
"email": "robert.brightline@gmail.com",
|
28
|
+
"url": "https://rbrightline.github.io"
|
29
|
+
},
|
30
|
+
"categories": [
|
31
|
+
"Other"
|
32
|
+
],
|
33
|
+
"contributors": [
|
34
|
+
{
|
35
|
+
"email": "robert.brightline@gmail.com",
|
36
|
+
"name": "Robert Brightline",
|
37
|
+
"url": "https://rbrightline.github.io"
|
38
|
+
}
|
39
|
+
],
|
40
|
+
"funding": [
|
41
|
+
"https://cash.app/$puqlib"
|
42
|
+
],
|
43
|
+
"icon": "https://raw.githubusercontent.com/rbrightline/puq/refs/heads/main/libs/type/favicon.png",
|
44
|
+
"type": "module",
|
45
|
+
"main": "./dist/index.js",
|
46
|
+
"module": "./dist/index.js",
|
47
|
+
"types": "./dist/index.d.ts",
|
48
|
+
"exports": {
|
49
|
+
"./package.json": "./package.json",
|
50
|
+
".": {
|
51
|
+
"types": "./dist/index.d.ts",
|
52
|
+
"import": "./dist/index.js",
|
53
|
+
"default": "./dist/index.js"
|
54
|
+
}
|
55
|
+
},
|
56
|
+
"files": [
|
57
|
+
"dist",
|
58
|
+
"!**/*.tsbuildinfo"
|
59
|
+
],
|
60
|
+
"nx": {
|
61
|
+
"sourceRoot": "libs/type/src",
|
62
|
+
"targets": {
|
63
|
+
"build": {
|
64
|
+
"executor": "@nx/js:swc",
|
65
|
+
"outputs": [
|
66
|
+
"{options.outputPath}"
|
67
|
+
],
|
68
|
+
"options": {
|
69
|
+
"outputPath": "libs/type/dist",
|
70
|
+
"main": "libs/type/src/index.ts",
|
71
|
+
"tsConfig": "libs/type/tsconfig.lib.json",
|
72
|
+
"skipTypeCheck": false,
|
73
|
+
"stripLeadingPaths": true
|
74
|
+
},
|
75
|
+
"dependsOn": [
|
76
|
+
"lint"
|
77
|
+
]
|
78
|
+
},
|
79
|
+
"doc": {
|
80
|
+
"command": "cd libs/type && npx compodoc -d ../../public/type -p tsconfig.lib.json -n type"
|
81
|
+
}
|
82
|
+
}
|
83
|
+
},
|
84
|
+
"dependencies": {
|
85
|
+
"@swc/helpers": "^0.5.15"
|
86
|
+
}
|
87
87
|
}
|