Sha256: aa96789e469c230d78c99b6a91011062b07d611b556e02493b7b8abbf2214627

Contents?: true

Size: 895 Bytes

Versions: 23

Compression:

Stored size: 895 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.makeStaticFileCache = makeStaticFileCache;
var _caching = require("../caching.js");
var fs = require("../../gensync-utils/fs.js");
function _fs2() {
  const data = require("fs");
  _fs2 = function () {
    return data;
  };
  return data;
}
function makeStaticFileCache(fn) {
  return (0, _caching.makeStrongCache)(function* (filepath, cache) {
    const cached = cache.invalidate(() => fileMtime(filepath));
    if (cached === null) {
      return null;
    }
    return fn(filepath, yield* fs.readFile(filepath, "utf8"));
  });
}
function fileMtime(filepath) {
  if (!_fs2().existsSync(filepath)) return null;
  try {
    return +_fs2().statSync(filepath).mtime;
  } catch (e) {
    if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e;
  }
  return null;
}
0 && 0;

//# sourceMappingURL=utils.js.map

Version data entries

23 entries across 16 versions & 3 rubygems

Version Path
trusty-cms-6.3.1 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.51 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.51 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.50 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.50 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.49 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.49 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.48 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.48 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.47 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.47 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.46 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.46 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.45 node_modules/jscodeshift/node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.45 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.44 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.43 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.42 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.41 node_modules/@babel/core/lib/config/files/utils.js
immosquare-cleaner-0.1.40 node_modules/@babel/core/lib/config/files/utils.js