express-tsx
Advanced tools
Comparing version 2.2.7 to 2.2.8
@@ -41,4 +41,4 @@ "use strict"; | ||
file = require.resolve(file); | ||
let deps = require.cache[file].children; | ||
let expiredFiles = deps.map(o => o.filename).concat(file).filter(Compile.filterFiles).filter(f => this.files[f].expired); | ||
let deps = Compile.getDeps(require.cache[file]); | ||
let expiredFiles = deps.filter(Compile.filterFiles).filter(f => this.files[f].expired); | ||
if (expiredFiles.length) { | ||
@@ -83,4 +83,5 @@ expiredFiles.forEach(file => { | ||
Compile.filterFiles = (file) => !(/node_modules/.test(file)); | ||
Compile.getDeps = (m) => m.children.reduce((deps, m) => deps.concat(Compile.getDeps(m)), [m.filename]); | ||
exports.Compile = Compile; | ||
exports.compile = new Compile(); | ||
//# sourceMappingURL=Compile.js.map |
{ | ||
"name": "express-tsx", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "express view tsx render", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -67,6 +67,7 @@ import ts = require('typescript') | ||
static filterFiles = (file:string)=>!(/node_modules/.test(file)) | ||
static getDeps = (m:NodeModule):string[]=>m.children.reduce((deps,m)=>deps.concat(Compile.getDeps(m)),[m.filename]) | ||
compile:(file:string)=>string = (file)=>{ | ||
file = require.resolve(file) | ||
let deps:NodeModule[] = require.cache[file].children | ||
let expiredFiles = deps.map(o=>o.filename).concat(file).filter(Compile.filterFiles).filter(f=>this.files[f].expired) | ||
let deps = Compile.getDeps(require.cache[file]) | ||
let expiredFiles = deps.filter(Compile.filterFiles).filter(f=>this.files[f].expired) | ||
if(expiredFiles.length){ | ||
@@ -73,0 +74,0 @@ expiredFiles.forEach(file=>{ |
Sorry, the diff of this file is not supported yet
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
22744
339