Comparing version 0.0.1 to 0.1.1
@@ -9,3 +9,3 @@ // Generated by CoffeeScript 1.10.0 | ||
var extract, name; | ||
name = 'anonymus'; | ||
name = types.forceString(funcname.anonymusName); | ||
if (types.isFunction(func)) { | ||
@@ -23,4 +23,11 @@ if ((types.isString(func.name)) && func.name.length) { | ||
funcname.anonymusName = ''; | ||
funcname.nameAnonymus = function(name) { | ||
funcname.anonymusName = types.forceString(name, 'anonymus'); | ||
return funcname; | ||
}; | ||
module.exports = funcname; | ||
}).call(this); |
@@ -1,1 +0,1 @@ | ||
(function(){var n,r;r=require("types.js"),n=function(n){var e,t;if(t="anonymus",r.isFunction(n)){if(r.isString(n.name)&&n.name.length)return n.name;if(e=r.forceArray(/^\s*function\s*([^\(]*)/im.exec(n.toString())),e.length&&e[1])return r.forceString(e[1],t)}return t},module.exports=n}).call(this); | ||
(function(){var n,e;e=require("types.js"),n=function(r){var t,i;if(i=e.forceString(n.anonymusName),e.isFunction(r)){if(e.isString(r.name)&&r.name.length)return r.name;if(t=e.forceArray(/^\s*function\s*([^\(]*)/im.exec(r.toString())),t.length&&t[1])return e.forceString(t[1],i)}return i},n.anonymusName="",n.nameAnonymus=function(r){return n.anonymusName=e.forceString(r,"anonymus"),n},module.exports=n}).call(this); |
{ | ||
"name": "func-name", | ||
"version": "0.0.1", | ||
"version": "0.1.1", | ||
"description": "A rudimentary and type save function name retrieve", | ||
@@ -5,0 +5,0 @@ "main": "func-name.min.js", |
@@ -17,4 +17,11 @@ # func-name | ||
// this_is_my_name | ||
console.log( funcname(anonymusFunc) ); | ||
// anonymus | ||
// an empty string literal as a logical false | ||
// call nameAnonymus to show "anonymus" as name, or pass a custom name | ||
funcname= require( 'func-name' ).nameAnonymus( '?' ); | ||
console.log( funcname(anonymusFunc) ); | ||
// ? | ||
``` | ||
@@ -21,0 +28,0 @@ |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
5201
25
32