Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@serverless/utils

Package Overview
Dependencies
Maintainers
2
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serverless/utils - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

dist/common/isOp.js

1

dist/common/all.js

@@ -56,2 +56,3 @@ 'use strict';

var _ref = _asyncToGenerator(function* (value) {
// TODO BRN: add support for more than one parameter
if ((0, _isArray2.default)(value)) {

@@ -58,0 +59,0 @@ return _bluebird2.default.all(value);

@@ -97,2 +97,20 @@ 'use strict';

var _isOp = require('./isOp');
Object.defineProperty(exports, 'isOp', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_isOp).default;
}
});
var _isResolved = require('./isResolved');
Object.defineProperty(exports, 'isResolved', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_isResolved).default;
}
});
var _memoize = require('./memoize');

@@ -134,2 +152,11 @@

var _pipe = require('./pipe');
Object.defineProperty(exports, 'pipe', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_pipe).default;
}
});
var _resolve = require('./resolve');

@@ -144,2 +171,20 @@

var _resolveToGeneratorWith = require('./resolveToGeneratorWith');
Object.defineProperty(exports, 'resolveToGeneratorWith', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_resolveToGeneratorWith).default;
}
});
var _resolveWith = require('./resolveWith');
Object.defineProperty(exports, 'resolveWith', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_resolveWith).default;
}
});
var _sleep = require('./sleep');

@@ -146,0 +191,0 @@

2

dist/data/arrayLikeKeys.js

@@ -31,3 +31,3 @@ 'use strict';

*
* @func
* @function
* @since v0.0.3

@@ -34,0 +34,0 @@ * @category data

@@ -24,2 +24,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -26,0 +27,0 @@ * @category data

@@ -7,10 +7,59 @@ 'use strict';

var _ramda = require('ramda');
var _curry = require('../common/curry');
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _ramda.forEach;
var _curry2 = _interopRequireDefault(_curry);
var _defn = require('../common/defn');
var _defn2 = _interopRequireDefault(_defn);
var _pipe = require('../common/pipe');
var _pipe2 = _interopRequireDefault(_pipe);
var _iterate = require('./iterate');
var _iterate2 = _interopRequireDefault(_iterate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Iterate over a collection calling a provided function `fn` for each element in the collection .
*
* `fn` receives two arguments: *(value, kdx)*
*
* This method automatically upgrades to async. If an async iterator is given to this method it will return a Promise.
*
* Note: `forEach` does not skip deleted or unassigned indices (sparse
* arrays), unlike the native `Array.prototype.forEach` method. For more
* details on this behavior, see:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description
*
* Also note that, unlike `Array.prototype.forEach`, this `forEach` returns
* the original value. In some libraries this function is named `each`.
*
* Dispatches to the `forEach` method of the second argument, if present.
*
* @function
* @since 0.0.3
* @category data
* @param {Function} fn The function to invoke. Receives two arguments, `value` and either `index` for arrays or `key` for objects.
* @param {*} collection The collection to iterate over.
* @returns {*} The original collection.
* @example
*
* const printXPlusFive = x => console.log(x + 5);
* forEach(printXPlusFive, [1, 2, 3]); //=> [1, 2, 3]
* // logs 6
* // logs 7
* // logs 8
*/
const forEach = (0, _curry2.default)((0, _defn2.default)('forEach', (fn, collection) => (0, _pipe2.default)(() => (0, _iterate2.default)(next => (0, _pipe2.default)(pNext => {
if (pNext.done) {
return pNext;
}
});
return fn(pNext.value, pNext.kdx, collection);
}, () => next)(next), collection), () => collection)()));
exports.default = forEach;
//# sourceMappingURL=forEach.js.map

@@ -7,6 +7,2 @@ 'use strict';

var _addIndex = require('./addIndex');
var _addIndex2 = _interopRequireDefault(_addIndex);
var _forEach = require('./forEach');

@@ -18,5 +14,15 @@

const forEachIndexed = (0, _addIndex2.default)(_forEach2.default);
/**
* Alias for [forEach](#forEach) method
*
* @function
* @since 0.0.3
* @category data
* @param {Function} fn The function to invoke. Receives two arguments, `value` and either `index` for arrays or `key` for objects.
* @param {*} collection The collection to iterate over.
* @returns {*} The original collection.
*/
const forEachIndexed = _forEach2.default;
exports.default = forEachIndexed;
//# sourceMappingURL=forEachIndexed.js.map

@@ -7,10 +7,21 @@ 'use strict';

var _ramda = require('ramda');
var _forEach = require('./forEach');
Object.defineProperty(exports, 'default', {
enumerable: true,
get: function get() {
return _ramda.forEachObjIndexed;
}
});
var _forEach2 = _interopRequireDefault(_forEach);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Alias for [forEach](#forEach) method
*
* @function
* @since 0.0.3
* @category data
* @param {Function} fn The function to invoke. Receives two arguments, `value` and either `index` for arrays or `key` for objects.
* @param {*} collection The collection to iterate over.
* @returns {*} The original collection.
*/
const forEachObjIndexed = _forEach2.default;
exports.default = forEachObjIndexed;
//# sourceMappingURL=forEachObjIndexed.js.map

@@ -61,2 +61,20 @@ 'use strict';

var _arrayIterator = require('./arrayIterator');
Object.defineProperty(exports, 'arrayIterator', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_arrayIterator).default;
}
});
var _arrayIteratorAtIndex = require('./arrayIteratorAtIndex');
Object.defineProperty(exports, 'arrayIteratorAtIndex', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_arrayIteratorAtIndex).default;
}
});
var _arrayLikeKeys = require('./arrayLikeKeys');

@@ -773,2 +791,20 @@

var _iterate = require('./iterate');
Object.defineProperty(exports, 'iterate', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_iterate).default;
}
});
var _iterator = require('./iterator');
Object.defineProperty(exports, 'iterator', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_iterator).default;
}
});
var _join = require('./join');

@@ -873,2 +909,20 @@

var _objectIterator = require('./objectIterator');
Object.defineProperty(exports, 'objectIterator', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_objectIterator).default;
}
});
var _objectKeys = require('./objectKeys');
Object.defineProperty(exports, 'objectKeys', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_objectKeys).default;
}
});
var _omit = require('./omit');

@@ -1135,2 +1189,11 @@

var _whereEq = require('./whereEq');
Object.defineProperty(exports, 'whereEq', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_whereEq).default;
}
});
var _without = require('./without');

@@ -1137,0 +1200,0 @@

@@ -27,2 +27,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -29,0 +30,0 @@ * @category data

@@ -20,2 +20,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -22,0 +23,0 @@ * @category data

@@ -27,2 +27,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -29,0 +30,0 @@ * @category data

@@ -20,2 +20,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -22,0 +23,0 @@ * @category data

@@ -24,2 +24,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -26,0 +27,0 @@ * @category data

@@ -6,5 +6,5 @@ 'use strict';

});
/** Used as references for various `Number` constants. */
const MAX_SAFE_INTEGER = 9007199254740991;
var _constants = require('../constants');
/** Used to detect unsigned integer values. */

@@ -22,7 +22,16 @@ const reIsUint = /^(?:0|[1-9]\d*)$/;

* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
* @example
*
* isIndex(0)
* //=> true
*
* isIndex(1)
* //=> true
*
* isIndex(-1)
* //=> false
*/
const isIndex = (value, length) => {
const isIndex = (value, length = _constants.MAX_SAFE_INTEGER) => {
// NOTE BRN: max safe length is exactly MAX_SAFE_INTEGER since the length of an array cannot safely be greater than the max integer.
const type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;

@@ -29,0 +38,0 @@ };

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -6,2 +6,9 @@ Object.defineProperty(exports, "__esModule", {

});
var _isNumber = require('./isNumber');
var _isNumber2 = _interopRequireDefault(_isNumber);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -19,2 +26,4 @@ * Determine if the passed argument is an integer.

*
* isInteger(new Number(3)) // => true
*
* isInteger(3.2) // => false

@@ -26,7 +35,9 @@

*
* isInteger(NaN) // => false
*
* isInteger('3') // => false
*/
const isInteger = Number.isInteger || (value => value << 0 === value);
const isInteger = value => (0, _isNumber2.default)(value) && value << 0 == value;
exports.default = isInteger;
//# sourceMappingURL=isInteger.js.map

@@ -6,6 +6,7 @@ 'use strict';

});
const symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
var _constants = require('../constants');
/**
* Checks if `value` implements the iterator symbol
* Checks if `value` implements the iterator symbol or is iterable
*

@@ -19,11 +20,17 @@ * @function

*
* isIterable(new Map) //=> true
* isIterable('abc')
* //=> true
*
* isIterable({}) //=> false
* isIterable(new Map())
* //=> true
*
* isIterable([]) //=> true
* isIterable({})
* //=> false
*
* isIterable([])
* //=> true
*/
const isIterable = value => value != null && value[symIterator] != null;
const isIterable = value => value != null && value[_constants.SYMBOL_ITERATOR] != null;
exports.default = isIterable;
//# sourceMappingURL=isIterable.js.map

@@ -24,2 +24,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -26,0 +27,0 @@ * @category data

@@ -29,5 +29,5 @@ 'use strict';

*/
const isPromise = value => value && (0, _isFunction2.default)(value.then);
const isPromise = value => value != null && (0, _isFunction2.default)(value.then);
exports.default = isPromise;
//# sourceMappingURL=isPromise.js.map

@@ -27,2 +27,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -29,0 +30,0 @@ * @category data

@@ -27,2 +27,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -29,0 +30,0 @@ * @category data

@@ -20,2 +20,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -22,0 +23,0 @@ * @category data

@@ -20,2 +20,3 @@ 'use strict';

*
* @function
* @since 0.0.10

@@ -22,0 +23,0 @@ * @category data

@@ -7,4 +7,2 @@ 'use strict';

var _ramda = require('ramda');
var _arrayLikeKeys = require('./arrayLikeKeys');

@@ -26,2 +24,6 @@

var _objectKeys = require('./objectKeys');
var _objectKeys2 = _interopRequireDefault(_objectKeys);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -63,3 +65,3 @@

let ownKeys = (0, _ramda.keys)(collection);
let ownKeys = (0, _objectKeys2.default)(collection);

@@ -66,0 +68,0 @@ if (typeof Object.getOwnPropertySymbols === 'function') {

@@ -21,3 +21,3 @@ 'use strict';

*
* @func
* @function
* @since v0.0.5

@@ -24,0 +24,0 @@ * @category data

@@ -111,2 +111,3 @@ 'use strict';

*
* This method automatically upgrades to async. If an async iterator is given to this method it will return a Promise.
*

@@ -113,0 +114,0 @@ * Note: `reduce` does not skip deleted or unassigned indices (sparse arrays), unlike the native `Array.prototype.reduce` method. For more details on this behavior, see:

@@ -29,2 +29,10 @@ 'use strict';

var _isEmpty = require('../data/isEmpty');
var _isEmpty2 = _interopRequireDefault(_isEmpty);
var _forEach = require('../data/forEach');
var _forEach2 = _interopRequireDefault(_forEach);
var _readFileIfExists = require('./readFileIfExists');

@@ -42,3 +50,3 @@

const packDir = (() => {
var _ref = _asyncToGenerator(function* (inputDirPath, outputFilePath) {
var _ref = _asyncToGenerator(function* (inputDirPath, outputFilePath, append = []) {
const format = (0, _last2.default)((0, _split2.default)('.', outputFilePath));

@@ -59,2 +67,10 @@

archive.pipe(output);
if (!(0, _isEmpty2.default)(append)) {
(0, _forEach2.default)(function (file) {
const stream = (0, _fsExtra.createReadStream)(file);
archive.append(stream, { name: _path2.default.basename(file) });
}, append);
}
archive.glob('**/*', {

@@ -61,0 +77,0 @@ cwd: inputDirPath,

@@ -12,2 +12,3 @@ 'use strict';

const common = require('./common');
const constants = require('./constants');
const data = require('./data');

@@ -21,3 +22,3 @@ const error = require('./error');

module.exports = Object.assign({}, common, data, error, fetch, fs, ip, lang, path);
module.exports = Object.assign({}, common, constants, data, error, fetch, fs, ip, lang, path);
//# sourceMappingURL=index.js.map
{
"name": "@serverless/utils",
"version": "0.0.10",
"version": "0.0.11",
"description": "General serverless utilities",

@@ -5,0 +5,0 @@ "author": "Serverless, Inc.",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc