aboutsummaryrefslogtreecommitdiff
path: root/node_modules/yaml/browser/dist/compose/compose-collection.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-06-04 08:51:19 +0200
committerMinteck <contact@minteck.org>2022-06-04 08:51:19 +0200
commitb22f6770c8bd084d66950655203c61dd701b3d90 (patch)
tree873d7fb19584ec2709b95cc1ca05a1fc7cfd0fc4 /node_modules/yaml/browser/dist/compose/compose-collection.js
parent383285ecd5292bf9a825e05904955b937de84cc9 (diff)
downloadequestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.gz
equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.bz2
equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.zip
Remove node_modules
Diffstat (limited to 'node_modules/yaml/browser/dist/compose/compose-collection.js')
-rw-r--r--node_modules/yaml/browser/dist/compose/compose-collection.js59
1 files changed, 0 insertions, 59 deletions
diff --git a/node_modules/yaml/browser/dist/compose/compose-collection.js b/node_modules/yaml/browser/dist/compose/compose-collection.js
deleted file mode 100644
index 6cf509c..0000000
--- a/node_modules/yaml/browser/dist/compose/compose-collection.js
+++ /dev/null
@@ -1,59 +0,0 @@
-import { isNode, isMap } from '../nodes/Node.js';
-import { Scalar } from '../nodes/Scalar.js';
-import { resolveBlockMap } from './resolve-block-map.js';
-import { resolveBlockSeq } from './resolve-block-seq.js';
-import { resolveFlowCollection } from './resolve-flow-collection.js';
-
-function composeCollection(CN, ctx, token, tagToken, onError) {
- let coll;
- switch (token.type) {
- case 'block-map': {
- coll = resolveBlockMap(CN, ctx, token, onError);
- break;
- }
- case 'block-seq': {
- coll = resolveBlockSeq(CN, ctx, token, onError);
- break;
- }
- case 'flow-collection': {
- coll = resolveFlowCollection(CN, ctx, token, onError);
- break;
- }
- }
- if (!tagToken)
- return coll;
- const tagName = ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
- if (!tagName)
- return coll;
- // Cast needed due to: https://github.com/Microsoft/TypeScript/issues/3841
- const Coll = coll.constructor;
- if (tagName === '!' || tagName === Coll.tagName) {
- coll.tag = Coll.tagName;
- return coll;
- }
- const expType = isMap(coll) ? 'map' : 'seq';
- let tag = ctx.schema.tags.find(t => t.collection === expType && t.tag === tagName);
- if (!tag) {
- const kt = ctx.schema.knownTags[tagName];
- if (kt && kt.collection === expType) {
- ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
- tag = kt;
- }
- else {
- onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
- coll.tag = tagName;
- return coll;
- }
- }
- const res = tag.resolve(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options);
- const node = isNode(res)
- ? res
- : new Scalar(res);
- node.range = coll.range;
- node.tag = tagName;
- if (tag === null || tag === void 0 ? void 0 : tag.format)
- node.format = tag.format;
- return node;
-}
-
-export { composeCollection };