@plotdb/srcbuild 0.0.65 → 0.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/view/pug.js +4 -4
  2. package/package.json +1 -1
package/dist/view/pug.js CHANGED
@@ -32,7 +32,7 @@ pugViewEngine = function(options){
32
32
  return logger.debug(f.replace(opt.basedir, '') + " served in " + t + "ms (" + type + (cache ? ' cached' : '') + ")");
33
33
  };
34
34
  return function(src, opt, cb){
35
- var lc, intl, ref$, desv, desh, startTime, mtime, mtimeSrc, ret, e;
35
+ var lc, intl, ref$, desv, desh, startTime, mtimeSrc, mtime, ret, e;
36
36
  lc = {
37
37
  isCached: false
38
38
  };
@@ -44,9 +44,9 @@ pugViewEngine = function(options){
44
44
  ref$ = builder.map(src, ''), src = ref$.src, desv = ref$.desv, desh = ref$.desh;
45
45
  startTime = Date.now();
46
46
  try {
47
- mtime = +fs.statSync(desv).mtime;
48
47
  mtimeSrc = +fs.statSync(src).mtime;
49
- if (mtimeSrc - mtime > 0) {
48
+ mtime = +fs.statSync(desv).mtime;
49
+ if (!(mtime != null) || mtimeSrc - mtime > 0) {
50
50
  throw new Error("src dirty");
51
51
  }
52
52
  if (!lc.useCache || !pugcache[desv] || mtime - pugcache[desv].mtime > 0) {
@@ -70,7 +70,7 @@ pugViewEngine = function(options){
70
70
  e = e$;
71
71
  return Promise.resolve().then(function(){
72
72
  lc.mtime = mtimeSrc;
73
- if (!lc.useCache || !pugcache[src] || lc.mtime - pugcache[src].mtime > 0) {
73
+ if (!lc.useCache || !pugcache[src] || !(pugcache[src].mtime != null) || lc.mtime - pugcache[src].mtime > 0) {
74
74
  return fsp.readFile(src).then(function(buf){
75
75
  return pugcache[src] = {
76
76
  buf: buf
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "zbryikt",
3
3
  "name": "@plotdb/srcbuild",
4
- "version": "0.0.65",
4
+ "version": "0.0.66",
5
5
  "description": "",
6
6
  "main": "./dist/main.js",
7
7
  "files": [