@mxpicture/gcp-functions-common 2.1.34 → 2.1.36
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/annotation/anno.property.d.ts +34 -3
- package/dist/annotation/anno.property.d.ts.map +1 -1
- package/dist/annotation/anno.property.js +34 -3
- package/dist/annotation/anno.property.js.map +1 -1
- package/dist/decorator/DecoDate.d.ts +5 -2
- package/dist/decorator/DecoDate.d.ts.map +1 -1
- package/dist/decorator/DecoDate.js +3 -2
- package/dist/decorator/DecoDate.js.map +1 -1
- package/dist/decorator/DecoEnum.d.ts +19 -3
- package/dist/decorator/DecoEnum.d.ts.map +1 -1
- package/dist/decorator/DecoEnum.js +15 -2
- package/dist/decorator/DecoEnum.js.map +1 -1
- package/dist/decorator/DecoProperty.d.ts +8 -4
- package/dist/decorator/DecoProperty.d.ts.map +1 -1
- package/dist/decorator/DecoProperty.js +8 -4
- package/dist/decorator/DecoProperty.js.map +1 -1
- package/dist/decorator/Decorator.d.ts +20 -0
- package/dist/decorator/Decorator.d.ts.map +1 -1
- package/dist/decorator/Decorator.js +20 -0
- package/dist/decorator/Decorator.js.map +1 -1
- package/dist/decorator/deco.browser.d.ts +20 -4
- package/dist/decorator/deco.browser.d.ts.map +1 -1
- package/dist/decorator/deco.browser.js +20 -4
- package/dist/decorator/deco.browser.js.map +1 -1
- package/dist/decorator/deco.enum.d.ts +66 -12
- package/dist/decorator/deco.enum.d.ts.map +1 -1
- package/dist/decorator/deco.enum.js +66 -12
- package/dist/decorator/deco.enum.js.map +1 -1
- package/dist/decorator/deco.names.d.ts +4 -0
- package/dist/decorator/deco.names.d.ts.map +1 -1
- package/dist/decorator/deco.names.js +1 -0
- package/dist/decorator/deco.names.js.map +1 -1
- package/dist/decorator/deco.routes.d.ts +8 -3
- package/dist/decorator/deco.routes.d.ts.map +1 -1
- package/dist/decorator/deco.routes.js +8 -3
- package/dist/decorator/deco.routes.js.map +1 -1
- package/dist/helper/EnumRegistry.d.ts +7 -2
- package/dist/helper/EnumRegistry.d.ts.map +1 -1
- package/dist/helper/EnumRegistry.js +7 -2
- package/dist/helper/EnumRegistry.js.map +1 -1
- package/dist/helper/FirebaseTimestamp.d.ts +5 -5
- package/dist/helper/FirebaseTimestamp.d.ts.map +1 -1
- package/dist/helper/FirebaseTimestamp.js +5 -5
- package/dist/helper/FirebaseTimestamp.js.map +1 -1
- package/dist/helper/helper.date.d.ts +15 -6
- package/dist/helper/helper.date.d.ts.map +1 -1
- package/dist/helper/helper.date.js +15 -6
- package/dist/helper/helper.date.js.map +1 -1
- package/dist/helper/helper.object.d.ts +23 -3
- package/dist/helper/helper.object.d.ts.map +1 -1
- package/dist/helper/helper.object.js +23 -3
- package/dist/helper/helper.object.js.map +1 -1
- package/dist/helper/helper.string.d.ts +17 -0
- package/dist/helper/helper.string.d.ts.map +1 -1
- package/dist/helper/helper.string.js +17 -0
- package/dist/helper/helper.string.js.map +1 -1
- package/dist/types/types.deco.common.d.ts +28 -1
- package/dist/types/types.deco.common.d.ts.map +1 -1
- package/dist/types/types.deco.property.d.ts +31 -3
- package/dist/types/types.deco.property.d.ts.map +1 -1
- package/dist/types/types.deco.property.js +6 -1
- package/dist/types/types.deco.property.js.map +1 -1
- package/dist/types/types.enum.registry.d.ts +12 -0
- package/dist/types/types.enum.registry.d.ts.map +1 -1
- package/dist/types/types.routes.d.ts +11 -4
- package/dist/types/types.routes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,16 +4,47 @@ import type { DecoPropertyBase, DecoPropertyRaw } from "../types/types.deco.prop
|
|
|
4
4
|
* Maps a single raw decorator property into an {@link AnnotationsProperty}.
|
|
5
5
|
*
|
|
6
6
|
* @remarks
|
|
7
|
-
* When the property
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* - When the property is a nested object, the referenced {@link Decorator}'s
|
|
8
|
+
* annotations are recursively extracted and attached as the `sub` field.
|
|
9
|
+
* - For enum properties, the enum's name is derived via {@link buildEnumName}
|
|
10
|
+
* and the latest entries are pulled from the global {@link enumRegistry}.
|
|
11
|
+
* - The returned object is a deep clone, so mutations don't affect the input.
|
|
10
12
|
*
|
|
11
13
|
* @typeParam T - The specific decorator property data shape.
|
|
14
|
+
* @param headName - The owning decorator's name; used to build enum names.
|
|
12
15
|
* @param propertyKey - The name of the property being mapped.
|
|
13
16
|
* @param prop - The raw decorator property containing common metadata and typed data.
|
|
14
17
|
* @returns A deep-cloned {@link AnnotationsProperty} enriched with resolved type and sub-annotations.
|
|
15
18
|
*/
|
|
16
19
|
export declare const mapAnnotationsProperty: <T extends DecoPropertyBase>(headName: string, propertyKey: string, prop: DecoPropertyRaw<T>) => AnnotationsProperty<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Comparator for {@link AnnotationsProperty} values that sorts by item order ascending.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Suitable for use with `Array.prototype.sort`. The order value is resolved by
|
|
25
|
+
* {@link extractPropertyItemOrder}, which understands both plain numeric `order`
|
|
26
|
+
* and the kind-parameterised `{ item }` variant.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam A - The first property type to compare.
|
|
29
|
+
* @typeParam B - The second property type to compare.
|
|
30
|
+
* @param a - The first property.
|
|
31
|
+
* @param b - The second property.
|
|
32
|
+
* @returns A negative number when `a` sorts before `b`, positive when after, `0` when equal.
|
|
33
|
+
*/
|
|
17
34
|
export declare const compareProperty: <A extends AnnotationsProperty<DecoPropertyBase>, B extends AnnotationsProperty<DecoPropertyBase>>(a: A, b: B) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Extracts the numeric item-order value from an annotation property.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* Handles three shapes for the `common.order` field:
|
|
40
|
+
* - missing / `undefined` → returns `0`.
|
|
41
|
+
* - plain `number` → returned directly.
|
|
42
|
+
* - `{ item, facet }` object → returns `item` when numeric, else `0`.
|
|
43
|
+
*
|
|
44
|
+
* @typeParam BASE - The property data shape.
|
|
45
|
+
* @typeParam PROP - The annotation property type wrapping `BASE`.
|
|
46
|
+
* @param prop - The annotation property to inspect.
|
|
47
|
+
* @returns The resolved item-order value.
|
|
48
|
+
*/
|
|
18
49
|
export declare const extractPropertyItemOrder: <BASE extends DecoPropertyBase, PROP extends AnnotationsProperty<BASE>>(prop: PROP) => number;
|
|
19
50
|
//# sourceMappingURL=anno.property.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anno.property.d.ts","sourceRoot":"","sources":["../../src/annotation/anno.property.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAKzC
|
|
1
|
+
{"version":3,"file":"anno.property.d.ts","sourceRoot":"","sources":["../../src/annotation/anno.property.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAKzC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,gBAAgB,EAC/D,UAAU,MAAM,EAChB,aAAa,MAAM,EACnB,MAAM,eAAe,CAAC,CAAC,CAAC,KACvB,mBAAmB,CAAC,CAAC,CAqBvB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,GAC1B,CAAC,SAAS,mBAAmB,CAAC,gBAAgB,CAAC,EAC/C,CAAC,SAAS,mBAAmB,CAAC,gBAAgB,CAAC,EAE/C,GAAG,CAAC,EACJ,GAAG,CAAC,WACwD,CAAC;AAE/D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,GACnC,IAAI,SAAS,gBAAgB,EAC7B,IAAI,SAAS,mBAAmB,CAAC,IAAI,CAAC,EAEtC,MAAM,IAAI,KACT,MAKF,CAAC"}
|
|
@@ -7,11 +7,14 @@ const isDecoObjectData = (data) => data.type === DecoPropertyType.object && "dec
|
|
|
7
7
|
* Maps a single raw decorator property into an {@link AnnotationsProperty}.
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
|
-
* When the property
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* - When the property is a nested object, the referenced {@link Decorator}'s
|
|
11
|
+
* annotations are recursively extracted and attached as the `sub` field.
|
|
12
|
+
* - For enum properties, the enum's name is derived via {@link buildEnumName}
|
|
13
|
+
* and the latest entries are pulled from the global {@link enumRegistry}.
|
|
14
|
+
* - The returned object is a deep clone, so mutations don't affect the input.
|
|
13
15
|
*
|
|
14
16
|
* @typeParam T - The specific decorator property data shape.
|
|
17
|
+
* @param headName - The owning decorator's name; used to build enum names.
|
|
15
18
|
* @param propertyKey - The name of the property being mapped.
|
|
16
19
|
* @param prop - The raw decorator property containing common metadata and typed data.
|
|
17
20
|
* @returns A deep-cloned {@link AnnotationsProperty} enriched with resolved type and sub-annotations.
|
|
@@ -36,7 +39,35 @@ export const mapAnnotationsProperty = (headName, propertyKey, prop) => {
|
|
|
36
39
|
sub: sub?.extractAnnotations(),
|
|
37
40
|
});
|
|
38
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Comparator for {@link AnnotationsProperty} values that sorts by item order ascending.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* Suitable for use with `Array.prototype.sort`. The order value is resolved by
|
|
47
|
+
* {@link extractPropertyItemOrder}, which understands both plain numeric `order`
|
|
48
|
+
* and the kind-parameterised `{ item }` variant.
|
|
49
|
+
*
|
|
50
|
+
* @typeParam A - The first property type to compare.
|
|
51
|
+
* @typeParam B - The second property type to compare.
|
|
52
|
+
* @param a - The first property.
|
|
53
|
+
* @param b - The second property.
|
|
54
|
+
* @returns A negative number when `a` sorts before `b`, positive when after, `0` when equal.
|
|
55
|
+
*/
|
|
39
56
|
export const compareProperty = (a, b) => extractPropertyItemOrder(a) - extractPropertyItemOrder(b);
|
|
57
|
+
/**
|
|
58
|
+
* Extracts the numeric item-order value from an annotation property.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Handles three shapes for the `common.order` field:
|
|
62
|
+
* - missing / `undefined` → returns `0`.
|
|
63
|
+
* - plain `number` → returned directly.
|
|
64
|
+
* - `{ item, facet }` object → returns `item` when numeric, else `0`.
|
|
65
|
+
*
|
|
66
|
+
* @typeParam BASE - The property data shape.
|
|
67
|
+
* @typeParam PROP - The annotation property type wrapping `BASE`.
|
|
68
|
+
* @param prop - The annotation property to inspect.
|
|
69
|
+
* @returns The resolved item-order value.
|
|
70
|
+
*/
|
|
40
71
|
export const extractPropertyItemOrder = (prop) => {
|
|
41
72
|
if (prop.common.order === undefined)
|
|
42
73
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anno.property.js","sourceRoot":"","sources":["../../src/annotation/anno.property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAOzD,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAA0B,EAAE,CAC1E,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC,MAAM,IAAI,MAAM,IAAI,IAAI,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"anno.property.js","sourceRoot":"","sources":["../../src/annotation/anno.property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE5E,OAAO,EAAE,SAAS,EA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AACL,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAI7B,CAAI,EACJ,CAAI,EACJ,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE/D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAItC,IAAU,EACF,EAAE;IACV,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IAC9C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IACpE,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;IAC9E,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
|
|
@@ -8,7 +8,9 @@ import { DecoProperty } from "./DecoProperty.js";
|
|
|
8
8
|
export interface DecoDateData extends DecoPropertyBase {
|
|
9
9
|
/** The date format to use for serialization. */
|
|
10
10
|
dateFormat: DecoDateFormat;
|
|
11
|
+
/** Initial date strategy (e.g. `now`, `today`, `date1970`); `null` when no default applies. */
|
|
11
12
|
dateType: DecoDateType | null;
|
|
13
|
+
/** Day offset added to the initial date computed from {@link DecoDateData.dateType}. */
|
|
12
14
|
dateOffsetDays: number;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
@@ -27,9 +29,10 @@ export declare class DecoDate extends DecoProperty<DecoDateData> {
|
|
|
27
29
|
/** Creates a new date property builder defaulting to timestamp format. */
|
|
28
30
|
constructor();
|
|
29
31
|
/**
|
|
30
|
-
* Sets the default date
|
|
32
|
+
* Sets the default date strategy and optional day offset.
|
|
31
33
|
*
|
|
32
|
-
* @param
|
|
34
|
+
* @param type - The initial-date strategy (e.g. `now`, `today`, `date1970`).
|
|
35
|
+
* @param offsetDays - Number of days to add to the computed initial date. Defaults to `0`.
|
|
33
36
|
* @returns This instance for chaining.
|
|
34
37
|
*/
|
|
35
38
|
default(type: DecoDateType, offsetDays?: number): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoDate.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoDate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAoB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,gDAAgD;IAChD,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,gBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,YAAY,CAAC,YAAY,CAAC;IACtD,0EAA0E;;IAU1E
|
|
1
|
+
{"version":3,"file":"DecoDate.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoDate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAoB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,gDAAgD;IAChD,UAAU,EAAE,cAAc,CAAC;IAC3B,+FAA+F;IAC/F,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,wFAAwF;IACxF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,gBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,YAAY,CAAC,YAAY,CAAC;IACtD,0EAA0E;;IAU1E;;;;;;OAMG;IACI,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,GAAE,MAAU,GAAG,IAAI;IAMhE;;;;;OAKG;IACI,MAAM,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;CAIhD"}
|
|
@@ -23,9 +23,10 @@ export class DecoDate extends DecoProperty {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Sets the default date
|
|
26
|
+
* Sets the default date strategy and optional day offset.
|
|
27
27
|
*
|
|
28
|
-
* @param
|
|
28
|
+
* @param type - The initial-date strategy (e.g. `now`, `today`, `date1970`).
|
|
29
|
+
* @param offsetDays - Number of days to add to the computed initial date. Defaults to `0`.
|
|
29
30
|
* @returns This instance for chaining.
|
|
30
31
|
*/
|
|
31
32
|
default(type, offsetDays = 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoDate.js","sourceRoot":"","sources":["../../src/decorator/DecoDate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DecoDate.js","sourceRoot":"","sources":["../../src/decorator/DecoDate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAcjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,YAA0B;IACtD,0EAA0E;IAC1E;QACE,KAAK,CAAC;YACJ,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,UAAU,EAAE,cAAc,CAAC,SAAS;YACpC,QAAQ,EAAE,IAAI;YACd,cAAc,EAAE,CAAC;SAClB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,OAAO,CAAC,IAAkB,EAAE,aAAqB,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -2,11 +2,14 @@ import type { DecoPropertyBase } from "../types/types.deco.property.js";
|
|
|
2
2
|
import type { EnumRegistryKeys } from "../types/types.enum.registry.js";
|
|
3
3
|
import { DecoProperty } from "./DecoProperty.js";
|
|
4
4
|
/**
|
|
5
|
-
* Configuration data for
|
|
5
|
+
* Configuration data for an enum-type decorator property.
|
|
6
6
|
*/
|
|
7
7
|
export interface DecoEnumData extends DecoPropertyBase {
|
|
8
|
+
/** Map of enum key to human-readable label. */
|
|
8
9
|
keys: EnumRegistryKeys;
|
|
10
|
+
/** When set, the generated enum is named after this decorator basename instead of the current one. */
|
|
9
11
|
linkBasename?: string;
|
|
12
|
+
/** When set, the generated enum is named after this property key instead of the current one. */
|
|
10
13
|
linkKey?: string;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
@@ -25,12 +28,25 @@ export declare class DecoEnum extends DecoProperty<DecoEnumData> {
|
|
|
25
28
|
/** Creates a new enum property builder with default settings. */
|
|
26
29
|
constructor();
|
|
27
30
|
/**
|
|
28
|
-
*
|
|
31
|
+
* Registers a single enum entry.
|
|
29
32
|
*
|
|
30
|
-
* @param
|
|
33
|
+
* @param key - The programmatic enum key.
|
|
34
|
+
* @param text - The human-readable label for the key.
|
|
31
35
|
* @returns This instance for chaining.
|
|
32
36
|
*/
|
|
33
37
|
key(key: string, text: string): this;
|
|
38
|
+
/**
|
|
39
|
+
* Links this property to an enum generated for a different property.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Used when two properties should share a single generated enum. The
|
|
43
|
+
* resulting enum is named after `basename` + `key` instead of the current
|
|
44
|
+
* decorator and property names — see {@link buildEnumName}.
|
|
45
|
+
*
|
|
46
|
+
* @param basename - The decorator basename to inherit the enum from.
|
|
47
|
+
* @param key - The property key on that decorator to inherit the enum from.
|
|
48
|
+
* @returns This instance for chaining.
|
|
49
|
+
*/
|
|
34
50
|
link(basename: string, key: string): this;
|
|
35
51
|
}
|
|
36
52
|
//# sourceMappingURL=DecoEnum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoEnum.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoEnum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,IAAI,EAAE,gBAAgB,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,gBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,YAAY,CAAC,YAAY,CAAC;IACtD,iEAAiE;;IAKjE
|
|
1
|
+
{"version":3,"file":"DecoEnum.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoEnum.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,+CAA+C;IAC/C,IAAI,EAAE,gBAAgB,CAAC;IACvB,sGAAsG;IACtG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,QAAQ,gBAAuB,CAAC;AAE7C;;;;;GAKG;AACH,qBAAa,QAAS,SAAQ,YAAY,CAAC,YAAY,CAAC;IACtD,iEAAiE;;IAKjE;;;;;;OAMG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3C;;;;;;;;;;;OAWG;IACI,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;CAKjD"}
|
|
@@ -18,15 +18,28 @@ export class DecoEnum extends DecoProperty {
|
|
|
18
18
|
super({ type: DecoPropertyType.enum, keys: {} });
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Registers a single enum entry.
|
|
22
22
|
*
|
|
23
|
-
* @param
|
|
23
|
+
* @param key - The programmatic enum key.
|
|
24
|
+
* @param text - The human-readable label for the key.
|
|
24
25
|
* @returns This instance for chaining.
|
|
25
26
|
*/
|
|
26
27
|
key(key, text) {
|
|
27
28
|
this.data.keys[key] = text;
|
|
28
29
|
return this;
|
|
29
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Links this property to an enum generated for a different property.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Used when two properties should share a single generated enum. The
|
|
36
|
+
* resulting enum is named after `basename` + `key` instead of the current
|
|
37
|
+
* decorator and property names — see {@link buildEnumName}.
|
|
38
|
+
*
|
|
39
|
+
* @param basename - The decorator basename to inherit the enum from.
|
|
40
|
+
* @param key - The property key on that decorator to inherit the enum from.
|
|
41
|
+
* @returns This instance for chaining.
|
|
42
|
+
*/
|
|
30
43
|
link(basename, key) {
|
|
31
44
|
this.data.linkBasename = basename;
|
|
32
45
|
this.data.linkKey = key;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoEnum.js","sourceRoot":"","sources":["../../src/decorator/DecoEnum.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DecoEnum.js","sourceRoot":"","sources":["../../src/decorator/DecoEnum.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAcjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,YAA0B;IACtD,iEAAiE;IACjE;QACE,KAAK,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;OAMG;IACI,GAAG,CAAC,GAAW,EAAE,IAAY;QAClC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;OAWG;IACI,IAAI,CAAC,QAAgB,EAAE,GAAW;QACvC,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DecoParamsKind } from "../types/types.deco.common.js";
|
|
2
|
-
import type { DecoPropertyBase, DecoPropertyCommon, DecoPropertyRaw } from "../types/types.deco.property.js";
|
|
2
|
+
import type { DecoPropertyBase, DecoPropertyCommon, DecoPropertyRaw, DecoVirtualDirection } from "../types/types.deco.property.js";
|
|
3
3
|
import type { AnnotationsProperty } from "../types/types.annotation.js";
|
|
4
4
|
/** A record mapping property names to their {@link DecoProperty} instances. */
|
|
5
5
|
export type DecoProperties = Record<string, DecoProperty<DecoPropertyBase>>;
|
|
@@ -98,12 +98,16 @@ export declare class DecoProperty<T extends DecoPropertyBase> {
|
|
|
98
98
|
*/
|
|
99
99
|
filterable(val?: boolean): this;
|
|
100
100
|
/**
|
|
101
|
-
* Marks this property as virtual in
|
|
101
|
+
* Marks this property as virtual (non-stored) in the given direction.
|
|
102
102
|
*
|
|
103
|
-
*
|
|
103
|
+
* - `'output'` (default) — computed on read, never sent by clients.
|
|
104
|
+
* - `'input'` — validated on input, stripped before storage.
|
|
105
|
+
* - `'both'` — both directions.
|
|
106
|
+
*
|
|
107
|
+
* @param direction - The direction of the virtual field. Defaults to `'output'`.
|
|
104
108
|
* @returns This instance for chaining.
|
|
105
109
|
*/
|
|
106
|
-
virtual(
|
|
110
|
+
virtual(direction?: DecoVirtualDirection): this;
|
|
107
111
|
/**
|
|
108
112
|
* Marks this property for triggering side effects.
|
|
109
113
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoProperty.d.ts","sourceRoot":"","sources":["../../src/decorator/DecoProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM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UjE;;;;;OAKG;IACI,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI;IAK/C;;;;;OAKG;IACI,WAAW,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI;IAKrD;;;;;OAKG;IACI,QAAQ,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;IAK1C;;;;;OAKG;IACI,QAAQ,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;IAK1C;;;;;OAKG;IACI,QAAQ,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;IAK1C;;;;;OAKG;IACI,UAAU,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;IAK5C;;;;;;;;;OASG;IACI,OAAO,CAAC,SAAS,GAAE,oBAA+B,GAAG,IAAI;IAKhE;;;;;OAKG;IACI,WAAW,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;IAK7C;;;;;OAKG;IACI,MAAM,CAAC,GAAG,GAAE,cAAc,CAAC,OAAO,CAAQ,GAAG,IAAI;IAKxD;;;;;OAKG;IACI,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACI,WAAW,CAAC,GAAG,GAAE,OAAc,GAAG,IAAI;IAK7C;;;;;OAKG;IACI,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI;IAK/C;;;;OAIG;IACI,UAAU,IAAI,eAAe,CAAC,CAAC,CAAC;IAOvC;;;;;OAKG;IACI,kBAAkB,CACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,mBAAmB,CAAC,CAAC,CAAC;CAG1B"}
|
|
@@ -118,13 +118,17 @@ export class DecoProperty {
|
|
|
118
118
|
return this;
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
|
-
* Marks this property as virtual in
|
|
121
|
+
* Marks this property as virtual (non-stored) in the given direction.
|
|
122
122
|
*
|
|
123
|
-
*
|
|
123
|
+
* - `'output'` (default) — computed on read, never sent by clients.
|
|
124
|
+
* - `'input'` — validated on input, stripped before storage.
|
|
125
|
+
* - `'both'` — both directions.
|
|
126
|
+
*
|
|
127
|
+
* @param direction - The direction of the virtual field. Defaults to `'output'`.
|
|
124
128
|
* @returns This instance for chaining.
|
|
125
129
|
*/
|
|
126
|
-
virtual(
|
|
127
|
-
this.common.virtual =
|
|
130
|
+
virtual(direction = "output") {
|
|
131
|
+
this.common.virtual = direction;
|
|
128
132
|
return this;
|
|
129
133
|
}
|
|
130
134
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecoProperty.js","sourceRoot":"","sources":["../../src/decorator/DecoProperty.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DecoProperty.js","sourceRoot":"","sources":["../../src/decorator/DecoProperty.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAcxE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAAwB,EACH,EAAE,CACvB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAA0B,EACV,EAAE;IAClB,MAAM,MAAM,GAAmB,EAAE,CAAC;IAClC,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,KAAK;QAAE,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACtD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,YAAY;IACb,MAAM,CAAqB;IAC3B,IAAI,CAAI;IAElB;;;;;OAKG;IACH,YAAmB,QAAW;QAC5B,IA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
121
121
|
* @returns This instance for chaining.
|
|
122
122
|
*/
|
|
123
123
|
standalone(standalone?: boolean): this;
|
|
124
|
+
/**
|
|
125
|
+
* Registers (or merges) enum entries under a given enum name.
|
|
126
|
+
*
|
|
127
|
+
* @remarks
|
|
128
|
+
* If an item with the same `name` already exists on this decorator, the new
|
|
129
|
+
* entries are merged into it without overwriting existing keys.
|
|
130
|
+
*
|
|
131
|
+
* @param name - The fully-qualified enum name (typically built via {@link buildEnumName}).
|
|
132
|
+
* @param entries - Map of enum key to human-readable label.
|
|
133
|
+
* @returns This instance for chaining.
|
|
134
|
+
*/
|
|
124
135
|
registerEnumByName(name: string, entries: DecoEnumEntries): this;
|
|
136
|
+
/**
|
|
137
|
+
* Convenience wrapper around {@link Decorator.registerEnumByName} that derives
|
|
138
|
+
* the enum name from a header name and property key via {@link buildEnumName}.
|
|
139
|
+
*
|
|
140
|
+
* @param headName - The decorator basename component.
|
|
141
|
+
* @param enumName - The property key component.
|
|
142
|
+
* @param entries - Map of enum key to human-readable label.
|
|
143
|
+
* @returns This instance for chaining.
|
|
144
|
+
*/
|
|
125
145
|
registerEnum(headName: string, enumName: string, entries: DecoEnumEntries): this;
|
|
126
146
|
/**
|
|
127
147
|
* Extracts a deep-cloned snapshot of the decorator's raw data.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decorator.d.ts","sourceRoot":"","sources":["../../src/decorator/Decorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACX,MAAM,+BAA+B,CAAC;AASvC,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb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AC,CAAC;AAEnD;;;;;;GAMG;AACH,qBAAa,SAAS;aAUF,IAAI,EAAE,MAAM;IAT9B,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;gBAEe,IAAI,EAAE,MAAM,EAC5B,aAAa,EAAE,MAAM;IAevB;;;;;OAKG;IACI,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;OAKG;IACI,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKnC;;;;;OAKG;IACI,UAAU,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAOnD;;;;;OAKG;IACI,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAOvC;;;;OAIG;IACI,UAAU,IAAI,IAAI;IAIzB;;;;OAIG;IACI,gBAAgB,IAAI,IAAI;IAI/B;;;;;OAKG;IACI,IAAI,CAAC,IAAI,GAAE,OAAc,GAAG,IAAI;IAKvC;;;;;;;;;OASG;IACI,UAAU,CAAC,UAAU,GAAE,OAAc,GAAG,IAAI;IAKnD;;;;;;;;;;OAUG;IACI,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAgBvE;;;;;;;;OAQG;IACI,YAAY,CACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,eAAe,GACvB,IAAI;IAIP;;;;OAIG;IACI,UAAU,IAAI,aAAa;IAQlC;;;;;;;;OAQG;IACI,kBAAkB,IAAI,iBAAiB;CAiB/C"}
|
|
@@ -126,6 +126,17 @@ export class Decorator {
|
|
|
126
126
|
this.data.standalone = standalone;
|
|
127
127
|
return this;
|
|
128
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Registers (or merges) enum entries under a given enum name.
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* If an item with the same `name` already exists on this decorator, the new
|
|
134
|
+
* entries are merged into it without overwriting existing keys.
|
|
135
|
+
*
|
|
136
|
+
* @param name - The fully-qualified enum name (typically built via {@link buildEnumName}).
|
|
137
|
+
* @param entries - Map of enum key to human-readable label.
|
|
138
|
+
* @returns This instance for chaining.
|
|
139
|
+
*/
|
|
129
140
|
registerEnumByName(name, entries) {
|
|
130
141
|
let item = this.data.registryItems.find((item) => item.name === name);
|
|
131
142
|
if (!item) {
|
|
@@ -139,6 +150,15 @@ export class Decorator {
|
|
|
139
150
|
item.keys[key] = text;
|
|
140
151
|
return this;
|
|
141
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Convenience wrapper around {@link Decorator.registerEnumByName} that derives
|
|
155
|
+
* the enum name from a header name and property key via {@link buildEnumName}.
|
|
156
|
+
*
|
|
157
|
+
* @param headName - The decorator basename component.
|
|
158
|
+
* @param enumName - The property key component.
|
|
159
|
+
* @param entries - Map of enum key to human-readable label.
|
|
160
|
+
* @returns This instance for chaining.
|
|
161
|
+
*/
|
|
142
162
|
registerEnum(headName, enumName, entries) {
|
|
143
163
|
return this.registerEnumByName(buildEnumName(headName, enumName), entries);
|
|
144
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decorator.js","sourceRoot":"","sources":["../../src/decorator/Decorator.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAwCpE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,QAAgB,EAAE,EAAE,CACrB,CAAC,IAAY,EAAa,EAAE,CAC1B,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ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AAgB,CAAC,MAAM;gBACzC,MAAM,IAAK,IAAqC,CAAC,MAAM,CAAC,EACxD,CAAC;gBACA,GAAG,CAAC,IAAuB,CAAC,IAAI,GAC/B,IACD,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;YACjB,CAAC;YACD,aAAa,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAC3B,CAAC;QACD,OAAO,oBAAoB,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,aAAa,CAAC,CAAC;IAChE,CAAC;CACF"}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* node:path basename
|
|
2
|
+
* Browser-safe equivalent of `node:path` `basename`.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Always splits on `/` regardless of platform, so it produces correct output in
|
|
6
|
+
* both Node and the browser. An optional `suffix` (typically a file extension)
|
|
7
|
+
* is stripped from the end of the result when present.
|
|
8
|
+
*
|
|
9
|
+
* @param path - The path to extract the basename from.
|
|
10
|
+
* @param suffix - Optional suffix to strip from the result (e.g. `".ts"`).
|
|
11
|
+
* @returns The final path segment, with `suffix` removed when applicable.
|
|
7
12
|
*/
|
|
8
13
|
export declare const browserBasename: (path: string, suffix?: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Browser-safe equivalent of `node:path` `dirname`.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Returns everything before the final path segment. Trailing slashes on `path`
|
|
19
|
+
* are ignored. A leading slash is preserved so absolute POSIX-style paths
|
|
20
|
+
* remain absolute.
|
|
21
|
+
*
|
|
22
|
+
* @param _path - The path whose directory portion should be returned.
|
|
23
|
+
* @returns The directory portion of `_path`.
|
|
24
|
+
*/
|
|
9
25
|
export declare const browserDirname: (_path: string) => string;
|
|
10
26
|
//# sourceMappingURL=deco.browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.browser.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.browser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deco.browser.d.ts","sourceRoot":"","sources":["../../src/decorator/deco.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,SAAS,MAAM,KAAG,MAK/D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,MAO9C,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* node:path basename
|
|
2
|
+
* Browser-safe equivalent of `node:path` `basename`.
|
|
3
3
|
*
|
|
4
|
-
* @
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Always splits on `/` regardless of platform, so it produces correct output in
|
|
6
|
+
* both Node and the browser. An optional `suffix` (typically a file extension)
|
|
7
|
+
* is stripped from the end of the result when present.
|
|
8
|
+
*
|
|
9
|
+
* @param path - The path to extract the basename from.
|
|
10
|
+
* @param suffix - Optional suffix to strip from the result (e.g. `".ts"`).
|
|
11
|
+
* @returns The final path segment, with `suffix` removed when applicable.
|
|
7
12
|
*/
|
|
8
13
|
export const browserBasename = (path, suffix) => {
|
|
9
14
|
const name = path.split("/").pop();
|
|
@@ -11,6 +16,17 @@ export const browserBasename = (path, suffix) => {
|
|
|
11
16
|
? name.slice(0, -suffix.length)
|
|
12
17
|
: name;
|
|
13
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Browser-safe equivalent of `node:path` `dirname`.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Returns everything before the final path segment. Trailing slashes on `path`
|
|
24
|
+
* are ignored. A leading slash is preserved so absolute POSIX-style paths
|
|
25
|
+
* remain absolute.
|
|
26
|
+
*
|
|
27
|
+
* @param _path - The path whose directory portion should be returned.
|
|
28
|
+
* @returns The directory portion of `_path`.
|
|
29
|
+
*/
|
|
14
30
|
export const browserDirname = (_path) => {
|
|
15
31
|
const isRoot = _path.startsWith("/");
|
|
16
32
|
const path = _path.replace(/\/+$/, "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deco.browser.js","sourceRoot":"","sources":["../../src/decorator/deco.browser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"deco.browser.js","sourceRoot":"","sources":["../../src/decorator/deco.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,MAAe,EAAU,EAAE;IACvE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;IACpC,OAAO,MAAM,IAAI,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;QAC/B,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IACtD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,GAAG,EAAE,CAAC;IACZ,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACnE,CAAC,CAAC"}
|