deprecated-decorator
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -5,2 +5,3 @@ /* | ||
*/ | ||
"use strict"; | ||
/** @internal */ | ||
@@ -14,3 +15,3 @@ exports.options = { | ||
var stack = (new Error()).stack || ''; | ||
var at = (stack.match(/(?:\s+at\s.+){2}\s+at\s(.+)/) || [])[1]; | ||
var at = (stack.match(/(?:\s+at\s.+){2}\s+at\s(.+)/) || [undefined, ''])[1]; | ||
if (/\)$/.test(at)) { | ||
@@ -41,3 +42,3 @@ at = at.match(/[^(]+(?=\)$)/)[0]; | ||
} | ||
message += " \"" + name + "\" has been deprecated"; | ||
message += " `" + name + "` has been deprecated"; | ||
if (version) { | ||
@@ -47,6 +48,8 @@ message += " since version " + version; | ||
if (alternative) { | ||
message += ", use \"" + alternative + "\" instead"; | ||
message += ", use `" + alternative + "` instead"; | ||
} | ||
message += '.'; | ||
message += "\n at " + at; | ||
if (at) { | ||
message += "\n at " + at; | ||
} | ||
if (url) { | ||
@@ -84,6 +87,6 @@ message += "\nCheck out " + url + " for more information."; | ||
else { | ||
var propertyValue = descriptor.value; | ||
var propertyValue_1 = descriptor.value; | ||
deprecatedDescriptor.get = function () { | ||
warner(); | ||
return propertyValue; | ||
return propertyValue_1; | ||
}; | ||
@@ -93,3 +96,3 @@ if (descriptor.writable) { | ||
warner(); | ||
propertyValue = value; | ||
propertyValue_1 = value; | ||
}; | ||
@@ -96,0 +99,0 @@ } |
{ | ||
"name": "deprecated-decorator", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A simple decorator for deprecated methods and properties.", | ||
@@ -5,0 +5,0 @@ "main": "bld/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15480
5
183