ripple-lib
Version:
Deprecated - consider migrating to xrpl.js: https://xrpl.org/xrpljs2-migration-guide.html
21 lines • 863 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.setPrototypeOf = exports.getConstructorName = void 0;
function setPrototypeOf(object, prototype) {
Object.setPrototypeOf
? Object.setPrototypeOf(object, prototype)
:
(object.__proto__ = prototype);
}
exports.setPrototypeOf = setPrototypeOf;
function getConstructorName(object) {
if (object.constructor.name) {
return object.constructor.name;
}
const constructorString = object.constructor.toString();
const functionConstructor = constructorString.match(/^function\s+([^(]*)/);
const classConstructor = constructorString.match(/^class\s([^\s]*)/);
return functionConstructor ? functionConstructor[1] : classConstructor[1];
}
exports.getConstructorName = getConstructorName;
//# sourceMappingURL=browser-hacks.js.map