initial commit

This commit is contained in:
air66
2019-07-24 18:16:32 +01:00
commit 5efebf4ded
8591 changed files with 899103 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
"use strict";
exports.__esModule = true;
exports.default = ensureObject;
function ensureObject(obj) {
for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
props[_key - 1] = arguments[_key];
}
while (props.length > 0) {
var prop = props.shift();
if (!obj[prop]) {
obj[prop] = {};
}
obj = obj[prop];
}
}
module.exports = exports["default"];

View File

@@ -0,0 +1,22 @@
"use strict";
exports.__esModule = true;
exports.default = getProp;
function getProp(obj) {
for (var _len = arguments.length, props = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
props[_key - 1] = arguments[_key];
}
while (props.length > 0) {
var prop = props.shift();
if (!obj[prop]) {
return undefined;
}
obj = obj[prop];
}
return obj;
}
module.exports = exports["default"];

View File

@@ -0,0 +1,41 @@
'use strict';
exports.__esModule = true;
var _unesc = require('./unesc');
Object.defineProperty(exports, 'unesc', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_unesc).default;
}
});
var _getProp = require('./getProp');
Object.defineProperty(exports, 'getProp', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_getProp).default;
}
});
var _ensureObject = require('./ensureObject');
Object.defineProperty(exports, 'ensureObject', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_ensureObject).default;
}
});
var _stripComments = require('./stripComments');
Object.defineProperty(exports, 'stripComments', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_stripComments).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

View File

@@ -0,0 +1,21 @@
"use strict";
exports.__esModule = true;
exports.default = stripComments;
function stripComments(str) {
var s = "";
var commentStart = str.indexOf("/*");
var lastEnd = 0;
while (commentStart >= 0) {
s = s + str.slice(lastEnd, commentStart);
var commentEnd = str.indexOf("*/", commentStart + 2);
if (commentEnd < 0) {
return s;
}
lastEnd = commentEnd + 2;
commentStart = str.indexOf("/*", lastEnd);
}
s = s + str.slice(lastEnd);
return s;
}
module.exports = exports["default"];

View File

@@ -0,0 +1,18 @@
"use strict";
exports.__esModule = true;
exports.default = unesc;
var HEX_ESC = /\\(?:([0-9a-fA-F]{6})|([0-9a-fA-F]{1,5})(?: |(?![0-9a-fA-F])))/g;
var OTHER_ESC = /\\(.)/g;
function unesc(str) {
str = str.replace(HEX_ESC, function (_, hex1, hex2) {
var hex = hex1 || hex2;
var code = parseInt(hex, 16);
return String.fromCharCode(code);
});
str = str.replace(OTHER_ESC, function (_, char) {
return char;
});
return str;
}
module.exports = exports["default"];