MCPcopy Index your code
hub / github.com/nodejs/node / createDeprecation

Function createDeprecation

test/fixtures/snapshot/typescript.js:3230–3242  ·  view source on GitHub ↗
(name, options)

Source from the content-addressed store, hash-verified

3228 };
3229 }
3230 function createDeprecation(name, options) {
3231 var _a, _b;
3232 if (options === void 0) { options = {}; }
3233 var version = typeof options.typeScriptVersion === "string" ? new ts.Version(options.typeScriptVersion) : (_a = options.typeScriptVersion) !== null && _a !== void 0 ? _a : getTypeScriptVersion();
3234 var errorAfter = typeof options.errorAfter === "string" ? new ts.Version(options.errorAfter) : options.errorAfter;
3235 var warnAfter = typeof options.warnAfter === "string" ? new ts.Version(options.warnAfter) : options.warnAfter;
3236 var since = typeof options.since === "string" ? new ts.Version(options.since) : (_b = options.since) !== null && _b !== void 0 ? _b : warnAfter;
3237 var error = options.error || errorAfter && version.compareTo(errorAfter) <= 0;
3238 var warn = !warnAfter || version.compareTo(warnAfter) >= 0;
3239 return error ? createErrorDeprecation(name, errorAfter, since, options.message) :
3240 warn ? createWarningDeprecation(name, errorAfter, since, options.message) :
3241 ts.noop;
3242 }
3243 function wrapFunction(deprecation, func) {
3244 return function () {
3245 deprecation();

Callers 1

deprecateFunction · 0.85

Calls 3

getTypeScriptVersionFunction · 0.85
createErrorDeprecationFunction · 0.85
createWarningDeprecationFunction · 0.85

Tested by

no test coverage detected