Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="node" />
import { Writable } from "stream";
export declare const runUseContainer: (strm: Writable, item: any, cb: Function) => void;
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var baseHasIn = require('./_baseHasIn'),
hasPath = require('./_hasPath');

/**
* Checks if `path` is a direct or inherited property of `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path to check.
* @returns {boolean} Returns `true` if `path` exists, else `false`.
* @example
*
* var object = _.create({ 'a': _.create({ 'b': 2 }) });
*
* _.hasIn(object, 'a');
* // => true
*
* _.hasIn(object, 'a.b');
* // => true
*
* _.hasIn(object, ['a', 'b']);
* // => true
*
* _.hasIn(object, 'b');
* // => false
*/
function hasIn(object, path) {
return object != null && hasPath(object, path, baseHasIn);
}

module.exports = hasIn;
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _eachOfLimit;

var _noop = require('lodash/noop');

var _noop2 = _interopRequireDefault(_noop);

var _once = require('./once');

var _once2 = _interopRequireDefault(_once);

var _iterator = require('./iterator');

var _iterator2 = _interopRequireDefault(_iterator);

var _onlyOnce = require('./onlyOnce');

var _onlyOnce2 = _interopRequireDefault(_onlyOnce);

var _breakLoop = require('./breakLoop');

var _breakLoop2 = _interopRequireDefault(_breakLoop);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _eachOfLimit(limit) {
return function (obj, iteratee, callback) {
callback = (0, _once2.default)(callback || _noop2.default);
if (limit <= 0 || !obj) {
return callback(null);
}
var nextElem = (0, _iterator2.default)(obj);
var done = false;
var running = 0;
var looping = false;

function iterateeCallback(err, value) {
running -= 1;
if (err) {
done = true;
callback(err);
} else if (value === _breakLoop2.default || done && running <= 0) {
done = true;
return callback(null);
} else if (!looping) {
replenish();
}
}

function replenish() {
looping = true;
while (running < limit && !done) {
var elem = nextElem();
if (elem === null) {
done = true;
if (running <= 0) {
callback(null);
}
return;
}
running += 1;
iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback));
}
looping = false;
}

replenish();
};
}
module.exports = exports['default'];
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../function'));
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('defaultsAll', require('../defaults'));

func.placeholder = require('./placeholder');
module.exports = func;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env node
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
const chalk_1 = require("chalk");
let v = process.argv[2] || '';
const color = process.argv[3] || '';
const isStderr = process.argv[4] || '';
if (color) {
try {
v = chalk_1.default[color](v);
}
catch (err) {
}
}
process.stdin.resume()
.pipe(_1.pt(v))
.pipe(isStderr ? process.stderr : process.stdout);
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
var apply = require('./_apply'),
arrayPush = require('./_arrayPush'),
baseRest = require('./_baseRest'),
castSlice = require('./_castSlice'),
toInteger = require('./toInteger');

/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;

/**
* Creates a function that invokes `func` with the `this` binding of the
* create function and an array of arguments much like
* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
*
* **Note:** This method is based on the
* [spread operator](https://mdn.io/spread_operator).
*
* @static
* @memberOf _
* @since 3.2.0
* @category Function
* @param {Function} func The function to spread arguments over.
* @param {number} [start=0] The start position of the spread.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.spread(function(who, what) {
* return who + ' says ' + what;
* });
*
* say(['fred', 'hello']);
* // => 'fred says hello'
*
* var numbers = Promise.all([
* Promise.resolve(40),
* Promise.resolve(36)
* ]);
*
* numbers.then(_.spread(function(x, y) {
* return x + y;
* }));
* // => a Promise of 76
*/
function spread(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start == null ? 0 : nativeMax(toInteger(start), 0);
return baseRest(function(args) {
var array = args[start],
otherArgs = castSlice(args, 0, start);

if (array) {
arrayPush(otherArgs, array);
}
return apply(func, this, otherArgs);
});
}

module.exports = spread;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- 0.6
- 0.8
- 0.9
- 0.10
- 0.12
- 4.2.4
- 5.4.1
- iojs-1
- iojs-2
- iojs-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const process = require('suman-browser-polyfills/modules/process');
const global = require('suman-browser-polyfills/modules/global');
const path = require("path");
const cp = require("child_process");
const _suman = global.__suman = (global.__suman || {});
exports.run = function (opts) {
const script = path.resolve(__dirname + '/../../scripts/suman-postinstall.sh');
console.log('\n');
console.log(' => Suman will run its postinstall routine.');
console.log('\n');
const k = cp.spawn(script);
k.stdout.pipe(process.stdout);
k.stderr.pipe(process.stderr);
k.once('close', function (code) {
process.exit(code || 0);
});
};
Loading