You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.2 KiB
56 lines
2.2 KiB
4 weeks ago
|
(function (factory) {
|
||
|
if (typeof module === "object" && typeof module.exports === "object") {
|
||
|
var v = factory(require, exports);
|
||
|
if (v !== undefined) module.exports = v;
|
||
|
}
|
||
|
else if (typeof define === "function" && define.amd) {
|
||
|
define(["require", "exports"], factory);
|
||
|
}
|
||
|
})(function (require, exports) {
|
||
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
var freeze = function freezeDefault(obj) {
|
||
|
return Object.freeze.apply(Object, arguments);
|
||
|
};
|
||
|
if (typeof Object.freeze !== 'function') {
|
||
|
// Fallback in case Object.freeze isn't supported
|
||
|
freeze = function (v) { return v; };
|
||
|
}
|
||
|
// Object.assign polyfill taken from
|
||
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
|
||
|
if (typeof Object.assign !== 'function') {
|
||
|
// Must be writable: true, enumerable: false, configurable: true
|
||
|
Object.defineProperty(Object, "assign", {
|
||
|
value: function assign(target, varArgs) {
|
||
|
'use strict';
|
||
|
if (target === null || target === undefined) {
|
||
|
throw new TypeError('Cannot convert undefined or null to object');
|
||
|
}
|
||
|
var to = Object(target);
|
||
|
for (var index = 1; index < arguments.length; index++) {
|
||
|
var nextSource = arguments[index];
|
||
|
if (nextSource !== null && nextSource !== undefined) {
|
||
|
for (var nextKey in nextSource) {
|
||
|
// Avoid bugs when hasOwnProperty is shadowed
|
||
|
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
||
|
to[nextKey] = nextSource[nextKey];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return to;
|
||
|
},
|
||
|
writable: true,
|
||
|
configurable: true
|
||
|
});
|
||
|
}
|
||
|
function MakeEnum() {
|
||
|
var x = [];
|
||
|
for (var _i = 0; _i < arguments.length; _i++) {
|
||
|
x[_i] = arguments[_i];
|
||
|
}
|
||
|
return freeze(Object.assign.apply(Object, [{}].concat(x)));
|
||
|
}
|
||
|
exports.MakeEnum = MakeEnum;
|
||
|
});
|