aboutsummaryrefslogtreecommitdiff
path: root/node_modules/yaml/dist/schema/yaml-1.1/omap.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/dist/schema/yaml-1.1/omap.js
parent383285ecd5292bf9a825e05904955b937de84cc9 (diff)
downloadequestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.gz
equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.tar.bz2
equestriadb-b22f6770c8bd084d66950655203c61dd701b3d90.zip
Remove node_modules
Diffstat (limited to 'node_modules/yaml/dist/schema/yaml-1.1/omap.js')
-rw-r--r--node_modules/yaml/dist/schema/yaml-1.1/omap.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/node_modules/yaml/dist/schema/yaml-1.1/omap.js b/node_modules/yaml/dist/schema/yaml-1.1/omap.js
deleted file mode 100644
index 006a65d..0000000
--- a/node_modules/yaml/dist/schema/yaml-1.1/omap.js
+++ /dev/null
@@ -1,76 +0,0 @@
-'use strict';
-
-var YAMLSeq = require('../../nodes/YAMLSeq.js');
-var toJS = require('../../nodes/toJS.js');
-var Node = require('../../nodes/Node.js');
-var YAMLMap = require('../../nodes/YAMLMap.js');
-var pairs = require('./pairs.js');
-
-class YAMLOMap extends YAMLSeq.YAMLSeq {
- constructor() {
- super();
- this.add = YAMLMap.YAMLMap.prototype.add.bind(this);
- this.delete = YAMLMap.YAMLMap.prototype.delete.bind(this);
- this.get = YAMLMap.YAMLMap.prototype.get.bind(this);
- this.has = YAMLMap.YAMLMap.prototype.has.bind(this);
- this.set = YAMLMap.YAMLMap.prototype.set.bind(this);
- this.tag = YAMLOMap.tag;
- }
- /**
- * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
- * but TypeScript won't allow widening the signature of a child method.
- */
- toJSON(_, ctx) {
- if (!ctx)
- return super.toJSON(_);
- const map = new Map();
- if (ctx === null || ctx === void 0 ? void 0 : ctx.onCreate)
- ctx.onCreate(map);
- for (const pair of this.items) {
- let key, value;
- if (Node.isPair(pair)) {
- key = toJS.toJS(pair.key, '', ctx);
- value = toJS.toJS(pair.value, key, ctx);
- }
- else {
- key = toJS.toJS(pair, '', ctx);
- }
- if (map.has(key))
- throw new Error('Ordered maps must not include duplicate keys');
- map.set(key, value);
- }
- return map;
- }
-}
-YAMLOMap.tag = 'tag:yaml.org,2002:omap';
-const omap = {
- collection: 'seq',
- identify: value => value instanceof Map,
- nodeClass: YAMLOMap,
- default: false,
- tag: 'tag:yaml.org,2002:omap',
- resolve(seq, onError) {
- const pairs$1 = pairs.resolvePairs(seq, onError);
- const seenKeys = [];
- for (const { key } of pairs$1.items) {
- if (Node.isScalar(key)) {
- if (seenKeys.includes(key.value)) {
- onError(`Ordered maps must not include duplicate keys: ${key.value}`);
- }
- else {
- seenKeys.push(key.value);
- }
- }
- }
- return Object.assign(new YAMLOMap(), pairs$1);
- },
- createNode(schema, iterable, ctx) {
- const pairs$1 = pairs.createPairs(schema, iterable, ctx);
- const omap = new YAMLOMap();
- omap.items = pairs$1.items;
- return omap;
- }
-};
-
-exports.YAMLOMap = YAMLOMap;
-exports.omap = omap;