@aws-cdk/aws-imagebuilder-alpha 2.224.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +9476 -0
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +71 -0
- package/LICENSE +201 -0
- package/NOTICE +19 -0
- package/README.md +94 -0
- package/awslint.json +5 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +19 -0
- package/lib/infrastructure-configuration.d.ts +323 -0
- package/lib/infrastructure-configuration.js +341 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +127 -0
- package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +1275 -0
- package/node_modules/yaml/browser/dist/Schema-e94716c8.js +682 -0
- package/node_modules/yaml/browser/dist/index.js +1002 -0
- package/node_modules/yaml/browser/dist/legacy-exports.js +3 -0
- package/node_modules/yaml/browser/dist/package.json +1 -0
- package/node_modules/yaml/browser/dist/parse-cst.js +1904 -0
- package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +2419 -0
- package/node_modules/yaml/browser/dist/types.js +4 -0
- package/node_modules/yaml/browser/dist/util.js +2 -0
- package/node_modules/yaml/browser/dist/warnings-df54cb69.js +499 -0
- package/node_modules/yaml/browser/index.js +1 -0
- package/node_modules/yaml/browser/map.js +2 -0
- package/node_modules/yaml/browser/pair.js +2 -0
- package/node_modules/yaml/browser/parse-cst.js +1 -0
- package/node_modules/yaml/browser/scalar.js +2 -0
- package/node_modules/yaml/browser/schema.js +9 -0
- package/node_modules/yaml/browser/seq.js +2 -0
- package/node_modules/yaml/browser/types/binary.js +8 -0
- package/node_modules/yaml/browser/types/omap.js +3 -0
- package/node_modules/yaml/browser/types/pairs.js +3 -0
- package/node_modules/yaml/browser/types/set.js +3 -0
- package/node_modules/yaml/browser/types/timestamp.js +10 -0
- package/node_modules/yaml/browser/types.js +1 -0
- package/node_modules/yaml/browser/util.js +1 -0
- package/node_modules/yaml/dist/Document-9b4560a1.js +757 -0
- package/node_modules/yaml/dist/PlainValue-ec8e588e.js +876 -0
- package/node_modules/yaml/dist/Schema-88e323a7.js +525 -0
- package/node_modules/yaml/dist/index.js +79 -0
- package/node_modules/yaml/dist/legacy-exports.js +16 -0
- package/node_modules/yaml/dist/parse-cst.js +1753 -0
- package/node_modules/yaml/dist/resolveSeq-d03cb037.js +2161 -0
- package/node_modules/yaml/dist/test-events.js +162 -0
- package/node_modules/yaml/dist/types.js +23 -0
- package/node_modules/yaml/dist/util.js +19 -0
- package/node_modules/yaml/dist/warnings-1000a372.js +416 -0
- package/node_modules/yaml/index.d.ts +372 -0
- package/node_modules/yaml/index.js +1 -0
- package/node_modules/yaml/map.js +2 -0
- package/node_modules/yaml/package.json +106 -0
- package/node_modules/yaml/pair.js +2 -0
- package/node_modules/yaml/parse-cst.d.ts +191 -0
- package/node_modules/yaml/parse-cst.js +1 -0
- package/node_modules/yaml/scalar.js +2 -0
- package/node_modules/yaml/schema.js +9 -0
- package/node_modules/yaml/seq.js +2 -0
- package/node_modules/yaml/types/binary.js +8 -0
- package/node_modules/yaml/types/omap.js +3 -0
- package/node_modules/yaml/types/pairs.js +3 -0
- package/node_modules/yaml/types/set.js +3 -0
- package/node_modules/yaml/types/timestamp.js +10 -0
- package/node_modules/yaml/types.d.ts +407 -0
- package/node_modules/yaml/types.js +17 -0
- package/node_modules/yaml/types.mjs +17 -0
- package/node_modules/yaml/util.d.ts +86 -0
- package/node_modules/yaml/util.js +16 -0
- package/node_modules/yaml/util.mjs +18 -0
- package/package.json +122 -0
- package/rosetta/_generated.ts-fixture +6 -0
- package/rosetta/default.ts-fixture +25 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { CST } from './parse-cst'
|
|
2
|
+
import {
|
|
3
|
+
AST,
|
|
4
|
+
Alias,
|
|
5
|
+
Collection,
|
|
6
|
+
Merge,
|
|
7
|
+
Node,
|
|
8
|
+
Scalar,
|
|
9
|
+
Schema,
|
|
10
|
+
YAMLMap,
|
|
11
|
+
YAMLSeq
|
|
12
|
+
} from './types'
|
|
13
|
+
import { Type, YAMLError, YAMLWarning } from './util'
|
|
14
|
+
|
|
15
|
+
export { AST, CST }
|
|
16
|
+
export { default as parseCST } from './parse-cst'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* `yaml` defines document-specific options in three places: as an argument of
|
|
20
|
+
* parse, create and stringify calls, in the values of `YAML.defaultOptions`,
|
|
21
|
+
* and in the version-dependent `YAML.Document.defaults` object. Values set in
|
|
22
|
+
* `YAML.defaultOptions` override version-dependent defaults, and argument
|
|
23
|
+
* options override both.
|
|
24
|
+
*/
|
|
25
|
+
export const defaultOptions: Options
|
|
26
|
+
|
|
27
|
+
export interface Options extends Schema.Options {
|
|
28
|
+
/**
|
|
29
|
+
* Default prefix for anchors.
|
|
30
|
+
*
|
|
31
|
+
* Default: `'a'`, resulting in anchors `a1`, `a2`, etc.
|
|
32
|
+
*/
|
|
33
|
+
anchorPrefix?: string
|
|
34
|
+
/**
|
|
35
|
+
* The number of spaces to use when indenting code.
|
|
36
|
+
*
|
|
37
|
+
* Default: `2`
|
|
38
|
+
*/
|
|
39
|
+
indent?: number
|
|
40
|
+
/**
|
|
41
|
+
* Whether block sequences should be indented.
|
|
42
|
+
*
|
|
43
|
+
* Default: `true`
|
|
44
|
+
*/
|
|
45
|
+
indentSeq?: boolean
|
|
46
|
+
/**
|
|
47
|
+
* Allow non-JSON JavaScript objects to remain in the `toJSON` output.
|
|
48
|
+
* Relevant with the YAML 1.1 `!!timestamp` and `!!binary` tags as well as BigInts.
|
|
49
|
+
*
|
|
50
|
+
* Default: `true`
|
|
51
|
+
*/
|
|
52
|
+
keepBlobsInJSON?: boolean
|
|
53
|
+
/**
|
|
54
|
+
* Include references in the AST to each node's corresponding CST node.
|
|
55
|
+
*
|
|
56
|
+
* Default: `false`
|
|
57
|
+
*/
|
|
58
|
+
keepCstNodes?: boolean
|
|
59
|
+
/**
|
|
60
|
+
* Store the original node type when parsing documents.
|
|
61
|
+
*
|
|
62
|
+
* Default: `true`
|
|
63
|
+
*/
|
|
64
|
+
keepNodeTypes?: boolean
|
|
65
|
+
/**
|
|
66
|
+
* When outputting JS, use Map rather than Object to represent mappings.
|
|
67
|
+
*
|
|
68
|
+
* Default: `false`
|
|
69
|
+
*/
|
|
70
|
+
mapAsMap?: boolean
|
|
71
|
+
/**
|
|
72
|
+
* Prevent exponential entity expansion attacks by limiting data aliasing count;
|
|
73
|
+
* set to `-1` to disable checks; `0` disallows all alias nodes.
|
|
74
|
+
*
|
|
75
|
+
* Default: `100`
|
|
76
|
+
*/
|
|
77
|
+
maxAliasCount?: number
|
|
78
|
+
/**
|
|
79
|
+
* Include line position & node type directly in errors; drop their verbose source and context.
|
|
80
|
+
*
|
|
81
|
+
* Default: `false`
|
|
82
|
+
*/
|
|
83
|
+
prettyErrors?: boolean
|
|
84
|
+
/**
|
|
85
|
+
* When stringifying, require keys to be scalars and to use implicit rather than explicit notation.
|
|
86
|
+
*
|
|
87
|
+
* Default: `false`
|
|
88
|
+
*/
|
|
89
|
+
simpleKeys?: boolean
|
|
90
|
+
/**
|
|
91
|
+
* The YAML version used by documents without a `%YAML` directive.
|
|
92
|
+
*
|
|
93
|
+
* Default: `"1.2"`
|
|
94
|
+
*/
|
|
95
|
+
version?: '1.0' | '1.1' | '1.2'
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Some customization options are availabe to control the parsing and
|
|
100
|
+
* stringification of scalars. Note that these values are used by all documents.
|
|
101
|
+
*/
|
|
102
|
+
export const scalarOptions: {
|
|
103
|
+
binary: scalarOptions.Binary
|
|
104
|
+
bool: scalarOptions.Bool
|
|
105
|
+
int: scalarOptions.Int
|
|
106
|
+
null: scalarOptions.Null
|
|
107
|
+
str: scalarOptions.Str
|
|
108
|
+
}
|
|
109
|
+
export namespace scalarOptions {
|
|
110
|
+
interface Binary {
|
|
111
|
+
/**
|
|
112
|
+
* The type of string literal used to stringify `!!binary` values.
|
|
113
|
+
*
|
|
114
|
+
* Default: `'BLOCK_LITERAL'`
|
|
115
|
+
*/
|
|
116
|
+
defaultType: Scalar.Type
|
|
117
|
+
/**
|
|
118
|
+
* Maximum line width for `!!binary`.
|
|
119
|
+
*
|
|
120
|
+
* Default: `76`
|
|
121
|
+
*/
|
|
122
|
+
lineWidth: number
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
interface Bool {
|
|
126
|
+
/**
|
|
127
|
+
* String representation for `true`. With the core schema, use `'true' | 'True' | 'TRUE'`.
|
|
128
|
+
*
|
|
129
|
+
* Default: `'true'`
|
|
130
|
+
*/
|
|
131
|
+
trueStr: string
|
|
132
|
+
/**
|
|
133
|
+
* String representation for `false`. With the core schema, use `'false' | 'False' | 'FALSE'`.
|
|
134
|
+
*
|
|
135
|
+
* Default: `'false'`
|
|
136
|
+
*/
|
|
137
|
+
falseStr: string
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface Int {
|
|
141
|
+
/**
|
|
142
|
+
* Whether integers should be parsed into BigInt values.
|
|
143
|
+
*
|
|
144
|
+
* Default: `false`
|
|
145
|
+
*/
|
|
146
|
+
asBigInt: boolean
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
interface Null {
|
|
150
|
+
/**
|
|
151
|
+
* String representation for `null`. With the core schema, use `'null' | 'Null' | 'NULL' | '~' | ''`.
|
|
152
|
+
*
|
|
153
|
+
* Default: `'null'`
|
|
154
|
+
*/
|
|
155
|
+
nullStr: string
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface Str {
|
|
159
|
+
/**
|
|
160
|
+
* The default type of string literal used to stringify values
|
|
161
|
+
*
|
|
162
|
+
* Default: `'PLAIN'`
|
|
163
|
+
*/
|
|
164
|
+
defaultType: Scalar.Type
|
|
165
|
+
doubleQuoted: {
|
|
166
|
+
/**
|
|
167
|
+
* Whether to restrict double-quoted strings to use JSON-compatible syntax.
|
|
168
|
+
*
|
|
169
|
+
* Default: `false`
|
|
170
|
+
*/
|
|
171
|
+
jsonEncoding: boolean
|
|
172
|
+
/**
|
|
173
|
+
* Minimum length to use multiple lines to represent the value.
|
|
174
|
+
*
|
|
175
|
+
* Default: `40`
|
|
176
|
+
*/
|
|
177
|
+
minMultiLineLength: number
|
|
178
|
+
}
|
|
179
|
+
fold: {
|
|
180
|
+
/**
|
|
181
|
+
* Maximum line width (set to `0` to disable folding).
|
|
182
|
+
*
|
|
183
|
+
* Default: `80`
|
|
184
|
+
*/
|
|
185
|
+
lineWidth: number
|
|
186
|
+
/**
|
|
187
|
+
* Minimum width for highly-indented content.
|
|
188
|
+
*
|
|
189
|
+
* Default: `20`
|
|
190
|
+
*/
|
|
191
|
+
minContentWidth: number
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export class Document extends Collection {
|
|
197
|
+
cstNode?: CST.Document
|
|
198
|
+
constructor(options?: Options)
|
|
199
|
+
tag: never
|
|
200
|
+
directivesEndMarker?: boolean
|
|
201
|
+
type: Type.DOCUMENT
|
|
202
|
+
/**
|
|
203
|
+
* Anchors associated with the document's nodes;
|
|
204
|
+
* also provides alias & merge node creators.
|
|
205
|
+
*/
|
|
206
|
+
anchors: Document.Anchors
|
|
207
|
+
/** The document contents. */
|
|
208
|
+
contents: any
|
|
209
|
+
/** Errors encountered during parsing. */
|
|
210
|
+
errors: YAMLError[]
|
|
211
|
+
/**
|
|
212
|
+
* The schema used with the document. Use `setSchema()` to change or
|
|
213
|
+
* initialise.
|
|
214
|
+
*/
|
|
215
|
+
schema?: Schema
|
|
216
|
+
/**
|
|
217
|
+
* Array of prefixes; each will have a string `handle` that
|
|
218
|
+
* starts and ends with `!` and a string `prefix` that the handle will be replaced by.
|
|
219
|
+
*/
|
|
220
|
+
tagPrefixes: Document.TagPrefix[]
|
|
221
|
+
/**
|
|
222
|
+
* The parsed version of the source document;
|
|
223
|
+
* if true-ish, stringified output will include a `%YAML` directive.
|
|
224
|
+
*/
|
|
225
|
+
version?: string
|
|
226
|
+
/** Warnings encountered during parsing. */
|
|
227
|
+
warnings: YAMLWarning[]
|
|
228
|
+
/**
|
|
229
|
+
* List the tags used in the document that are not in the default
|
|
230
|
+
* `tag:yaml.org,2002:` namespace.
|
|
231
|
+
*/
|
|
232
|
+
listNonDefaultTags(): string[]
|
|
233
|
+
/** Parse a CST into this document */
|
|
234
|
+
parse(cst: CST.Document): this
|
|
235
|
+
/**
|
|
236
|
+
* When a document is created with `new YAML.Document()`, the schema object is
|
|
237
|
+
* not set as it may be influenced by parsed directives; call this with no
|
|
238
|
+
* arguments to set it manually, or with arguments to change the schema used
|
|
239
|
+
* by the document.
|
|
240
|
+
**/
|
|
241
|
+
setSchema(
|
|
242
|
+
id?: Options['version'] | Schema.Name,
|
|
243
|
+
customTags?: (Schema.TagId | Schema.Tag)[]
|
|
244
|
+
): void
|
|
245
|
+
/** Set `handle` as a shorthand string for the `prefix` tag namespace. */
|
|
246
|
+
setTagPrefix(handle: string, prefix: string): void
|
|
247
|
+
/**
|
|
248
|
+
* A plain JavaScript representation of the document `contents`.
|
|
249
|
+
*
|
|
250
|
+
* @param arg Used by `JSON.stringify` to indicate the array index or property
|
|
251
|
+
* name. If its value is a `string` and the document `contents` has a scalar
|
|
252
|
+
* value, the `keepBlobsInJSON` option has no effect.
|
|
253
|
+
* @param onAnchor If defined, called with the resolved `value` and reference
|
|
254
|
+
* `count` for each anchor in the document.
|
|
255
|
+
* */
|
|
256
|
+
toJSON(arg?: string, onAnchor?: (value: any, count: number) => void): any
|
|
257
|
+
/** A YAML representation of the document. */
|
|
258
|
+
toString(): string
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export namespace Document {
|
|
262
|
+
interface Parsed extends Document {
|
|
263
|
+
contents: Scalar | YAMLMap | YAMLSeq | null
|
|
264
|
+
/** The schema used with the document. */
|
|
265
|
+
schema: Schema
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
interface Anchors {
|
|
269
|
+
/**
|
|
270
|
+
* Create a new `Alias` node, adding the required anchor for `node`.
|
|
271
|
+
* If `name` is empty, a new anchor name will be generated.
|
|
272
|
+
*/
|
|
273
|
+
createAlias(node: Node, name?: string): Alias
|
|
274
|
+
/**
|
|
275
|
+
* Create a new `Merge` node with the given source nodes.
|
|
276
|
+
* Non-`Alias` sources will be automatically wrapped.
|
|
277
|
+
*/
|
|
278
|
+
createMergePair(...nodes: Node[]): Merge
|
|
279
|
+
/** The anchor name associated with `node`, if set. */
|
|
280
|
+
getName(node: Node): undefined | string
|
|
281
|
+
/** List of all defined anchor names. */
|
|
282
|
+
getNames(): string[]
|
|
283
|
+
/** The node associated with the anchor `name`, if set. */
|
|
284
|
+
getNode(name: string): undefined | Node
|
|
285
|
+
/**
|
|
286
|
+
* Find an available anchor name with the given `prefix` and a
|
|
287
|
+
* numerical suffix.
|
|
288
|
+
*/
|
|
289
|
+
newName(prefix: string): string
|
|
290
|
+
/**
|
|
291
|
+
* Associate an anchor with `node`. If `name` is empty, a new name will be generated.
|
|
292
|
+
* To remove an anchor, use `setAnchor(null, name)`.
|
|
293
|
+
*/
|
|
294
|
+
setAnchor(node: Node | null, name?: string): void | string
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
interface TagPrefix {
|
|
298
|
+
handle: string
|
|
299
|
+
prefix: string
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Recursively turns objects into collections. Generic objects as well as `Map`
|
|
305
|
+
* and its descendants become mappings, while arrays and other iterable objects
|
|
306
|
+
* result in sequences.
|
|
307
|
+
*
|
|
308
|
+
* The primary purpose of this function is to enable attaching comments or other
|
|
309
|
+
* metadata to a value, or to otherwise exert more fine-grained control over the
|
|
310
|
+
* stringified output. To that end, you'll need to assign its return value to
|
|
311
|
+
* the `contents` of a Document (or somewhere within said contents), as the
|
|
312
|
+
* document's schema is required for YAML string output.
|
|
313
|
+
*
|
|
314
|
+
* @param wrapScalars If undefined or `true`, also wraps plain values in
|
|
315
|
+
* `Scalar` objects; if `false` and `value` is not an object, it will be
|
|
316
|
+
* returned directly.
|
|
317
|
+
* @param tag Use to specify the collection type, e.g. `"!!omap"`. Note that
|
|
318
|
+
* this requires the corresponding tag to be available based on the default
|
|
319
|
+
* options. To use a specific document's schema, use `doc.schema.createNode`.
|
|
320
|
+
*/
|
|
321
|
+
export function createNode(
|
|
322
|
+
value: any,
|
|
323
|
+
wrapScalars?: true,
|
|
324
|
+
tag?: string
|
|
325
|
+
): YAMLMap | YAMLSeq | Scalar
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* YAML.createNode recursively turns objects into Map and arrays to Seq collections.
|
|
329
|
+
* Its primary use is to enable attaching comments or other metadata to a value,
|
|
330
|
+
* or to otherwise exert more fine-grained control over the stringified output.
|
|
331
|
+
*
|
|
332
|
+
* Doesn't wrap plain values in Scalar objects.
|
|
333
|
+
*/
|
|
334
|
+
export function createNode(
|
|
335
|
+
value: any,
|
|
336
|
+
wrapScalars: false,
|
|
337
|
+
tag?: string
|
|
338
|
+
): YAMLMap | YAMLSeq | string | number | boolean | null
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Parse an input string into a single YAML.Document.
|
|
342
|
+
*/
|
|
343
|
+
export function parseDocument(str: string, options?: Options): Document.Parsed
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Parse the input as a stream of YAML documents.
|
|
347
|
+
*
|
|
348
|
+
* Documents should be separated from each other by `...` or `---` marker lines.
|
|
349
|
+
*/
|
|
350
|
+
export function parseAllDocuments(
|
|
351
|
+
str: string,
|
|
352
|
+
options?: Options
|
|
353
|
+
): Document.Parsed[]
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Parse an input string into JavaScript.
|
|
357
|
+
*
|
|
358
|
+
* Only supports input consisting of a single YAML document; for multi-document
|
|
359
|
+
* support you should use `YAML.parseAllDocuments`. May throw on error, and may
|
|
360
|
+
* log warnings using `console.warn`.
|
|
361
|
+
*
|
|
362
|
+
* @param str A string with YAML formatting.
|
|
363
|
+
* @returns The value will match the type of the root value of the parsed YAML
|
|
364
|
+
* document, so Maps become objects, Sequences arrays, and scalars result in
|
|
365
|
+
* nulls, booleans, numbers and strings.
|
|
366
|
+
*/
|
|
367
|
+
export function parse(str: string, options?: Options): any
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @returns Will always include \n as the last character, as is expected of YAML documents.
|
|
371
|
+
*/
|
|
372
|
+
export function stringify(value: any, options?: Options): string
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist').YAML
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "yaml",
|
|
3
|
+
"version": "1.10.2",
|
|
4
|
+
"license": "ISC",
|
|
5
|
+
"author": "Eemeli Aro <eemeli@gmail.com>",
|
|
6
|
+
"repository": "github:eemeli/yaml",
|
|
7
|
+
"description": "JavaScript parser and stringifier for YAML",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"YAML",
|
|
10
|
+
"parser",
|
|
11
|
+
"stringifier"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://eemeli.org/yaml/v1/",
|
|
14
|
+
"files": [
|
|
15
|
+
"browser/",
|
|
16
|
+
"dist/",
|
|
17
|
+
"types/",
|
|
18
|
+
"*.d.ts",
|
|
19
|
+
"*.js",
|
|
20
|
+
"*.mjs",
|
|
21
|
+
"!*config.js"
|
|
22
|
+
],
|
|
23
|
+
"type": "commonjs",
|
|
24
|
+
"main": "./index.js",
|
|
25
|
+
"browser": {
|
|
26
|
+
"./index.js": "./browser/index.js",
|
|
27
|
+
"./map.js": "./browser/map.js",
|
|
28
|
+
"./pair.js": "./browser/pair.js",
|
|
29
|
+
"./parse-cst.js": "./browser/parse-cst.js",
|
|
30
|
+
"./scalar.js": "./browser/scalar.js",
|
|
31
|
+
"./schema.js": "./browser/schema.js",
|
|
32
|
+
"./seq.js": "./browser/seq.js",
|
|
33
|
+
"./types.js": "./browser/types.js",
|
|
34
|
+
"./types.mjs": "./browser/types.js",
|
|
35
|
+
"./types/binary.js": "./browser/types/binary.js",
|
|
36
|
+
"./types/omap.js": "./browser/types/omap.js",
|
|
37
|
+
"./types/pairs.js": "./browser/types/pairs.js",
|
|
38
|
+
"./types/set.js": "./browser/types/set.js",
|
|
39
|
+
"./types/timestamp.js": "./browser/types/timestamp.js",
|
|
40
|
+
"./util.js": "./browser/util.js",
|
|
41
|
+
"./util.mjs": "./browser/util.js"
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": "./index.js",
|
|
45
|
+
"./parse-cst": "./parse-cst.js",
|
|
46
|
+
"./types": [
|
|
47
|
+
{
|
|
48
|
+
"import": "./types.mjs"
|
|
49
|
+
},
|
|
50
|
+
"./types.js"
|
|
51
|
+
],
|
|
52
|
+
"./util": [
|
|
53
|
+
{
|
|
54
|
+
"import": "./util.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./util.js"
|
|
57
|
+
],
|
|
58
|
+
"./": "./"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "npm run build:node && npm run build:browser",
|
|
62
|
+
"build:browser": "rollup -c rollup.browser-config.js",
|
|
63
|
+
"build:node": "rollup -c rollup.node-config.js",
|
|
64
|
+
"clean": "git clean -fdxe node_modules",
|
|
65
|
+
"lint": "eslint src/",
|
|
66
|
+
"prettier": "prettier --write .",
|
|
67
|
+
"start": "cross-env TRACE_LEVEL=log npm run build:node && node -i -e 'YAML=require(\".\")'",
|
|
68
|
+
"test": "jest",
|
|
69
|
+
"test:browsers": "cd playground && npm test",
|
|
70
|
+
"test:dist": "npm run build:node && jest",
|
|
71
|
+
"test:types": "tsc --lib ES2017 --noEmit tests/typings.ts",
|
|
72
|
+
"docs:install": "cd docs-slate && bundle install",
|
|
73
|
+
"docs:deploy": "cd docs-slate && ./deploy.sh",
|
|
74
|
+
"docs": "cd docs-slate && bundle exec middleman server",
|
|
75
|
+
"preversion": "npm test && npm run build",
|
|
76
|
+
"prepublishOnly": "npm run clean && npm test && npm run build"
|
|
77
|
+
},
|
|
78
|
+
"browserslist": "> 0.5%, not dead",
|
|
79
|
+
"prettier": {
|
|
80
|
+
"arrowParens": "avoid",
|
|
81
|
+
"semi": false,
|
|
82
|
+
"singleQuote": true,
|
|
83
|
+
"trailingComma": "none"
|
|
84
|
+
},
|
|
85
|
+
"devDependencies": {
|
|
86
|
+
"@babel/core": "^7.12.10",
|
|
87
|
+
"@babel/plugin-proposal-class-properties": "^7.12.1",
|
|
88
|
+
"@babel/preset-env": "^7.12.11",
|
|
89
|
+
"@rollup/plugin-babel": "^5.2.3",
|
|
90
|
+
"babel-eslint": "^10.1.0",
|
|
91
|
+
"babel-jest": "^26.6.3",
|
|
92
|
+
"babel-plugin-trace": "^1.1.0",
|
|
93
|
+
"common-tags": "^1.8.0",
|
|
94
|
+
"cross-env": "^7.0.3",
|
|
95
|
+
"eslint": "^7.19.0",
|
|
96
|
+
"eslint-config-prettier": "^7.2.0",
|
|
97
|
+
"fast-check": "^2.12.0",
|
|
98
|
+
"jest": "^26.6.3",
|
|
99
|
+
"prettier": "^2.2.1",
|
|
100
|
+
"rollup": "^2.38.2",
|
|
101
|
+
"typescript": "^4.1.3"
|
|
102
|
+
},
|
|
103
|
+
"engines": {
|
|
104
|
+
"node": ">= 6"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Type, YAMLSyntaxError } from './util'
|
|
2
|
+
|
|
3
|
+
export default function parseCST(str: string): ParsedCST
|
|
4
|
+
|
|
5
|
+
export interface ParsedCST extends Array<CST.Document> {
|
|
6
|
+
setOrigRanges(): boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export namespace CST {
|
|
10
|
+
interface Range {
|
|
11
|
+
start: number
|
|
12
|
+
end: number
|
|
13
|
+
origStart?: number
|
|
14
|
+
origEnd?: number
|
|
15
|
+
isEmpty(): boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ParseContext {
|
|
19
|
+
/** Node starts at beginning of line */
|
|
20
|
+
atLineStart: boolean
|
|
21
|
+
/** true if currently in a collection context */
|
|
22
|
+
inCollection: boolean
|
|
23
|
+
/** true if currently in a flow context */
|
|
24
|
+
inFlow: boolean
|
|
25
|
+
/** Current level of indentation */
|
|
26
|
+
indent: number
|
|
27
|
+
/** Start of the current line */
|
|
28
|
+
lineStart: number
|
|
29
|
+
/** The parent of the node */
|
|
30
|
+
parent: Node
|
|
31
|
+
/** Source of the YAML document */
|
|
32
|
+
src: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Node {
|
|
36
|
+
context: ParseContext | null
|
|
37
|
+
/** if not null, indicates a parser failure */
|
|
38
|
+
error: YAMLSyntaxError | null
|
|
39
|
+
/** span of context.src parsed into this node */
|
|
40
|
+
range: Range | null
|
|
41
|
+
valueRange: Range | null
|
|
42
|
+
/** anchors, tags and comments */
|
|
43
|
+
props: Range[]
|
|
44
|
+
/** specific node type */
|
|
45
|
+
type: Type
|
|
46
|
+
/** if non-null, overrides source value */
|
|
47
|
+
value: string | null
|
|
48
|
+
|
|
49
|
+
readonly anchor: string | null
|
|
50
|
+
readonly comment: string | null
|
|
51
|
+
readonly hasComment: boolean
|
|
52
|
+
readonly hasProps: boolean
|
|
53
|
+
readonly jsonLike: boolean
|
|
54
|
+
readonly rangeAsLinePos: null | {
|
|
55
|
+
start: { line: number; col: number }
|
|
56
|
+
end?: { line: number; col: number }
|
|
57
|
+
}
|
|
58
|
+
readonly rawValue: string | null
|
|
59
|
+
readonly tag:
|
|
60
|
+
| null
|
|
61
|
+
| { verbatim: string }
|
|
62
|
+
| { handle: string; suffix: string }
|
|
63
|
+
readonly valueRangeContainsNewline: boolean
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface Alias extends Node {
|
|
67
|
+
type: Type.ALIAS
|
|
68
|
+
/** contain the anchor without the * prefix */
|
|
69
|
+
readonly rawValue: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type Scalar = BlockValue | PlainValue | QuoteValue
|
|
73
|
+
|
|
74
|
+
interface BlockValue extends Node {
|
|
75
|
+
type: Type.BLOCK_FOLDED | Type.BLOCK_LITERAL
|
|
76
|
+
chomping: 'CLIP' | 'KEEP' | 'STRIP'
|
|
77
|
+
blockIndent: number | null
|
|
78
|
+
header: Range
|
|
79
|
+
readonly strValue: string | null
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface BlockFolded extends BlockValue {
|
|
83
|
+
type: Type.BLOCK_FOLDED
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface BlockLiteral extends BlockValue {
|
|
87
|
+
type: Type.BLOCK_LITERAL
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
interface PlainValue extends Node {
|
|
91
|
+
type: Type.PLAIN
|
|
92
|
+
readonly strValue: string | null
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface QuoteValue extends Node {
|
|
96
|
+
type: Type.QUOTE_DOUBLE | Type.QUOTE_SINGLE
|
|
97
|
+
readonly strValue:
|
|
98
|
+
| null
|
|
99
|
+
| string
|
|
100
|
+
| { str: string; errors: YAMLSyntaxError[] }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface QuoteDouble extends QuoteValue {
|
|
104
|
+
type: Type.QUOTE_DOUBLE
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
interface QuoteSingle extends QuoteValue {
|
|
108
|
+
type: Type.QUOTE_SINGLE
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface Comment extends Node {
|
|
112
|
+
type: Type.COMMENT
|
|
113
|
+
readonly anchor: null
|
|
114
|
+
readonly comment: string
|
|
115
|
+
readonly rawValue: null
|
|
116
|
+
readonly tag: null
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface BlankLine extends Node {
|
|
120
|
+
type: Type.BLANK_LINE
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
interface MapItem extends Node {
|
|
124
|
+
type: Type.MAP_KEY | Type.MAP_VALUE
|
|
125
|
+
node: ContentNode | null
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface MapKey extends MapItem {
|
|
129
|
+
type: Type.MAP_KEY
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface MapValue extends MapItem {
|
|
133
|
+
type: Type.MAP_VALUE
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface Map extends Node {
|
|
137
|
+
type: Type.MAP
|
|
138
|
+
/** implicit keys are not wrapped */
|
|
139
|
+
items: Array<BlankLine | Comment | Alias | Scalar | MapItem>
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface SeqItem extends Node {
|
|
143
|
+
type: Type.SEQ_ITEM
|
|
144
|
+
node: ContentNode | null
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface Seq extends Node {
|
|
148
|
+
type: Type.SEQ
|
|
149
|
+
items: Array<BlankLine | Comment | SeqItem>
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface FlowChar {
|
|
153
|
+
char: '{' | '}' | '[' | ']' | ',' | '?' | ':'
|
|
154
|
+
offset: number
|
|
155
|
+
origOffset?: number
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface FlowCollection extends Node {
|
|
159
|
+
type: Type.FLOW_MAP | Type.FLOW_SEQ
|
|
160
|
+
items: Array<
|
|
161
|
+
FlowChar | BlankLine | Comment | Alias | Scalar | FlowCollection
|
|
162
|
+
>
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface FlowMap extends FlowCollection {
|
|
166
|
+
type: Type.FLOW_MAP
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
interface FlowSeq extends FlowCollection {
|
|
170
|
+
type: Type.FLOW_SEQ
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
type ContentNode = Alias | Scalar | Map | Seq | FlowCollection
|
|
174
|
+
|
|
175
|
+
interface Directive extends Node {
|
|
176
|
+
type: Type.DIRECTIVE
|
|
177
|
+
name: string
|
|
178
|
+
readonly anchor: null
|
|
179
|
+
readonly parameters: string[]
|
|
180
|
+
readonly tag: null
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface Document extends Node {
|
|
184
|
+
type: Type.DOCUMENT
|
|
185
|
+
directives: Array<BlankLine | Comment | Directive>
|
|
186
|
+
contents: Array<BlankLine | Comment | ContentNode>
|
|
187
|
+
readonly anchor: null
|
|
188
|
+
readonly comment: null
|
|
189
|
+
readonly tag: null
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/parse-cst').parse
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const types = require('./dist/types')
|
|
2
|
+
const util = require('./dist/util')
|
|
3
|
+
|
|
4
|
+
module.exports = types.Schema
|
|
5
|
+
module.exports.nullOptions = types.nullOptions
|
|
6
|
+
module.exports.strOptions = types.strOptions
|
|
7
|
+
module.exports.stringify = util.stringifyString
|
|
8
|
+
|
|
9
|
+
require('./dist/legacy-exports').warnFileDeprecation(__filename)
|