INNER CODE UNIT · JavaScript
listFiles
postalsys/postal-mime · scripts/build.js:50
function listFiles(dir, ext) {
return fs
.readdirSync(dir, { recursive: true })
.filter(name => name.endsWith(ext))
.map(name => path.join(dir, name));
}
// Modules that deliberately combine a default export with named runtime exports.
// Every other module with a default export must have no other runtime export so
// that `require()` can return the default export itself, see applyCjsInterop.
const MIXED_EXPORT_MODULES = new Set(['postal-mime.js']);
// tsc emits `exports.default = X` for `export default X`. Make `require()` return X
// directly instead of the exports object. The default export stays reachable as a
// non-enumerable `.default` property, which is what TypeScript and Babel generated
// `import X from '...'` code reads.
//
// A module that has both a default export and named runtime exports gets the named