UNPKG

@pixi/utils

Version:

Collection of utilities used by PixiJS

28 lines (26 loc) 889 B
const warnings = {}; function deprecation(version, message, ignoreDepth = 3) { if (warnings[message]) { return; } let stack = new Error().stack; if (typeof stack === "undefined") { console.warn("PixiJS Deprecation Warning: ", `${message} Deprecated since v${version}`); } else { stack = stack.split("\n").splice(ignoreDepth).join("\n"); if (console.groupCollapsed) { console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s", "color:#614108;background:#fffbe6", "font-weight:normal;color:#614108;background:#fffbe6", `${message} Deprecated since v${version}`); console.warn(stack); console.groupEnd(); } else { console.warn("PixiJS Deprecation Warning: ", `${message} Deprecated since v${version}`); console.warn(stack); } } warnings[message] = true; } export { deprecation }; //# sourceMappingURL=deprecation.mjs.map