egg-core
Advanced tools
Comparing version 4.13.0 to 4.13.1
4.13.1 / 2019-01-11 | ||
================== | ||
**others** | ||
* [[`35ed3fa`](http://github.com/eggjs/egg-core/commit/35ed3fa2baf4cbcfee9f9e307e9f9f56fb93349d)] - refactor(jest-support): Replace require.extensions with Module._extensions (#196) (Gray <<njugray@gmail.com>>) | ||
4.13.0 / 2018-12-14 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -125,3 +125,3 @@ 'use strict'; | ||
if (!files) { | ||
files = (process.env.EGG_TYPESCRIPT === 'true' && utils.extensions.includes('.ts')) | ||
files = (process.env.EGG_TYPESCRIPT === 'true' && utils.extensions['.ts']) | ||
? [ '**/*.(js|ts)', '!**/*.d.ts' ] | ||
@@ -128,0 +128,0 @@ : [ '**/*.js' ]; |
@@ -8,14 +8,12 @@ 'use strict'; | ||
const co = require('co'); | ||
const extensions = Object.keys(require.extensions); | ||
/* istanbul ignore if */ | ||
if (!extensions.length) { | ||
// adapt for jest | ||
extensions.push('.js', '.node', '.json'); | ||
if (process.env.EGG_TYPESCRIPT === 'true') { | ||
extensions.push('.ts'); | ||
} | ||
} | ||
const BuiltinModule = require('module'); | ||
// Guard against poorly mocked module constructors. | ||
const Module = module.constructor.length > 1 | ||
? module.constructor | ||
/* istanbul ignore next */ | ||
: BuiltinModule; | ||
module.exports = { | ||
extensions, | ||
extensions: Module._extensions, | ||
@@ -26,3 +24,3 @@ loadFile(filepath) { | ||
const extname = path.extname(filepath); | ||
if (extname && !extensions.includes(extname)) { | ||
if (extname && !Module._extensions[extname]) { | ||
return fs.readFileSync(filepath); | ||
@@ -29,0 +27,0 @@ } |
{ | ||
"name": "egg-core", | ||
"version": "4.13.0", | ||
"version": "4.13.1", | ||
"description": "A core Pluggable framework based on koa", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
113614
2723