Comparing version 3.0.2 to 3.1.0
import type { Options } from './types.js'; | ||
export default function inspectFunction(func: Function, options: Options): string; | ||
type ToStringable = Function & { | ||
[Symbol.toStringTag]: string; | ||
}; | ||
export default function inspectFunction(func: ToStringable, options: Options): string; | ||
export {}; | ||
//# sourceMappingURL=function.d.ts.map |
import { truncate } from './helpers.js'; | ||
export default function inspectFunction(func, options) { | ||
const functionType = func[Symbol.toStringTag] || 'Function'; | ||
const name = func.name; | ||
if (!name) { | ||
return options.stylize('[Function]', 'special'); | ||
return options.stylize(`[${functionType}]`, 'special'); | ||
} | ||
return options.stylize(`[Function ${truncate(name, options.truncate - 11)}]`, 'special'); | ||
return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, 'special'); | ||
} |
@@ -257,7 +257,8 @@ "use strict"; | ||
function inspectFunction(func, options) { | ||
const functionType = func[Symbol.toStringTag] || "Function"; | ||
const name = func.name; | ||
if (!name) { | ||
return options.stylize("[Function]", "special"); | ||
return options.stylize(`[${functionType}]`, "special"); | ||
} | ||
return options.stylize(`[Function ${truncate(name, options.truncate - 11)}]`, "special"); | ||
return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special"); | ||
} | ||
@@ -264,0 +265,0 @@ |
{ | ||
"name": "loupe", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Inspect utility for Node.js and browsers", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/chaijs/loupe", |
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
60097
1300