swc/packages/helpers/esm/_create_class.js

19 lines
636 B
JavaScript
Raw Normal View History

2021-12-05 09:46:09 +03:00
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);
}
2021-12-05 09:46:09 +03:00
}
export function _create_class(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
2021-12-05 09:46:09 +03:00
}
export { _create_class as _ };