@stoplight/yaml
Advanced tools
Comparing version 3.0.2 to 3.1.0
{ | ||
"name": "@stoplight/yaml", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Useful functions when working with YAML.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -61,3 +61,3 @@ "use strict"; | ||
case yaml_ast_parser_1.Kind.SCALAR: | ||
return 'valueObject' in node ? node.valueObject : node.value; | ||
return getScalarValue(node); | ||
case yaml_ast_parser_1.Kind.ANCHOR_REF: | ||
@@ -107,2 +107,16 @@ if (node.value !== void 0 && isCircularAnchorRef(node)) { | ||
}; | ||
function getScalarValue(node) { | ||
switch (yaml_ast_parser_1.determineScalarType(node)) { | ||
case yaml_ast_parser_1.ScalarType.null: | ||
return null; | ||
case yaml_ast_parser_1.ScalarType.string: | ||
return String(node.value); | ||
case yaml_ast_parser_1.ScalarType.bool: | ||
return yaml_ast_parser_1.parseYamlBoolean(node.value); | ||
case yaml_ast_parser_1.ScalarType.int: | ||
return yaml_ast_parser_1.parseYamlInteger(node.value); | ||
case yaml_ast_parser_1.ScalarType.float: | ||
return yaml_ast_parser_1.parseYamlFloat(node.value); | ||
} | ||
} | ||
const computeLineMap = (input) => { | ||
@@ -109,0 +123,0 @@ const lineMap = []; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54005
553