@fgv/ts-extras 5.0.0-23 → 5.0.0-24
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/CHANGELOG.json +0 -15
- package/lib/packlets/zip-file-tree/zipFileTreeAccessors.js +1 -6
- package/package.json +9 -9
- package/.vscode/settings.json +0 -27
- package/dist/ts-extras.d.ts +0 -602
- package/dist/tsdoc-metadata.json +0 -11
- package/lib/test/unit/converters.test.d.ts +0 -2
- package/lib/test/unit/csvHelpers.test.d.ts +0 -2
- package/lib/test/unit/extendedArray.test.d.ts +0 -2
- package/lib/test/unit/formatter.test.d.ts +0 -2
- package/lib/test/unit/md5Normalizer.test.d.ts +0 -2
- package/lib/test/unit/rangeOf.test.d.ts +0 -2
- package/lib/test/unit/recordJarHelpers.test.d.ts +0 -2
- package/lib/test/unit/zipFileTreeAccessors.test.d.ts +0 -2
package/CHANGELOG.json
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fgv/ts-extras",
|
|
3
3
|
"entries": [
|
|
4
|
-
{
|
|
5
|
-
"version": "5.0.0",
|
|
6
|
-
"tag": "@fgv/ts-extras_v5.0.0",
|
|
7
|
-
"date": "Thu, 17 Jul 2025 00:13:24 GMT",
|
|
8
|
-
"comments": {
|
|
9
|
-
"none": [
|
|
10
|
-
{
|
|
11
|
-
"comment": "upgrade dependencies"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"comment": "bump version"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
4
|
{
|
|
20
5
|
"version": "4.6.0",
|
|
21
6
|
"tag": "@fgv/ts-extras_v4.6.0",
|
|
@@ -53,12 +53,7 @@ class ZipFileItem {
|
|
|
53
53
|
return (0, ts_utils_1.captureResult)(() => {
|
|
54
54
|
const parsed = JSON.parse(contents);
|
|
55
55
|
if (converter) {
|
|
56
|
-
|
|
57
|
-
return converter.convert(parsed);
|
|
58
|
-
} /* c8 ignore next 3 - validator branch functionally tested but coverage tool misses due to interface complexity */
|
|
59
|
-
else {
|
|
60
|
-
return converter.validate(parsed);
|
|
61
|
-
}
|
|
56
|
+
return converter.convert(parsed);
|
|
62
57
|
}
|
|
63
58
|
return (0, ts_utils_1.succeed)(parsed);
|
|
64
59
|
}).onFailure(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fgv/ts-extras",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-24",
|
|
4
4
|
"description": "Assorted Typescript Utilities",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "dist/ts-extras.d.ts",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"rimraf": "^5.0.7",
|
|
37
37
|
"ts-jest": "^29.4.1",
|
|
38
38
|
"ts-node": "^10.9.2",
|
|
39
|
-
"typescript": "
|
|
39
|
+
"typescript": "5.8.3",
|
|
40
40
|
"eslint-plugin-n": "^16.6.2",
|
|
41
41
|
"jest-snapshot": "~29.7.0",
|
|
42
|
-
"@rushstack/heft": "
|
|
43
|
-
"@rushstack/heft-node-rig": "
|
|
44
|
-
"@rushstack/eslint-config": "
|
|
42
|
+
"@rushstack/heft": "0.74.3",
|
|
43
|
+
"@rushstack/heft-node-rig": "2.9.4",
|
|
44
|
+
"@rushstack/eslint-config": "4.4.0",
|
|
45
45
|
"@types/heft-jest": "1.0.6",
|
|
46
|
-
"@rushstack/heft-jest-plugin": "
|
|
46
|
+
"@rushstack/heft-jest-plugin": "0.16.12",
|
|
47
47
|
"eslint-plugin-tsdoc": "~0.4.0",
|
|
48
|
-
"@fgv/ts-utils
|
|
49
|
-
"@fgv/ts-utils": "5.0.0-
|
|
48
|
+
"@fgv/ts-utils": "5.0.0-24",
|
|
49
|
+
"@fgv/ts-utils-jest": "5.0.0-24"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"luxon": "^3.7.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"fflate": "~0.8.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@fgv/ts-utils": "5.0.0-
|
|
58
|
+
"@fgv/ts-utils": "5.0.0-24"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "heft test --clean",
|
package/.vscode/settings.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"typescript.tsdk": "node_modules\\typescript\\lib",
|
|
3
|
-
"search.exclude": {
|
|
4
|
-
"**/boneyard": true
|
|
5
|
-
},
|
|
6
|
-
"files.exclude": {
|
|
7
|
-
"**/boneyard/**/*.ts": true
|
|
8
|
-
},
|
|
9
|
-
"cSpell.words": [
|
|
10
|
-
"badp",
|
|
11
|
-
"dflt",
|
|
12
|
-
"Eulers",
|
|
13
|
-
"fixlint",
|
|
14
|
-
"furst",
|
|
15
|
-
"luxon",
|
|
16
|
-
"nums",
|
|
17
|
-
"oopsy",
|
|
18
|
-
"papaparse",
|
|
19
|
-
"prefixp",
|
|
20
|
-
"TCONV",
|
|
21
|
-
"TDEST",
|
|
22
|
-
"TELEM",
|
|
23
|
-
"TSRC",
|
|
24
|
-
"TTOELEM",
|
|
25
|
-
"xyzzy"
|
|
26
|
-
]
|
|
27
|
-
}
|
package/dist/ts-extras.d.ts
DELETED
|
@@ -1,602 +0,0 @@
|
|
|
1
|
-
import { Conversion } from '@fgv/ts-utils';
|
|
2
|
-
import { Converter } from '@fgv/ts-utils';
|
|
3
|
-
import { FileTree } from '@fgv/ts-utils';
|
|
4
|
-
import { Hash as Hash_2 } from '@fgv/ts-utils';
|
|
5
|
-
import { Result } from '@fgv/ts-utils';
|
|
6
|
-
import { Validator } from '@fgv/ts-utils';
|
|
7
|
-
|
|
8
|
-
declare namespace Converters {
|
|
9
|
-
export {
|
|
10
|
-
templateString,
|
|
11
|
-
extendedArrayOf,
|
|
12
|
-
rangeTypeOf,
|
|
13
|
-
rangeOf,
|
|
14
|
-
isoDate
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export { Converters }
|
|
18
|
-
|
|
19
|
-
declare namespace Csv {
|
|
20
|
-
export {
|
|
21
|
-
readCsvFileSync,
|
|
22
|
-
CsvOptions
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
export { Csv }
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Options for {@link Csv.readCsvFileSync | readCsvFileSync}
|
|
29
|
-
* @beta
|
|
30
|
-
*/
|
|
31
|
-
declare interface CsvOptions {
|
|
32
|
-
delimiter?: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Default {@link Experimental.RangeOfFormats | formats} to use for both
|
|
37
|
-
* open-ended and complete {@link Experimental.RangeOf | RangeOf<T>}.
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
|
-
declare const DEFAULT_RANGEOF_FORMATS: RangeOfFormats;
|
|
41
|
-
|
|
42
|
-
declare namespace Experimental {
|
|
43
|
-
export {
|
|
44
|
-
ExtendedArray,
|
|
45
|
-
formatList,
|
|
46
|
-
FormatTargets,
|
|
47
|
-
Formattable,
|
|
48
|
-
FormattableBase,
|
|
49
|
-
Formatter,
|
|
50
|
-
FormattersByExtendedTarget,
|
|
51
|
-
FormattersByTarget,
|
|
52
|
-
RangeOfProperties,
|
|
53
|
-
RangeOfFormats,
|
|
54
|
-
DEFAULT_RANGEOF_FORMATS,
|
|
55
|
-
RangeOf
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export { Experimental }
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* An experimental array template which extend built-in `Array` to include a handful
|
|
62
|
-
* of predicates which return `Result<T>`.
|
|
63
|
-
* @beta
|
|
64
|
-
*/
|
|
65
|
-
declare class ExtendedArray<T> extends Array<T> {
|
|
66
|
-
readonly itemDescription: string;
|
|
67
|
-
/**
|
|
68
|
-
* Constructs an {@link Experimental.ExtendedArray | ExtendedArray}.
|
|
69
|
-
* @param itemDescription - Brief description of the type of each item in this array.
|
|
70
|
-
* @param items - The initial contents of the array.
|
|
71
|
-
*/
|
|
72
|
-
constructor(itemDescription: string, ...items: T[]);
|
|
73
|
-
/**
|
|
74
|
-
* Type guard to determine if some arbitrary array is an
|
|
75
|
-
* {@link Experimental.ExtendedArray}
|
|
76
|
-
* @param a - The `Array` to be tested.
|
|
77
|
-
* @returns Returns `true` if `a` is an {@link Experimental.ExtendedArray | ExtendedArray},
|
|
78
|
-
* `false` otherwise.
|
|
79
|
-
*/
|
|
80
|
-
static isExtendedArray<T>(a?: T[]): a is ExtendedArray<T>;
|
|
81
|
-
/**
|
|
82
|
-
* Determines if this array contains exactly one element which matches
|
|
83
|
-
* a supplied predicate.
|
|
84
|
-
* @param predicate - The predicate function to be applied.
|
|
85
|
-
* @returns Returns `Success<T>` with the single matching
|
|
86
|
-
* result if exactly one item matches `predicate`. Returns `Failure<T>`
|
|
87
|
-
* with an error message if there are no matches or more than one match.
|
|
88
|
-
*/
|
|
89
|
-
single(predicate?: (item: T) => boolean): Result<T>;
|
|
90
|
-
/**
|
|
91
|
-
* Returns the first element of an {@link Experimental.ExtendedArray | ExtendedArray}. Fails with an
|
|
92
|
-
* error message if the array is empty.
|
|
93
|
-
* @param failMessage - Optional message to be displayed in the event of failure.
|
|
94
|
-
* @returns Returns `Success<T>` with the value of the first element
|
|
95
|
-
* in the array, or `Failure<T>` with an error message if the array is empty.
|
|
96
|
-
*/
|
|
97
|
-
first(failMessage?: string): Result<T>;
|
|
98
|
-
/**
|
|
99
|
-
* Returns an array containing all elements of an {@link Experimental.ExtendedArray | ExtendedArray}.
|
|
100
|
-
* Fails with an error message if the array is empty.
|
|
101
|
-
* @param failMessage - Optional message to be displayed in the event of failure.
|
|
102
|
-
* @returns Returns `Success<T>` with a new (non-extended) `Array`
|
|
103
|
-
* containing the elements of this array, or `Failure<T>` with an error message
|
|
104
|
-
* if the array is empty.
|
|
105
|
-
*/
|
|
106
|
-
atLeastOne(failMessage?: string): Result<T[]>;
|
|
107
|
-
/**
|
|
108
|
-
* Gets a new (non-extended) `Array` containing all of the elements from this
|
|
109
|
-
* {@link Experimental.ExtendedArray | ExtendedArray}.
|
|
110
|
-
* @returns A new (non-extended) `Array<T>`.
|
|
111
|
-
*/
|
|
112
|
-
all(): T[];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* A helper function to create a `Converter` which converts `unknown` to {@link Experimental.ExtendedArray | ExtendedArray<T>}.
|
|
117
|
-
* @remarks
|
|
118
|
-
* If `onError` is `'failOnError'` (default), then the entire conversion fails if any element cannot
|
|
119
|
-
* be converted. If `onError` is `'ignoreErrors'`, then failing elements are silently ignored.
|
|
120
|
-
* @param converter - `Converter` used to convert each item in the array
|
|
121
|
-
* @param ignoreErrors - Specifies treatment of unconvertible elements
|
|
122
|
-
* @beta
|
|
123
|
-
*/
|
|
124
|
-
declare function extendedArrayOf<T, TC = undefined>(label: string, converter: Converter<T, TC>, onError?: Conversion.OnError): Converter<ExtendedArray<T>, TC>;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Formats a list of items using the supplied template and formatter, one result
|
|
128
|
-
* per output line.
|
|
129
|
-
* @param format - A mustache template used to format each item.
|
|
130
|
-
* @param items - The items to be formatted.
|
|
131
|
-
* @param itemFormatter - The {@link Experimental.Formatter | Formatter<T>} used to format each item.
|
|
132
|
-
* @returns The resulting string.
|
|
133
|
-
* @beta
|
|
134
|
-
*/
|
|
135
|
-
declare function formatList<T>(format: string, items: T[], itemFormatter: Formatter<T>): Result<string>;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Interface for an object that can be formatted.
|
|
139
|
-
* @beta
|
|
140
|
-
*/
|
|
141
|
-
declare interface Formattable {
|
|
142
|
-
/**
|
|
143
|
-
* Formats an object using the supplied mustache template.
|
|
144
|
-
* @param format - A mustache template used to format the object.
|
|
145
|
-
* @returns `Success<string>` with the resulting string, or `Failure<string>`
|
|
146
|
-
* with an error message if an error occurs.
|
|
147
|
-
*/
|
|
148
|
-
format(format: string): Result<string>;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Base class which adds common formatting.
|
|
153
|
-
* @beta
|
|
154
|
-
*/
|
|
155
|
-
declare class FormattableBase {
|
|
156
|
-
/**
|
|
157
|
-
* Helper enables derived classes to add named details to a formatted presentation.
|
|
158
|
-
* @param details - An array of detail description strings.
|
|
159
|
-
* @param label - Label to use for the new detail.
|
|
160
|
-
* @param value - Value to use for the new detail.
|
|
161
|
-
* @internal
|
|
162
|
-
*/
|
|
163
|
-
protected static _tryAddDetail(details: string[], label: string, value: string | undefined): void;
|
|
164
|
-
/**
|
|
165
|
-
* {@inheritdoc Experimental.Formattable.format}
|
|
166
|
-
*/
|
|
167
|
-
format(template: string): Result<string>;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Destination format for some formatted string.
|
|
172
|
-
* @beta
|
|
173
|
-
*/
|
|
174
|
-
declare type FormatTargets = 'text' | 'markdown' | 'embed';
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Type definition for a formatting function, which takes a `string` and an
|
|
178
|
-
* item and returns `Result<string>`.
|
|
179
|
-
* @beta
|
|
180
|
-
*/
|
|
181
|
-
declare type Formatter<T> = (format: string, item: T) => Result<string>;
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* A collection of {@link Experimental.Formatter | formatters} indexed by target name, to enable
|
|
185
|
-
* different format methods per output target.
|
|
186
|
-
* @beta
|
|
187
|
-
*/
|
|
188
|
-
declare type FormattersByExtendedTarget<TFT extends FormatTargets, T> = Record<TFT, Formatter<T>>;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* A collection of {@link Experimental.Formatter | formatters} indexed by the
|
|
192
|
-
* {@link Experimental.FormatTargets | default supported target formats}.
|
|
193
|
-
* @beta
|
|
194
|
-
*/
|
|
195
|
-
declare type FormattersByTarget<T> = FormattersByExtendedTarget<FormatTargets, T>;
|
|
196
|
-
|
|
197
|
-
declare namespace Hash {
|
|
198
|
-
export {
|
|
199
|
-
Md5Normalizer
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
export { Hash }
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* A `Converter` which converts an iso formatted string, a number or a `Date` object to
|
|
206
|
-
* a `Date` object.
|
|
207
|
-
* @public
|
|
208
|
-
*/
|
|
209
|
-
declare const isoDate: Converter<Date, unknown>;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* @public
|
|
213
|
-
*/
|
|
214
|
-
declare type JarFieldPicker<T extends JarRecord = JarRecord> = (record: T) => (keyof T)[];
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Represents a single record in a JAR file
|
|
218
|
-
* @public
|
|
219
|
-
*/
|
|
220
|
-
declare type JarRecord = Record<string, string | string[]>;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Options for a JAR record parser.
|
|
224
|
-
* @public
|
|
225
|
-
*/
|
|
226
|
-
declare interface JarRecordParserOptions {
|
|
227
|
-
readonly arrayFields?: string[] | JarFieldPicker;
|
|
228
|
-
readonly fixedContinuationSize?: number;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* A hashing normalizer which computes object
|
|
233
|
-
* hash using the MD5 algorithm.
|
|
234
|
-
* @public
|
|
235
|
-
*/
|
|
236
|
-
declare class Md5Normalizer extends Hash_2.HashingNormalizer {
|
|
237
|
-
constructor();
|
|
238
|
-
static md5Hash(parts: string[]): string;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Reads a record-jar from an array of strings, each of which represents one
|
|
243
|
-
* line in the source file.
|
|
244
|
-
* @param lines - the array of strings to be parsed
|
|
245
|
-
* @param options - Optional parser configuration
|
|
246
|
-
* @returns a corresponding array of `Record<string, string>`
|
|
247
|
-
* @public
|
|
248
|
-
*/
|
|
249
|
-
declare function parseRecordJarLines(lines: string[], options?: JarRecordParserOptions): Result<JarRecord[]>;
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Simple implementation of a possibly open-ended range of some comparable
|
|
253
|
-
* type `<T>` with test and formatting.
|
|
254
|
-
* @public
|
|
255
|
-
*/
|
|
256
|
-
declare class RangeOf<T> implements RangeOfProperties<T> {
|
|
257
|
-
/**
|
|
258
|
-
* Minimum extent of the range.
|
|
259
|
-
*/
|
|
260
|
-
readonly min?: T;
|
|
261
|
-
/**
|
|
262
|
-
* Maximum extent of the range.
|
|
263
|
-
*/
|
|
264
|
-
readonly max?: T;
|
|
265
|
-
/**
|
|
266
|
-
* Creates a new {@link Experimental.RangeOf | RangeOf<T>}.
|
|
267
|
-
* @param min - Optional minimum extent of the range.
|
|
268
|
-
* @param max - Optional maximum extent of the range.
|
|
269
|
-
*/
|
|
270
|
-
constructor(min?: T, max?: T);
|
|
271
|
-
/**
|
|
272
|
-
* Static constructor for a {@link Experimental.RangeOf | RangeOf<T>}.
|
|
273
|
-
* @param init - {@link Experimental.RangeOfProperties | Range initializer}.
|
|
274
|
-
* @returns A new {@link Experimental.RangeOf | RangeOf<T>}.
|
|
275
|
-
*/
|
|
276
|
-
static createRange<T>(init?: RangeOfProperties<T>): Result<RangeOf<T>>;
|
|
277
|
-
/**
|
|
278
|
-
* Gets a formatted description of a {@link Experimental.RangeOfProperties | RangeOfProperties<T>} given an
|
|
279
|
-
* optional set of formats and 'empty' value to use.
|
|
280
|
-
* @param range - The {@link Experimental.RangeOfProperties | RangeOfProperties<T>} to be formatted.
|
|
281
|
-
* @param formats - Optional {@link Experimental.RangeOfFormats | formats} to use. Default is
|
|
282
|
-
* {@link Experimental.DEFAULT_RANGEOF_FORMATS | DEFAULT_RANGEOF_FORMATS}.
|
|
283
|
-
* @param emptyValue - Value which represents unbounded minimum or maximum for this range. Default is `undefined`.
|
|
284
|
-
* @returns A string representation of the range.
|
|
285
|
-
*/
|
|
286
|
-
static propertiesToString<T>(range: RangeOfProperties<T>, formats?: RangeOfFormats, emptyValue?: T): string | undefined;
|
|
287
|
-
/**
|
|
288
|
-
* Default comparison uses javascript built-in comparison.
|
|
289
|
-
* @param t1 - First value to be compared.
|
|
290
|
-
* @param t2 - Second value to be compared.
|
|
291
|
-
* @returns `'less'` if `t1` is less than `t2`, `'greater'` if `t1` is larger
|
|
292
|
-
* and `'equal'` if `t1` and `t2` are equal.
|
|
293
|
-
* @internal
|
|
294
|
-
*/
|
|
295
|
-
protected static _defaultCompare<T>(t1: T, t2: T): 'less' | 'equal' | 'greater';
|
|
296
|
-
/**
|
|
297
|
-
* Checks if a supplied value is within this range.
|
|
298
|
-
* @param t - The value to be tested.
|
|
299
|
-
* @returns `'included'` if `t` falls within the range, `'less'` if `t` falls
|
|
300
|
-
* below the minimum extent of the range and `'greater'` if `t` is above the
|
|
301
|
-
* maximum extent.
|
|
302
|
-
*/
|
|
303
|
-
check(t: T): 'less' | 'included' | 'greater';
|
|
304
|
-
/**
|
|
305
|
-
* Determines if a supplied value is within this range.
|
|
306
|
-
* @param t - The value to be tested.
|
|
307
|
-
* @returns Returns `true` if `t` falls within the range, `false` otherwise.
|
|
308
|
-
*/
|
|
309
|
-
includes(t: T): boolean;
|
|
310
|
-
/**
|
|
311
|
-
* Finds the transition value that would bring a supplied value `t` into
|
|
312
|
-
* range.
|
|
313
|
-
* @param t - The value to be tested.
|
|
314
|
-
* @returns The minimum extent of the range if `t` is below the range or
|
|
315
|
-
* the maximum extent of the range if `t` is above the range. Returns
|
|
316
|
-
* `undefined` if `t` already falls within the range.
|
|
317
|
-
*/
|
|
318
|
-
findTransition(t: T): T | undefined;
|
|
319
|
-
/**
|
|
320
|
-
* Formats the minimum and maximum values of this range.
|
|
321
|
-
* @param format - A format function used to format the values.
|
|
322
|
-
* @returns A {@link Experimental.RangeOfProperties | RangeOfProperties<string>} containing the
|
|
323
|
-
* formatted representation of the {@link Experimental.RangeOf.min | minimum} and
|
|
324
|
-
* {@link Experimental.RangeOf.max | maximum}
|
|
325
|
-
* extent of the range, or `undefined` for an extent that is not present.
|
|
326
|
-
*/
|
|
327
|
-
toFormattedProperties(format: (value: T) => string | undefined): RangeOfProperties<string>;
|
|
328
|
-
/**
|
|
329
|
-
* Formats this range using the supplied format function.
|
|
330
|
-
* @param format - Format function used to format minimum and maximum extent values.
|
|
331
|
-
* @param formats - The {@link Experimental.RangeOfFormats | format strings} used to format the range
|
|
332
|
-
* (default {@link Experimental.DEFAULT_RANGEOF_FORMATS}).
|
|
333
|
-
* @returns Returns a formatted representation of this range.
|
|
334
|
-
*/
|
|
335
|
-
format(format: (value: T) => string | undefined, formats?: RangeOfFormats): string | undefined;
|
|
336
|
-
/**
|
|
337
|
-
* Inner compare method can be overridden by a derived class.
|
|
338
|
-
* @param t1 - First value to compare.
|
|
339
|
-
* @param t2 - Second value to compare.
|
|
340
|
-
* @returns `'less'` if `t1` is less than `t2`, `'greater'` if `t1` is larger
|
|
341
|
-
* and `'equal'` if `t1` and `t2` are equal.
|
|
342
|
-
* @internal
|
|
343
|
-
*/
|
|
344
|
-
protected _compare(t1: T, t2: T): 'less' | 'equal' | 'greater';
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* A helper wrapper to construct a `Converter` which converts to {@link Experimental.RangeOf | RangeOf<T>}
|
|
349
|
-
* where `<T>` is some comparable type.
|
|
350
|
-
* @param converter - `Converter` used to convert `min` and `max` extent of the range.
|
|
351
|
-
* @public
|
|
352
|
-
*/
|
|
353
|
-
declare function rangeOf<T, TC = unknown>(converter: Converter<T, TC>): Converter<RangeOf<T>, TC>;
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Format strings (in mustache format) to
|
|
357
|
-
* use for both open-ended and complete
|
|
358
|
-
* {@link Experimental.RangeOf | RangeOf<T>}.
|
|
359
|
-
* @public
|
|
360
|
-
*/
|
|
361
|
-
declare interface RangeOfFormats {
|
|
362
|
-
minOnly: string;
|
|
363
|
-
maxOnly: string;
|
|
364
|
-
minMax: string;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* Represents a generic range of some comparable type `<T>`.
|
|
369
|
-
* @public
|
|
370
|
-
*/
|
|
371
|
-
declare interface RangeOfProperties<T> {
|
|
372
|
-
readonly min?: T;
|
|
373
|
-
readonly max?: T;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* A helper wrapper to construct a `Converter` which converts to an arbitrary strongly-typed
|
|
378
|
-
* range of some comparable type.
|
|
379
|
-
* @param converter - `Converter` used to convert `min` and `max` extent of the range.
|
|
380
|
-
* @param constructor - Static constructor to instantiate the object.
|
|
381
|
-
* @public
|
|
382
|
-
*/
|
|
383
|
-
declare function rangeTypeOf<T, RT extends RangeOf<T>, TC = unknown>(converter: Converter<T, TC>, constructor: (init: RangeOfProperties<T>) => Result<RT>): Converter<RT, TC>;
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Reads a CSV file from a supplied path.
|
|
387
|
-
* @param srcPath - Source path from which the file is read.
|
|
388
|
-
* @param options - optional parameters to control the processing
|
|
389
|
-
* @returns The contents of the file.
|
|
390
|
-
* @beta
|
|
391
|
-
*/
|
|
392
|
-
declare function readCsvFileSync(srcPath: string, options?: CsvOptions): Result<unknown>;
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Reads a record-jar file from a supplied path.
|
|
396
|
-
* @param srcPath - Source path from which the file is read.
|
|
397
|
-
* @param options - Optional parser configuration
|
|
398
|
-
* @returns The contents of the file as an array of `Record<string, string>`
|
|
399
|
-
* @see https://datatracker.ietf.org/doc/html/draft-phillips-record-jar-01
|
|
400
|
-
* @public
|
|
401
|
-
*/
|
|
402
|
-
declare function readRecordJarFileSync(srcPath: string, options?: JarRecordParserOptions): Result<JarRecord[]>;
|
|
403
|
-
|
|
404
|
-
declare namespace RecordJar {
|
|
405
|
-
export {
|
|
406
|
-
parseRecordJarLines,
|
|
407
|
-
readRecordJarFileSync,
|
|
408
|
-
JarRecord,
|
|
409
|
-
JarFieldPicker,
|
|
410
|
-
JarRecordParserOptions
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
export { RecordJar }
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Helper function to create a `StringConverter` which converts
|
|
417
|
-
* `unknown` to `string`, applying template conversions supplied at construction time or at
|
|
418
|
-
* runtime as context.
|
|
419
|
-
* @remarks
|
|
420
|
-
* Template conversions are applied using `mustache` syntax.
|
|
421
|
-
* @param defaultContext - Optional default context to use for template values.
|
|
422
|
-
* @returns A new `Converter` returning `string`.
|
|
423
|
-
* @public
|
|
424
|
-
*/
|
|
425
|
-
declare function templateString(defaultContext?: unknown): Conversion.StringConverter<string, unknown>;
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Implementation of `IFileTreeDirectoryItem` for directories in a ZIP archive.
|
|
429
|
-
* @public
|
|
430
|
-
*/
|
|
431
|
-
declare class ZipDirectoryItem implements FileTree.IFileTreeDirectoryItem {
|
|
432
|
-
/**
|
|
433
|
-
* Indicates that this `FileTree.FileTreeItem` is a directory.
|
|
434
|
-
*/
|
|
435
|
-
readonly type: 'directory';
|
|
436
|
-
/**
|
|
437
|
-
* The absolute path of the directory within the ZIP archive.
|
|
438
|
-
*/
|
|
439
|
-
readonly absolutePath: string;
|
|
440
|
-
/**
|
|
441
|
-
* The name of the directory
|
|
442
|
-
*/
|
|
443
|
-
readonly name: string;
|
|
444
|
-
/**
|
|
445
|
-
* The ZIP file tree accessors that created this item.
|
|
446
|
-
*/
|
|
447
|
-
private readonly _accessors;
|
|
448
|
-
/**
|
|
449
|
-
* Constructor for ZipDirectoryItem.
|
|
450
|
-
* @param directoryPath - The path of the directory within the ZIP.
|
|
451
|
-
* @param accessors - The ZIP file tree accessors.
|
|
452
|
-
*/
|
|
453
|
-
constructor(directoryPath: string, accessors: ZipFileTreeAccessors);
|
|
454
|
-
/**
|
|
455
|
-
* Gets the children of the directory.
|
|
456
|
-
*/
|
|
457
|
-
getChildren(): Result<ReadonlyArray<FileTree.FileTreeItem>>;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Implementation of `FileTree.IFileTreeFileItem` for files in a ZIP archive.
|
|
462
|
-
* @public
|
|
463
|
-
*/
|
|
464
|
-
declare class ZipFileItem implements FileTree.IFileTreeFileItem {
|
|
465
|
-
/**
|
|
466
|
-
* Indicates that this `FileTree.FileTreeItem` is a file.
|
|
467
|
-
*/
|
|
468
|
-
readonly type: 'file';
|
|
469
|
-
/**
|
|
470
|
-
* The absolute path of the file within the ZIP archive.
|
|
471
|
-
*/
|
|
472
|
-
readonly absolutePath: string;
|
|
473
|
-
/**
|
|
474
|
-
* The name of the file
|
|
475
|
-
*/
|
|
476
|
-
readonly name: string;
|
|
477
|
-
/**
|
|
478
|
-
* The base name of the file (without extension)
|
|
479
|
-
*/
|
|
480
|
-
readonly baseName: string;
|
|
481
|
-
/**
|
|
482
|
-
* The extension of the file
|
|
483
|
-
*/
|
|
484
|
-
readonly extension: string;
|
|
485
|
-
/**
|
|
486
|
-
* The pre-loaded contents of the file.
|
|
487
|
-
*/
|
|
488
|
-
private readonly _contents;
|
|
489
|
-
/**
|
|
490
|
-
* The ZIP file tree accessors that created this item.
|
|
491
|
-
*/
|
|
492
|
-
private readonly _accessors;
|
|
493
|
-
/**
|
|
494
|
-
* Constructor for ZipFileItem.
|
|
495
|
-
* @param zipFilePath - The path of the file within the ZIP.
|
|
496
|
-
* @param contents - The pre-loaded contents of the file.
|
|
497
|
-
* @param accessors - The ZIP file tree accessors.
|
|
498
|
-
*/
|
|
499
|
-
constructor(zipFilePath: string, contents: string, accessors: ZipFileTreeAccessors);
|
|
500
|
-
/**
|
|
501
|
-
* Gets the contents of the file as parsed JSON.
|
|
502
|
-
*/
|
|
503
|
-
getContents(): Result<unknown>;
|
|
504
|
-
getContents<T>(converter: Validator<T> | Converter<T>): Result<T>;
|
|
505
|
-
/**
|
|
506
|
-
* Gets the raw contents of the file as a string.
|
|
507
|
-
*/
|
|
508
|
-
getRawContents(): Result<string>;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
declare namespace ZipFileTree {
|
|
512
|
-
export {
|
|
513
|
-
ZipFileTreeAccessors,
|
|
514
|
-
ZipFileItem,
|
|
515
|
-
ZipDirectoryItem
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
export { ZipFileTree }
|
|
519
|
-
|
|
520
|
-
/**
|
|
521
|
-
* File tree accessors for ZIP archives.
|
|
522
|
-
* @public
|
|
523
|
-
*/
|
|
524
|
-
declare class ZipFileTreeAccessors implements FileTree.IFileTreeAccessors {
|
|
525
|
-
/**
|
|
526
|
-
* The unzipped file data.
|
|
527
|
-
*/
|
|
528
|
-
private readonly _files;
|
|
529
|
-
/**
|
|
530
|
-
* Optional prefix to prepend to paths.
|
|
531
|
-
*/
|
|
532
|
-
private readonly _prefix;
|
|
533
|
-
/**
|
|
534
|
-
* Cache of all items in the ZIP for efficient lookups.
|
|
535
|
-
*/
|
|
536
|
-
private readonly _itemCache;
|
|
537
|
-
/**
|
|
538
|
-
* Constructor for ZipFileTreeAccessors.
|
|
539
|
-
* @param files - The unzipped file data from fflate.
|
|
540
|
-
* @param prefix - Optional prefix to prepend to paths.
|
|
541
|
-
*/
|
|
542
|
-
private constructor();
|
|
543
|
-
/**
|
|
544
|
-
* Creates a new ZipFileTreeAccessors instance from a ZIP file buffer (synchronous).
|
|
545
|
-
* @param zipBuffer - The ZIP file as an ArrayBuffer or Uint8Array.
|
|
546
|
-
* @param prefix - Optional prefix to prepend to paths.
|
|
547
|
-
* @returns Result containing the ZipFileTreeAccessors instance.
|
|
548
|
-
*/
|
|
549
|
-
static fromBuffer(zipBuffer: ArrayBuffer | Uint8Array, prefix?: string): Result<ZipFileTreeAccessors>;
|
|
550
|
-
/**
|
|
551
|
-
* Creates a new ZipFileTreeAccessors instance from a ZIP file buffer (asynchronous).
|
|
552
|
-
* @param zipBuffer - The ZIP file as an ArrayBuffer or Uint8Array.
|
|
553
|
-
* @param prefix - Optional prefix to prepend to paths.
|
|
554
|
-
* @returns Promise containing Result with the ZipFileTreeAccessors instance.
|
|
555
|
-
*/
|
|
556
|
-
static fromBufferAsync(zipBuffer: ArrayBuffer | Uint8Array, prefix?: string): Promise<Result<ZipFileTreeAccessors>>;
|
|
557
|
-
/**
|
|
558
|
-
* Creates a new ZipFileTreeAccessors instance from a File object (browser environment).
|
|
559
|
-
* @param file - The File object containing ZIP data.
|
|
560
|
-
* @param prefix - Optional prefix to prepend to paths.
|
|
561
|
-
* @returns Result containing the ZipFileTreeAccessors instance.
|
|
562
|
-
*/
|
|
563
|
-
static fromFile(file: File, prefix?: string): Promise<Result<ZipFileTreeAccessors>>;
|
|
564
|
-
/**
|
|
565
|
-
* Builds the cache of all items in the ZIP archive.
|
|
566
|
-
*/
|
|
567
|
-
private _buildItemCache;
|
|
568
|
-
/**
|
|
569
|
-
* Resolves paths to an absolute path.
|
|
570
|
-
*/
|
|
571
|
-
resolveAbsolutePath(...paths: string[]): string;
|
|
572
|
-
/**
|
|
573
|
-
* Gets the extension of a path.
|
|
574
|
-
*/
|
|
575
|
-
getExtension(path: string): string;
|
|
576
|
-
/**
|
|
577
|
-
* Gets the base name of a path.
|
|
578
|
-
*/
|
|
579
|
-
getBaseName(path: string, suffix?: string): string;
|
|
580
|
-
/**
|
|
581
|
-
* Joins paths together.
|
|
582
|
-
*/
|
|
583
|
-
joinPaths(...paths: string[]): string;
|
|
584
|
-
/**
|
|
585
|
-
* Gets an item from the file tree.
|
|
586
|
-
*/
|
|
587
|
-
getItem(path: string): Result<FileTree.FileTreeItem>;
|
|
588
|
-
/**
|
|
589
|
-
* Gets the contents of a file in the file tree.
|
|
590
|
-
*/
|
|
591
|
-
getFileContents(path: string): Result<string>;
|
|
592
|
-
/**
|
|
593
|
-
* Gets the children of a directory in the file tree.
|
|
594
|
-
*/
|
|
595
|
-
getChildren(path: string): Result<ReadonlyArray<FileTree.FileTreeItem>>;
|
|
596
|
-
/**
|
|
597
|
-
* Checks if childPath is a direct child of parentPath.
|
|
598
|
-
*/
|
|
599
|
-
private _isDirectChild;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
export { }
|
package/dist/tsdoc-metadata.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.52.10"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|