yaml-language-server-parser
Version:
This is a maintained fork of YAML-AST-PARSER specifically for the YAML Language server.
31 lines (21 loc) • 489 B
text/typescript
;
import {Type} from '../type';
import ast = require("../yamlAST");
var _hasOwnProperty = Object.prototype.hasOwnProperty;
function resolveYamlSet(data) {
if (null === data) {
return true;
}
if(data.kind != ast.Kind.MAP){
return false;
}
return true;
}
function constructYamlSet(data) {
return null !== data ? data : {};
}
export = new Type('tag:yaml.org,2002:set', {
kind: 'mapping',
resolve: resolveYamlSet,
construct: constructYamlSet
});