Files scanned
10
file:line anchor. No new abstraction proposed.object-assign → native Object.assignObject.assign has shipped since Node v4. This shim is kept alive only by engines.node: ">= 0.10". Drop shim + drop dep.isString() — inline the checks instanceof String matches only boxed strings — a value nobody writes on purpose. Inline typeof x === 'string' at both callers.'use strict'.configureExposedHeaders / configureMaxAgeif (!headers) return null;, the follow-up if (headers && …) is dead. Same shape twice. Drop the redundant conjunct — do not extract a shared helper.applyHeaders recursion → Array#flatheaders.push([{…}]) nests arrays. Array.prototype.flat(Infinity) collapses them; the branch on Array.isArray disappears.else in isOriginAllowed is unreachableelse returns !!allowedOrigin — but null / undefined / boolean are already handled upstream at lib/index.js:41. Delete.object-assign; use native Object.assign
lib/index.js:5,208 · package.json:20
engines.node: ">= 0.10" at package.json:35. Drop 0.10 → delete shim.lib/index.js
lib/index.js:1-4,238
test/test.js:6 — a nested IIFE inside a module that already sets 'use strict' on line 1.isString() — inline typeof
lib/index.js:15-17
util.inherits → class FakeResponse extends EventEmitter
test/test.js:1-4,708-737
util.inherits is a compat shim. Test-only code — no user impact..eslintrc.yml is on ESLint 7 — delete or upgrade
.eslintrc.yml · test/.eslintrc.yml · package.json:25,40
if (headers) return null; if (headers && …) — twice. No new helper. Just clean the branches.after callback-fanout dep — Promise.all covers it
test/test.js:9 · dozens of callsites
after(1, done) is a no-op wrapper; after(n, done) is Promise.all(…).then(done). Removes a 2013-era dep that predates promises.ponytail: notefalse header value; unify with skip-check
lib/index.js:60-62,152
null instead of false for a rejected origin aligns with applyHeaders's truthy filter. Needs a characterization test before touching.ponytail: notes across 4 filesengines.node bumpstypeof x === 'string' at both callersflat(Infinity); delete recursive branchFakeResponse as class; delete require('util')after(n, done) with Promise.all([…]).then(done)object-assign; use native + delete isString() + delete IIFE wrapper