Laptop-Thing/web/node_modules/yaml/dist/compose/util-map-includes.js

16 lines
471 B
JavaScript
Raw Normal View History

2024-11-27 12:35:48 -05:00
'use strict';
var identity = require('../nodes/identity.js');
function mapIncludes(ctx, items, search) {
const { uniqueKeys } = ctx.options;
if (uniqueKeys === false)
return false;
const isEqual = typeof uniqueKeys === 'function'
? uniqueKeys
: (a, b) => a === b || (identity.isScalar(a) && identity.isScalar(b) && a.value === b.value);
return items.some(pair => isEqual(pair.key, search));
}
exports.mapIncludes = mapIncludes;