Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parent,
null,
instance.endPosition,
instance.endPosition
)
: this.recursivelyBuildAst(result, item)
itemNode.location = count++
result.addItem(itemNode)
}
return result
}
case Yaml.Kind.SCALAR: {
const instance = node as YamlScalar
const type = Yaml.determineScalarType(instance)
// The name is set either by the sequence or the mapping case.
const name = null
const value = instance.value
// This is a patch for redirecting values with these strings to be boolean nodes because its not supported in the parser.
const possibleBooleanValues = [
"y",
"Y",
"yes",
"Yes",
"YES",
"n",
"N",
"no",
"No",
for (const item of instance.items) {
const itemNode =
item === null
? new NullASTNode(
parent,
instance.endPosition,
instance.endPosition,
)
: buildAstRecursively(result, item);
result.addItem(itemNode);
}
return result;
}
case Yaml.Kind.SCALAR: {
const instance = node as Yaml.YAMLScalar;
const type = Yaml.determineScalarType(instance);
const value = instance.value;
switch (type) {
case Yaml.ScalarType.null: {
return new StringASTNode(
parent,
false,
instance.startPosition,
instance.endPosition,
);
}
case Yaml.ScalarType.bool: {
return new BooleanASTNode(
parent,
Yaml.parseYamlBoolean(value),
instance.startPosition,
instance.endPosition,