* Copy every export from a module namespace except `default` into a plain, * mutable object. ESM namespace properties are non-configurable, so * `node:test`'s `mock.method` cannot replace them in place. The wrapper is * also handed straight to `mock.module`'s `namedExports` in * `implementation-
(ns)
| 18 | * @returns {Record<string, unknown>} mutable copy without the `default` key |
| 19 | */ |
| 20 | function namedExportsOnly(ns) { |
| 21 | const copy = {}; |
| 22 | |
| 23 | for (const key of Object.keys(ns)) { |
| 24 | if (key !== "default") { |
| 25 | copy[key] = ns[key]; |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | return copy; |
| 30 | } |
| 31 | |
| 32 | const sass = namedExportsOnly(sassNs); |
| 33 | const sassEmbedded = namedExportsOnly(sassEmbeddedNs); |
no outgoing calls
no test coverage detected
searching dependent graphs…