@cdklabs/cdk-cicd-wrapper 0.2.15 → 0.2.17
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/.eslintrc.js +1 -1
- package/.jsii +6 -6
- package/lib/code-pipeline/AppStage.js +1 -1
- package/lib/code-pipeline/CDKPipeline.js +1 -1
- package/lib/code-pipeline/PostDeployBuildStep.js +1 -1
- package/lib/code-pipeline/PreDeployBuildStep.js +1 -1
- package/lib/common/spi/ResourceContext.js +1 -1
- package/lib/common/types/BaseStackProvider.js +1 -1
- package/lib/common/types/DefaultStackProvider.js +1 -1
- package/lib/common/types/Types.js +2 -2
- package/lib/constructs/CodeCommitRepositoryConstruct.js +1 -1
- package/lib/constructs/CodeStarConnectionConstruct.js +1 -1
- package/lib/plugins/index.js +1 -1
- package/lib/plugins/optimization/DestroyEncryptionKeysOnDeletePlugin.js +1 -1
- package/lib/plugins/pipeline/GitHubPipelinePlugin.js +1 -1
- package/lib/plugins/security/AccessLogsForBucketPlugin.js +1 -1
- package/lib/plugins/security/DisablePublicIPAssignmentForEC2Plugin.js +1 -1
- package/lib/plugins/security/EncryptBucketOnTransitPlugin.js +1 -1
- package/lib/plugins/security/EncryptCloudWatchLogGroupsPlugin.js +1 -1
- package/lib/plugins/security/EncryptSNSTopicOnTransitPlugin.js +1 -1
- package/lib/plugins/security/LambdaDLQPlugin.js +1 -1
- package/lib/plugins/security/RotateEncryptionKeysPlugin.js +1 -1
- package/lib/plugins/utils/CodeArtifactPlugin.js +1 -1
- package/lib/resource-providers/CIDefinitionProvider.js +2 -2
- package/lib/resource-providers/CodeBuildFactoryProvider.js +2 -2
- package/lib/resource-providers/ComplianceBucketProvider.js +1 -1
- package/lib/resource-providers/EncryptionProvider.js +1 -1
- package/lib/resource-providers/HooksProvider.js +2 -2
- package/lib/resource-providers/LoggingProvider.js +1 -1
- package/lib/resource-providers/ParameterProvider.js +1 -1
- package/lib/resource-providers/PhaseCommandProvider.js +6 -6
- package/lib/resource-providers/ProxyProvider.js +1 -1
- package/lib/resource-providers/RepositoryProvider.js +4 -4
- package/lib/resource-providers/StageProvider.js +1 -1
- package/lib/resource-providers/VPCProvider.js +1 -1
- package/lib/stacks/CodeStarConnectRepositoryStack.js +1 -1
- package/lib/stacks/EncryptionStack.js +1 -1
- package/lib/stacks/PipelineBlueprint.js +2 -2
- package/lib/stacks/PostDeployExecutorStack.js +1 -1
- package/lib/stacks/SSMParameterStack.js +1 -1
- package/lib/stacks/compliance-bucket/ComplianceBucketStack.js +1 -1
- package/lib/stacks/vpc/ManagedVPCStack.js +1 -1
- package/lib/stacks/vpc/NoVPCStack.js +1 -1
- package/lib/stacks/vpc/VPCFromLookUpStack.js +1 -1
- package/lib/utils/ParameterResolver.js +1 -1
- package/node_modules/yaml/README.md +44 -11
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +1 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +10 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +14 -8
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +2 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +2 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +4 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +1 -1
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +1 -5
- package/node_modules/yaml/browser/dist/doc/Document.js +3 -2
- package/node_modules/yaml/browser/dist/log.js +1 -4
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +7 -49
- package/node_modules/yaml/browser/dist/public-api.js +3 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +1 -2
- package/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
- package/node_modules/yaml/browser/dist/schema/tags.js +26 -13
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +2 -11
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +2 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/node_modules/yaml/browser/dist/stringify/stringify.js +6 -1
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +20 -11
- package/node_modules/yaml/browser/dist/util.js +1 -1
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +4 -4
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -6
- package/node_modules/yaml/dist/compose/compose-doc.js +1 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +8 -7
- package/node_modules/yaml/dist/compose/compose-node.js +10 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +4 -4
- package/node_modules/yaml/dist/compose/compose-scalar.js +13 -7
- package/node_modules/yaml/dist/compose/composer.d.ts +7 -6
- package/node_modules/yaml/dist/compose/composer.js +2 -1
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +5 -5
- package/node_modules/yaml/dist/compose/resolve-block-map.js +2 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +5 -5
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -5
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +2 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +2 -2
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -7
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +4 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +4 -4
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -2
- package/node_modules/yaml/dist/compose/resolve-props.js +1 -1
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +1 -1
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +1 -1
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +2 -2
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
- package/node_modules/yaml/dist/compose/util-map-includes.js +1 -5
- package/node_modules/yaml/dist/doc/Document.d.ts +11 -11
- package/node_modules/yaml/dist/doc/Document.js +3 -2
- package/node_modules/yaml/dist/doc/anchors.d.ts +2 -2
- package/node_modules/yaml/dist/doc/createNode.d.ts +4 -4
- package/node_modules/yaml/dist/doc/directives.d.ts +1 -1
- package/node_modules/yaml/dist/errors.d.ts +1 -1
- package/node_modules/yaml/dist/index.d.ts +21 -18
- package/node_modules/yaml/dist/log.js +4 -2
- package/node_modules/yaml/dist/nodes/Alias.d.ts +9 -8
- package/node_modules/yaml/dist/nodes/Collection.d.ts +4 -4
- package/node_modules/yaml/dist/nodes/Node.d.ts +15 -9
- package/node_modules/yaml/dist/nodes/Pair.d.ts +9 -8
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +4 -3
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +10 -10
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +10 -10
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -3
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +6 -48
- package/node_modules/yaml/dist/nodes/identity.d.ts +7 -7
- package/node_modules/yaml/dist/nodes/toJS.d.ts +2 -2
- package/node_modules/yaml/dist/options.d.ts +16 -10
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +4 -4
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +1 -1
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
- package/node_modules/yaml/dist/parse/cst.d.ts +4 -3
- package/node_modules/yaml/dist/parse/lexer.d.ts +1 -1
- package/node_modules/yaml/dist/parse/parser.d.ts +4 -4
- package/node_modules/yaml/dist/parse/parser.js +2 -1
- package/node_modules/yaml/dist/public-api.d.ts +6 -5
- package/node_modules/yaml/dist/public-api.js +3 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +4 -5
- package/node_modules/yaml/dist/schema/Schema.js +1 -2
- package/node_modules/yaml/dist/schema/common/map.d.ts +1 -1
- package/node_modules/yaml/dist/schema/common/null.d.ts +1 -1
- package/node_modules/yaml/dist/schema/common/seq.d.ts +1 -1
- package/node_modules/yaml/dist/schema/common/string.d.ts +1 -1
- package/node_modules/yaml/dist/schema/core/bool.d.ts +1 -1
- package/node_modules/yaml/dist/schema/core/float.d.ts +1 -1
- package/node_modules/yaml/dist/schema/core/int.d.ts +1 -1
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
- package/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
- package/node_modules/yaml/dist/schema/json/schema.js +1 -1
- package/node_modules/yaml/dist/schema/tags.d.ts +11 -3
- package/node_modules/yaml/dist/schema/tags.js +26 -13
- package/node_modules/yaml/dist/schema/types.d.ts +14 -12
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +6 -5
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +11 -17
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +7 -7
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +9 -9
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +1 -1
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
- package/node_modules/yaml/dist/stringify/stringify.d.ts +3 -3
- package/node_modules/yaml/dist/stringify/stringify.js +6 -1
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -2
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -3
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +1 -1
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +2 -2
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +2 -2
- package/node_modules/yaml/dist/stringify/stringifyString.js +20 -11
- package/node_modules/yaml/dist/util.d.ts +16 -12
- package/node_modules/yaml/dist/util.js +2 -2
- package/node_modules/yaml/dist/visit.d.ts +7 -7
- package/node_modules/yaml/package.json +4 -4
- package/package.json +13 -13
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CreateNodeContext } from '../doc/createNode
|
|
2
|
-
import type { BlockSequence, FlowCollection } from '../parse/cst
|
|
3
|
-
import type { Schema } from '../schema/Schema
|
|
4
|
-
import type { StringifyContext } from '../stringify/stringify
|
|
5
|
-
import { Collection } from './Collection
|
|
6
|
-
import type { ParsedNode, Range } from './Node
|
|
7
|
-
import type { Pair } from './Pair
|
|
8
|
-
import { Scalar } from './Scalar
|
|
9
|
-
import { ToJSContext } from './toJS
|
|
1
|
+
import type { CreateNodeContext } from '../doc/createNode';
|
|
2
|
+
import type { BlockSequence, FlowCollection } from '../parse/cst';
|
|
3
|
+
import type { Schema } from '../schema/Schema';
|
|
4
|
+
import type { StringifyContext } from '../stringify/stringify';
|
|
5
|
+
import { Collection } from './Collection';
|
|
6
|
+
import type { ParsedNode, Range } from './Node';
|
|
7
|
+
import type { Pair } from './Pair';
|
|
8
|
+
import type { Scalar } from './Scalar';
|
|
9
|
+
import type { ToJSContext } from './toJS';
|
|
10
10
|
export declare namespace YAMLSeq {
|
|
11
11
|
interface Parsed<T extends ParsedNode | Pair<ParsedNode, ParsedNode | null> = ParsedNode> extends YAMLSeq<T> {
|
|
12
12
|
items: T[];
|
|
@@ -56,5 +56,5 @@ export declare class YAMLSeq<T = unknown> extends Collection {
|
|
|
56
56
|
set(key: unknown, value: T): void;
|
|
57
57
|
toJSON(_?: unknown, ctx?: ToJSContext): unknown[];
|
|
58
58
|
toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
|
|
59
|
-
static from(schema: Schema, obj: unknown, ctx: CreateNodeContext): YAMLSeq
|
|
59
|
+
static from(schema: Schema, obj: unknown, ctx: CreateNodeContext): YAMLSeq;
|
|
60
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Pair } from './Pair
|
|
2
|
-
import { ToJSContext } from './toJS
|
|
3
|
-
import type { MapLike } from './YAMLMap
|
|
1
|
+
import type { Pair } from './Pair';
|
|
2
|
+
import type { ToJSContext } from './toJS';
|
|
3
|
+
import type { MapLike } from './YAMLMap';
|
|
4
4
|
export declare function addPairToJSMap(ctx: ToJSContext | undefined, map: MapLike, { key, value }: Pair): MapLike;
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var log = require('../log.js');
|
|
4
|
+
var merge = require('../schema/yaml-1.1/merge.js');
|
|
4
5
|
var stringify = require('../stringify/stringify.js');
|
|
5
6
|
var identity = require('./identity.js');
|
|
6
|
-
var Scalar = require('./Scalar.js');
|
|
7
7
|
var toJS = require('./toJS.js');
|
|
8
8
|
|
|
9
|
-
const MERGE_KEY = '<<';
|
|
10
9
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
else if (Array.isArray(value))
|
|
17
|
-
for (const it of value)
|
|
18
|
-
mergeToJSMap(ctx, map, it);
|
|
19
|
-
else
|
|
20
|
-
mergeToJSMap(ctx, map, value);
|
|
21
|
-
}
|
|
10
|
+
if (identity.isNode(key) && key.addToJSMap)
|
|
11
|
+
key.addToJSMap(ctx, map, value);
|
|
12
|
+
// TODO: Should drop this special case for bare << handling
|
|
13
|
+
else if (merge.isMergeKey(ctx, key))
|
|
14
|
+
merge.addMergeToJSMap(ctx, map, value);
|
|
22
15
|
else {
|
|
23
16
|
const jsKey = toJS.toJS(key, '', ctx);
|
|
24
17
|
if (map instanceof Map) {
|
|
@@ -43,41 +36,6 @@ function addPairToJSMap(ctx, map, { key, value }) {
|
|
|
43
36
|
}
|
|
44
37
|
return map;
|
|
45
38
|
}
|
|
46
|
-
const isMergeKey = (key) => key === MERGE_KEY ||
|
|
47
|
-
(identity.isScalar(key) &&
|
|
48
|
-
key.value === MERGE_KEY &&
|
|
49
|
-
(!key.type || key.type === Scalar.Scalar.PLAIN));
|
|
50
|
-
// If the value associated with a merge key is a single mapping node, each of
|
|
51
|
-
// its key/value pairs is inserted into the current mapping, unless the key
|
|
52
|
-
// already exists in it. If the value associated with the merge key is a
|
|
53
|
-
// sequence, then this sequence is expected to contain mapping nodes and each
|
|
54
|
-
// of these nodes is merged in turn according to its order in the sequence.
|
|
55
|
-
// Keys in mapping nodes earlier in the sequence override keys specified in
|
|
56
|
-
// later mapping nodes. -- http://yaml.org/type/merge.html
|
|
57
|
-
function mergeToJSMap(ctx, map, value) {
|
|
58
|
-
const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
|
|
59
|
-
if (!identity.isMap(source))
|
|
60
|
-
throw new Error('Merge sources must be maps or map aliases');
|
|
61
|
-
const srcMap = source.toJSON(null, ctx, Map);
|
|
62
|
-
for (const [key, value] of srcMap) {
|
|
63
|
-
if (map instanceof Map) {
|
|
64
|
-
if (!map.has(key))
|
|
65
|
-
map.set(key, value);
|
|
66
|
-
}
|
|
67
|
-
else if (map instanceof Set) {
|
|
68
|
-
map.add(key);
|
|
69
|
-
}
|
|
70
|
-
else if (!Object.prototype.hasOwnProperty.call(map, key)) {
|
|
71
|
-
Object.defineProperty(map, key, {
|
|
72
|
-
value,
|
|
73
|
-
writable: true,
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return map;
|
|
80
|
-
}
|
|
81
39
|
function stringifyKey(key, jsKey, ctx) {
|
|
82
40
|
if (jsKey === null)
|
|
83
41
|
return '';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Document } from '../doc/Document
|
|
2
|
-
import type { Alias } from './Alias
|
|
3
|
-
import type { Node } from './Node
|
|
4
|
-
import type { Pair } from './Pair
|
|
5
|
-
import type { Scalar } from './Scalar
|
|
6
|
-
import type { YAMLMap } from './YAMLMap
|
|
7
|
-
import type { YAMLSeq } from './YAMLSeq
|
|
1
|
+
import type { Document } from '../doc/Document';
|
|
2
|
+
import type { Alias } from './Alias';
|
|
3
|
+
import type { Node } from './Node';
|
|
4
|
+
import type { Pair } from './Pair';
|
|
5
|
+
import type { Scalar } from './Scalar';
|
|
6
|
+
import type { YAMLMap } from './YAMLMap';
|
|
7
|
+
import type { YAMLSeq } from './YAMLSeq';
|
|
8
8
|
export declare const ALIAS: unique symbol;
|
|
9
9
|
export declare const DOC: unique symbol;
|
|
10
10
|
export declare const MAP: unique symbol;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Reviver } from './doc/applyReviver
|
|
2
|
-
import type { Directives } from './doc/directives
|
|
3
|
-
import type { LogLevelId } from './log
|
|
4
|
-
import type { ParsedNode } from './nodes/Node
|
|
5
|
-
import type { Pair } from './nodes/Pair
|
|
6
|
-
import type { Scalar } from './nodes/Scalar
|
|
7
|
-
import type { LineCounter } from './parse/line-counter
|
|
8
|
-
import type { Schema } from './schema/Schema
|
|
9
|
-
import type { Tags } from './schema/tags
|
|
10
|
-
import type { CollectionTag, ScalarTag } from './schema/types
|
|
1
|
+
import type { Reviver } from './doc/applyReviver';
|
|
2
|
+
import type { Directives } from './doc/directives';
|
|
3
|
+
import type { LogLevelId } from './log';
|
|
4
|
+
import type { ParsedNode } from './nodes/Node';
|
|
5
|
+
import type { Pair } from './nodes/Pair';
|
|
6
|
+
import type { Scalar } from './nodes/Scalar';
|
|
7
|
+
import type { LineCounter } from './parse/line-counter';
|
|
8
|
+
import type { Schema } from './schema/Schema';
|
|
9
|
+
import type { Tags } from './schema/tags';
|
|
10
|
+
import type { CollectionTag, ScalarTag } from './schema/types';
|
|
11
11
|
export type ParseOptions = {
|
|
12
12
|
/**
|
|
13
13
|
* Whether integers should be parsed into BigInt rather than number values.
|
|
@@ -42,6 +42,12 @@ export type ParseOptions = {
|
|
|
42
42
|
* Default: `true`
|
|
43
43
|
*/
|
|
44
44
|
strict?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Parse all mapping keys as strings. Treat all non-scalar keys as errors.
|
|
47
|
+
*
|
|
48
|
+
* Default: `false`
|
|
49
|
+
*/
|
|
50
|
+
stringKeys?: boolean;
|
|
45
51
|
/**
|
|
46
52
|
* YAML requires map keys to be unique. By default, this is checked by
|
|
47
53
|
* comparing scalar values with `===`; deep equality is not checked for
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ErrorCode } from '../errors
|
|
2
|
-
import { Range } from '../nodes/Node
|
|
3
|
-
import type { Scalar } from '../nodes/Scalar
|
|
4
|
-
import type { BlockScalar, FlowScalar, SourceToken, Token } from './cst
|
|
1
|
+
import type { ErrorCode } from '../errors';
|
|
2
|
+
import type { Range } from '../nodes/Node';
|
|
3
|
+
import type { Scalar } from '../nodes/Scalar';
|
|
4
|
+
import type { BlockScalar, FlowScalar, SourceToken, Token } from './cst';
|
|
5
5
|
/**
|
|
6
6
|
* If `token` is a CST flow or block scalar, determine its string value and a few other attributes.
|
|
7
7
|
* Otherwise, return `null`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectionItem, Document } from './cst
|
|
1
|
+
import type { BlockMap, BlockSequence, CollectionItem, Document, FlowCollection } from './cst';
|
|
2
2
|
export type VisitPath = readonly ['key' | 'value', number][];
|
|
3
3
|
export type Visitor = (item: CollectionItem, path: VisitPath) => number | symbol | Visitor | void;
|
|
4
4
|
/**
|
|
@@ -35,5 +35,5 @@ export declare namespace visit {
|
|
|
35
35
|
var SKIP: symbol;
|
|
36
36
|
var REMOVE: symbol;
|
|
37
37
|
var itemAtPath: (cst: Document | CollectionItem, path: VisitPath) => CollectionItem | undefined;
|
|
38
|
-
var parentCollection: (cst: Document | CollectionItem, path: VisitPath) =>
|
|
38
|
+
var parentCollection: (cst: Document | CollectionItem, path: VisitPath) => BlockMap | BlockSequence | FlowCollection;
|
|
39
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { createScalarToken, resolveAsScalar, setScalarValue } from './cst-scalar
|
|
2
|
-
export { stringify } from './cst-stringify
|
|
3
|
-
export {
|
|
1
|
+
export { createScalarToken, resolveAsScalar, setScalarValue } from './cst-scalar';
|
|
2
|
+
export { stringify } from './cst-stringify';
|
|
3
|
+
export type { Visitor, VisitPath } from './cst-visit';
|
|
4
|
+
export { visit } from './cst-visit';
|
|
4
5
|
export interface SourceToken {
|
|
5
6
|
type: 'byte-order-mark' | 'doc-mode' | 'doc-start' | 'space' | 'comment' | 'newline' | 'directive-line' | 'anchor' | 'tag' | 'seq-item-ind' | 'explicit-key-ind' | 'map-value-ind' | 'flow-map-start' | 'flow-map-end' | 'flow-seq-start' | 'flow-seq-end' | 'flow-error-end' | 'comma' | 'block-scalar-header';
|
|
6
7
|
offset: number;
|
|
@@ -59,7 +59,7 @@ export declare class Lexer {
|
|
|
59
59
|
*
|
|
60
60
|
* @returns A generator of lexical tokens
|
|
61
61
|
*/
|
|
62
|
-
lex(source: string, incomplete?: boolean): Generator<string, void
|
|
62
|
+
lex(source: string, incomplete?: boolean): Generator<string, void>;
|
|
63
63
|
private atLineEnd;
|
|
64
64
|
private charAt;
|
|
65
65
|
private continueScalar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Token } from './cst
|
|
1
|
+
import type { Token } from './cst';
|
|
2
2
|
/**
|
|
3
3
|
* A YAML concrete syntax tree (CST) parser
|
|
4
4
|
*
|
|
@@ -57,14 +57,14 @@ export declare class Parser {
|
|
|
57
57
|
*
|
|
58
58
|
* @returns A generator of tokens representing each directive, document, and other structure.
|
|
59
59
|
*/
|
|
60
|
-
parse(source: string, incomplete?: boolean): Generator<Token, void
|
|
60
|
+
parse(source: string, incomplete?: boolean): Generator<Token, void>;
|
|
61
61
|
/**
|
|
62
62
|
* Advance the parser by the `source` of one lexical token.
|
|
63
63
|
*/
|
|
64
|
-
next(source: string): Generator<Token, void
|
|
64
|
+
next(source: string): Generator<Token, void>;
|
|
65
65
|
private lexer;
|
|
66
66
|
/** Call at end of input to push out any remaining constructions */
|
|
67
|
-
end(): Generator<Token, void
|
|
67
|
+
end(): Generator<Token, void>;
|
|
68
68
|
private get sourceToken();
|
|
69
69
|
private step;
|
|
70
70
|
private peek;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var node_process = require('node:process');
|
|
3
4
|
var cst = require('./cst.js');
|
|
4
5
|
var lexer = require('./lexer.js');
|
|
5
6
|
|
|
@@ -166,7 +167,7 @@ class Parser {
|
|
|
166
167
|
*/
|
|
167
168
|
*next(source) {
|
|
168
169
|
this.source = source;
|
|
169
|
-
if (
|
|
170
|
+
if (node_process.env.LOG_TOKENS)
|
|
170
171
|
console.log('|', cst.prettyToken(source));
|
|
171
172
|
if (this.atScalar) {
|
|
172
173
|
this.atScalar = false;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Composer } from './compose/composer
|
|
2
|
-
import type { Reviver } from './doc/applyReviver
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import type {
|
|
1
|
+
import { Composer } from './compose/composer';
|
|
2
|
+
import type { Reviver } from './doc/applyReviver';
|
|
3
|
+
import type { Replacer } from './doc/Document';
|
|
4
|
+
import { Document } from './doc/Document';
|
|
5
|
+
import type { Node, ParsedNode } from './nodes/Node';
|
|
6
|
+
import type { CreateNodeOptions, DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions, ToStringOptions } from './options';
|
|
6
7
|
export interface EmptyStream extends Array<Document.Parsed>, ReturnType<Composer['streamInfo']> {
|
|
7
8
|
empty: true;
|
|
8
9
|
}
|
|
@@ -4,6 +4,7 @@ var composer = require('./compose/composer.js');
|
|
|
4
4
|
var Document = require('./doc/Document.js');
|
|
5
5
|
var errors = require('./errors.js');
|
|
6
6
|
var log = require('./log.js');
|
|
7
|
+
var identity = require('./nodes/identity.js');
|
|
7
8
|
var lineCounter = require('./parse/line-counter.js');
|
|
8
9
|
var parser = require('./parse/parser.js');
|
|
9
10
|
|
|
@@ -95,6 +96,8 @@ function stringify(value, replacer, options) {
|
|
|
95
96
|
if (!keepUndefined)
|
|
96
97
|
return undefined;
|
|
97
98
|
}
|
|
99
|
+
if (identity.isDocument(value) && !_replacer)
|
|
100
|
+
return value.toString(options);
|
|
98
101
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
99
102
|
}
|
|
100
103
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { MAP, SCALAR, SEQ } from '../nodes/identity
|
|
2
|
-
import type { Pair } from '../nodes/Pair
|
|
3
|
-
import type { SchemaOptions, ToStringOptions } from '../options
|
|
4
|
-
import type { CollectionTag, ScalarTag } from './types
|
|
1
|
+
import { MAP, SCALAR, SEQ } from '../nodes/identity';
|
|
2
|
+
import type { Pair } from '../nodes/Pair';
|
|
3
|
+
import type { SchemaOptions, ToStringOptions } from '../options';
|
|
4
|
+
import type { CollectionTag, ScalarTag } from './types';
|
|
5
5
|
export declare class Schema {
|
|
6
6
|
compat: Array<CollectionTag | ScalarTag> | null;
|
|
7
7
|
knownTags: Record<string, CollectionTag | ScalarTag>;
|
|
8
|
-
merge: boolean;
|
|
9
8
|
name: string;
|
|
10
9
|
sortMapEntries: ((a: Pair, b: Pair) => number) | null;
|
|
11
10
|
tags: Array<CollectionTag | ScalarTag>;
|
|
@@ -14,10 +14,9 @@ class Schema {
|
|
|
14
14
|
: compat
|
|
15
15
|
? tags.getTags(null, compat)
|
|
16
16
|
: null;
|
|
17
|
-
this.merge = !!merge;
|
|
18
17
|
this.name = (typeof schema === 'string' && schema) || 'core';
|
|
19
18
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
20
|
-
this.tags = tags.getTags(customTags, this.name);
|
|
19
|
+
this.tags = tags.getTags(customTags, this.name, merge);
|
|
21
20
|
this.toStringOptions = toStringDefaults ?? null;
|
|
22
21
|
Object.defineProperty(this, identity.MAP, { value: map.map });
|
|
23
22
|
Object.defineProperty(this, identity.SCALAR, { value: string.string });
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CollectionTag } from '../types
|
|
1
|
+
import type { CollectionTag } from '../types';
|
|
2
2
|
export declare const map: CollectionTag;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CollectionTag } from '../types
|
|
1
|
+
import type { CollectionTag } from '../types';
|
|
2
2
|
export declare const seq: CollectionTag;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ScalarTag } from '../types
|
|
1
|
+
import type { ScalarTag } from '../types';
|
|
2
2
|
export declare const string: ScalarTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const schema: (import(
|
|
1
|
+
export declare const schema: (import('../types').CollectionTag | import('../types').ScalarTag)[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CollectionTag, ScalarTag } from '../types
|
|
1
|
+
import type { CollectionTag, ScalarTag } from '../types';
|
|
2
2
|
export declare const schema: (CollectionTag | ScalarTag)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SchemaOptions } from '../options
|
|
2
|
-
import type { CollectionTag, ScalarTag } from './types
|
|
1
|
+
import type { SchemaOptions } from '../options';
|
|
2
|
+
import type { CollectionTag, ScalarTag } from './types';
|
|
3
3
|
declare const tagsByName: {
|
|
4
4
|
binary: ScalarTag;
|
|
5
5
|
bool: ScalarTag & {
|
|
@@ -14,6 +14,10 @@ declare const tagsByName: {
|
|
|
14
14
|
intOct: ScalarTag;
|
|
15
15
|
intTime: ScalarTag;
|
|
16
16
|
map: CollectionTag;
|
|
17
|
+
merge: ScalarTag & {
|
|
18
|
+
identify(value: unknown): boolean;
|
|
19
|
+
test: RegExp;
|
|
20
|
+
};
|
|
17
21
|
null: ScalarTag & {
|
|
18
22
|
test: RegExp;
|
|
19
23
|
};
|
|
@@ -29,6 +33,10 @@ export type TagId = keyof typeof tagsByName;
|
|
|
29
33
|
export type Tags = Array<ScalarTag | CollectionTag | TagId>;
|
|
30
34
|
export declare const coreKnownTags: {
|
|
31
35
|
'tag:yaml.org,2002:binary': ScalarTag;
|
|
36
|
+
'tag:yaml.org,2002:merge': ScalarTag & {
|
|
37
|
+
identify(value: unknown): boolean;
|
|
38
|
+
test: RegExp;
|
|
39
|
+
};
|
|
32
40
|
'tag:yaml.org,2002:omap': CollectionTag;
|
|
33
41
|
'tag:yaml.org,2002:pairs': CollectionTag;
|
|
34
42
|
'tag:yaml.org,2002:set': CollectionTag;
|
|
@@ -36,5 +44,5 @@ export declare const coreKnownTags: {
|
|
|
36
44
|
test: RegExp;
|
|
37
45
|
};
|
|
38
46
|
};
|
|
39
|
-
export declare function getTags(customTags: SchemaOptions['customTags'] | undefined, schemaName: string): (CollectionTag | ScalarTag)[];
|
|
47
|
+
export declare function getTags(customTags: SchemaOptions['customTags'] | undefined, schemaName: string, addMergeTag?: boolean): (CollectionTag | ScalarTag)[];
|
|
40
48
|
export {};
|
|
@@ -10,6 +10,7 @@ var int = require('./core/int.js');
|
|
|
10
10
|
var schema = require('./core/schema.js');
|
|
11
11
|
var schema$1 = require('./json/schema.js');
|
|
12
12
|
var binary = require('./yaml-1.1/binary.js');
|
|
13
|
+
var merge = require('./yaml-1.1/merge.js');
|
|
13
14
|
var omap = require('./yaml-1.1/omap.js');
|
|
14
15
|
var pairs = require('./yaml-1.1/pairs.js');
|
|
15
16
|
var schema$2 = require('./yaml-1.1/schema.js');
|
|
@@ -35,6 +36,7 @@ const tagsByName = {
|
|
|
35
36
|
intOct: int.intOct,
|
|
36
37
|
intTime: timestamp.intTime,
|
|
37
38
|
map: map.map,
|
|
39
|
+
merge: merge.merge,
|
|
38
40
|
null: _null.nullTag,
|
|
39
41
|
omap: omap.omap,
|
|
40
42
|
pairs: pairs.pairs,
|
|
@@ -44,13 +46,20 @@ const tagsByName = {
|
|
|
44
46
|
};
|
|
45
47
|
const coreKnownTags = {
|
|
46
48
|
'tag:yaml.org,2002:binary': binary.binary,
|
|
49
|
+
'tag:yaml.org,2002:merge': merge.merge,
|
|
47
50
|
'tag:yaml.org,2002:omap': omap.omap,
|
|
48
51
|
'tag:yaml.org,2002:pairs': pairs.pairs,
|
|
49
52
|
'tag:yaml.org,2002:set': set.set,
|
|
50
53
|
'tag:yaml.org,2002:timestamp': timestamp.timestamp
|
|
51
54
|
};
|
|
52
|
-
function getTags(customTags, schemaName) {
|
|
53
|
-
|
|
55
|
+
function getTags(customTags, schemaName, addMergeTag) {
|
|
56
|
+
const schemaTags = schemas.get(schemaName);
|
|
57
|
+
if (schemaTags && !customTags) {
|
|
58
|
+
return addMergeTag && !schemaTags.includes(merge.merge)
|
|
59
|
+
? schemaTags.concat(merge.merge)
|
|
60
|
+
: schemaTags.slice();
|
|
61
|
+
}
|
|
62
|
+
let tags = schemaTags;
|
|
54
63
|
if (!tags) {
|
|
55
64
|
if (Array.isArray(customTags))
|
|
56
65
|
tags = [];
|
|
@@ -69,17 +78,21 @@ function getTags(customTags, schemaName) {
|
|
|
69
78
|
else if (typeof customTags === 'function') {
|
|
70
79
|
tags = customTags(tags.slice());
|
|
71
80
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const tagObj = tagsByName[tag];
|
|
76
|
-
if (tagObj)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
if (addMergeTag)
|
|
82
|
+
tags = tags.concat(merge.merge);
|
|
83
|
+
return tags.reduce((tags, tag) => {
|
|
84
|
+
const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
|
|
85
|
+
if (!tagObj) {
|
|
86
|
+
const tagName = JSON.stringify(tag);
|
|
87
|
+
const keys = Object.keys(tagsByName)
|
|
88
|
+
.map(key => JSON.stringify(key))
|
|
89
|
+
.join(', ');
|
|
90
|
+
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
|
91
|
+
}
|
|
92
|
+
if (!tags.includes(tagObj))
|
|
93
|
+
tags.push(tagObj);
|
|
94
|
+
return tags;
|
|
95
|
+
}, []);
|
|
83
96
|
}
|
|
84
97
|
|
|
85
98
|
exports.coreKnownTags = coreKnownTags;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import type { CreateNodeContext } from '../doc/createNode
|
|
2
|
-
import type { Node } from '../nodes/Node
|
|
3
|
-
import type { Scalar } from '../nodes/Scalar
|
|
4
|
-
import type { YAMLMap } from '../nodes/YAMLMap
|
|
5
|
-
import type { YAMLSeq } from '../nodes/YAMLSeq
|
|
6
|
-
import type { ParseOptions } from '../options
|
|
7
|
-
import type { StringifyContext } from '../stringify/stringify
|
|
8
|
-
import type { Schema } from './Schema
|
|
1
|
+
import type { CreateNodeContext } from '../doc/createNode';
|
|
2
|
+
import type { Node } from '../nodes/Node';
|
|
3
|
+
import type { Scalar } from '../nodes/Scalar';
|
|
4
|
+
import type { YAMLMap } from '../nodes/YAMLMap';
|
|
5
|
+
import type { YAMLSeq } from '../nodes/YAMLSeq';
|
|
6
|
+
import type { ParseOptions } from '../options';
|
|
7
|
+
import type { StringifyContext } from '../stringify/stringify';
|
|
8
|
+
import type { Schema } from './Schema';
|
|
9
9
|
interface TagBase {
|
|
10
10
|
/**
|
|
11
11
|
* An optional factory function, used e.g. by collections when wrapping JS objects as AST nodes.
|
|
12
12
|
*/
|
|
13
13
|
createNode?: (schema: Schema, value: unknown, ctx: CreateNodeContext) => Node;
|
|
14
14
|
/**
|
|
15
|
-
* If `true`,
|
|
16
|
-
* an explicit tag
|
|
17
|
-
*
|
|
15
|
+
* If `true`, allows for values to be stringified without
|
|
16
|
+
* an explicit tag together with `test`.
|
|
17
|
+
* If `'key'`, this only applies if the value is used as a mapping key.
|
|
18
|
+
* For most cases, it's unlikely that you'll actually want to use this,
|
|
19
|
+
* even if you first think you do.
|
|
18
20
|
*/
|
|
19
|
-
default?: boolean;
|
|
21
|
+
default?: boolean | 'key';
|
|
20
22
|
/**
|
|
21
23
|
* If a tag has multiple forms that should be parsed and/or stringified
|
|
22
24
|
* differently, use `format` to identify them.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ScalarTag } from '../types
|
|
1
|
+
import type { ScalarTag } from '../types';
|
|
2
2
|
export declare const binary: ScalarTag;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var node_buffer = require('node:buffer');
|
|
3
4
|
var Scalar = require('../../nodes/Scalar.js');
|
|
4
5
|
var stringifyString = require('../../stringify/stringifyString.js');
|
|
5
6
|
|
|
@@ -16,8 +17,8 @@ const binary = {
|
|
|
16
17
|
* document.querySelector('#photo').src = URL.createObjectURL(blob)
|
|
17
18
|
*/
|
|
18
19
|
resolve(src, onError) {
|
|
19
|
-
if (typeof Buffer === 'function') {
|
|
20
|
-
return Buffer.from(src, 'base64');
|
|
20
|
+
if (typeof node_buffer.Buffer === 'function') {
|
|
21
|
+
return node_buffer.Buffer.from(src, 'base64');
|
|
21
22
|
}
|
|
22
23
|
else if (typeof atob === 'function') {
|
|
23
24
|
// On IE 11, atob() can't handle newlines
|
|
@@ -35,11 +36,11 @@ const binary = {
|
|
|
35
36
|
stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
36
37
|
const buf = value; // checked earlier by binary.identify()
|
|
37
38
|
let str;
|
|
38
|
-
if (typeof Buffer === 'function') {
|
|
39
|
+
if (typeof node_buffer.Buffer === 'function') {
|
|
39
40
|
str =
|
|
40
|
-
buf instanceof Buffer
|
|
41
|
+
buf instanceof node_buffer.Buffer
|
|
41
42
|
? buf.toString('base64')
|
|
42
|
-
: Buffer.from(buf.buffer).toString('base64');
|
|
43
|
+
: node_buffer.Buffer.from(buf.buffer).toString('base64');
|
|
43
44
|
}
|
|
44
45
|
else if (typeof btoa === 'function') {
|
|
45
46
|
let s = '';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToJSContext } from '../../nodes/toJS';
|
|
2
|
+
import type { MapLike } from '../../nodes/YAMLMap';
|
|
3
|
+
import type { ScalarTag } from '../types';
|
|
4
|
+
export declare const merge: ScalarTag & {
|
|
5
|
+
identify(value: unknown): boolean;
|
|
6
|
+
test: RegExp;
|
|
7
|
+
};
|
|
8
|
+
export declare const isMergeKey: (ctx: ToJSContext | undefined, key: unknown) => boolean | undefined;
|
|
9
|
+
export declare function addMergeToJSMap(ctx: ToJSContext | undefined, map: MapLike, value: unknown): void;
|