persona-community-5/.pnpm-store/v3/files/c9/dc075d1c109914d75ca4b8e02e4bfc5886bbd275647f02cd179360e304a6ea3241fd9c4f09d2167d599b0091dcea52924341795c17b181a4df6cdfd2893b7b
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

45 lines
1.2 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = deprecationWarning;
const warnings = new Set();
function deprecationWarning(oldName, newName, prefix = "", cacheKey = oldName) {
if (warnings.has(cacheKey)) return;
warnings.add(cacheKey);
const {
internal,
trace
} = captureShortStackTrace(1, 2);
if (internal) {
return;
}
console.warn(`${prefix}\`${oldName}\` has been deprecated, please migrate to \`${newName}\`\n${trace}`);
}
function captureShortStackTrace(skip, length) {
const {
stackTraceLimit,
prepareStackTrace
} = Error;
let stackTrace;
Error.stackTraceLimit = 1 + skip + length;
Error.prepareStackTrace = function (err, stack) {
stackTrace = stack;
};
new Error().stack;
Error.stackTraceLimit = stackTraceLimit;
Error.prepareStackTrace = prepareStackTrace;
if (!stackTrace) return {
internal: false,
trace: ""
};
const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length);
return {
internal: /[\\/]@babel[\\/]/.test(shortStackTrace[1].getFileName()),
trace: shortStackTrace.map(frame => ` at ${frame}`).join("\n")
};
}
//# sourceMappingURL=deprecationWarning.js.map