plist2
Version:
Converts between .tmLanguage(.plist), .json, .cson and .yaml formats
35 lines (32 loc) • 769 B
JavaScript
/* eslint-disable */
/*
dester builds:
yaml2js.ts
*/
;
Object.defineProperty(exports, '__esModule', {
value: true
});
var yaml = require('yaml');
var lib = require('../lib');
/* filename: yaml2js.ts
timestamp: 2024-12-13T15:18:11.969Z */
var scanItems = items => {
if (items) {
items.forEach(value => {
if (value = value.value) {
if (value.tag === 'tag:yaml.org,2002:binary') {
value.value = {
[lib.__BINARY64_KEY__]: value.value.replace(/\s+/g, '')
};
} else scanItems(value.items);
}
});
}
};
var yaml2js = source => {
var yaml$1 = yaml.parseDocument(source);
scanItems(yaml$1.contents && yaml$1.contents.items);
return yaml$1.toJSON();
};
exports["default"] = yaml2js;