UNPKG

@visactor/vrender-animate

Version:

This module provides a graph-based animation system for VRender.

23 lines (19 loc) 772 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.getCustomType = void 0; const vutils_1 = require("@visactor/vutils"); function getCustomType(custom) { if (!custom || !(0, vutils_1.isFunction)(custom)) return 0; const functionStr = Function.prototype.toString.call(custom); if (/^class\s/.test(functionStr)) return 1; if (!custom.prototype) return 2; if (custom.prototype.constructor === custom) { const descriptor = Object.getOwnPropertyDescriptor(custom, "prototype"); if (descriptor && !descriptor.writable) return 1; if (Object.getOwnPropertyNames(custom.prototype).length > 1) return 1; } return 2; } exports.getCustomType = getCustomType; //# sourceMappingURL=utils.js.map