mirror of
https://github.com/deployphp/action.git
synced 2025-06-29 20:54:14 +00:00
Add node_modules
This commit is contained in:
parent
e1f786311a
commit
554eb0b122
994 changed files with 195567 additions and 0 deletions
42
node_modules/yaml/browser/dist/schema/common/map.js
generated
vendored
Normal file
42
node_modules/yaml/browser/dist/schema/common/map.js
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
import { isMap } from '../../nodes/Node.js';
|
||||
import { createPair } from '../../nodes/Pair.js';
|
||||
import { YAMLMap } from '../../nodes/YAMLMap.js';
|
||||
|
||||
function createMap(schema, obj, ctx) {
|
||||
const { keepUndefined, replacer } = ctx;
|
||||
const map = new YAMLMap(schema);
|
||||
const add = (key, value) => {
|
||||
if (typeof replacer === 'function')
|
||||
value = replacer.call(obj, key, value);
|
||||
else if (Array.isArray(replacer) && !replacer.includes(key))
|
||||
return;
|
||||
if (value !== undefined || keepUndefined)
|
||||
map.items.push(createPair(key, value, ctx));
|
||||
};
|
||||
if (obj instanceof Map) {
|
||||
for (const [key, value] of obj)
|
||||
add(key, value);
|
||||
}
|
||||
else if (obj && typeof obj === 'object') {
|
||||
for (const key of Object.keys(obj))
|
||||
add(key, obj[key]);
|
||||
}
|
||||
if (typeof schema.sortMapEntries === 'function') {
|
||||
map.items.sort(schema.sortMapEntries);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
const map = {
|
||||
collection: 'map',
|
||||
createNode: createMap,
|
||||
default: true,
|
||||
nodeClass: YAMLMap,
|
||||
tag: 'tag:yaml.org,2002:map',
|
||||
resolve(map, onError) {
|
||||
if (!isMap(map))
|
||||
onError('Expected a mapping for this tag');
|
||||
return map;
|
||||
}
|
||||
};
|
||||
|
||||
export { map };
|
Loading…
Add table
Add a link
Reference in a new issue