@namely/underly
Advanced tools
Comparing version 0.2.0 to 0.2.2
@@ -121,19 +121,32 @@ var isNumber = function isNumber(value) { | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
@@ -537,3 +550,3 @@ | ||
* | ||
* @param {...string} keys - The nested keys to pluck from each scoped value. | ||
* @param {...(string|number)} keys - The nested keys to pluck from each scoped value. | ||
* @returns {function(input: any): any} | ||
@@ -712,3 +725,3 @@ */ | ||
export { chunk, filter, find, flatten, groupBy, identity, is, join, map, max, maxBy, min, minBy, neg, noop, not, partition, pipe, pluck, reduce, sort, split, tap, trim, unique, fromPrototype }; | ||
export { chunk, filter, find, flatten, fromPrototype, groupBy, identity, is, join, map, max, maxBy, min, minBy, neg, noop, not, partition, pipe, pluck, reduce, sort, split, tap, trim, unique }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -125,19 +125,32 @@ 'use strict'; | ||
function _toConsumableArray(arr) { | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); | ||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); | ||
} | ||
function _arrayWithoutHoles(arr) { | ||
if (Array.isArray(arr)) { | ||
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
if (Array.isArray(arr)) return _arrayLikeToArray(arr); | ||
} | ||
function _iterableToArray(iter) { | ||
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); | ||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableSpread() { | ||
throw new TypeError("Invalid attempt to spread non-iterable instance"); | ||
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
} | ||
@@ -541,3 +554,3 @@ | ||
* | ||
* @param {...string} keys - The nested keys to pluck from each scoped value. | ||
* @param {...(string|number)} keys - The nested keys to pluck from each scoped value. | ||
* @returns {function(input: any): any} | ||
@@ -720,2 +733,3 @@ */ | ||
exports.flatten = flatten; | ||
exports.fromPrototype = fromPrototype; | ||
exports.groupBy = groupBy; | ||
@@ -742,3 +756,2 @@ exports.identity = identity; | ||
exports.unique = unique; | ||
exports.fromPrototype = fromPrototype; | ||
//# sourceMappingURL=index.js.map |
@@ -31,5 +31,5 @@ import { Head, Tail } from './util/types'; | ||
* | ||
* @param {...string} keys - The nested keys to pluck from each scoped value. | ||
* @param {...(string|number)} keys - The nested keys to pluck from each scoped value. | ||
* @returns {function(input: any): any} | ||
*/ | ||
export declare const pluck: <Keys extends string[]>(...keys: Keys) => <T extends any>(input: T) => Pluck<T, Keys>; | ||
export declare const pluck: <Keys extends (string | number)[]>(...keys: Keys) => <T extends unknown>(input: T) => Pluck<T, Keys>; |
{ | ||
"name": "@namely/underly", | ||
"version": "0.2.0", | ||
"version": "0.2.2", | ||
"description": "Lightweight functional helpers", | ||
"author": "Vince Malone <vince.malone@namely.com>", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=12", | ||
"npm": "please-use-yarn", | ||
"yarn": ">=1.22.4" | ||
}, | ||
"repository": { | ||
@@ -20,11 +25,11 @@ "type": "git", | ||
"test": "ava", | ||
"test:watch": "npm test -- -w", | ||
"check": "npm run type-check && npm run lint && npm test", | ||
"release": "npm run check && npm run build && npm run declaration" | ||
"test:watch": "yarn test -- -w", | ||
"check": "yarn type-check && yarn lint && yarn test", | ||
"release": "yarn check && yarn build && yarn declaration" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.3.3", | ||
"@babel/preset-env": "^7.3.1", | ||
"@babel/preset-typescript": "^7.3.3", | ||
"@babel/register": "^7.0.0", | ||
"@babel/core": "^7.14.8", | ||
"@babel/preset-env": "^7.14.8", | ||
"@babel/preset-typescript": "^7.14.5", | ||
"@babel/register": "^7.14.5", | ||
"ava": "^1.2.1", | ||
@@ -31,0 +36,0 @@ "prettier": "1.16.4", |
@@ -0,0 +0,0 @@ import resolve from 'rollup-plugin-node-resolve'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { isNumber } from './util/isNumber'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { identity } from './identity'; |
@@ -0,0 +0,0 @@ import test, { Macro } from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ export { chunk } from './chunk'; |
@@ -0,0 +0,0 @@ import test, { Macro } from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test, { Macro } from 'ava'; |
@@ -0,0 +0,0 @@ interface Compare<T> { |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { max } from './max'; |
@@ -0,0 +0,0 @@ import test, { Macro } from 'ava'; |
@@ -0,0 +0,0 @@ import { neg } from './neg'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { min } from './min'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ // prettier-ignore |
@@ -0,0 +0,0 @@ import test, { Macro } from 'ava'; |
@@ -35,6 +35,6 @@ import { Head, Tail } from './util/types'; | ||
* | ||
* @param {...string} keys - The nested keys to pluck from each scoped value. | ||
* @param {...(string|number)} keys - The nested keys to pluck from each scoped value. | ||
* @returns {function(input: any): any} | ||
*/ | ||
export const pluck = <Keys extends string[]>(...keys: Keys) => { | ||
export const pluck = <Keys extends Array<string|number>>(...keys: Keys) => { | ||
if (keys.length === 0) { | ||
@@ -41,0 +41,0 @@ throw new Error('[_ly/pluck] At least one key must be provided.'); |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { noop } from './noop'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { fromPrototype } from './util/fromPrototype'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ import { identity } from './identity'; |
@@ -0,0 +0,0 @@ import test from 'ava'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import test from 'ava'; |
export const isNumber = (value: any) => typeof value === 'number' && Number.isFinite(value); |
@@ -0,0 +0,0 @@ import { Macro } from 'ava'; |
@@ -0,0 +0,0 @@ export type Head<T> = T extends [any, ...any[]] |
require('@babel/register')({ | ||
extensions: ['.ts'], | ||
}); |
@@ -0,0 +0,0 @@ # TODO |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
162003
3346
1