persona-community-5/.pnpm-store/v3/files/74/561640d67bf11144e424712dd1f8e69278ec7e35066503d06081ec778749fa27baac3680ad5590088d9c976b3eb418009a4ae6da87c8b1c23131270fce062f
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

59 lines
1.1 KiB
Plaintext

'use strict';
import {Type} from '../type';
var _hasOwnProperty = Object.prototype.hasOwnProperty;
var _toString = Object.prototype.toString;
function resolveYamlOmap(data) {
if (null === data) {
return true;
}
var objectKeys = [], index, length, pair, pairKey, pairHasKey,
object = data;
for (index = 0, length = object.length; index < length; index += 1) {
pair = object[index];
pairHasKey = false;
if ('[object Object]' !== _toString.call(pair)) {
return false;
}
for (pairKey in pair) {
if (_hasOwnProperty.call(pair, pairKey)) {
if (!pairHasKey) {
pairHasKey = true;
} else {
return false;
}
}
}
if (!pairHasKey) {
return false;
}
if (-1 === objectKeys.indexOf(pairKey)) {
objectKeys.push(pairKey);
} else {
return false;
}
}
return true;
}
function constructYamlOmap(data) {
return null !== data ? data : [];
}
export = new Type('tag:yaml.org,2002:omap', {
kind: 'sequence',
resolve: resolveYamlOmap,
construct: constructYamlOmap
});