@esfx/internal-deprecate
Advanced tools
Comparing version
@@ -25,19 +25,19 @@ "use strict"; | ||
catch (_) { | ||
const emitWarning = typeof process === "object" && typeof process.emitWarning === "function" ? function emitWarning(msg, name, ctor = emitWarning) { | ||
process.emitWarning(msg, name, ctor); | ||
const emitWarning = typeof process === "object" && typeof process.emitWarning === "function" ? function emitWarning(warning, type = "Warning", ctor = emitWarning) { | ||
process.emitWarning(warning, type, ctor); | ||
} : | ||
typeof Error.captureStackTrace === "function" ? function emitWarning(msg, name = "Warning", ctor = emitWarning) { | ||
if (typeof msg === "string") { | ||
msg = new Error(msg); | ||
msg.name = name; | ||
typeof Error.captureStackTrace === "function" ? function emitWarning(warning, type = "Warning", ctor = emitWarning) { | ||
if (typeof warning === "string") { | ||
warning = new Error(warning); | ||
warning.name = type; | ||
} | ||
Error.captureStackTrace(msg, ctor); | ||
console.warn(msg); | ||
Error.captureStackTrace(warning, ctor); | ||
console.warn(warning); | ||
} : | ||
function emitWarning(msg, name = "Warning") { | ||
if (typeof msg === "string") { | ||
console.warn(`${name}:`, msg); | ||
function emitWarning(warning, type = "Warning") { | ||
if (typeof warning === "string") { | ||
console.warn(`${type}:`, warning); | ||
} | ||
else { | ||
console.warn(msg); | ||
console.warn(warning); | ||
} | ||
@@ -44,0 +44,0 @@ }; |
{ | ||
"name": "@esfx/internal-deprecate", | ||
"version": "1.0.0-pre.17", | ||
"version": "1.0.0-pre.19", | ||
"description": "This package provides internal utilities for '@esfx' and is not intended for use in user-code.", | ||
"main": "dist", | ||
"types": "dist", | ||
"type": "commonjs", | ||
"main": "./dist/index.js", | ||
"exports": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"author": "Ron Buckton (rbuckton@chronicles.org)", | ||
@@ -19,3 +21,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "ef28dc6735b94222c27779066ee2af255333a9fe" | ||
"gitHead": "36454798ce965ab3bc08a8841a2ba2e86c5d6115" | ||
} |
Sorry, the diff of this file is not supported yet
22774
-4.66%7
-30%100
-21.26%