@fgv/ts-json 2.1.1-alpha.0 → 2.1.1-alpha.1

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.
Files changed (69) hide show
  1. package/CHANGELOG.json +44 -0
  2. package/CHANGELOG.md +20 -0
  3. package/dist/ts-json.d.ts +3 -198
  4. package/lib/index.d.ts +0 -1
  5. package/lib/index.d.ts.map +1 -1
  6. package/lib/index.js +0 -1
  7. package/lib/index.js.map +1 -1
  8. package/lib/packlets/context/compositeJsonMap.d.ts +1 -1
  9. package/lib/packlets/context/compositeJsonMap.d.ts.map +1 -1
  10. package/lib/packlets/context/compositeJsonMap.js +2 -2
  11. package/lib/packlets/context/compositeJsonMap.js.map +1 -1
  12. package/lib/packlets/context/jsonContext.d.ts +1 -1
  13. package/lib/packlets/context/jsonContext.d.ts.map +1 -1
  14. package/lib/packlets/context/jsonContext.js.map +1 -1
  15. package/lib/packlets/converters/converters.d.ts +1 -1
  16. package/lib/packlets/converters/converters.d.ts.map +1 -1
  17. package/lib/packlets/converters/converters.js.map +1 -1
  18. package/lib/packlets/converters/index.d.ts +1 -2
  19. package/lib/packlets/converters/index.d.ts.map +1 -1
  20. package/lib/packlets/converters/index.js +1 -3
  21. package/lib/packlets/converters/index.js.map +1 -1
  22. package/lib/packlets/converters/jsonConverter.d.ts +1 -1
  23. package/lib/packlets/converters/jsonConverter.d.ts.map +1 -1
  24. package/lib/packlets/converters/jsonConverter.js +2 -2
  25. package/lib/packlets/converters/jsonConverter.js.map +1 -1
  26. package/lib/packlets/editor/common.d.ts +1 -1
  27. package/lib/packlets/editor/common.d.ts.map +1 -1
  28. package/lib/packlets/editor/common.js.map +1 -1
  29. package/lib/packlets/editor/jsonEditor.d.ts +1 -1
  30. package/lib/packlets/editor/jsonEditor.d.ts.map +1 -1
  31. package/lib/packlets/editor/jsonEditor.js +9 -9
  32. package/lib/packlets/editor/jsonEditor.js.map +1 -1
  33. package/lib/packlets/editor/jsonEditorRule.d.ts +1 -1
  34. package/lib/packlets/editor/jsonEditorRule.d.ts.map +1 -1
  35. package/lib/packlets/editor/jsonEditorRule.js.map +1 -1
  36. package/lib/packlets/editor/jsonEditorState.d.ts +1 -1
  37. package/lib/packlets/editor/jsonEditorState.d.ts.map +1 -1
  38. package/lib/packlets/editor/jsonEditorState.js.map +1 -1
  39. package/lib/packlets/editor/jsonReferenceMap.d.ts +1 -1
  40. package/lib/packlets/editor/jsonReferenceMap.d.ts.map +1 -1
  41. package/lib/packlets/editor/jsonReferenceMap.js +2 -2
  42. package/lib/packlets/editor/jsonReferenceMap.js.map +1 -1
  43. package/lib/packlets/editor/rules/conditional.d.ts +1 -1
  44. package/lib/packlets/editor/rules/conditional.d.ts.map +1 -1
  45. package/lib/packlets/editor/rules/conditional.js +3 -3
  46. package/lib/packlets/editor/rules/conditional.js.map +1 -1
  47. package/lib/packlets/editor/rules/multivalue.d.ts +1 -1
  48. package/lib/packlets/editor/rules/multivalue.d.ts.map +1 -1
  49. package/lib/packlets/editor/rules/multivalue.js.map +1 -1
  50. package/lib/packlets/editor/rules/references.d.ts +1 -1
  51. package/lib/packlets/editor/rules/references.d.ts.map +1 -1
  52. package/lib/packlets/editor/rules/references.js +3 -3
  53. package/lib/packlets/editor/rules/references.js.map +1 -1
  54. package/lib/packlets/editor/rules/templates.d.ts +1 -1
  55. package/lib/packlets/editor/rules/templates.d.ts.map +1 -1
  56. package/lib/packlets/editor/rules/templates.js.map +1 -1
  57. package/package.json +12 -9
  58. package/lib/packlets/converters/file.d.ts +0 -83
  59. package/lib/packlets/converters/file.d.ts.map +0 -1
  60. package/lib/packlets/converters/file.js +0 -162
  61. package/lib/packlets/converters/file.js.map +0 -1
  62. package/lib/packlets/json/common.d.ts +0 -85
  63. package/lib/packlets/json/common.d.ts.map +0 -1
  64. package/lib/packlets/json/common.js +0 -123
  65. package/lib/packlets/json/common.js.map +0 -1
  66. package/lib/packlets/json/index.d.ts +0 -2
  67. package/lib/packlets/json/index.d.ts.map +0 -1
  68. package/lib/packlets/json/index.js +0 -39
  69. package/lib/packlets/json/index.js.map +0 -1
package/CHANGELOG.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@fgv/ts-json",
3
+ "entries": [
4
+ {
5
+ "version": "2.2.0",
6
+ "tag": "@fgv/ts-json_v2.2.0",
7
+ "date": "Thu, 18 Jan 2024 05:45:04 GMT",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "comment": "fix export issues"
12
+ },
13
+ {
14
+ "comment": "fix peers"
15
+ },
16
+ {
17
+ "comment": "bump versions"
18
+ },
19
+ {
20
+ "comment": "refactor"
21
+ },
22
+ {
23
+ "comment": "major refactor"
24
+ },
25
+ {
26
+ "comment": "Match ts-utils refactor"
27
+ },
28
+ {
29
+ "comment": "version upgrades"
30
+ },
31
+ {
32
+ "comment": "update dependencies"
33
+ },
34
+ {
35
+ "comment": "update peer dependencies"
36
+ },
37
+ {
38
+ "comment": "bump version"
39
+ }
40
+ ]
41
+ }
42
+ }
43
+ ]
44
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Change Log - @fgv/ts-json
2
+
3
+ This log was last generated on Thu, 18 Jan 2024 05:45:04 GMT and should not be manually modified.
4
+
5
+ ## 2.2.0
6
+ Thu, 18 Jan 2024 05:45:04 GMT
7
+
8
+ ### Updates
9
+
10
+ - fix export issues
11
+ - fix peers
12
+ - bump versions
13
+ - refactor
14
+ - major refactor
15
+ - Match ts-utils refactor
16
+ - version upgrades
17
+ - update dependencies
18
+ - update peer dependencies
19
+ - bump version
20
+
package/dist/ts-json.d.ts CHANGED
@@ -2,18 +2,11 @@ import { Conversion } from '@fgv/ts-utils';
2
2
  import { Converter } from '@fgv/ts-utils';
3
3
  import { DetailedFailure } from '@fgv/ts-utils';
4
4
  import { DetailedResult } from '@fgv/ts-utils';
5
+ import { JsonArray } from '@fgv/ts-json-base';
6
+ import { JsonObject } from '@fgv/ts-json-base';
7
+ import { JsonValue } from '@fgv/ts-json-base';
5
8
  import { Result } from '@fgv/ts-utils';
6
9
 
7
- /**
8
- * Identifies whether some `unknown` value is a {@link JsonPrimitive | primitive},
9
- * {@link JsonObject | object} or {@link JsonArray | array}. Fails for any value
10
- * that cannot be converted to JSON (e.g. a function) _but_ this is a shallow test -
11
- * it does not test the properties of an object or elements in an array.
12
- * @param from - The `unknown` value to be tested
13
- * @public
14
- */
15
- export declare function classifyJsonValue(from: unknown): Result<JsonValueType>;
16
-
17
10
  /**
18
11
  * A {@link CompositeJsonMap | CompositeJsonMap} presents a composed view of one or more other
19
12
  * {@link IJsonReferenceMap | JSON reference maps}.
@@ -222,36 +215,6 @@ declare namespace Converters {
222
215
  }
223
216
  export { Converters }
224
217
 
225
- /**
226
- * Reads all JSON files from a directory and apply a supplied converter.
227
- * @param srcPath - The path of the folder to be read.
228
- * @param options - {@link Files.IDirectoryConvertOptions | Options} to control
229
- * conversion and filtering
230
- * @public
231
- */
232
- declare function convertJsonDirectorySync<T>(srcPath: string, options: IDirectoryConvertOptions<T>): Result<IReadDirectoryItem<T>[]>;
233
-
234
- /**
235
- * Reads and converts all JSON files from a directory, returning a
236
- * `Map<string, T>` indexed by file base name (i.e. minus the extension)
237
- * with an optional name transformation applied if present.
238
- * @param srcPath - The path of the folder to be read.
239
- * @param options - {@link Files.IDirectoryToMapConvertOptions | Options} to control conversion,
240
- * filtering and naming.
241
- * @public
242
- */
243
- declare function convertJsonDirectoryToMapSync<T, TC = unknown>(srcPath: string, options: IDirectoryToMapConvertOptions<T, TC>): Result<Map<string, T>>;
244
-
245
- /**
246
- * Convenience function to read a JSON file and apply a supplied converter.
247
- * @param srcPath - Path of the file to read.
248
- * @param converter - `Converter` used to convert the file contents
249
- * @returns `Success` with a result of type `<T>`, or `Failure`
250
- * with a message if an error occurs.
251
- * @public
252
- */
253
- declare function convertJsonFileSync<T>(srcPath: string, converter: Converter<T>): Result<T>;
254
-
255
218
  /**
256
219
  * This default implementation of a {@link TemplateVarsExtendFunction | TemplateVarsExtendFunction}
257
220
  * creates a new collection via inheritance from the supplied collection.
@@ -276,21 +239,6 @@ declare namespace EditorRules {
276
239
  }
277
240
  export { EditorRules }
278
241
 
279
- declare namespace File_2 {
280
- export {
281
- readJsonFileSync,
282
- convertJsonFileSync,
283
- convertJsonDirectorySync,
284
- convertJsonDirectoryToMapSync,
285
- writeJsonFileSync,
286
- IDirectoryConvertOptions,
287
- IReadDirectoryItem,
288
- ItemNameTransformFunction,
289
- IDirectoryToMapConvertOptions
290
- }
291
- }
292
- export { File_2 as File }
293
-
294
242
  /**
295
243
  * On a successful match, the {@link Editor.Rules.ConditionalJsonEditorRule | ConditionalJsonEditorRule}
296
244
  * stores a {@link Editor.Rules.IConditionalJsonDeferredObject | IConditionalJsonDeferredObject} describing the
@@ -322,26 +270,6 @@ declare interface IConditionalJsonRuleOptions extends Partial<IJsonEditorOptions
322
270
  flattenUnconditionalValues?: boolean;
323
271
  }
324
272
 
325
- /**
326
- * Options for directory conversion.
327
- * TODO: add filtering, allowed and excluded.
328
- * @public
329
- */
330
- declare interface IDirectoryConvertOptions<T, TC = unknown> {
331
- /**
332
- * The converter used to convert incoming JSON objects.
333
- */
334
- converter: Converter<T, TC>;
335
- }
336
-
337
- /**
338
- * Options controlling conversion of a directory.
339
- * @public
340
- */
341
- declare interface IDirectoryToMapConvertOptions<T, TC = unknown> extends IDirectoryConvertOptions<T, TC> {
342
- transformName?: ItemNameTransformFunction<T>;
343
- }
344
-
345
273
  /**
346
274
  * A specialized JSON editor which does a deep clone of a supplied {@link JsonValue | JsonValue}.
347
275
  * @public
@@ -623,21 +551,6 @@ declare interface IMultiValuePropertyParts {
623
551
  readonly asArray: boolean;
624
552
  }
625
553
 
626
- /**
627
- * Return value for one item in a directory conversion.
628
- * @public
629
- */
630
- declare interface IReadDirectoryItem<T> {
631
- /**
632
- * Relative name of the file that was processed
633
- */
634
- filename: string;
635
- /**
636
- * The payload of the file.
637
- */
638
- item: T;
639
- }
640
-
641
554
  /**
642
555
  * Options for creating a {@link ReferenceMapKeyPolicy | ReferenceMapKeyPolicy} object.
643
556
  * @public
@@ -659,40 +572,6 @@ declare interface ISimpleJsonMapOptions {
659
572
  editor?: JsonEditor;
660
573
  }
661
574
 
662
- /**
663
- * Test if an `unknown` is potentially a {@link JsonArray | JsonArray}.
664
- * @param from - The `unknown` to be tested.
665
- * @returns `true` if the supplied parameter is an array object,
666
- * `false` otherwise.
667
- * @public
668
- */
669
- export declare function isJsonArray(from: unknown): from is JsonArray;
670
-
671
- /**
672
- * Test if an `unknown` is potentially a {@link JsonObject | JsonObject}.
673
- * @param from - The `unknown` to be tested.
674
- * @returns `true` if the supplied parameter is a non-array, non-special object,
675
- * `false` otherwise.
676
- * @public
677
- */
678
- export declare function isJsonObject(from: unknown): from is JsonObject;
679
-
680
- /**
681
- * Test if an `unknown` is a {@link JsonValue | JsonValue}.
682
- * @param from - The `unknown` to be tested
683
- * @returns `true` if the supplied parameter is a valid {@link JsonPrimitive | JsonPrimitive},
684
- * `false` otherwise.
685
- * @public
686
- */
687
- export declare function isJsonPrimitive(from: unknown): from is JsonPrimitive;
688
-
689
- /**
690
- * Function to transform the name of a some entity, given an original name
691
- * and the contents of the entity.
692
- * @public
693
- */
694
- declare type ItemNameTransformFunction<T> = (name: string, item: T) => Result<string>;
695
-
696
575
  /**
697
576
  * Configuration options for the {@link Editor.Rules.TemplatedJsonEditorRule | Templated JSON editor rule}.
698
577
  * @public
@@ -715,13 +594,6 @@ declare interface ITemplatedJsonRuleOptions extends Partial<IJsonEditorOptions>
715
594
  */
716
595
  declare const json: JsonConverter;
717
596
 
718
- /**
719
- * A {@link JsonArray | JsonArray} is an array containing only valid {@link JsonValue | JsonValues}.
720
- * @public
721
- */
722
- export declare interface JsonArray extends Array<JsonValue> {
723
- }
724
-
725
597
  /**
726
598
  * A simple validating {@link JsonConverter | JSON converter}. Converts `unknown` to a
727
599
  * {@link JsonArray | JsonArray}, or fails if the unknown contains invalid JSON or is
@@ -1199,15 +1071,6 @@ export declare class JsonEditorState {
1199
1071
  */
1200
1072
  export declare type JsonEditorValidationRules = 'invalidPropertyName' | 'invalidPropertyValue' | 'undefinedPropertyValue';
1201
1073
 
1202
- /**
1203
- * A {@link JsonObject | JsonObject} is a string-keyed object
1204
- * containing only valid {@link JsonValue | JSON values}.
1205
- * @public
1206
- */
1207
- export declare interface JsonObject {
1208
- [key: string]: JsonValue;
1209
- }
1210
-
1211
1074
  /**
1212
1075
  * A simple validating {@link JsonConverter | JSON converter}. Converts unknown
1213
1076
  * to a {@link JsonObject | JsonObject}, or fails if the `unknown` contains invalid
@@ -1216,12 +1079,6 @@ export declare interface JsonObject {
1216
1079
  */
1217
1080
  declare const jsonObject: Converter<JsonObject, IJsonContext>;
1218
1081
 
1219
- /**
1220
- * Primitive (terminal) values allowed in by JSON.
1221
- * @public
1222
- */
1223
- export declare type JsonPrimitive = boolean | number | string | null;
1224
-
1225
1082
  /**
1226
1083
  * Possible `DetailedResult` details for property edit operations.
1227
1084
  * @public
@@ -1236,19 +1093,6 @@ export declare type JsonPropertyEditFailureReason = JsonEditFailureReason | 'def
1236
1093
  */
1237
1094
  export declare type JsonReferenceMapFailureReason = 'unknown' | 'error';
1238
1095
 
1239
- /**
1240
- * A {@link JsonValue | JsonValue} is one of: a {@link JsonPrimitive | JsonPrimitive},
1241
- * a {@link JsonObject | JsonObject} or an {@link JsonArray | JsonArray}.
1242
- * @public
1243
- */
1244
- export declare type JsonValue = JsonPrimitive | JsonObject | JsonArray;
1245
-
1246
- /**
1247
- * Classes of {@link JsonValue | JsonValue}.
1248
- * @public
1249
- */
1250
- export declare type JsonValueType = 'primitive' | 'object' | 'array';
1251
-
1252
1096
  /**
1253
1097
  * Type representing either a `Map\<string, T\>` or a `Record\<string, T\>`.
1254
1098
  * @public
@@ -1328,28 +1172,6 @@ declare class MultiValueJsonEditorRule extends JsonEditorRuleBase {
1328
1172
  protected _tryParse(token: string, state: JsonEditorState): DetailedResult<IMultiValuePropertyParts, JsonEditFailureReason>;
1329
1173
  }
1330
1174
 
1331
- /**
1332
- * Picks a nested {@link JsonObject | JsonObject} from a supplied
1333
- * {@link JsonObject | JsonObject}.
1334
- * @param src - The {@link JsonObject | object} from which the field is
1335
- * to be picked.
1336
- * @param path - Dot-separated path of the member to be picked.
1337
- * @returns `Success` with the property if the path is valid and the value
1338
- * is an object. Returns `Failure` with details if an error occurs.
1339
- * @public
1340
- */
1341
- export declare function pickJsonObject(src: JsonObject, path: string): Result<JsonObject>;
1342
-
1343
- /**
1344
- * Picks a nested field from a supplied {@link JsonObject | JsonObject}.
1345
- * @param src - The {@link JsonObject | object} from which the field is to be picked.
1346
- * @param path - Dot-separated path of the member to be picked.
1347
- * @returns `Success` with the property if the path is valid, `Failure`
1348
- * with an error message otherwise.
1349
- * @public
1350
- */
1351
- export declare function pickJsonValue(src: JsonObject, path: string): Result<JsonValue>;
1352
-
1353
1175
  /**
1354
1176
  * A {@link PrefixedJsonMap | PrefixedJsonMap} enforces a supplied prefix for all contained values,
1355
1177
  * optionally adding the prefix as necessary (default `true`).
@@ -1396,15 +1218,6 @@ export declare class PrefixedJsonMap extends SimpleJsonMap {
1396
1218
  protected static _toPolicy(prefixOptions: string | IKeyPrefixOptions): ReferenceMapKeyPolicy<JsonValue>;
1397
1219
  }
1398
1220
 
1399
- /**
1400
- * Convenience function to read type-safe JSON from a file
1401
- * @param srcPath - Path of the file to read
1402
- * @returns `Success` with a {@link JsonValue | JsonValue} or `Failure`
1403
- * with a message if an error occurs.
1404
- * @public
1405
- */
1406
- declare function readJsonFileSync(srcPath: string): Result<JsonValue>;
1407
-
1408
1221
  /**
1409
1222
  * The {@link Editor.Rules.ReferenceJsonEditorRule | Reference JSON editor rule} replaces property
1410
1223
  * keys or values that match some known object with a copy of that referenced object, formatted
@@ -1815,12 +1628,4 @@ declare abstract class SimpleJsonMapBase<T> implements IJsonReferenceMap {
1815
1628
  */
1816
1629
  export declare type VariableValue = [string, unknown];
1817
1630
 
1818
- /**
1819
- * Convenience function to write type-safe JSON to a file.
1820
- * @param srcPath - Path of the file to write.
1821
- * @param value - The {@link JsonValue | JsonValue} to be written.
1822
- * @public
1823
- */
1824
- declare function writeJsonFileSync(srcPath: string, value: JsonValue): Result<boolean>;
1825
-
1826
1631
  export { }
package/lib/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './packlets/context';
2
2
  export * from './packlets/converters';
3
3
  export * from './packlets/editor';
4
- export * from './packlets/json';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
package/lib/index.js CHANGED
@@ -38,5 +38,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
38
38
  __exportStar(require("./packlets/context"), exports);
39
39
  __exportStar(require("./packlets/converters"), exports);
40
40
  __exportStar(require("./packlets/editor"), exports);
41
- __exportStar(require("./packlets/json"), exports);
42
41
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,wDAAsC;AACtC,oDAAkC;AAClC,kDAAgC","sourcesContent":["/*\n * Copyright (c) 2023 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 './packlets/context';\nexport * from './packlets/converters';\nexport * from './packlets/editor';\nexport * from './packlets/json';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH,qDAAmC;AACnC,wDAAsC;AACtC,oDAAkC","sourcesContent":["/*\n * Copyright (c) 2023 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 './packlets/context';\nexport * from './packlets/converters';\nexport * from './packlets/editor';\n"]}
@@ -1,5 +1,5 @@
1
+ import { JsonObject, JsonValue } from '@fgv/ts-json-base';
1
2
  import { DetailedResult, Result } from '@fgv/ts-utils';
2
- import { JsonObject, JsonValue } from '../json';
3
3
  import { IJsonContext, IJsonReferenceMap, JsonReferenceMapFailureReason } from './jsonContext';
4
4
  /**
5
5
  * A {@link CompositeJsonMap | CompositeJsonMap} presents a composed view of one or more other
@@ -1 +1 @@
1
- {"version":3,"file":"compositeJsonMap.d.ts","sourceRoot":"","sources":["../../../src/packlets/context/compositeJsonMap.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAoD,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,UAAU,EAAE,SAAS,EAAgB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE/F;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAErC;;;;;OAKG;IACH,SAAS,aAAa,IAAI,EAAE,iBAAiB,EAAE;IAI/C;;;;OAIG;WACW,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAIzE;;;;;OAKG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;OAIG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIhC;;;;;;;OAOG;IACI,aAAa,CAClB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,YAAY,GACrB,cAAc,CAAC,UAAU,EAAE,6BAA6B,CAAC;IAS5D;;;;;;;OAOG;IAEI,YAAY,CACjB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,YAAY,GACrB,cAAc,CAAC,SAAS,EAAE,6BAA6B,CAAC;CAW5D"}
1
+ {"version":3,"file":"compositeJsonMap.d.ts","sourceRoot":"","sources":["../../../src/packlets/context/compositeJsonMap.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAgB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAoD,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AAE/F;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;IACxD;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAErC;;;;;OAKG;IACH,SAAS,aAAa,IAAI,EAAE,iBAAiB,EAAE;IAI/C;;;;OAIG;WACW,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAIzE;;;;;OAKG;IACI,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;OAIG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIhC;;;;;;;OAOG;IACI,aAAa,CAClB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,YAAY,GACrB,cAAc,CAAC,UAAU,EAAE,6BAA6B,CAAC;IAS5D;;;;;;;OAOG;IAEI,YAAY,CACjB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,YAAY,GACrB,cAAc,CAAC,SAAS,EAAE,6BAA6B,CAAC;CAW5D"}
@@ -22,8 +22,8 @@
22
22
  */
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.CompositeJsonMap = void 0;
25
+ const ts_json_base_1 = require("@fgv/ts-json-base");
25
26
  const ts_utils_1 = require("@fgv/ts-utils");
26
- const json_1 = require("../json");
27
27
  /**
28
28
  * A {@link CompositeJsonMap | CompositeJsonMap} presents a composed view of one or more other
29
29
  * {@link IJsonReferenceMap | JSON reference maps}.
@@ -74,7 +74,7 @@ class CompositeJsonMap {
74
74
  */
75
75
  getJsonObject(key, context) {
76
76
  return this.getJsonValue(key, context).onSuccess((jv) => {
77
- if (!(0, json_1.isJsonObject)(jv)) {
77
+ if (!(0, ts_json_base_1.isJsonObject)(jv)) {
78
78
  return (0, ts_utils_1.failWithDetail)(`${key}: not an object`, 'error');
79
79
  }
80
80
  return (0, ts_utils_1.succeedWithDetail)(jv);
@@ -1 +1 @@
1
- {"version":3,"file":"compositeJsonMap.js","sourceRoot":"","sources":["../../../src/packlets/context/compositeJsonMap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,4CAAyG;AACzG,kCAA8D;AAG9D;;;;GAIG;AACH,MAAa,gBAAgB;IAO3B;;;;;OAKG;IACH,YAAsB,IAAyB;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,MAAM,CAAC,IAAyB;QAC5C,OAAO,IAAA,wBAAa,EAAC,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,CAAC;IAED;;;;;OAKG;IACI,YAAY,CAAC,GAAW;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,SAAS,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACI,GAAG,CAAC,GAAW;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,SAAS,CAAC;IAC9D,CAAC;IAED;;;;;;;OAOG;IACI,aAAa,CAClB,GAAW,EACX,OAAsB;QAEtB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE;YACtD,IAAI,CAAC,IAAA,mBAAY,EAAC,EAAE,CAAC,EAAE,CAAC;gBACtB,OAAO,IAAA,yBAAc,EAAC,GAAG,GAAG,iBAAiB,EAAE,OAAO,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,IAAA,4BAAiB,EAAC,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,gDAAgD;IACzC,YAAY,CACjB,GAAW,EACX,OAAsB;QAEtB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC7B,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAC9C,IAAI,MAAM,CAAC,SAAS,EAAE,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;oBACpD,OAAO,MAAM,CAAC;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,GAAG,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;CACF;AAxFD,4CAwFC","sourcesContent":["/*\n * Copyright (c) 2020 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 { DetailedResult, Result, captureResult, failWithDetail, succeedWithDetail } from '@fgv/ts-utils';\nimport { JsonObject, JsonValue, isJsonObject } from '../json';\nimport { IJsonContext, IJsonReferenceMap, JsonReferenceMapFailureReason } from './jsonContext';\n\n/**\n * A {@link CompositeJsonMap | CompositeJsonMap} presents a composed view of one or more other\n * {@link IJsonReferenceMap | JSON reference maps}.\n * @public\n */\nexport class CompositeJsonMap implements IJsonReferenceMap {\n /**\n * The {@link IJsonReferenceMap | reference maps} from which this map is composed.\n * @internal\n */\n protected _maps: IJsonReferenceMap[];\n\n /**\n * The {@link IJsonReferenceMap | reference maps} from which this map is to be composed.\n * @param maps - An array o {@link IJsonReferenceMap | IJsonReferenceMap} containing the maps\n * from which this map is to be composed.\n * @internal\n */\n protected constructor(maps: IJsonReferenceMap[]) {\n this._maps = maps;\n }\n\n /**\n * Creates a new {@link CompositeJsonMap | CompositeJsonMap} from supplied\n * {@link IJsonReferenceMap | maps}.\n * @param maps - one or more {@link IJsonReferenceMap | object maps} to be composed.\n */\n public static create(maps: IJsonReferenceMap[]): Result<CompositeJsonMap> {\n return captureResult(() => new CompositeJsonMap(maps));\n }\n\n /**\n * Determine if a key might be valid for this map but does not determine\n * if key actually exists. Allows key range to be constrained.\n * @param key - The key to be tested.\n * @returns `true` if the key is in the valid range, `false` otherwise.\n */\n public keyIsInRange(key: string): boolean {\n return this._maps.find((map) => map.keyIsInRange(key)) !== undefined;\n }\n\n /**\n * Determines if an object with the specified key actually exists in the map.\n * @param key - The key to be tested.\n * @returns `true` if an object with the specified key exists, `false` otherwise.\n */\n public has(key: string): boolean {\n return this._maps.find((map) => map.has(key)) !== undefined;\n }\n\n /**\n * Gets a {@link JsonObject | JSON object} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - An optional {@link IJsonContext | JSON Context} used to format the object.\n * @returns `Success` with the formatted object if successful. `Failure` with detail `'unknown'`\n * if no such object exists, or `Failure` with detail `'error'` if the object was found but\n * could not be formatted.\n */\n public getJsonObject(\n key: string,\n context?: IJsonContext\n ): DetailedResult<JsonObject, JsonReferenceMapFailureReason> {\n return this.getJsonValue(key, context).onSuccess((jv) => {\n if (!isJsonObject(jv)) {\n return failWithDetail(`${key}: not an object`, 'error');\n }\n return succeedWithDetail(jv);\n });\n }\n\n /**\n * Gets a {@link JsonValue | JSON value} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - An optional {@link IJsonContext | JSON Context} used to format the value.\n * @returns `Success` with the formatted object if successful. `Failure` with detail `'unknown'`\n * if no such object exists, or failure with detail `'error'` if the object was found but\n * could not be formatted.\n */\n // eslint-disable-next-line no-use-before-define\n public getJsonValue(\n key: string,\n context?: IJsonContext\n ): DetailedResult<JsonValue, JsonReferenceMapFailureReason> {\n for (const map of this._maps) {\n if (map.keyIsInRange(key)) {\n const result = map.getJsonValue(key, context);\n if (result.isSuccess() || result.detail === 'error') {\n return result;\n }\n }\n }\n return failWithDetail(`${key}: value not found`, 'unknown');\n }\n}\n"]}
1
+ {"version":3,"file":"compositeJsonMap.js","sourceRoot":"","sources":["../../../src/packlets/context/compositeJsonMap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAEH,oDAAwE;AACxE,4CAAyG;AAG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,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAC9C,IAAI,MAAM,CAAC,SAAS,EAAE,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;oBACpD,OAAO,MAAM,CAAC;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,IAAA,yBAAc,EAAC,GAAG,GAAG,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;CACF;AAxFD,4CAwFC","sourcesContent":["/*\n * Copyright (c) 2020 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 { JsonObject, JsonValue, isJsonObject } from '@fgv/ts-json-base';\nimport { DetailedResult, Result, captureResult, failWithDetail, succeedWithDetail } from '@fgv/ts-utils';\nimport { IJsonContext, IJsonReferenceMap, JsonReferenceMapFailureReason } from './jsonContext';\n\n/**\n * A {@link CompositeJsonMap | CompositeJsonMap} presents a composed view of one or more other\n * {@link IJsonReferenceMap | JSON reference maps}.\n * @public\n */\nexport class CompositeJsonMap implements IJsonReferenceMap {\n /**\n * The {@link IJsonReferenceMap | reference maps} from which this map is composed.\n * @internal\n */\n protected _maps: IJsonReferenceMap[];\n\n /**\n * The {@link IJsonReferenceMap | reference maps} from which this map is to be composed.\n * @param maps - An array o {@link IJsonReferenceMap | IJsonReferenceMap} containing the maps\n * from which this map is to be composed.\n * @internal\n */\n protected constructor(maps: IJsonReferenceMap[]) {\n this._maps = maps;\n }\n\n /**\n * Creates a new {@link CompositeJsonMap | CompositeJsonMap} from supplied\n * {@link IJsonReferenceMap | maps}.\n * @param maps - one or more {@link IJsonReferenceMap | object maps} to be composed.\n */\n public static create(maps: IJsonReferenceMap[]): Result<CompositeJsonMap> {\n return captureResult(() => new CompositeJsonMap(maps));\n }\n\n /**\n * Determine if a key might be valid for this map but does not determine\n * if key actually exists. Allows key range to be constrained.\n * @param key - The key to be tested.\n * @returns `true` if the key is in the valid range, `false` otherwise.\n */\n public keyIsInRange(key: string): boolean {\n return this._maps.find((map) => map.keyIsInRange(key)) !== undefined;\n }\n\n /**\n * Determines if an object with the specified key actually exists in the map.\n * @param key - The key to be tested.\n * @returns `true` if an object with the specified key exists, `false` otherwise.\n */\n public has(key: string): boolean {\n return this._maps.find((map) => map.has(key)) !== undefined;\n }\n\n /**\n * Gets a {@link JsonObject | JSON object} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - An optional {@link IJsonContext | JSON Context} used to format the object.\n * @returns `Success` with the formatted object if successful. `Failure` with detail `'unknown'`\n * if no such object exists, or `Failure` with detail `'error'` if the object was found but\n * could not be formatted.\n */\n public getJsonObject(\n key: string,\n context?: IJsonContext\n ): DetailedResult<JsonObject, JsonReferenceMapFailureReason> {\n return this.getJsonValue(key, context).onSuccess((jv) => {\n if (!isJsonObject(jv)) {\n return failWithDetail(`${key}: not an object`, 'error');\n }\n return succeedWithDetail(jv);\n });\n }\n\n /**\n * Gets a {@link JsonValue | JSON value} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - An optional {@link IJsonContext | JSON Context} used to format the value.\n * @returns `Success` with the formatted object if successful. `Failure` with detail `'unknown'`\n * if no such object exists, or failure with detail `'error'` if the object was found but\n * could not be formatted.\n */\n // eslint-disable-next-line no-use-before-define\n public getJsonValue(\n key: string,\n context?: IJsonContext\n ): DetailedResult<JsonValue, JsonReferenceMapFailureReason> {\n for (const map of this._maps) {\n if (map.keyIsInRange(key)) {\n const result = map.getJsonValue(key, context);\n if (result.isSuccess() || result.detail === 'error') {\n return result;\n }\n }\n }\n return failWithDetail(`${key}: value not found`, 'unknown');\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
+ import { JsonObject, JsonValue } from '@fgv/ts-json-base';
1
2
  import { DetailedResult, Result } from '@fgv/ts-utils';
2
- import { JsonObject, JsonValue } from '../json';
3
3
  /**
4
4
  * Collection of variables used for template replacement in a JSON edit or
5
5
  * conversion.
@@ -1 +1 @@
1
- {"version":3,"file":"jsonContext.d.ts","sourceRoot":"","sources":["../../../src/packlets/context/jsonContext.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAW,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,CACvC,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,MAAM,EAAE,aAAa,EAAE,KACpB,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,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C,CAAC,CAAC,EAAE,CAAC;IAC7C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AATD,8CASC","sourcesContent":["/*\n * Copyright (c) 2020 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 { DetailedResult, Result, succeed } from '@fgv/ts-utils';\nimport { JsonObject, JsonValue } from '../json';\n\n/**\n * Collection of variables used for template replacement in a JSON edit or\n * conversion.\n * @public\n */\nexport type TemplateVars = Record<string, unknown>;\n\n/**\n * Describes one value in a {@link TemplateVars | TemplateVars} collection of\n * variables.\n * @public\n */\nexport type VariableValue = [string, unknown];\n\n/**\n * Function used to create a new collection of {@link TemplateVars | TemplateVars} with\n * one or more new or changed values.\n * @public\n */\nexport type TemplateVarsExtendFunction = (\n base: TemplateVars | undefined,\n values: VariableValue[]\n) => Result<TemplateVars | undefined>;\n\n/**\n * This default implementation of a {@link TemplateVarsExtendFunction | TemplateVarsExtendFunction}\n * creates a new collection via inheritance from the supplied collection.\n * @param base - The base {@link TemplateVars | variables} to be extended.\n * @param values - The {@link VariableValue | values} to be added or overridden in the new variables.\n * @public\n */\nexport function defaultExtendVars(\n base: TemplateVars | undefined,\n values: VariableValue[]\n): Result<TemplateVars | undefined> {\n const rtrn = base ? Object.create(base) : {};\n for (const v of values) {\n rtrn[v[0]] = v[1];\n }\n return succeed(rtrn);\n}\n\n/**\n * Failure reason for {@link IJsonReferenceMap | IJsonReferenceMap} lookup, where `'unknown'`\n * means that the object is not present in the map and `'error'` means\n * that an error occurred while retrieving or converting it.\n * @public\n */\nexport type JsonReferenceMapFailureReason = 'unknown' | 'error';\n\n/**\n * Interface for a simple map that returns named {@link JsonValue | JsonValue} values with templating,\n * conditional logic, and external reference lookups applied using an optionally supplied context.\n * @public\n */\nexport interface IJsonReferenceMap {\n /**\n * Determine if a key might be valid for this map but does not determine if key actually\n * exists. Allows key range to be constrained.\n * @param key - The key to be tested.\n * @returns `true` if the key is in the valid range, `false` otherwise.\n */\n keyIsInRange(key: string): boolean;\n\n /**\n * Determines if an object with the specified key actually exists in the map.\n * @param key - The key to be tested.\n * @returns `true` if an object with the specified key exists, `false` otherwise.\n */\n has(key: string): boolean;\n\n /**\n * Gets a {@link JsonObject | JsonObject} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - Optional {@link IJsonContext | IJsonContext} used to construct\n * the object.\n * @returns `Success` with the formatted {@link JsonObject | object} if successful. `Failure`\n * with detail `'unknown'` if no such object exists, or `Failure` with detail `'error'` if\n * the object was found but could not be formatted.\n */\n // eslint-disable-next-line no-use-before-define\n getJsonObject(\n key: string,\n context?: IJsonContext\n ): DetailedResult<JsonObject, JsonReferenceMapFailureReason>;\n\n /**\n * Gets a {@link JsonValue | JsonValue} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - Optional {@link IJsonContext | JSON Context} used to format the value\n * @returns `Success` with the formatted {@link JsonValue | value} if successful. `Failure`\n * with detail `'unknown'` if no such object exists, or `Failure` with detail `'error'` if\n * the object was found but could not be formatted.\n */\n // eslint-disable-next-line no-use-before-define\n getJsonValue(key: string, context?: IJsonContext): DetailedResult<JsonValue, JsonReferenceMapFailureReason>;\n}\n\n/**\n * Context used to convert or edit JSON objects.\n * @public\n */\nexport interface IJsonContext {\n vars?: TemplateVars;\n refs?: IJsonReferenceMap;\n extendVars?: TemplateVarsExtendFunction;\n}\n"]}
1
+ {"version":3,"file":"jsonContext.js","sourceRoot":"","sources":["../../../src/packlets/context/jsonContext.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAGH,4CAAgE;AA0BhE;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAC/B,IAA8B,EAC9B,MAAuB;IAEvB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,IAAA,kBAAO,EAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AATD,8CASC","sourcesContent":["/*\n * Copyright (c) 2020 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 { JsonObject, JsonValue } from '@fgv/ts-json-base';\nimport { DetailedResult, Result, succeed } from '@fgv/ts-utils';\n\n/**\n * Collection of variables used for template replacement in a JSON edit or\n * conversion.\n * @public\n */\nexport type TemplateVars = Record<string, unknown>;\n\n/**\n * Describes one value in a {@link TemplateVars | TemplateVars} collection of\n * variables.\n * @public\n */\nexport type VariableValue = [string, unknown];\n\n/**\n * Function used to create a new collection of {@link TemplateVars | TemplateVars} with\n * one or more new or changed values.\n * @public\n */\nexport type TemplateVarsExtendFunction = (\n base: TemplateVars | undefined,\n values: VariableValue[]\n) => Result<TemplateVars | undefined>;\n\n/**\n * This default implementation of a {@link TemplateVarsExtendFunction | TemplateVarsExtendFunction}\n * creates a new collection via inheritance from the supplied collection.\n * @param base - The base {@link TemplateVars | variables} to be extended.\n * @param values - The {@link VariableValue | values} to be added or overridden in the new variables.\n * @public\n */\nexport function defaultExtendVars(\n base: TemplateVars | undefined,\n values: VariableValue[]\n): Result<TemplateVars | undefined> {\n const rtrn = base ? Object.create(base) : {};\n for (const v of values) {\n rtrn[v[0]] = v[1];\n }\n return succeed(rtrn);\n}\n\n/**\n * Failure reason for {@link IJsonReferenceMap | IJsonReferenceMap} lookup, where `'unknown'`\n * means that the object is not present in the map and `'error'` means\n * that an error occurred while retrieving or converting it.\n * @public\n */\nexport type JsonReferenceMapFailureReason = 'unknown' | 'error';\n\n/**\n * Interface for a simple map that returns named {@link JsonValue | JsonValue} values with templating,\n * conditional logic, and external reference lookups applied using an optionally supplied context.\n * @public\n */\nexport interface IJsonReferenceMap {\n /**\n * Determine if a key might be valid for this map but does not determine if key actually\n * exists. Allows key range to be constrained.\n * @param key - The key to be tested.\n * @returns `true` if the key is in the valid range, `false` otherwise.\n */\n keyIsInRange(key: string): boolean;\n\n /**\n * Determines if an object with the specified key actually exists in the map.\n * @param key - The key to be tested.\n * @returns `true` if an object with the specified key exists, `false` otherwise.\n */\n has(key: string): boolean;\n\n /**\n * Gets a {@link JsonObject | JsonObject} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - Optional {@link IJsonContext | IJsonContext} used to construct\n * the object.\n * @returns `Success` with the formatted {@link JsonObject | object} if successful. `Failure`\n * with detail `'unknown'` if no such object exists, or `Failure` with detail `'error'` if\n * the object was found but could not be formatted.\n */\n // eslint-disable-next-line no-use-before-define\n getJsonObject(\n key: string,\n context?: IJsonContext\n ): DetailedResult<JsonObject, JsonReferenceMapFailureReason>;\n\n /**\n * Gets a {@link JsonValue | JsonValue} specified by key.\n * @param key - The key of the object to be retrieved.\n * @param context - Optional {@link IJsonContext | JSON Context} used to format the value\n * @returns `Success` with the formatted {@link JsonValue | value} if successful. `Failure`\n * with detail `'unknown'` if no such object exists, or `Failure` with detail `'error'` if\n * the object was found but could not be formatted.\n */\n // eslint-disable-next-line no-use-before-define\n getJsonValue(key: string, context?: IJsonContext): DetailedResult<JsonValue, JsonReferenceMapFailureReason>;\n}\n\n/**\n * Context used to convert or edit JSON objects.\n * @public\n */\nexport interface IJsonContext {\n vars?: TemplateVars;\n refs?: IJsonReferenceMap;\n extendVars?: TemplateVarsExtendFunction;\n}\n"]}
@@ -1,6 +1,6 @@
1
+ import { JsonArray, JsonObject } from '@fgv/ts-json-base';
1
2
  import { Converter } from '@fgv/ts-utils';
2
3
  import { IJsonContext } from '../context';
3
- import { JsonArray, JsonObject } from '../json';
4
4
  import { ConditionalJsonConverterOptions, JsonConverter, RichJsonConverterOptions, TemplatedJsonConverterOptions } from './jsonConverter';
5
5
  /**
6
6
  * A simple validating {@link JsonConverter | JSON converter}. Converts unknown to
@@ -1 +1 @@
1
- {"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/packlets/converters/converters.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAEL,+BAA+B,EAC/B,aAAa,EAEb,wBAAwB,EAExB,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,aAAmC,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,UAAU,EAAE,YAAY,CAAiB,CAAC;AAE7E;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,YAAY,CAAgB,CAAC;AAM1E;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,GAAG,aAAa,CAQ7F;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAAG,aAAa,CAQjG;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,aAAa,CAQnF"}
1
+ {"version":3,"file":"converters.d.ts","sourceRoot":"","sources":["../../../src/packlets/converters/converters.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EA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B,EAAE,CAAC;YAC1B,oBAAoB,GAAG,IAAI,sCAAsB,EAAE,CAAC;QACtD,CAAC;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,OAAO,IAAI,sCAAsB,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AARD,sCAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,OAAkD;IAChF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC5B,sBAAsB,GAAG,IAAI,wCAAwB,EAAE,CAAC;QAC1D,CAAC;QACD,OAAO,sBAAsB,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,wCAAwB,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AARD,0CAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,QAAQ,CAAC,OAA2C;IAClE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,eAAe,GAAG,IAAI,iCAAiB,EAAE,CAAC;QAC5C,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,iCAAiB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AARD,4BAQC","sourcesContent":["/*\n * Copyright (c) 2020 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 { Converter } from '@fgv/ts-utils';\nimport { IJsonContext } from '../context';\nimport { JsonArray, JsonObject } from '../json';\nimport {\n ConditionalJsonConverter,\n ConditionalJsonConverterOptions,\n JsonConverter,\n RichJsonConverter,\n RichJsonConverterOptions,\n TemplatedJsonConverter,\n TemplatedJsonConverterOptions\n} from './jsonConverter';\n\n/**\n * A simple validating {@link JsonConverter | JSON converter}. Converts unknown to\n * JSON or fails if the unknown contains any invalid JSON values.\n * @public\n */\nexport const json: JsonConverter = new JsonConverter();\n\n/**\n * A simple validating {@link JsonConverter | JSON converter}. Converts unknown\n * to a {@link JsonObject | JsonObject}, or fails if the `unknown` contains invalid\n * JSON or is not an object.\n * @public\n */\nexport const jsonObject: Converter<JsonObject, IJsonContext> = json.object();\n\n/**\n * A simple validating {@link JsonConverter | JSON converter}. Converts `unknown` to a\n * {@link JsonArray | JsonArray}, or fails if the unknown contains invalid JSON or is\n * not an array.\n * @public\n */\nexport const jsonArray: Converter<JsonArray, IJsonContext> = json.array();\n\nlet templatedJsonDefault: JsonConverter | undefined;\nlet conditionalJsonDefault: JsonConverter | undefined;\nlet richJsonDefault: JsonConverter | undefined;\n\n/**\n * Helper function which creates a new {@link JsonConverter | JsonConverter} which converts an\n * `unknown` value to JSON, rendering any property names or string values using mustache with\n * the supplied context. See the mustache documentation for details of mustache syntax and view.\n * @param options - {@link TemplatedJsonConverterOptions | Options and context} for\n * the conversion.\n * @public\n */\nexport function templatedJson(options?: Partial<TemplatedJsonConverterOptions>): JsonConverter {\n if (!options) {\n if (!templatedJsonDefault) {\n templatedJsonDefault = new TemplatedJsonConverter();\n }\n return templatedJsonDefault;\n }\n return new TemplatedJsonConverter(options);\n}\n\n/**\n * Helper function which creates a new {@link JsonConverter | JsonConverter} which converts a\n * supplied `unknown` to strongly-typed JSON, by first rendering any property\n * names or string values using mustache with the supplied context, then applying\n * multi-value property expansion and conditional flattening based on property names.\n * @param options - {@link ConditionalJsonConverterOptions | Options and context} for\n * the conversion.\n * @public\n */\nexport function conditionalJson(options?: Partial<ConditionalJsonConverterOptions>): JsonConverter {\n if (!options) {\n if (!conditionalJsonDefault) {\n conditionalJsonDefault = new ConditionalJsonConverter();\n }\n return conditionalJsonDefault;\n }\n return new ConditionalJsonConverter(options);\n}\n\n/**\n * Helper function which creates a new {@link JsonConverter | JsonConverter} which converts a\n * supplied `unknown` to strongly-typed JSON, by first rendering any property\n * names or string values using mustache with the supplied context, then applying\n * multi-value property expansion and conditional flattening based on property names.\n * @param options - {@link RichJsonConverterOptions | Options and context} for\n * the conversion.\n * @public\n */\nexport function richJson(options?: Partial<RichJsonConverterOptions>): JsonConverter {\n if (!options) {\n if (!richJsonDefault) {\n richJsonDefault = new RichJsonConverter();\n }\n return richJsonDefault;\n }\n return new RichJsonConverter(options);\n}\n"]}
1
+ {"version":3,"file":"converters.js","sourceRoot":"","sources":["../../../src/packlets/converters/converters.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;AAKH,mDAQyB;AAEzB;;;;GAIG;AACU,QAAA,IAAI,GAAkB,IAAI,6BAAa,EAAE,CAAC;AAEvD;;;;;GAKG;AACU,QAAA,UAAU,GAAwC,YAAI,CAAC,MAAM,EAAE,CAAC;AAE7E;;;;;GAKG;AACU,QAAA,SAAS,GAAuC,YAAI,CAAC,KAAK,EAAE,CAAC;AAE1E,IAAI,oBAA+C,CAAC;AACpD,IAAI,sBAAiD,CAAC;AACtD,IAAI,eAA0C,CAAC;AAE/C;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,OAAgD;IAC5E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,oBAAoB,GAAG,IAAI,sCAAsB,EAAE,CAAC;QACtD,CAAC;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,OAAO,IAAI,sCAAsB,CAAC,OAAO,CAAC,CAAC;AAC7C,CAAC;AARD,sCAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,OAAkD;IAChF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAC5B,sBAAsB,GAAG,IAAI,wCAAwB,EAAE,CAAC;QAC1D,CAAC;QACD,OAAO,sBAAsB,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,wCAAwB,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AARD,0CAQC;AAED;;;;;;;;GAQG;AACH,SAAgB,QAAQ,CAAC,OAA2C;IAClE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,eAAe,GAAG,IAAI,iCAAiB,EAAE,CAAC;QAC5C,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,OAAO,IAAI,iCAAiB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC;AARD,4BAQC","sourcesContent":["/*\n * Copyright (c) 2020 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 { JsonArray, JsonObject } from '@fgv/ts-json-base';\nimport { Converter } from '@fgv/ts-utils';\nimport { IJsonContext } from '../context';\nimport {\n ConditionalJsonConverter,\n ConditionalJsonConverterOptions,\n JsonConverter,\n RichJsonConverter,\n RichJsonConverterOptions,\n TemplatedJsonConverter,\n TemplatedJsonConverterOptions\n} from './jsonConverter';\n\n/**\n * A simple validating {@link JsonConverter | JSON converter}. Converts unknown to\n * JSON or fails if the unknown contains any invalid JSON values.\n * @public\n */\nexport const json: JsonConverter = new JsonConverter();\n\n/**\n * A simple validating {@link JsonConverter | JSON converter}. Converts unknown\n * to a {@link JsonObject | JsonObject}, or fails if the `unknown` contains invalid\n * JSON or is not an object.\n * @public\n */\nexport const jsonObject: Converter<JsonObject, IJsonContext> = json.object();\n\n/**\n * A simple validating {@link JsonConverter | JSON converter}. Converts `unknown` to a\n * {@link JsonArray | JsonArray}, or fails if the unknown contains invalid JSON or is\n * not an array.\n * @public\n */\nexport const jsonArray: Converter<JsonArray, IJsonContext> = json.array();\n\nlet templatedJsonDefault: JsonConverter | undefined;\nlet conditionalJsonDefault: JsonConverter | undefined;\nlet richJsonDefault: JsonConverter | undefined;\n\n/**\n * Helper function which creates a new {@link JsonConverter | JsonConverter} which converts an\n * `unknown` value to JSON, rendering any property names or string values using mustache with\n * the supplied context. See the mustache documentation for details of mustache syntax and view.\n * @param options - {@link TemplatedJsonConverterOptions | Options and context} for\n * the conversion.\n * @public\n */\nexport function templatedJson(options?: Partial<TemplatedJsonConverterOptions>): JsonConverter {\n if (!options) {\n if (!templatedJsonDefault) {\n templatedJsonDefault = new TemplatedJsonConverter();\n }\n return templatedJsonDefault;\n }\n return new TemplatedJsonConverter(options);\n}\n\n/**\n * Helper function which creates a new {@link JsonConverter | JsonConverter} which converts a\n * supplied `unknown` to strongly-typed JSON, by first rendering any property\n * names or string values using mustache with the supplied context, then applying\n * multi-value property expansion and conditional flattening based on property names.\n * @param options - {@link ConditionalJsonConverterOptions | Options and context} for\n * the conversion.\n * @public\n */\nexport function conditionalJson(options?: Partial<ConditionalJsonConverterOptions>): JsonConverter {\n if (!options) {\n if (!conditionalJsonDefault) {\n conditionalJsonDefault = new ConditionalJsonConverter();\n }\n return conditionalJsonDefault;\n }\n return new ConditionalJsonConverter(options);\n}\n\n/**\n * Helper function which creates a new {@link JsonConverter | JsonConverter} which converts a\n * supplied `unknown` to strongly-typed JSON, by first rendering any property\n * names or string values using mustache with the supplied context, then applying\n * multi-value property expansion and conditional flattening based on property names.\n * @param options - {@link RichJsonConverterOptions | Options and context} for\n * the conversion.\n * @public\n */\nexport function richJson(options?: Partial<RichJsonConverterOptions>): JsonConverter {\n if (!options) {\n if (!richJsonDefault) {\n richJsonDefault = new RichJsonConverter();\n }\n return richJsonDefault;\n }\n return new RichJsonConverter(options);\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  import * as Converters from './converters';
2
- import * as File from './file';
3
2
  export * from './jsonConverter';
4
- export { Converters, File };
3
+ export { Converters };
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/converters/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAE/B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/converters/index.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -47,10 +47,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
47
47
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.File = exports.Converters = void 0;
50
+ exports.Converters = void 0;
51
51
  const Converters = __importStar(require("./converters"));
52
52
  exports.Converters = Converters;
53
- const File = __importStar(require("./file"));
54
- exports.File = File;
55
53
  __exportStar(require("./jsonConverter"), exports);
56
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/converters/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAIlC,gCAAU;AAHnB,6CAA+B;AAGV,oBAAI;AADzB,kDAAgC","sourcesContent":["/*\n * Copyright (c) 2023 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 Converters from './converters';\nimport * as File from './file';\n\nexport * from './jsonConverter';\nexport { Converters, File };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/converters/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yDAA2C;AAGlC,gCAAU;AADnB,kDAAgC","sourcesContent":["/*\n * Copyright (c) 2023 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 Converters from './converters';\n\nexport * from './jsonConverter';\nexport { Converters };\n"]}
@@ -1,6 +1,6 @@
1
+ import { JsonArray, JsonObject, JsonValue } from '@fgv/ts-json-base';
1
2
  import { Conversion, Converter, Result } from '@fgv/ts-utils';
2
3
  import { IJsonContext, IJsonReferenceMap, TemplateVars, TemplateVarsExtendFunction } from '../context';
3
- import { JsonArray, JsonObject, JsonValue } from '../json';
4
4
  import { JsonEditor } from '../editor';
5
5
  /**
6
6
  * Conversion options for {@link JsonConverter | JsonConverter}.
@@ -1 +1 @@
1
- {"version":3,"file":"jsonConverter.d.ts","sourceRoot":"","sources":["../../../src/packlets/converters/jsonConverter.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAgC,MAAM,eAAe,CAAC;AAC5F,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAE3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAgB,MAAM,SAAS,CAAC;AAEzE,OAAO,EAAoD,UAAU,EAAE,MAAM,WAAW,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;;OAQG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;;;;;;OAQG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAC;IAEpC;;;;;;;;OAQG;IACH,0BAA0B,EAAE,OAAO,CAAC;IAEpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,0BAA0B,CAAC;IAExC;;;;;;;OAOG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB;;;;;OAKG;IACH,qBAAqB,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1C;;;;;OAKG;IACH,sBAAsB,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE3C;;;;;OAKG;IACH,wBAAwB,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC9C;AAED;;;;;;;;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AAM,CAAC,aAAa,CAAC;CAG9F;AAED;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,6BAA6B,EAAE,qBAAqB,CAAC,CAAC;AAEzG;;;;;GAKG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC/D;;;OAGG;IACH,gBAAuB,kBAAkB,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAIvE;IAEF;;;;;OAKG;gBACgB,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC;IAMrE;;;;;OAKG;WACW,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,+BAA+B,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC;CAGhG;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,+BAA+B,EAAE,eAAe,CAAC,CAAC;AAE9F;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,mBAAmB;IACxD;;;OAGG;IACH,gBAAuB,WAAW,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAGhE;IAEF;;;;;OAKG;gBACgB,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC;IAM9D;;;;;OAKG;WACW,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC;CAGzF"}
@@ -22,9 +22,9 @@
22
22
  */
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.RichJsonConverter = exports.ConditionalJsonConverter = exports.TemplatedJsonConverter = exports.JsonConverter = exports.JsonEditorConverter = exports.converterOptionsToEditor = exports.contextFromConverterOptions = exports.mergeDefaultJsonConverterOptions = void 0;
25
+ const ts_json_base_1 = require("@fgv/ts-json-base");
25
26
  const ts_utils_1 = require("@fgv/ts-utils");
26
27
  const context_1 = require("../context");
27
- const json_1 = require("../json");
28
28
  const editor_1 = require("../editor");
29
29
  /**
30
30
  * Merges an optionally supplied partial set of {@link IJsonConverterOptions | options} with
@@ -148,7 +148,7 @@ class JsonEditorConverter extends ts_utils_1.Conversion.BaseConverter {
148
148
  */
149
149
  object() {
150
150
  return this.map((jv) => {
151
- if (!(0, json_1.isJsonObject)(jv)) {
151
+ if (!(0, ts_json_base_1.isJsonObject)(jv)) {
152
152
  return (0, ts_utils_1.fail)(`Cannot convert "${JSON.stringify(jv)}" to JSON object.`);
153
153
  }
154
154
  return (0, ts_utils_1.succeed)(jv);