Closed dotnetCarpenter closed 3 years ago
Closing in favour of:
wrapped.toString = always0 (typeSignature (typeInfo));
// Node.js
if (
typeof process === 'object' &&
process != null &&
process.versions != null &&
process.versions.node != null
) wrapped[Symbol.for('nodejs.util.inspect.custom')] = wrapped.toString;
// Deno
if (
typeof Deno !== 'undefined' &&
Deno != null &&
typeof Deno.customInspect === 'symbol'
) wrapped[Deno.customInspect] = wrapped.toString;
Fix so sanctuary-def can be used in CommonJS enviroments that does not have the
util
module, such as scrimba.com.Here is an example with sanctuary-def 0.22.0: https://scrimba.com/scrim/cQGBN6cM
The def test "returns a function with "inspect" and "@@show" methods" fails with the default
util
object but I guess you already know that.This will hopefully fix issue #300 but I guess the only way to know for sure is to publish and test it out on scrimba.com.