@fgv/ts-res 5.1.0-28 → 5.1.0-29
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/packlets/conditions/conditionDecls.js.map +1 -1
- package/dist/packlets/conditions/conditionSet.js +14 -5
- package/dist/packlets/conditions/conditionSet.js.map +1 -1
- package/dist/packlets/conditions/conditionSetDecls.js.map +1 -1
- package/dist/packlets/conditions/convert/conditionSetDecls.js +50 -6
- package/dist/packlets/conditions/convert/conditionSetDecls.js.map +1 -1
- package/dist/packlets/conditions/convert/decls.js +61 -5
- package/dist/packlets/conditions/convert/decls.js.map +1 -1
- package/dist/packlets/qualifiers/qualifierCollector.js +151 -7
- package/dist/packlets/qualifiers/qualifierCollector.js.map +1 -1
- package/dist/packlets/resource-json/convert.js +225 -0
- package/dist/packlets/resource-json/convert.js.map +1 -1
- package/dist/packlets/resource-json/json.js +2 -2
- package/dist/packlets/resource-json/json.js.map +1 -1
- package/dist/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
- package/dist/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -1
- package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
- package/dist/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -1
- package/dist/ts-res.d.ts +442 -52
- package/lib/packlets/conditions/conditionDecls.d.ts +6 -1
- package/lib/packlets/conditions/conditionDecls.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionDecls.js.map +1 -1
- package/lib/packlets/conditions/conditionSet.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionSet.js +14 -5
- package/lib/packlets/conditions/conditionSet.js.map +1 -1
- package/lib/packlets/conditions/conditionSetDecls.d.ts +7 -2
- package/lib/packlets/conditions/conditionSetDecls.d.ts.map +1 -1
- package/lib/packlets/conditions/conditionSetDecls.js.map +1 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts +30 -2
- package/lib/packlets/conditions/convert/conditionSetDecls.d.ts.map +1 -1
- package/lib/packlets/conditions/convert/conditionSetDecls.js +51 -5
- package/lib/packlets/conditions/convert/conditionSetDecls.js.map +1 -1
- package/lib/packlets/conditions/convert/decls.d.ts +39 -3
- package/lib/packlets/conditions/convert/decls.d.ts.map +1 -1
- package/lib/packlets/conditions/convert/decls.js +63 -5
- package/lib/packlets/conditions/convert/decls.js.map +1 -1
- package/lib/packlets/qualifiers/qualifierCollector.d.ts +104 -6
- package/lib/packlets/qualifiers/qualifierCollector.d.ts.map +1 -1
- package/lib/packlets/qualifiers/qualifierCollector.js +150 -6
- package/lib/packlets/qualifiers/qualifierCollector.js.map +1 -1
- package/lib/packlets/resource-json/convert.d.ts +85 -0
- package/lib/packlets/resource-json/convert.d.ts.map +1 -1
- package/lib/packlets/resource-json/convert.js +237 -0
- package/lib/packlets/resource-json/convert.js.map +1 -1
- package/lib/packlets/resource-json/json.d.ts +128 -39
- package/lib/packlets/resource-json/json.d.ts.map +1 -1
- package/lib/packlets/resource-json/json.js +2 -2
- package/lib/packlets/resource-json/json.js.map +1 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts +9 -2
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.d.ts.map +1 -1
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js +3 -0
- package/lib/packlets/runtime/context/simpleContextQualifierProvider.js.map +1 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts +8 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.d.ts.map +1 -1
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js +3 -5
- package/lib/packlets/runtime/context/validatingSimpleContextQualifierProvider.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validatingSimpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,aAAa,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAEL,wCAAwC,EACzC,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"validatingSimpleContextQualifierProvider.js","sourceRoot":"","sources":["../../../../src/packlets/runtime/context/validatingSimpleContextQualifierProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAU,aAAa,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAEL,wCAAwC,EACzC,MAAM,qCAAqC,CAAC;AA0B7C;;;;;;GAMG;AACH,MAAM,OAAO,wCAAyC,SAAQ,8BAA8B;IAO1F;;;OAGG;IACH,YAAsB,MAA6D;QACjF,6EAA6E;QAC7E,yDAAyD;QACzD,MAAM,eAAe,GAAG,MAAM,CAAC,eAElB,CAAC;QAEd,KAAK,CAAC;YACJ,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE,eAAe;SACjC,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,GAAG,IAAI,wCAAwC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAClB,MAA6D;QAE7D,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,wCAAwC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,CAAC;CACF","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 { Result, captureResult } from '@fgv/ts-utils';\nimport { QualifierContextValue } from '../../common';\nimport { IReadOnlyQualifierCollector } from '../../qualifiers';\nimport { SimpleContextQualifierProvider } from './simpleContextQualifierProvider';\nimport {\n IMutableContextQualifierProviderValidator,\n MutableContextQualifierProviderValidator\n} from './contextQualifierProviderValidator';\n\n/**\n * Parameters for creating a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider}.\n * @public\n */\nexport interface IValidatingSimpleContextQualifierProviderCreateParams {\n /**\n * The {@link Qualifiers.IReadOnlyQualifierCollector | readonly qualifier collector} that defines and validates qualifiers.\n */\n qualifiers: IReadOnlyQualifierCollector;\n\n /**\n * Optional record of initial qualifier name-value pairs to populate the provider.\n * Accepts string keys and values which will be converted to strongly-typed values.\n *\n * @remarks\n * Typed as `Readonly<Partial<Record<string, string>>>` so callers can\n * naturally express conditional context construction, e.g.\n * `tone === 'formal' ? { tone: 'formal' } : {}`. Entries whose value is\n * `undefined` are skipped on load - semantically equivalent to omitting\n * the key.\n */\n qualifierValues?: Readonly<Partial<Record<string, string>>>;\n}\n\n/**\n * A {@link Runtime.SimpleContextQualifierProvider | SimpleContextQualifierProvider} with a\n * {@link Runtime.Context.MutableContextQualifierProviderValidator | validator} property that enables\n * validated use of the underlying provider with string keys and values.\n * This eliminates the need for type casting in consumer code.\n * @public\n */\nexport class ValidatingSimpleContextQualifierProvider extends SimpleContextQualifierProvider {\n /**\n * A {@link Runtime.Context.MutableContextQualifierProviderValidator | MutableContextQualifierProviderValidator} which validates\n * string inputs before passing them to this provider.\n */\n public readonly validating: IMutableContextQualifierProviderValidator;\n\n /**\n * Constructor for a {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.\n * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.\n */\n protected constructor(params: IValidatingSimpleContextQualifierProviderCreateParams) {\n // The branded QualifierContextValue is structurally a string; widen via cast\n // and let the base class skip undefined entries on load.\n const convertedValues = params.qualifierValues as\n | Readonly<Partial<Record<string, QualifierContextValue>>>\n | undefined;\n\n super({\n qualifiers: params.qualifiers,\n qualifierValues: convertedValues\n });\n\n this.validating = new MutableContextQualifierProviderValidator({ provider: this });\n }\n\n /**\n * Creates a new {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object.\n * @param params - {@link Runtime.IValidatingSimpleContextQualifierProviderCreateParams | Parameters} used to create the provider.\n * @returns `Success` with the new {@link Runtime.ValidatingSimpleContextQualifierProvider | ValidatingSimpleContextQualifierProvider} object if successful,\n * or `Failure` with an error message if not.\n * @public\n */\n public static create(\n params: IValidatingSimpleContextQualifierProviderCreateParams\n ): Result<ValidatingSimpleContextQualifierProvider> {\n return captureResult(() => new ValidatingSimpleContextQualifierProvider(params));\n }\n}\n"]}
|