@fgv/ts-json-base 5.0.2 → 5.1.0-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.
- package/dist/packlets/converters/converters.js +36 -14
- package/dist/packlets/file-tree/directoryItem.js +99 -4
- package/dist/packlets/file-tree/fileItem.js +47 -9
- package/dist/packlets/file-tree/fileTreeAccessors.js +59 -1
- package/dist/packlets/file-tree/filterSpec.js +74 -0
- package/dist/packlets/file-tree/fsTree.js +107 -12
- package/dist/packlets/file-tree/in-memory/inMemoryTree.js +279 -21
- package/dist/packlets/file-tree/in-memory/treeBuilder.js +31 -0
- package/dist/packlets/file-tree/index.browser.js +1 -0
- package/dist/packlets/file-tree/index.js +1 -0
- package/dist/packlets/json-file/file.js +1 -1
- package/dist/packlets/json-file/jsonFsHelper.js +1 -1
- package/dist/packlets/validators/validators.js +8 -8
- package/dist/ts-json-base.d.ts +439 -65
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/packlets/converters/converters.d.ts +20 -13
- package/lib/packlets/converters/converters.js +36 -13
- package/lib/packlets/file-tree/directoryItem.d.ts +29 -6
- package/lib/packlets/file-tree/directoryItem.js +98 -3
- package/lib/packlets/file-tree/fileItem.d.ts +31 -14
- package/lib/packlets/file-tree/fileItem.js +46 -8
- package/lib/packlets/file-tree/fileTreeAccessors.d.ts +237 -3
- package/lib/packlets/file-tree/fileTreeAccessors.js +63 -0
- package/lib/packlets/file-tree/filterSpec.d.ts +10 -0
- package/lib/packlets/file-tree/filterSpec.js +77 -0
- package/lib/packlets/file-tree/fsTree.d.ts +37 -13
- package/lib/packlets/file-tree/fsTree.js +106 -11
- package/lib/packlets/file-tree/in-memory/inMemoryTree.d.ts +37 -13
- package/lib/packlets/file-tree/in-memory/inMemoryTree.js +278 -20
- package/lib/packlets/file-tree/in-memory/treeBuilder.d.ts +15 -0
- package/lib/packlets/file-tree/in-memory/treeBuilder.js +31 -0
- package/lib/packlets/file-tree/index.browser.d.ts +1 -0
- package/lib/packlets/file-tree/index.browser.js +1 -0
- package/lib/packlets/file-tree/index.d.ts +1 -0
- package/lib/packlets/file-tree/index.js +1 -0
- package/lib/packlets/json-file/file.d.ts +1 -1
- package/lib/packlets/json-file/file.js +1 -1
- package/lib/packlets/json-file/jsonFsHelper.d.ts +1 -1
- package/lib/packlets/json-file/jsonFsHelper.js +1 -1
- package/lib/packlets/validators/validators.d.ts +9 -9
- package/lib/packlets/validators/validators.js +8 -8
- package/package.json +29 -30
- package/dist/test/fixtures/file-tree/docs/api/reference.json +0 -1
|
@@ -120,26 +120,26 @@ export const jsonValue = new Validation.Base.GenericValidator({
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
/**
|
|
123
|
-
* A
|
|
123
|
+
* A `StringValidator` which validates a string in place.
|
|
124
124
|
* Accepts {@link Validators.IJsonValidatorContext | IJsonValidatorContext} but ignores it.
|
|
125
125
|
* @public
|
|
126
126
|
*/
|
|
127
127
|
export const string = new Validation.Classes.StringValidator();
|
|
128
128
|
/**
|
|
129
|
-
* A
|
|
129
|
+
* A `NumberValidator` which validates a number in place.
|
|
130
130
|
* Accepts {@link Validators.IJsonValidatorContext | IJsonValidatorContext} but ignores it.
|
|
131
131
|
* @public
|
|
132
132
|
*/
|
|
133
133
|
export const number = new Validation.Classes.NumberValidator();
|
|
134
134
|
/**
|
|
135
|
-
* A
|
|
136
|
-
* Accepts
|
|
135
|
+
* A `BooleanValidator` which validates a boolean in place.
|
|
136
|
+
* Accepts `IJsonValidatorContext` but ignores it.
|
|
137
137
|
* @public
|
|
138
138
|
*/
|
|
139
139
|
export const boolean = new Validation.Classes.BooleanValidator();
|
|
140
140
|
/**
|
|
141
141
|
* Helper to create a validator for a literal value.
|
|
142
|
-
* Accepts
|
|
142
|
+
* Accepts `IJsonValidatorContext` but ignores it.
|
|
143
143
|
* Mirrors the behavior of `@fgv/ts-utils`.
|
|
144
144
|
* @public
|
|
145
145
|
*/
|
|
@@ -151,17 +151,17 @@ export function literal(value) {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
154
|
-
* Helper function to create a
|
|
154
|
+
* Helper function to create a `Validator` which validates `unknown` to one of a set of
|
|
155
155
|
* supplied enumerated values. Anything else fails.
|
|
156
156
|
*
|
|
157
157
|
* @remarks
|
|
158
|
-
* This JSON variant accepts an
|
|
158
|
+
* This JSON variant accepts an `IJsonValidatorContext` OR
|
|
159
159
|
* a `ReadonlyArray<T>` as its validation context. If the context is an array, it is used to override the
|
|
160
160
|
* allowed values for that validation; otherwise, the original `values` supplied at creation time are used.
|
|
161
161
|
*
|
|
162
162
|
* @param values - Array of allowed values.
|
|
163
163
|
* @param message - Optional custom failure message.
|
|
164
|
-
* @returns A new
|
|
164
|
+
* @returns A new `Validator` returning `<T>`.
|
|
165
165
|
* @public
|
|
166
166
|
*/
|
|
167
167
|
export function enumeratedValue(values, message) {
|