forked from enviPath/enviPy
Current Dev State
This commit is contained in:
21
static/js/ketcher2/node_modules/debug-fabulous/LICENSE
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/debug-fabulous/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Nicholas McCready
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
37
static/js/ketcher2/node_modules/debug-fabulous/README.md
generated
vendored
Normal file
37
static/js/ketcher2/node_modules/debug-fabulous/README.md
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
## debug-fabulous [![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url]
|
||||
|
||||
## Install
|
||||
`npm install --save debug-fabulous`
|
||||
|
||||
# Purpose
|
||||
|
||||
Wrapper / Extension around [visionmedia's debug](https://github.com/visionmedia/debug) to allow lazy evaluation of debugging via closure handling.
|
||||
|
||||
This library essentially wraps two things:
|
||||
|
||||
- [lazy-eval](./src/lazy-eval.js): debug closure handling
|
||||
- [spawn](./src/spawn.js): spawns off existing namespaces for a sub namespace.
|
||||
|
||||
|
||||
## Example:
|
||||
|
||||
For usage see the [tests](./test) or the example below.
|
||||
|
||||
```js
|
||||
var debug = require('')();
|
||||
// force namespace to be enabled otherwise it assumes process.env.DEBUG is setup
|
||||
// debug.save('namespace');
|
||||
// debug.enable(debug.load())
|
||||
debug = debug('namespace'); // debugger in the namespace
|
||||
debug(function(){return 'ya something to log' + someLargeHarryString;});
|
||||
debug('small out'); // prints namespace small out
|
||||
var childDbg = debug.spawn('child'); // debugger in the namespace:child
|
||||
childDbg('small out'); // prints namespace:child small out
|
||||
var grandChildDbg = debug.spawn('grandChild'); // debugger in the namespace:child:grandChild
|
||||
grandChildDbg('small out'); // prints namespace:child:grandChild small out
|
||||
```
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/debug-fabulous.svg
|
||||
[npm-url]: https://www.npmjs.com/package/debug-fabulous
|
||||
[travis-image]: https://img.shields.io/travis/nmccready/debug-fabulous.svg
|
||||
[travis-url]: https://travis-ci.org/nmccready/debug-fabulous
|
||||
2
static/js/ketcher2/node_modules/debug-fabulous/index.js
generated
vendored
Normal file
2
static/js/ketcher2/node_modules/debug-fabulous/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
module.exports = require('./src/debugFabFactory');
|
||||
module.exports.spawnable = require('./src/spawn');
|
||||
61
static/js/ketcher2/node_modules/debug-fabulous/package.json
generated
vendored
Normal file
61
static/js/ketcher2/node_modules/debug-fabulous/package.json
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"_from": "debug-fabulous@0.1.X",
|
||||
"_id": "debug-fabulous@0.1.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-7f5cKUu19x1/E1piQCVeRSjJ/YW6se26OKr9GFVj7wOONqdCuhkAsKvgtJpq5gL8HSiMEuohM5hNwDN4SIOblg==",
|
||||
"_location": "/debug-fabulous",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "debug-fabulous@0.1.X",
|
||||
"name": "debug-fabulous",
|
||||
"escapedName": "debug-fabulous",
|
||||
"rawSpec": "0.1.X",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.1.X"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-sourcemaps"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-0.1.2.tgz",
|
||||
"_shasum": "c63ac4df92a13690b8b79d511401d653b0a31767",
|
||||
"_spec": "debug-fabulous@0.1.X",
|
||||
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/gulp-sourcemaps",
|
||||
"author": {
|
||||
"name": "Nicholas McCready"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"debug": "^2.6.9",
|
||||
"memoizee": "0.4.X",
|
||||
"object-assign": "4.X"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "visionmedia debug extensions rolled into one",
|
||||
"devDependencies": {
|
||||
"chai": "3.X",
|
||||
"eslint": "3.X",
|
||||
"hook-std": "0.X",
|
||||
"memwatch-next": "0.3.X",
|
||||
"mocha": "3.X"
|
||||
},
|
||||
"keywords": [
|
||||
"debug",
|
||||
"lazy",
|
||||
"lazy-eval"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "debug-fabulous",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://www.github.com/nmccready/debug-fabulous"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint !./node_modules *.js ./**/*.js",
|
||||
"mocha": "mocha",
|
||||
"test": "npm run lint && mocha ./test/**/*test.js ./test/*.test.js"
|
||||
},
|
||||
"version": "0.1.2"
|
||||
}
|
||||
18
static/js/ketcher2/node_modules/debug-fabulous/src/debugFabFactory.js
generated
vendored
Normal file
18
static/js/ketcher2/node_modules/debug-fabulous/src/debugFabFactory.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
module.exports = function debugFactory(_debugApi, _options) {
|
||||
var wrapLazyEval = require('./lazy-eval');
|
||||
var formatArgs = require('./formatArgs');
|
||||
|
||||
var options = _options || {
|
||||
formatArgs: true
|
||||
};
|
||||
|
||||
var debugApi = _debugApi ? _debugApi : require('debug');
|
||||
debugApi = wrapLazyEval(debugApi);
|
||||
|
||||
debugApi = formatArgs({
|
||||
debugApi: debugApi,
|
||||
options: options
|
||||
});
|
||||
|
||||
return debugApi;
|
||||
}
|
||||
24
static/js/ketcher2/node_modules/debug-fabulous/src/formatArgs.js
generated
vendored
Normal file
24
static/js/ketcher2/node_modules/debug-fabulous/src/formatArgs.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
module.exports = function formatArgs(args) {
|
||||
var debugApi = args.debugApi;
|
||||
var options = args.options;
|
||||
|
||||
if(options.formatArgs == true){
|
||||
/*
|
||||
fixing it so we don't get redundant timestamps on prod
|
||||
https://github.com/visionmedia/debug/issues/161
|
||||
*/
|
||||
debugApi.formatArgs = function() {
|
||||
if (this.useColors)
|
||||
arguments[0] = ' \u001b[9' + this.color + 'm' + this.namespace + ' ' + '\u001b[0m' + arguments[0];
|
||||
else
|
||||
arguments[0] = ' ' + this.namespace + ' ' + arguments[0];
|
||||
|
||||
return arguments;
|
||||
}
|
||||
}
|
||||
else if ( typeof options.formatArgs === 'function'){
|
||||
debugApi.formatArgs = options.formatArgs;
|
||||
}
|
||||
|
||||
return debugApi;
|
||||
}
|
||||
50
static/js/ketcher2/node_modules/debug-fabulous/src/lazy-eval.js
generated
vendored
Normal file
50
static/js/ketcher2/node_modules/debug-fabulous/src/lazy-eval.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
var objectAssign = require('object-assign');
|
||||
var memoize = require('memoizee');
|
||||
|
||||
function _resolveOutput(func, bindThis) {
|
||||
var wrapped = function() {
|
||||
var i = arguments.length;
|
||||
var args = [];
|
||||
while (i--) args[i] = arguments[i];
|
||||
|
||||
// lazy function eval to keep output memory pressure down, if not used
|
||||
if (typeof args[0] === 'function') {
|
||||
args[0] = args[0]();
|
||||
}
|
||||
return func.apply(bindThis, args);
|
||||
};
|
||||
objectAssign(wrapped, func);
|
||||
|
||||
return wrapped;
|
||||
};
|
||||
|
||||
|
||||
function wrapEval(_debug) {
|
||||
|
||||
var debugOrig = _debug;
|
||||
var noop = function(){};
|
||||
|
||||
function debug(namespace) {
|
||||
|
||||
var instance = debugOrig(namespace);
|
||||
|
||||
// if we're not enabled then don't attempt to log anything
|
||||
// if a debug namespace wraps its debug in a closure then it never allocates anything but the function itself
|
||||
if (!instance.enabled){
|
||||
objectAssign(noop, instance);
|
||||
instance = noop;
|
||||
}
|
||||
else {
|
||||
instance = _resolveOutput(instance);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
var debugMemoized = memoize(debug);
|
||||
|
||||
objectAssign(debugMemoized, debugOrig);
|
||||
|
||||
return debugMemoized;
|
||||
}
|
||||
|
||||
module.exports = wrapEval;
|
||||
34
static/js/ketcher2/node_modules/debug-fabulous/src/spawn.js
generated
vendored
Normal file
34
static/js/ketcher2/node_modules/debug-fabulous/src/spawn.js
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
function spawnFactory(_namespace, _debugFabFactory) {
|
||||
var memoize = require('memoizee');
|
||||
var namespace = _namespace || '';
|
||||
var debugFabFactory = _debugFabFactory;
|
||||
|
||||
if(!debugFabFactory){
|
||||
debugFabFactory = require('./debugFabFactory')();
|
||||
}
|
||||
|
||||
function Debugger(_base, _ns){
|
||||
var base = _base || '';
|
||||
var ns = _ns || '';
|
||||
|
||||
var newNs = ns ? [base, ns].join(':') : base;
|
||||
var debug = debugFabFactory(newNs);
|
||||
|
||||
this.debug = debug;
|
||||
this.debug.spawn = this.spawn;
|
||||
}
|
||||
|
||||
Debugger.prototype.spawn = function(ns) {
|
||||
var dbg = new Debugger(this.namespace, ns);
|
||||
|
||||
return dbg.debug;
|
||||
};
|
||||
|
||||
Debugger.prototype.spawn = memoize(Debugger.prototype.spawn);
|
||||
|
||||
var rootDebug = (new Debugger(namespace)).debug;
|
||||
|
||||
return rootDebug;
|
||||
};
|
||||
|
||||
module.exports = spawnFactory;
|
||||
Reference in New Issue
Block a user