forked from enviPath/enviPy
Current Dev State
This commit is contained in:
3
static/js/ketcher2/node_modules/fs-exists-cached/README.md
generated
vendored
Normal file
3
static/js/ketcher2/node_modules/fs-exists-cached/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# fs-exists-cached
|
||||
|
||||
Just like `fs.exists` and `fs.existsSync`, but cached
|
||||
24
static/js/ketcher2/node_modules/fs-exists-cached/index.js
generated
vendored
Normal file
24
static/js/ketcher2/node_modules/fs-exists-cached/index.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
module.exports = exists
|
||||
exists.sync = sync
|
||||
var fs = require('fs')
|
||||
var existsCache = Object.create(null)
|
||||
|
||||
function exists (file, cb) {
|
||||
if (file in existsCache)
|
||||
return process.nextTick(cb.bind(null, existsCache[file]))
|
||||
fs.lstat(file, function (er) {
|
||||
cb(existsCache[file] = !er)
|
||||
})
|
||||
}
|
||||
|
||||
function sync (file) {
|
||||
if (file in existsCache)
|
||||
return existsCache[file]
|
||||
try {
|
||||
fs.lstatSync(file)
|
||||
existsCache[file] = true
|
||||
} catch (er) {
|
||||
existsCache[file] = false
|
||||
}
|
||||
return existsCache[file]
|
||||
}
|
||||
53
static/js/ketcher2/node_modules/fs-exists-cached/package.json
generated
vendored
Normal file
53
static/js/ketcher2/node_modules/fs-exists-cached/package.json
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"_from": "fs-exists-cached@^1.0.0",
|
||||
"_id": "fs-exists-cached@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-zyVVTKBQ3EmuZla0HeQiWJidy84=",
|
||||
"_location": "/fs-exists-cached",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "fs-exists-cached@^1.0.0",
|
||||
"name": "fs-exists-cached",
|
||||
"escapedName": "fs-exists-cached",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/tap"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz",
|
||||
"_shasum": "cf25554ca050dc49ae6656b41de42258989dcbce",
|
||||
"_spec": "fs-exists-cached@^1.0.0",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/tap",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/fs-exists-cached/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Just like `fs.exists` and `fs.existsSync`, but cached",
|
||||
"devDependencies": {
|
||||
"tap": "9 || 10"
|
||||
},
|
||||
"homepage": "https://github.com/isaacs/fs-exists-cached#readme",
|
||||
"keywords": [],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "fs-exists-cached",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/fs-exists-cached.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test.js --100"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
60
static/js/ketcher2/node_modules/fs-exists-cached/test.js
generated
vendored
Normal file
60
static/js/ketcher2/node_modules/fs-exists-cached/test.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
var exists = require('./')
|
||||
var t = require('tap')
|
||||
var touch = require('touch')
|
||||
var rimraf = require('rimraf')
|
||||
|
||||
t.test('setup', function (t) {
|
||||
touch.sync('one')
|
||||
touch.sync('two')
|
||||
touch.sync('three')
|
||||
touch.sync('four')
|
||||
t.end()
|
||||
})
|
||||
|
||||
t.test('existing file same way', function (t) {
|
||||
t.plan(4)
|
||||
t.ok(exists.sync('one'))
|
||||
t.ok(exists.sync('one'))
|
||||
exists('two', function (e) {
|
||||
t.ok(e)
|
||||
exists('two', t.ok)
|
||||
})
|
||||
})
|
||||
|
||||
t.test('existing file different ways', function (t) {
|
||||
t.plan(4)
|
||||
t.ok(exists.sync('three'))
|
||||
t.ok(exists.sync('four'))
|
||||
exists('three', function (e) {
|
||||
t.ok(e)
|
||||
exists('four', t.ok)
|
||||
})
|
||||
})
|
||||
|
||||
t.test('non-existing file same way', function (t) {
|
||||
t.plan(4)
|
||||
t.notOk(exists.sync('one-no'))
|
||||
t.notOk(exists.sync('one-no'))
|
||||
exists('two-no', function (e) {
|
||||
t.notOk(e)
|
||||
exists('two-no', t.notOk)
|
||||
})
|
||||
})
|
||||
|
||||
t.test('non-existing file different ways', function (t) {
|
||||
t.plan(4)
|
||||
t.notOk(exists.sync('three-no'))
|
||||
t.notOk(exists.sync('four-no'))
|
||||
exists('three-no', function (e) {
|
||||
t.notOk(e)
|
||||
exists('four-no', t.notOk)
|
||||
})
|
||||
})
|
||||
|
||||
t.test('cleanup', function (t) {
|
||||
rimraf.sync('one')
|
||||
rimraf.sync('two')
|
||||
rimraf.sync('three')
|
||||
rimraf.sync('four')
|
||||
t.end()
|
||||
})
|
||||
Reference in New Issue
Block a user