@fgv/ts-res 4.5.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/LICENSE +21 -0
- package/README.md +27 -0
- package/dist/ts-res.d.ts +4282 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +79 -0
- package/lib/index.js.map +1 -0
- package/lib/packlets/common/conditions.d.ts +148 -0
- package/lib/packlets/common/conditions.d.ts.map +1 -0
- package/lib/packlets/common/conditions.js +50 -0
- package/lib/packlets/common/conditions.js.map +1 -0
- package/lib/packlets/common/convert.d.ts +111 -0
- package/lib/packlets/common/convert.d.ts.map +1 -0
- package/lib/packlets/common/convert.js +173 -0
- package/lib/packlets/common/convert.js.map +1 -0
- package/lib/packlets/common/helpers/conditions.d.ts +39 -0
- package/lib/packlets/common/helpers/conditions.d.ts.map +1 -0
- package/lib/packlets/common/helpers/conditions.js +105 -0
- package/lib/packlets/common/helpers/conditions.js.map +1 -0
- package/lib/packlets/common/helpers/index.d.ts +3 -0
- package/lib/packlets/common/helpers/index.d.ts.map +1 -0
- package/lib/packlets/common/helpers/index.js +40 -0
- package/lib/packlets/common/helpers/index.js.map +1 -0
- package/lib/packlets/common/helpers/resources.d.ts +34 -0
- package/lib/packlets/common/helpers/resources.d.ts.map +1 -0
- package/lib/packlets/common/helpers/resources.js +81 -0
- package/lib/packlets/common/helpers/resources.js.map +1 -0
- package/lib/packlets/common/index.d.ts +7 -0
- package/lib/packlets/common/index.d.ts.map +1 -0
- package/lib/packlets/common/index.js +69 -0
- package/lib/packlets/common/index.js.map +1 -0
- package/lib/packlets/common/resources.d.ts +41 -0
- package/lib/packlets/common/resources.d.ts.map +1 -0
- package/lib/packlets/common/resources.js +30 -0
- package/lib/packlets/common/resources.js.map +1 -0
- package/lib/packlets/common/validate/conditions.d.ts +248 -0
- package/lib/packlets/common/validate/conditions.d.ts.map +1 -0
- package/lib/packlets/common/validate/conditions.js +436 -0
- package/lib/packlets/common/validate/conditions.js.map +1 -0
- package/lib/packlets/common/validate/index.d.ts +5 -0
- package/lib/packlets/common/validate/index.d.ts.map +1 -0
- package/lib/packlets/common/validate/index.js +65 -0
- package/lib/packlets/common/validate/index.js.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.d.ts +39 -0
- package/lib/packlets/common/validate/regularExpressions.d.ts.map +1 -0
- package/lib/packlets/common/validate/regularExpressions.js +63 -0
- package/lib/packlets/common/validate/regularExpressions.js.map +1 -0
- package/lib/packlets/common/validate/resources.d.ts +97 -0
- package/lib/packlets/common/validate/resources.d.ts.map +1 -0
- package/lib/packlets/common/validate/resources.js +171 -0
- package/lib/packlets/common/validate/resources.js.map +1 -0
- package/lib/packlets/conditions/condition.d.ts +91 -0
- package/lib/packlets/conditions/condition.d.ts.map +1 -0
- package/lib/packlets/conditions/condition.js +146 -0
- package/lib/packlets/conditions/condition.js.map +1 -0
- package/lib/packlets/conditions/conditionCollector.d.ts +54 -0
- package/lib/packlets/conditions/conditionCollector.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionCollector.js +72 -0
- package/lib/packlets/conditions/conditionCollector.js.map +1 -0
- package/lib/packlets/conditions/conditionDecls.d.ts +26 -0
- package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionDecls.js +24 -0
- package/lib/packlets/conditions/conditionDecls.js.map +1 -0
- package/lib/packlets/conditions/conditionSet.d.ts +99 -0
- package/lib/packlets/conditions/conditionSet.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSet.js +164 -0
- package/lib/packlets/conditions/conditionSet.js.map +1 -0
- package/lib/packlets/conditions/conditionSetCollector.d.ts +65 -0
- package/lib/packlets/conditions/conditionSetCollector.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSetCollector.js +90 -0
- package/lib/packlets/conditions/conditionSetCollector.js.map +1 -0
- package/lib/packlets/conditions/conditionSetDecls.d.ts +18 -0
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionSetDecls.js +24 -0
- package/lib/packlets/conditions/conditionSetDecls.js.map +1 -0
- package/lib/packlets/conditions/conditionToken.d.ts +86 -0
- package/lib/packlets/conditions/conditionToken.d.ts.map +1 -0
- package/lib/packlets/conditions/conditionToken.js +150 -0
- package/lib/packlets/conditions/conditionToken.js.map +1 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +24 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.js +54 -0
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -0
- package/lib/packlets/conditions/convert/decls.d.ts +24 -0
- package/lib/packlets/conditions/convert/decls.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/decls.js +111 -0
- package/lib/packlets/conditions/convert/decls.js.map +1 -0
- package/lib/packlets/conditions/convert/index.d.ts +3 -0
- package/lib/packlets/conditions/convert/index.d.ts.map +1 -0
- package/lib/packlets/conditions/convert/index.js +40 -0
- package/lib/packlets/conditions/convert/index.js.map +1 -0
- package/lib/packlets/conditions/index.d.ts +10 -0
- package/lib/packlets/conditions/index.d.ts.map +1 -0
- package/lib/packlets/conditions/index.js +70 -0
- package/lib/packlets/conditions/index.js.map +1 -0
- package/lib/packlets/decisions/abstractDecision.d.ts +39 -0
- package/lib/packlets/decisions/abstractDecision.d.ts.map +1 -0
- package/lib/packlets/decisions/abstractDecision.js +63 -0
- package/lib/packlets/decisions/abstractDecision.js.map +1 -0
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts +59 -0
- package/lib/packlets/decisions/abstractDecisionCollector.d.ts.map +1 -0
- package/lib/packlets/decisions/abstractDecisionCollector.js +92 -0
- package/lib/packlets/decisions/abstractDecisionCollector.js.map +1 -0
- package/lib/packlets/decisions/candidate.d.ts +58 -0
- package/lib/packlets/decisions/candidate.d.ts.map +1 -0
- package/lib/packlets/decisions/candidate.js +80 -0
- package/lib/packlets/decisions/candidate.js.map +1 -0
- package/lib/packlets/decisions/common.d.ts +15 -0
- package/lib/packlets/decisions/common.d.ts.map +1 -0
- package/lib/packlets/decisions/common.js +24 -0
- package/lib/packlets/decisions/common.js.map +1 -0
- package/lib/packlets/decisions/concreteDecision.d.ts +74 -0
- package/lib/packlets/decisions/concreteDecision.d.ts.map +1 -0
- package/lib/packlets/decisions/concreteDecision.js +114 -0
- package/lib/packlets/decisions/concreteDecision.js.map +1 -0
- package/lib/packlets/decisions/decision.d.ts +91 -0
- package/lib/packlets/decisions/decision.d.ts.map +1 -0
- package/lib/packlets/decisions/decision.js +126 -0
- package/lib/packlets/decisions/decision.js.map +1 -0
- package/lib/packlets/decisions/index.d.ts +7 -0
- package/lib/packlets/decisions/index.d.ts.map +1 -0
- package/lib/packlets/decisions/index.js +44 -0
- package/lib/packlets/decisions/index.js.map +1 -0
- package/lib/packlets/import/fsItem.d.ts +99 -0
- package/lib/packlets/import/fsItem.d.ts.map +1 -0
- package/lib/packlets/import/fsItem.js +174 -0
- package/lib/packlets/import/fsItem.js.map +1 -0
- package/lib/packlets/import/importContext.d.ts +85 -0
- package/lib/packlets/import/importContext.d.ts.map +1 -0
- package/lib/packlets/import/importContext.js +94 -0
- package/lib/packlets/import/importContext.js.map +1 -0
- package/lib/packlets/import/importManager.d.ts +93 -0
- package/lib/packlets/import/importManager.d.ts.map +1 -0
- package/lib/packlets/import/importManager.js +133 -0
- package/lib/packlets/import/importManager.js.map +1 -0
- package/lib/packlets/import/importable.d.ts +71 -0
- package/lib/packlets/import/importable.d.ts.map +1 -0
- package/lib/packlets/import/importable.js +35 -0
- package/lib/packlets/import/importable.js.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.d.ts +60 -0
- package/lib/packlets/import/importers/collectionImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/collectionImporter.js +146 -0
- package/lib/packlets/import/importers/collectionImporter.js.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.d.ts +49 -0
- package/lib/packlets/import/importers/fsItemImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/fsItemImporter.js +120 -0
- package/lib/packlets/import/importers/fsItemImporter.js.map +1 -0
- package/lib/packlets/import/importers/importer.d.ts +31 -0
- package/lib/packlets/import/importers/importer.d.ts.map +1 -0
- package/lib/packlets/import/importers/importer.js +24 -0
- package/lib/packlets/import/importers/importer.js.map +1 -0
- package/lib/packlets/import/importers/index.d.ts +6 -0
- package/lib/packlets/import/importers/index.d.ts.map +1 -0
- package/lib/packlets/import/importers/index.js +43 -0
- package/lib/packlets/import/importers/index.js.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.d.ts +32 -0
- package/lib/packlets/import/importers/jsonImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/jsonImporter.js +140 -0
- package/lib/packlets/import/importers/jsonImporter.js.map +1 -0
- package/lib/packlets/import/importers/pathImporter.d.ts +61 -0
- package/lib/packlets/import/importers/pathImporter.d.ts.map +1 -0
- package/lib/packlets/import/importers/pathImporter.js +87 -0
- package/lib/packlets/import/importers/pathImporter.js.map +1 -0
- package/lib/packlets/import/index.d.ts +7 -0
- package/lib/packlets/import/index.d.ts.map +1 -0
- package/lib/packlets/import/index.js +67 -0
- package/lib/packlets/import/index.js.map +1 -0
- package/lib/packlets/qualifier-types/convert.d.ts +19 -0
- package/lib/packlets/qualifier-types/convert.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/convert.js +45 -0
- package/lib/packlets/qualifier-types/convert.js.map +1 -0
- package/lib/packlets/qualifier-types/index.d.ts +8 -0
- package/lib/packlets/qualifier-types/index.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/index.js +68 -0
- package/lib/packlets/qualifier-types/index.js.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts +56 -0
- package/lib/packlets/qualifier-types/languageQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/languageQualifierType.js +87 -0
- package/lib/packlets/qualifier-types/languageQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts +92 -0
- package/lib/packlets/qualifier-types/literalQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/literalQualifierType.js +114 -0
- package/lib/packlets/qualifier-types/literalQualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts +184 -0
- package/lib/packlets/qualifier-types/qualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierType.js +173 -0
- package/lib/packlets/qualifier-types/qualifierType.js.map +1 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts +40 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js +102 -0
- package/lib/packlets/qualifier-types/qualifierTypeCollector.js.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts +74 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.d.ts.map +1 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.js +113 -0
- package/lib/packlets/qualifier-types/territoryQualifierType.js.map +1 -0
- package/lib/packlets/qualifiers/convert/decls.d.ts +23 -0
- package/lib/packlets/qualifiers/convert/decls.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/decls.js +71 -0
- package/lib/packlets/qualifiers/convert/decls.js.map +1 -0
- package/lib/packlets/qualifiers/convert/index.d.ts +3 -0
- package/lib/packlets/qualifiers/convert/index.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/index.js +40 -0
- package/lib/packlets/qualifiers/convert/index.js.map +1 -0
- package/lib/packlets/qualifiers/convert/qualifier.d.ts +17 -0
- package/lib/packlets/qualifiers/convert/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/convert/qualifier.js +43 -0
- package/lib/packlets/qualifiers/convert/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/index.d.ts +6 -0
- package/lib/packlets/qualifiers/index.d.ts.map +1 -0
- package/lib/packlets/qualifiers/index.js +66 -0
- package/lib/packlets/qualifiers/index.js.map +1 -0
- package/lib/packlets/qualifiers/qualifier.d.ts +68 -0
- package/lib/packlets/qualifiers/qualifier.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifier.js +87 -0
- package/lib/packlets/qualifiers/qualifier.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.d.ts +90 -0
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierCollector.js +157 -0
- package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -0
- package/lib/packlets/qualifiers/qualifierDecl.d.ts +46 -0
- package/lib/packlets/qualifiers/qualifierDecl.d.ts.map +1 -0
- package/lib/packlets/qualifiers/qualifierDecl.js +24 -0
- package/lib/packlets/qualifiers/qualifierDecl.js.map +1 -0
- package/lib/packlets/resource-json/convert.d.ts +54 -0
- package/lib/packlets/resource-json/convert.d.ts.map +1 -0
- package/lib/packlets/resource-json/convert.js +139 -0
- package/lib/packlets/resource-json/convert.js.map +1 -0
- package/lib/packlets/resource-json/helpers.d.ts +41 -0
- package/lib/packlets/resource-json/helpers.d.ts.map +1 -0
- package/lib/packlets/resource-json/helpers.js +96 -0
- package/lib/packlets/resource-json/helpers.js.map +1 -0
- package/lib/packlets/resource-json/index.d.ts +9 -0
- package/lib/packlets/resource-json/index.d.ts.map +1 -0
- package/lib/packlets/resource-json/index.js +72 -0
- package/lib/packlets/resource-json/index.js.map +1 -0
- package/lib/packlets/resource-json/json.d.ts +182 -0
- package/lib/packlets/resource-json/json.d.ts.map +1 -0
- package/lib/packlets/resource-json/json.js +24 -0
- package/lib/packlets/resource-json/json.js.map +1 -0
- package/lib/packlets/resource-json/normalized.d.ts +123 -0
- package/lib/packlets/resource-json/normalized.d.ts.map +1 -0
- package/lib/packlets/resource-json/normalized.js +24 -0
- package/lib/packlets/resource-json/normalized.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts +39 -0
- package/lib/packlets/resource-json/resourceDeclCollection.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclCollection.js +121 -0
- package/lib/packlets/resource-json/resourceDeclCollection.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts +11 -0
- package/lib/packlets/resource-json/resourceDeclContainer.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclContainer.js +24 -0
- package/lib/packlets/resource-json/resourceDeclContainer.js.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.d.ts +39 -0
- package/lib/packlets/resource-json/resourceDeclTree.d.ts.map +1 -0
- package/lib/packlets/resource-json/resourceDeclTree.js +122 -0
- package/lib/packlets/resource-json/resourceDeclTree.js.map +1 -0
- package/lib/packlets/resource-types/index.d.ts +4 -0
- package/lib/packlets/resource-types/index.d.ts.map +1 -0
- package/lib/packlets/resource-types/index.js +41 -0
- package/lib/packlets/resource-types/index.js.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.d.ts +65 -0
- package/lib/packlets/resource-types/jsonResourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/jsonResourceType.js +63 -0
- package/lib/packlets/resource-types/jsonResourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceType.d.ts +87 -0
- package/lib/packlets/resource-types/resourceType.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceType.js +62 -0
- package/lib/packlets/resource-types/resourceType.js.map +1 -0
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts +30 -0
- package/lib/packlets/resource-types/resourceTypeCollector.d.ts.map +1 -0
- package/lib/packlets/resource-types/resourceTypeCollector.js +65 -0
- package/lib/packlets/resource-types/resourceTypeCollector.js.map +1 -0
- package/lib/packlets/resources/index.d.ts +5 -0
- package/lib/packlets/resources/index.d.ts.map +1 -0
- package/lib/packlets/resources/index.js +42 -0
- package/lib/packlets/resources/index.js.map +1 -0
- package/lib/packlets/resources/resource.d.ts +75 -0
- package/lib/packlets/resources/resource.d.ts.map +1 -0
- package/lib/packlets/resources/resource.js +109 -0
- package/lib/packlets/resources/resource.js.map +1 -0
- package/lib/packlets/resources/resourceBuilder.d.ts +112 -0
- package/lib/packlets/resources/resourceBuilder.d.ts.map +1 -0
- package/lib/packlets/resources/resourceBuilder.js +162 -0
- package/lib/packlets/resources/resourceBuilder.js.map +1 -0
- package/lib/packlets/resources/resourceCandidate.d.ts +102 -0
- package/lib/packlets/resources/resourceCandidate.d.ts.map +1 -0
- package/lib/packlets/resources/resourceCandidate.js +180 -0
- package/lib/packlets/resources/resourceCandidate.js.map +1 -0
- package/lib/packlets/resources/resourceManager.d.ts +104 -0
- package/lib/packlets/resources/resourceManager.d.ts.map +1 -0
- package/lib/packlets/resources/resourceManager.js +193 -0
- package/lib/packlets/resources/resourceManager.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { ConditionSetToken, ConditionToken } from '../conditions';
|
|
3
|
+
/**
|
|
4
|
+
* The values needed to create a {@link ConditionToken | condition token}.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IConditionTokenParts {
|
|
8
|
+
qualifier?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Converts a {@link Helpers.IConditionTokenParts | the parts that make up a condition token} into
|
|
13
|
+
* a syntactically validated {@link ConditionToken | condition token}.
|
|
14
|
+
* @param parts - the parts to convert
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildConditionToken({ qualifier, value }: IConditionTokenParts): Result<ConditionToken>;
|
|
18
|
+
/**
|
|
19
|
+
* Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
|
|
20
|
+
* syntactically validated {@link ConditionToken | condition tokens}.
|
|
21
|
+
* @param parts - the parts to convert
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildConditionSetToken(parts: ReadonlyArray<IConditionTokenParts>): Result<ConditionSetToken>;
|
|
25
|
+
/**
|
|
26
|
+
* Parses a condition token string into its {@link Helpers.IConditionTokenParts | parts}.
|
|
27
|
+
* @param token - the token string to parse.
|
|
28
|
+
* @returns `Success` with the parts if successful, `Failure` with an error message if not.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseConditionTokenParts(token: string): Result<IConditionTokenParts>;
|
|
32
|
+
/**
|
|
33
|
+
* Parses a condition set token string into an array of {@link Helpers.IConditionTokenParts | condition token parts}.
|
|
34
|
+
* @param token - the conditions set token string to parse.
|
|
35
|
+
* @returns `Success` with the parts if successful, `Failure` with an error message if not.
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseConditionSetTokenParts(token: string): Result<IConditionTokenParts[]>;
|
|
39
|
+
//# sourceMappingURL=conditions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/conditions.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAc,MAAM,EAAW,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,CAEtG;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,aAAa,CAAC,oBAAoB,CAAC,GACzC,MAAM,CAAC,iBAAiB,CAAC,CAI3B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAQpF;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC,CAEzF"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.buildConditionToken = buildConditionToken;
|
|
58
|
+
exports.buildConditionSetToken = buildConditionSetToken;
|
|
59
|
+
exports.parseConditionTokenParts = parseConditionTokenParts;
|
|
60
|
+
exports.parseConditionSetTokenParts = parseConditionSetTokenParts;
|
|
61
|
+
const ts_utils_1 = require("@fgv/ts-utils");
|
|
62
|
+
const Validate = __importStar(require("../validate"));
|
|
63
|
+
/**
|
|
64
|
+
* Converts a {@link Helpers.IConditionTokenParts | the parts that make up a condition token} into
|
|
65
|
+
* a syntactically validated {@link ConditionToken | condition token}.
|
|
66
|
+
* @param parts - the parts to convert
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
function buildConditionToken({ qualifier, value }) {
|
|
70
|
+
return Validate.toConditionToken(qualifier ? `${qualifier}=${value}` : value);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of
|
|
74
|
+
* syntactically validated {@link ConditionToken | condition tokens}.
|
|
75
|
+
* @param parts - the parts to convert
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
function buildConditionSetToken(parts) {
|
|
79
|
+
return (0, ts_utils_1.mapResults)(parts.map(buildConditionToken)).onSuccess((tokens) => Validate.toConditionSetToken(tokens.join(',')));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Parses a condition token string into its {@link Helpers.IConditionTokenParts | parts}.
|
|
83
|
+
* @param token - the token string to parse.
|
|
84
|
+
* @returns `Success` with the parts if successful, `Failure` with an error message if not.
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
function parseConditionTokenParts(token) {
|
|
88
|
+
return Validate.toConditionToken(token).onSuccess((t) => {
|
|
89
|
+
const parts = t.split('=');
|
|
90
|
+
if (parts.length === 1) {
|
|
91
|
+
return (0, ts_utils_1.succeed)({ value: parts[0] });
|
|
92
|
+
}
|
|
93
|
+
return (0, ts_utils_1.succeed)({ qualifier: parts[0], value: parts[1] });
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Parses a condition set token string into an array of {@link Helpers.IConditionTokenParts | condition token parts}.
|
|
98
|
+
* @param token - the conditions set token string to parse.
|
|
99
|
+
* @returns `Success` with the parts if successful, `Failure` with an error message if not.
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
function parseConditionSetTokenParts(token) {
|
|
103
|
+
return (0, ts_utils_1.mapResults)(token.split(',').map(parseConditionTokenParts));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=conditions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/conditions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,kDAEC;AAQD,wDAMC;AAQD,4DAQC;AAQD,kEAEC;AA7DD,4CAA4D;AAC5D,sDAAwC;AAYxC;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAwB;IAC5E,OAAO,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,KAA0C;IAE1C,OAAO,IAAA,qBAAU,EAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CACrE,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC/C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,KAAa;IACpD,OAAO,QAAQ,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACtD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,IAAA,kBAAO,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,IAAA,kBAAO,EAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,KAAa;IACvD,OAAO,IAAA,qBAAU,EAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { mapResults, Result, succeed } from '@fgv/ts-utils';\nimport * as Validate from '../validate';\nimport { ConditionSetToken, ConditionToken } from '../conditions';\n\n/**\n * The values needed to create a {@link ConditionToken | condition token}.\n * @public\n */\nexport interface IConditionTokenParts {\n qualifier?: string;\n value: string;\n}\n\n/**\n * Converts a {@link Helpers.IConditionTokenParts | the parts that make up a condition token} into\n * a syntactically validated {@link ConditionToken | condition token}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildConditionToken({ qualifier, value }: IConditionTokenParts): Result<ConditionToken> {\n return Validate.toConditionToken(qualifier ? `${qualifier}=${value}` : value);\n}\n\n/**\n * Converts an array of {@link Helpers.IConditionTokenParts | condition token parts} into an array of\n * syntactically validated {@link ConditionToken | condition tokens}.\n * @param parts - the parts to convert\n * @public\n */\nexport function buildConditionSetToken(\n parts: ReadonlyArray<IConditionTokenParts>\n): Result<ConditionSetToken> {\n return mapResults(parts.map(buildConditionToken)).onSuccess((tokens) =>\n Validate.toConditionSetToken(tokens.join(','))\n );\n}\n\n/**\n * Parses a condition token string into its {@link Helpers.IConditionTokenParts | parts}.\n * @param token - the token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseConditionTokenParts(token: string): Result<IConditionTokenParts> {\n return Validate.toConditionToken(token).onSuccess((t) => {\n const parts = t.split('=');\n if (parts.length === 1) {\n return succeed({ value: parts[0] });\n }\n return succeed({ qualifier: parts[0], value: parts[1] });\n });\n}\n\n/**\n * Parses a condition set token string into an array of {@link Helpers.IConditionTokenParts | condition token parts}.\n * @param token - the conditions set token string to parse.\n * @returns `Success` with the parts if successful, `Failure` with an error message if not.\n * @public\n */\nexport function parseConditionSetTokenParts(token: string): Result<IConditionTokenParts[]> {\n return mapResults(token.split(',').map(parseConditionTokenParts));\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/index.ts"],"names":[],"mappings":"AAsBA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
35
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
__exportStar(require("./conditions"), exports);
|
|
39
|
+
__exportStar(require("./resources"), exports);
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,8CAA4B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nexport * from './conditions';\nexport * from './resources';\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Result } from '@fgv/ts-utils';
|
|
2
|
+
import { ResourceId, ResourceName } from '../resources';
|
|
3
|
+
/**
|
|
4
|
+
* Splits a {@link ResourceId | resource id} into its component {@link ResourceName | resource names}.
|
|
5
|
+
*
|
|
6
|
+
* @param id - The ID to split.
|
|
7
|
+
* @returns `Success`with an array of {@link ResourceName | ResourceName} objects if the ID is valid, or
|
|
8
|
+
* `Failure` with an error message if not.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare function splitResourceId(id: string | undefined): Result<ResourceName[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
14
|
+
* to create a new {@link ResourceId | resource ID}. Fails if resulting ID is invalid or empty.
|
|
15
|
+
*
|
|
16
|
+
* @param base - The base name or ID to join.
|
|
17
|
+
* @param names - Additional names to join.
|
|
18
|
+
* @returns `Success` with the new ID if the base and names are valid, or `Failure` with an error message
|
|
19
|
+
* if not.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export declare function joinResourceIds(...ids: (string | undefined)[]): Result<ResourceId>;
|
|
23
|
+
/**
|
|
24
|
+
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
25
|
+
* to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
|
|
26
|
+
*
|
|
27
|
+
* @param base - The base name or ID to join.
|
|
28
|
+
* @param names - Additional names to join.
|
|
29
|
+
* @returns `Success` with the new ID if the base and names are valid, `Success` with `undefined`
|
|
30
|
+
* if names were present, or `Failure` with an error message if the resulting id is invalid.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export declare function joinOptionalResourceIds(...ids: (string | undefined)[]): Result<ResourceId | undefined>;
|
|
34
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAqB,MAAM,EAAuB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGxD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC,CAK9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC,CAQlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAG,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC,CAQtG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.splitResourceId = splitResourceId;
|
|
25
|
+
exports.joinResourceIds = joinResourceIds;
|
|
26
|
+
exports.joinOptionalResourceIds = joinOptionalResourceIds;
|
|
27
|
+
const ts_utils_1 = require("@fgv/ts-utils");
|
|
28
|
+
const resources_1 = require("../validate/resources");
|
|
29
|
+
/**
|
|
30
|
+
* Splits a {@link ResourceId | resource id} into its component {@link ResourceName | resource names}.
|
|
31
|
+
*
|
|
32
|
+
* @param id - The ID to split.
|
|
33
|
+
* @returns `Success`with an array of {@link ResourceName | ResourceName} objects if the ID is valid, or
|
|
34
|
+
* `Failure` with an error message if not.
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
function splitResourceId(id) {
|
|
38
|
+
if (id === undefined) {
|
|
39
|
+
return (0, ts_utils_1.succeed)([]);
|
|
40
|
+
}
|
|
41
|
+
return (0, ts_utils_1.mapResults)(id.split('.').map(resources_1.toResourceName));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
45
|
+
* to create a new {@link ResourceId | resource ID}. Fails if resulting ID is invalid or empty.
|
|
46
|
+
*
|
|
47
|
+
* @param base - The base name or ID to join.
|
|
48
|
+
* @param names - Additional names to join.
|
|
49
|
+
* @returns `Success` with the new ID if the base and names are valid, or `Failure` with an error message
|
|
50
|
+
* if not.
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
function joinResourceIds(...ids) {
|
|
54
|
+
const errors = new ts_utils_1.MessageAggregator();
|
|
55
|
+
const parts = [];
|
|
56
|
+
ids.forEach((id) => {
|
|
57
|
+
parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));
|
|
58
|
+
});
|
|
59
|
+
const id = parts.join('.');
|
|
60
|
+
return errors.returnOrReport((0, resources_1.toResourceId)(id));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with
|
|
64
|
+
* to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.
|
|
65
|
+
*
|
|
66
|
+
* @param base - The base name or ID to join.
|
|
67
|
+
* @param names - Additional names to join.
|
|
68
|
+
* @returns `Success` with the new ID if the base and names are valid, `Success` with `undefined`
|
|
69
|
+
* if names were present, or `Failure` with an error message if the resulting id is invalid.
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
function joinOptionalResourceIds(...ids) {
|
|
73
|
+
const errors = new ts_utils_1.MessageAggregator();
|
|
74
|
+
const parts = [];
|
|
75
|
+
ids.forEach((id) => {
|
|
76
|
+
parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));
|
|
77
|
+
});
|
|
78
|
+
const id = parts.join('.');
|
|
79
|
+
return errors.returnOrReport(id ? (0, resources_1.toResourceId)(id) : (0, ts_utils_1.succeed)(undefined));
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../../src/packlets/common/helpers/resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAcH,0CAKC;AAYD,0CAQC;AAYD,0DAQC;AAzDD,4CAA+E;AAE/E,qDAAqE;AAErE;;;;;;;GAOG;AACH,SAAgB,eAAe,CAAC,EAAsB;IACpD,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;QACrB,OAAO,IAAA,kBAAO,EAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,IAAA,qBAAU,EAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,GAAG,GAA2B;IAC5D,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,GAAG,GAA2B;IACpE,MAAM,MAAM,GAAsB,IAAI,4BAAiB,EAAE,CAAC;IAC1D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;QACjB,KAAK,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IACH,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,IAAA,wBAAY,EAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAA,kBAAO,EAAC,SAAS,CAAC,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { MessageAggregator, Result, mapResults, succeed } from '@fgv/ts-utils';\nimport { ResourceId, ResourceName } from '../resources';\nimport { toResourceId, toResourceName } from '../validate/resources';\n\n/**\n * Splits a {@link ResourceId | resource id} into its component {@link ResourceName | resource names}.\n *\n * @param id - The ID to split.\n * @returns `Success`with an array of {@link ResourceName | ResourceName} objects if the ID is valid, or\n * `Failure` with an error message if not.\n * @public\n */\nexport function splitResourceId(id: string | undefined): Result<ResourceName[]> {\n if (id === undefined) {\n return succeed([]);\n }\n return mapResults(id.split('.').map(toResourceName));\n}\n\n/**\n * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with\n * to create a new {@link ResourceId | resource ID}. Fails if resulting ID is invalid or empty.\n *\n * @param base - The base name or ID to join.\n * @param names - Additional names to join.\n * @returns `Success` with the new ID if the base and names are valid, or `Failure` with an error message\n * if not.\n * @public\n */\nexport function joinResourceIds(...ids: (string | undefined)[]): Result<ResourceId> {\n const errors: MessageAggregator = new MessageAggregator();\n const parts: ResourceName[] = [];\n ids.forEach((id) => {\n parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));\n });\n const id = parts.join('.');\n return errors.returnOrReport(toResourceId(id));\n}\n\n/**\n * Joins a list of {@link ResourceId | resource ID} or {@link ResourceName | resource name} with\n * to create a new {@link ResourceId | resource ID}. Returns `undefined` if no names are defined.\n *\n * @param base - The base name or ID to join.\n * @param names - Additional names to join.\n * @returns `Success` with the new ID if the base and names are valid, `Success` with `undefined`\n * if names were present, or `Failure` with an error message if the resulting id is invalid.\n * @public\n */\nexport function joinOptionalResourceIds(...ids: (string | undefined)[]): Result<ResourceId | undefined> {\n const errors: MessageAggregator = new MessageAggregator();\n const parts: ResourceName[] = [];\n ids.forEach((id) => {\n parts.push(...splitResourceId(id).aggregateError(errors).orDefault([]));\n });\n const id = parts.join('.');\n return errors.returnOrReport(id ? toResourceId(id) : succeed(undefined));\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
57
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
+
exports.Validate = exports.Helpers = exports.Convert = void 0;
|
|
61
|
+
const Convert = __importStar(require("./convert"));
|
|
62
|
+
exports.Convert = Convert;
|
|
63
|
+
const Helpers = __importStar(require("./helpers"));
|
|
64
|
+
exports.Helpers = Helpers;
|
|
65
|
+
const Validate = __importStar(require("./validate"));
|
|
66
|
+
exports.Validate = Validate;
|
|
67
|
+
__exportStar(require("./conditions"), exports);
|
|
68
|
+
__exportStar(require("./resources"), exports);
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/common/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mDAAqC;AAO5B,0BAAO;AANhB,mDAAqC;AAMnB,0BAAO;AALzB,qDAAuC;AAKZ,4BAAQ;AAHnC,+CAA6B;AAC7B,8CAA4B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport * as Convert from './convert';\nimport * as Helpers from './helpers';\nimport * as Validate from './validate';\n\nexport * from './conditions';\nexport * from './resources';\n\nexport { Convert, Helpers, Validate };\n"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Brand } from '@fgv/ts-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Branded string representing a validated resource id. A resource ID
|
|
4
|
+
* is a dot-separated sequence of resource names.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type ResourceId = Brand<string, 'ResourceId'>;
|
|
8
|
+
/**
|
|
9
|
+
* Branded string representing a validated resource name.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export type ResourceName = Brand<string, 'ResourceName'>;
|
|
13
|
+
/**
|
|
14
|
+
* Branded number representing a validated resource index.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export type ResourceIndex = Brand<number, 'ResourceIndex'>;
|
|
18
|
+
/**
|
|
19
|
+
* Branded string representing a validated resource type name.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export type ResourceTypeName = Brand<string, 'ResourceTypeName'>;
|
|
23
|
+
/**
|
|
24
|
+
* Branded number representing a validated resource type index.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export type ResourceTypeIndex = Brand<number, 'ResourceTypeIndex'>;
|
|
28
|
+
/**
|
|
29
|
+
* Type representing the possible ways that a resource value can be merged into an existing resource.
|
|
30
|
+
* - 'augment' means that the new value should be merged into the existing value, with new properties added and existing properties updated.
|
|
31
|
+
* - 'delete' means that the existing values should be deleted.
|
|
32
|
+
* - 'replace' means that the new value should replace the existing value.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export type ResourceValueMergeMethod = 'augment' | 'delete' | 'replace';
|
|
36
|
+
/**
|
|
37
|
+
* Array of all possible {@link ResourceValueMergeMethod | resource merge type} values.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare const allResourceValueMergeMethods: ResourceValueMergeMethod[];
|
|
41
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../src/packlets/common/resources.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEzD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,wBAAwB,EAAqC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.allResourceValueMergeMethods = void 0;
|
|
25
|
+
/**
|
|
26
|
+
* Array of all possible {@link ResourceValueMergeMethod | resource merge type} values.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
exports.allResourceValueMergeMethods = ['augment', 'delete', 'replace'];
|
|
30
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../../src/packlets/common/resources.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AA4CH;;;GAGG;AACU,QAAA,4BAA4B,GAA+B,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { Brand } from '@fgv/ts-utils';\n\n/**\n * Branded string representing a validated resource id. A resource ID\n * is a dot-separated sequence of resource names.\n * @public\n */\nexport type ResourceId = Brand<string, 'ResourceId'>;\n\n/**\n * Branded string representing a validated resource name.\n * @public\n */\nexport type ResourceName = Brand<string, 'ResourceName'>;\n\n/**\n * Branded number representing a validated resource index.\n * @public\n */\nexport type ResourceIndex = Brand<number, 'ResourceIndex'>;\n\n/**\n * Branded string representing a validated resource type name.\n * @public\n */\nexport type ResourceTypeName = Brand<string, 'ResourceTypeName'>;\n\n/**\n * Branded number representing a validated resource type index.\n * @public\n */\nexport type ResourceTypeIndex = Brand<number, 'ResourceTypeIndex'>;\n\n/**\n * Type representing the possible ways that a resource value can be merged into an existing resource.\n * - 'augment' means that the new value should be merged into the existing value, with new properties added and existing properties updated.\n * - 'delete' means that the existing values should be deleted.\n * - 'replace' means that the new value should replace the existing value.\n * @public\n */\nexport type ResourceValueMergeMethod = 'augment' | 'delete' | 'replace';\n\n/**\n * Array of all possible {@link ResourceValueMergeMethod | resource merge type} values.\n * @public\n */\nexport const allResourceValueMergeMethods: ResourceValueMergeMethod[] = ['augment', 'delete', 'replace'];\n"]}
|