Initial import with skill sheet working
This commit is contained in:
26
node_modules/glob-watcher/lib/debounce.js
generated
vendored
Normal file
26
node_modules/glob-watcher/lib/debounce.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
function debounce(fn, delay) {
|
||||
var timeout;
|
||||
var args;
|
||||
var self;
|
||||
|
||||
return function () {
|
||||
self = this;
|
||||
args = arguments;
|
||||
clear();
|
||||
timeout = setTimeout(run, delay);
|
||||
};
|
||||
|
||||
function run() {
|
||||
clear();
|
||||
fn.apply(self, args);
|
||||
}
|
||||
|
||||
function clear() {
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = debounce;
|
33
node_modules/glob-watcher/lib/normalize-args.js
generated
vendored
Normal file
33
node_modules/glob-watcher/lib/normalize-args.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var defaultOpts = {
|
||||
delay: 200,
|
||||
events: ['add', 'change', 'unlink'],
|
||||
ignored: [],
|
||||
ignoreInitial: true,
|
||||
queue: true,
|
||||
};
|
||||
|
||||
function normalizeArgs(glob, options, cb, next) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
var opts = Object.assign({}, defaultOpts, options);
|
||||
|
||||
if (!Array.isArray(opts.events)) {
|
||||
opts.events = [opts.events];
|
||||
}
|
||||
|
||||
if (Array.isArray(glob)) {
|
||||
// We slice so we don't mutate the passed globs array
|
||||
glob = glob.slice();
|
||||
} else {
|
||||
glob = [glob];
|
||||
}
|
||||
|
||||
return next(glob, opts, cb);
|
||||
}
|
||||
|
||||
module.exports = normalizeArgs;
|
Reference in New Issue
Block a user