Skip to content

Instantly share code, notes, and snippets.

@tangoabcdelta
Created August 7, 2022 22:26
Show Gist options
  • Save tangoabcdelta/e2c66048b1fab16348370ee7c5811f30 to your computer and use it in GitHub Desktop.
Save tangoabcdelta/e2c66048b1fab16348370ee7c5811f30 to your computer and use it in GitHub Desktop.
Polyfills for a Class definition in Javascript
var _createClass = (function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true;
}
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
})();
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Can not call a class as a function");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment