forked from enviPath/enviPy
Current Dev State
This commit is contained in:
15
static/js/ketcher2/node_modules/own-or-env/LICENSE
generated
vendored
Normal file
15
static/js/ketcher2/node_modules/own-or-env/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
23
static/js/ketcher2/node_modules/own-or-env/README.md
generated
vendored
Normal file
23
static/js/ketcher2/node_modules/own-or-env/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# own-or-env
|
||||
|
||||
Use an objects own property, or an environment variable. Optionally
|
||||
treat as a boolean if the env should be set to 1 or 0.
|
||||
|
||||
## API
|
||||
|
||||
`ownOrEnv(object, field, env, boolean)`
|
||||
|
||||
Use the `object[field]` if it's an own property, otherwise use the
|
||||
named environent variable. If `boolean` is set to `true`, then cast
|
||||
to a boolean flag.
|
||||
|
||||
## USAGE
|
||||
|
||||
```js
|
||||
// will set doTheThing to true based on config.doThing, falling back
|
||||
// to reading process.env.DO_THING, where '0' is treated as false.
|
||||
var doTheThing = ownOrEnv(config, 'doThing', 'DO_THING', true)
|
||||
|
||||
// just treat this one as a string, not a boolean flag
|
||||
var file = ownOrEnv(config, 'file', 'MY_FILE')
|
||||
```
|
||||
7
static/js/ketcher2/node_modules/own-or-env/own-or-env.js
generated
vendored
Normal file
7
static/js/ketcher2/node_modules/own-or-env/own-or-env.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
var ownOr = require('own-or')
|
||||
module.exports = function ownOrEnv (object, field, env, bool) {
|
||||
var res = ownOr(object, field, process.env[env])
|
||||
if (bool)
|
||||
res = !!+(res)
|
||||
return res
|
||||
}
|
||||
48
static/js/ketcher2/node_modules/own-or-env/package.json
generated
vendored
Normal file
48
static/js/ketcher2/node_modules/own-or-env/package.json
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"_from": "own-or-env@^1.0.0",
|
||||
"_id": "own-or-env@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-nvkg/IHi5jz1nUEQElg2jPT8pPs=",
|
||||
"_location": "/own-or-env",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "own-or-env@^1.0.0",
|
||||
"name": "own-or-env",
|
||||
"escapedName": "own-or-env",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/tap"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.0.tgz",
|
||||
"_shasum": "9ef920fc81e2e63cf59d41101258368cf4fca4fb",
|
||||
"_spec": "own-or-env@^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/own-or-env/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Use an objects own property, or an environment variable. Optionally treat as a boolean if the env should be set to 1 or 0.",
|
||||
"homepage": "https://github.com/isaacs/own-or-env#readme",
|
||||
"license": "ISC",
|
||||
"main": "own-or-env.js",
|
||||
"name": "own-or-env",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/isaacs/own-or-env.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
16
static/js/ketcher2/node_modules/own-or-env/test.js
generated
vendored
Normal file
16
static/js/ketcher2/node_modules/own-or-env/test.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
var assert = require('assert')
|
||||
var ownOrEnv = require('./')
|
||||
|
||||
process.env.OWN_OR_BOOL_TRUE = '1'
|
||||
process.env.OWN_OR_BOOL_FALSE = '0'
|
||||
process.env.OWN_OR_STRING = 'foo'
|
||||
|
||||
var conf = { t: true, f: false, s: 'bar' }
|
||||
assert.equal(ownOrEnv(conf, 't', 'OWN_OR_BOOL_FALSE', true), true)
|
||||
assert.equal(ownOrEnv(conf, 'x', 'OWN_OR_BOOL_FALSE', true), false)
|
||||
assert.equal(ownOrEnv(conf, 'f', 'OWN_OR_BOOL_TRUE', true), false)
|
||||
assert.equal(ownOrEnv(conf, 'x', 'OWN_OR_BOOL_TRUE', true), true)
|
||||
assert.equal(ownOrEnv(conf, 's', 'OWN_OR_STRING'), 'bar')
|
||||
assert.equal(ownOrEnv(conf, 'x', 'OWN_OR_STRING'), 'foo')
|
||||
|
||||
console.log('TAP version 13\nok\n1..1')
|
||||
Reference in New Issue
Block a user