Comparing version 2.0.2 to 2.0.3
@@ -5,32 +5,13 @@ 'use strict' | ||
const { Buffer } = require('buffer') | ||
const { getGlobalThis } = require('@offirmo/globalthis-ponyfill') | ||
const TextDecoder = require('@cto.af/textdecoder') | ||
let util = null | ||
let customInspect = Symbol.for('nodejs.util.inspect.custom') | ||
const gt = getGlobalThis() | ||
let TD = gt.TextDecoder | ||
try { | ||
util = require('util') | ||
customInspect = util.inspect.custom | ||
/* istanbul ignore next */ | ||
if (typeof TD !== 'function') { | ||
// node 10 | ||
TD = util.TextDecoder | ||
} | ||
} catch (ignored) { | ||
// Do without | ||
if (typeof TD !== 'function') { | ||
class TextDecoder { | ||
constructor(utfLabel, options) { | ||
this.utfLabel = utfLabel | ||
} | ||
decode(buf) { | ||
return buf.toString(this.utfLabel) | ||
} | ||
} | ||
TD = TextDecoder | ||
} | ||
} | ||
const td = new TD('utf8', {fatal: true, ignoreBOM: true}) | ||
const td = new TextDecoder('utf8', {fatal: true, ignoreBOM: true}) | ||
@@ -37,0 +18,0 @@ /** |
{ | ||
"name": "nofilter", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Read and write a growable buffer as a stream", | ||
@@ -50,8 +50,8 @@ "main": "lib/index.js", | ||
}, | ||
"dependencies": { | ||
"@cto.af/textdecoder": "^0.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=10.18" | ||
}, | ||
"dependencies": { | ||
"@offirmo/globalthis-ponyfill": "^3.0.1" | ||
} | ||
} |
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
26539
807
+ Added@cto.af/textdecoder@^0.0.0
+ Added@cto.af/textdecoder@0.0.0(transitive)
- Removed@offirmo/globalthis-ponyfill@^3.0.1
- Removed@offirmo/globalthis-ponyfill@3.0.2(transitive)