promise-toolbox
Advanced tools
Comparing version 0.3.3 to 0.4.0
'use strict';Object.defineProperty(exports,"__esModule",{value:true});exports.TimeoutError=exports.finally=exports.fromCallback=exports.forOwn=exports.forIterable=exports.forIn=exports.forEach=exports.forArray=exports.makeAsyncIterator=exports.defer=exports.cancellable=exports.nodeify=exports.isPromise=undefined;var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj;}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol?"symbol":typeof obj;};exports.all=all;exports.asCallback=asCallback;exports.catchPlus=catchPlus;exports.delay=delay;exports.join=join;exports.lastly=lastly;exports.promisify=promisify;exports.promisifyAll=promisifyAll;exports.reflect=reflect;exports.settle=settle;exports.some=some;exports.timeout=timeout;exports.unpromisify=unpromisify;var _makeError=require('make-error');function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;} // =================================================================== | ||
var _endsWith=function _endsWith(str,suffix){var pos=arguments.length<=2||arguments[2]===undefined?str.length:arguments[2];pos-=suffix.length;return pos>=0&&str.indexOf(suffix,pos)===pos;};var _isArray=Array.isArray||function(value){return value instanceof Array;};var _isLength=function _isLength(value){return typeof value==='number'&&value>=0&&value<Infinity&&Math.floor(value)===value;};var _isArrayLike=function _isArrayLike(value){return value&&_isLength(value.length);};var _isIterable=typeof Symbol==='function'?function(value){return value&&typeof value[Symbol.iterator]==='function';}:function(){return false;};var _noop=function _noop(){}; // ------------------------------------------------------------------- | ||
if(typeof Promise!=='function'||typeof Promise.reject!=='function'||typeof Promise.resolve!=='function'){throw new Error('a standard Promise implementation is required (https://github.com/JsCommunity/promise-toolbox#usage)');} // =================================================================== | ||
var _endsWith=function _endsWith(str,suffix){var pos=arguments.length<=2||arguments[2]===undefined?str.length:arguments[2];pos-=suffix.length;return pos>=0&&str.indexOf(suffix,pos)===pos;};var _isArray=Array.isArray||function(value){return value instanceof Array;};var _isLength=function _isLength(value){return typeof value==='number'&&value>=0&&value<Infinity&&Math.floor(value)===value;};var _isArrayLike=function _isArrayLike(value){return value&&typeof value!=='function'&&_isLength(value.length);};var _isIterable=typeof Symbol==='function'?function(value){return value&&typeof value[Symbol.iterator]==='function';}:function(){return false;};var _noop=function _noop(){}; // ------------------------------------------------------------------- | ||
var _forArray=function _forArray(array,iteratee){var length=array.length;for(var i=0;i<length;++i){iteratee(array[i],i,array);}};var _forIn=function _forIn(object,iteratee){for(var key in object){iteratee(object[key],key,object);}};var _forIterable=function _forIterable(iterable,iteratee){var iterator=iterable[Symbol.iterator]();var current=void 0;while(!(current=iterator.next()).done){iteratee(current.value,null,iterable);}};var hasOwnProperty=Object.prototype.hasOwnProperty;var _forOwn=function _forOwn(object,iteratee){for(var key in object){if(hasOwnProperty.call(object,key)){iteratee(object[key],key,object);}}};var _forEach=function _forEach(collection,iteratee){return _isArray(collection)?_forArray(collection,iteratee):_isIterable(collection)?_forIterable(collection,iteratee):_isArrayLike(collection)?_forArray(collection,iteratee):_forOwn(collection,iteratee);};var _map=function _map(collection,iteratee){var result=_isArrayLike(collection)?new Array(collection.length):{}; // If iteratee is not a function, simply returns the new container. | ||
@@ -4,0 +5,0 @@ if(iteratee){_forEach(collection,function(item,key){result[key]=iteratee(item,key,collection);});}return result;}; // =================================================================== |
{ | ||
"name": "promise-toolbox", | ||
"version": "0.3.3", | ||
"version": "0.4.0", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "description": "Essential utils for promises", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85656
171