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

@livechat/data-utils

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livechat/data-utils - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

types/toArray.d.ts

6

dist/data-utils.es.js

@@ -785,2 +785,6 @@ function add(first, second) {

function toArray(arrayLike) {
return Array.prototype.slice.call(arrayLike);
}
var toPairs = function toPairs(obj) {

@@ -891,2 +895,2 @@ return Object.keys(obj).map(function (key) {

export { add, assign, chain, cloneDeep, camelCase, compact, compose, debounce, defaultTo, drop, dropRight, ensureArray, entries, find, findIndex, findKey, findLast, findLastIndex, findLastIndexFrom, filledArray, flatMap, flatten, forOwn, fromPairs, generateRandomId, generateUniqueId, get, getOr, groupBy, groupKeys, hasOwn, identity, includes, isArray, isEmpty, isFalsy, isNil, isObject, isTruthy, isPromise, keyBy, keys, last, mapKeys, mapValues, mapValuesIndexed, merge, mergeAll, memoize, memoizeOne, memoizeWith, noop, numericSortBy, omit, omitBy, omitByIndexed, once, over, overArgs, pair, partitionObject, pick, pickBy, pickByIndexed, pickOwn, range, reject, removeAt, set$1 as set, shallowEqual, sliceDiff, snakeCase, someAreTruthy, splitAt, splitRightWhenAccum, spread, sum, take, takeLast, takeRightWhile, takeRightWhileFrom, throttle, toPairs, trailingThrottle, leadingThrottle, stringCompare, trimStart, trimEnd, repeat, uniq, uniqBy, update, values, without, zip, zipWith };
export { add, assign, chain, cloneDeep, camelCase, compact, compose, debounce, defaultTo, drop, dropRight, ensureArray, entries, find, findIndex, findKey, findLast, findLastIndex, findLastIndexFrom, filledArray, flatMap, flatten, forOwn, fromPairs, generateRandomId, generateUniqueId, get, getOr, groupBy, groupKeys, hasOwn, identity, includes, isArray, isEmpty, isFalsy, isNil, isObject, isTruthy, isPromise, keyBy, keys, last, mapKeys, mapValues, mapValuesIndexed, merge, mergeAll, memoize, memoizeOne, memoizeWith, noop, numericSortBy, omit, omitBy, omitByIndexed, once, over, overArgs, pair, partitionObject, pick, pickBy, pickByIndexed, pickOwn, range, reject, removeAt, set$1 as set, shallowEqual, sliceDiff, snakeCase, someAreTruthy, splitAt, splitRightWhenAccum, spread, sum, take, takeLast, takeRightWhile, takeRightWhileFrom, throttle, toArray, toPairs, trailingThrottle, leadingThrottle, stringCompare, trimStart, trimEnd, repeat, uniq, uniqBy, update, values, without, zip, zipWith };

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

function toArray(arrayLike) {
return Array.prototype.slice.call(arrayLike);
}
var toPairs = function toPairs(obj) {

@@ -977,2 +981,3 @@ return Object.keys(obj).map(function (key) {

exports.throttle = throttle;
exports.toArray = toArray;
exports.toPairs = toPairs;

@@ -979,0 +984,0 @@ exports.trailingThrottle = trailingThrottle;

@@ -791,2 +791,6 @@ (function (global, factory) {

function toArray(arrayLike) {
return Array.prototype.slice.call(arrayLike);
}
var toPairs = function toPairs(obj) {

@@ -979,2 +983,3 @@ return Object.keys(obj).map(function (key) {

exports.throttle = throttle;
exports.toArray = toArray;
exports.toPairs = toPairs;

@@ -981,0 +986,0 @@ exports.trailingThrottle = trailingThrottle;

2

dist/data-utils.umd.min.js

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

!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.DataUtils={})}(this,function(n){"use strict";function r(n,r){return n+r}var t={}.hasOwnProperty;function a(n,r){return t.call(r,n)}function e(){return(e=Object.assign||function(t){for(var n=arguments.length,r=Array(1<n?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];return r.forEach(function(n){for(var r in n)a(r,n)&&(t[r]=n[r])}),t}).apply(void 0,arguments)}function u(n,r){var t;return(t=[]).concat.apply(t,r.map(n))}var c=Array.isArray;function f(n){return"object"==typeof n&&null!==n&&!c(n)}function i(t,e){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r]),n},{})}function o(n){return null==n}function l(n,r){for(var t=0;t<r.length;t++){var e=r[t];if(n(e))return e}}function s(n,r,t){for(var e=r;0<=e;e--)if(n(t[e]))return e;return-1}function p(n){return n}function v(r,t){return Object.keys(t).forEach(function(n){r(t[n],n)})}function y(){return Math.random().toString(36).substring(2)}function d(n,r){for(var t="string"==typeof n?n.split("."):n,e=0,u=r;u&&e<t.length;)u=u[t[e++]];return u}function h(n){return 0===(c(n)?n:Object.keys(n)).length}function g(u,i){if(h(i))return u;var o={};return v(function(n,r){if(a(r,i))if(f(u[r])&&f(i[r]))o[r]=g(u[r],i[r]);else if(c(u[r])&&c(i[r])){var t=Math.max(u[r].length,i[r].length);o[r]=Array(t);for(var e=0;e<t;e++)e in i[r]?o[r][e]=i[r][e]:e in u[r]&&(o[r][e]=u[r][e])}else o[r]=i[r];else o[r]=u[r]},u),v(function(n,r){a(r,o)||(o[r]=i[r])},i),o}function m(t,e){var u={};return function(){var n=t.apply(void 0,arguments);if(a(n,u))return u[n];var r=e.apply(void 0,arguments);return u[n]=r}}function O(r){return Object.keys(r).map(function(n){return r[n]})}function b(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r],r)||(n[r]=e[r]),n},{})}function j(n,r){return r.slice(-n)}function k(n,r){return[n,r]}function w(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r],r)&&(n[r]=e[r]),n},{})}function A(){return(A=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n}).apply(this,arguments)}function x(n,r){return n===r?0!==n||0!==r||1/n==1/r:n!=n&&r!=r}function C(n,r){return[r.slice(0,n),r.slice(n,r.length)]}function D(r,n,t){var e=s(function(n){return!r(n)},n,t);return e===n?[]:t.slice(e+1,n+1)}var T=/^\s+/;var L=/\s+$/;function z(t,n){var e=[];return n.filter(function(n){var r=t(n);return-1==e.indexOf(r)&&(e.push(r),!0)})}function B(t,n,e){return n.map(function(n,r){return t(n,e[r])})}n.add=r,n.assign=e,n.chain=function(r,t){return"function"==typeof t?function(n){return r(t(n))(n)}:u(r,t)},n.cloneDeep=function n(r){return c(r)?r.map(n):f(r)?i(n,r):r},n.camelCase=function(n){var r=n.trim();return 0===r.length?"":1===r.length?r.toLowerCase():/^[a-z\d]+$/.test(r)?r:(r!==r.toLowerCase()&&(r=function(n){for(var r=n,t=!1,e=!1,u=!1,i=0;i<r.length;i++){var o=r[i];t&&/[a-zA-Z]/.test(o)&&o.toUpperCase()===o?(r=r.slice(0,i)+"-"+r.slice(i),u=e,e=!(t=!1),i++):e&&u&&/[a-zA-Z]/.test(o)&&o.toLowerCase()===o?(r=r.slice(0,i-1)+"-"+r.slice(i-1),u=e,t=!(e=!1)):(t=o.toLowerCase()===o,u=e,e=o.toUpperCase()===o)}return r}(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,function(n,r){return r.toUpperCase()}))},n.compact=function(e){return c(e)?e.filter(function(n){return null!=n}):Object.keys(e).reduce(function(n,r){var t=e[r];return null!=t&&(n[r]=t),n},{})},n.compose=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return r.reduce(function(n,r){return function(){return n(r.apply(void 0,arguments))}})},n.debounce=function(e,u){var i;return function(){clearTimeout(i);for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];i=setTimeout.apply(void 0,[u,e].concat(r))}},n.defaultTo=function(r){return function(n){return o(n)?r:n}},n.drop=function(n,r){return r.slice(n)},n.dropRight=function(n,r){return r.slice(0,-n)},n.ensureArray=function(n){return c(n)?n:[n]},n.entries=function(r){return Object.keys(r).map(function(n){return[n,r[n]]})},n.find=l,n.findIndex=function(n,r){for(var t=0;t<r.length;t++)if(n(r[t]))return t;return-1},n.findKey=function(r,t){return l(function(n){return r(t[n])},Object.keys(t))},n.findLast=function(n,r){for(var t=r.length-1;0<=t;t--)if(n(r[t]))return r[t]},n.findLastIndex=function(n,r){return s(n,r.length-1,r)},n.findLastIndexFrom=s,n.filledArray=function(n,r){for(var t=[];n--;)t.push(r);return t},n.flatMap=u,n.flatten=function(n){return u(p,n)},n.forOwn=v,n.fromPairs=function(n){return n.reduce(function(n,r){return n[r[0]]=r[1],n},{})},n.generateRandomId=y,n.generateUniqueId=function n(r){var t=y();return a(t,r)?n(r):t},n.get=d,n.getOr=function(n,r,t){var e=d(r,t);return null!=e?e:n},n.groupBy=function(u,i){return Object.keys(i).reduce(function(n,r){var t=i[r],e=u(t);return n[e]=n[e]||[],n[e].push(t),n},{})},n.groupKeys=function(e,u){return Object.keys(u).reduce(function(n,r){var t=e(r);return n[t]=n[t]||{},n[t][r]=u[r],n},{})},n.hasOwn=a,n.identity=p,n.includes=function(n,r){return-1!=r.indexOf(n)},n.isArray=c,n.isEmpty=h,n.isFalsy=function(n){return!n},n.isNil=o,n.isObject=f,n.isTruthy=function(n){return!!n},n.isPromise=function(n){return!!n&&"function"==typeof n.then},n.keyBy=function(t,n){return n.reduce(function(n,r){return n[r[t]]=r,n},{})},n.keys=function(n){var r=[];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.push(t);return r},n.last=function(n){return 0<n.length?n[n.length-1]:null},n.mapKeys=function(t,e){return Object.keys(e).reduce(function(n,r){return n[t(r)]=e[r],n},{})},n.mapValues=i,n.mapValuesIndexed=function(t,e){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})},n.merge=g,n.mergeAll=function(n){if(0===n.length)return{};var r=n[0];return n.slice(1).reduce(function(n,r){return g(n,r)},r)},n.memoize=function(n){return m(p,n)},n.memoizeOne=function(n){var r,t,e=!1;return function(){return e&&(0<arguments.length?arguments[0]:void 0)===t?r:(e=!0,t=0<arguments.length?arguments[0]:void 0,r=n.apply(void 0,arguments))}},n.memoizeWith=m,n.noop=function(){},n.numericSortBy=function(r,n){var t="function"==typeof r?r:function(n){return d(r,n)};return(c(n)?[].concat(n):O(n)).sort(function(n,r){return t(n)-t(r)})},n.omit=function(t,n){return b(function(n,r){return-1!=t.indexOf(r)},n)},n.omitBy=function(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r])||(n[r]=e[r]),n},{})},n.omitByIndexed=b,n.once=function(n){var r,t=!1;return function(){return t?r:(t=!0,r=n.apply(void 0,arguments))}},n.over=function(e){return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.map(function(n){return n.apply(void 0,r)})}},n.overArgs=function(u,i){return function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];var e=i.map(function(n,r){return n(t[r])});return u.apply(void 0,e.length<t.length?e.concat(j(t.length-e.length,t)):e)}},n.pair=k,n.partitionObject=function(t,e){return Object.keys(e).reduce(function(n,r){return n[t(e[r])?0:1][r]=e[r],n},[{},{}])},n.pick=function(n,t){return n.reduce(function(n,r){return n[r]=t[r],n},{})},n.pickBy=function(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r])&&(n[r]=e[r]),n},{})},n.pickByIndexed=w,n.pickOwn=function(n,t){return n.reduce(function(n,r){return a(r,t)&&(n[r]=t[r]),n},{})},n.range=function(n){for(var r=[],t=0;t<=n;)r.push(t++);return r},n.reject=function(r,n){return n.filter(function(n){return!r(n)})},n.removeAt=function(n,r){var t=[].concat(r);return t.splice(n,1),t},n.set=function n(r,t,e){var u,i=r.split?r.split("."):r,o=i[0],c=t;if(1<i.length){var f=null!=e&&a(o,e)?e[o]:{};c=n(i.slice(1),t,f)}return A({},e,((u={})[o]=c,u))},n.shallowEqual=function(n,r){if(x(n,r))return!0;if("object"!=typeof n||null===n||"object"!=typeof r||null===r)return!1;var t=Object.keys(n);if(t.length!==Object.keys(r).length)return!1;for(var e=0;e<t.length;e++)if(!a(t[e],r)||!x(n[t[e]],r[t[e]]))return!1;return!0},n.sliceDiff=function(n,t){var r=w(function(n,r){return n!==t[r]},n);return h(r)?null:r},n.snakeCase=function(n){var r=n.replace(/[A-Z]|([-_ ]+)/g,function(n){var r=n.charCodeAt(0);return 64<r&&r<91?"_"+n.toLowerCase():"_"});return"_"===r[0]?r.substr(1):r},n.someAreTruthy=function(n){return n.some(p)},n.splitAt=C,n.splitRightWhenAccum=function(n,r,t){for(var e=t.length;0<e;e--){var u=n(t[e-1],r);if(r=u[1],u[0])return C(e-1,t)}return[[],t]},n.spread=function(r){return function(n){return r.apply(void 0,n)}},n.sum=function(n){return n.reduce(r,0)},n.take=function(n,r){return r.slice(0,n)},n.takeLast=j,n.takeRightWhile=function(n,r){return D(n,r.length-1,r)},n.takeRightWhileFrom=D,n.throttle=function(u,n){var i,o=Date.now()-2*u,c=function(){o=Date.now(),n.apply(void 0,arguments)};return function(){for(var n=Date.now(),r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];n-o<u?(clearTimeout(i),i=setTimeout.apply(void 0,[c,o-n+u].concat(t))):c.apply(void 0,t)}},n.toPairs=function(r){return Object.keys(r).map(function(n){return[n,r[n]]})},n.trailingThrottle=function(u,i){var o,c=Date.now()-2*u;return function(){var n=Date.now();n-c<u||(c=Date.now()),clearTimeout(o);for(var r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];o=setTimeout.apply(void 0,[function(){return c=Date.now(),i.apply(void 0,arguments)},c-n+u].concat(t))}},n.leadingThrottle=function(n,r){var t=0;return function(){Date.now()-t<n||(t=Date.now(),r.apply(void 0,arguments))}},n.stringCompare=function(n,r){return n===r?0:n<r?-1:1},n.trimStart=function(n){return n.replace(T,"")},n.trimEnd=function(n){return n.replace(L,"")},n.repeat=function(n,r){return Array(n+1).join(r)},n.uniq=function(n){return z(p,n)},n.uniqBy=z,n.update=function(n,r,t){return[].concat(t.slice(0,n),[r],t.slice(n+1,t.length))},n.values=O,n.without=function(r,n){return n.filter(function(n){return-1==r.indexOf(n)})},n.zip=function(n,r){return B(k,n,r)},n.zipWith=B,Object.defineProperty(n,"__esModule",{value:!0})});
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.DataUtils={})}(this,function(n){"use strict";function r(n,r){return n+r}var t={}.hasOwnProperty;function a(n,r){return t.call(r,n)}function e(){return(e=Object.assign||function(t){for(var n=arguments.length,r=Array(1<n?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];return r.forEach(function(n){for(var r in n)a(r,n)&&(t[r]=n[r])}),t}).apply(void 0,arguments)}function u(n,r){var t;return(t=[]).concat.apply(t,r.map(n))}var c=Array.isArray;function f(n){return"object"==typeof n&&null!==n&&!c(n)}function o(t,e){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r]),n},{})}function i(n){return null==n}function l(n,r){for(var t=0;t<r.length;t++){var e=r[t];if(n(e))return e}}function s(n,r,t){for(var e=r;0<=e;e--)if(n(t[e]))return e;return-1}function p(n){return n}function y(r,t){return Object.keys(t).forEach(function(n){r(t[n],n)})}function v(){return Math.random().toString(36).substring(2)}function d(n,r){for(var t="string"==typeof n?n.split("."):n,e=0,u=r;u&&e<t.length;)u=u[t[e++]];return u}function h(n){return 0===(c(n)?n:Object.keys(n)).length}function g(u,o){if(h(o))return u;var i={};return y(function(n,r){if(a(r,o))if(f(u[r])&&f(o[r]))i[r]=g(u[r],o[r]);else if(c(u[r])&&c(o[r])){var t=Math.max(u[r].length,o[r].length);i[r]=Array(t);for(var e=0;e<t;e++)e in o[r]?i[r][e]=o[r][e]:e in u[r]&&(i[r][e]=u[r][e])}else i[r]=o[r];else i[r]=u[r]},u),y(function(n,r){a(r,i)||(i[r]=o[r])},o),i}function m(t,e){var u={};return function(){var n=t.apply(void 0,arguments);if(a(n,u))return u[n];var r=e.apply(void 0,arguments);return u[n]=r}}function O(r){return Object.keys(r).map(function(n){return r[n]})}function b(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r],r)||(n[r]=e[r]),n},{})}function j(n,r){return r.slice(-n)}function k(n,r){return[n,r]}function A(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r],r)&&(n[r]=e[r]),n},{})}function w(){return(w=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n}).apply(this,arguments)}function x(n,r){return n===r?0!==n||0!==r||1/n==1/r:n!=n&&r!=r}function C(n,r){return[r.slice(0,n),r.slice(n,r.length)]}function D(r,n,t){var e=s(function(n){return!r(n)},n,t);return e===n?[]:t.slice(e+1,n+1)}var T=/^\s+/;var L=/\s+$/;function z(t,n){var e=[];return n.filter(function(n){var r=t(n);return-1==e.indexOf(r)&&(e.push(r),!0)})}function B(t,n,e){return n.map(function(n,r){return t(n,e[r])})}n.add=r,n.assign=e,n.chain=function(r,t){return"function"==typeof t?function(n){return r(t(n))(n)}:u(r,t)},n.cloneDeep=function n(r){return c(r)?r.map(n):f(r)?o(n,r):r},n.camelCase=function(n){var r=n.trim();return 0===r.length?"":1===r.length?r.toLowerCase():/^[a-z\d]+$/.test(r)?r:(r!==r.toLowerCase()&&(r=function(n){for(var r=n,t=!1,e=!1,u=!1,o=0;o<r.length;o++){var i=r[o];t&&/[a-zA-Z]/.test(i)&&i.toUpperCase()===i?(r=r.slice(0,o)+"-"+r.slice(o),u=e,e=!(t=!1),o++):e&&u&&/[a-zA-Z]/.test(i)&&i.toLowerCase()===i?(r=r.slice(0,o-1)+"-"+r.slice(o-1),u=e,t=!(e=!1)):(t=i.toLowerCase()===i,u=e,e=i.toUpperCase()===i)}return r}(r)),r=r.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,function(n,r){return r.toUpperCase()}))},n.compact=function(e){return c(e)?e.filter(function(n){return null!=n}):Object.keys(e).reduce(function(n,r){var t=e[r];return null!=t&&(n[r]=t),n},{})},n.compose=function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return r.reduce(function(n,r){return function(){return n(r.apply(void 0,arguments))}})},n.debounce=function(e,u){var o;return function(){clearTimeout(o);for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];o=setTimeout.apply(void 0,[u,e].concat(r))}},n.defaultTo=function(r){return function(n){return i(n)?r:n}},n.drop=function(n,r){return r.slice(n)},n.dropRight=function(n,r){return r.slice(0,-n)},n.ensureArray=function(n){return c(n)?n:[n]},n.entries=function(r){return Object.keys(r).map(function(n){return[n,r[n]]})},n.find=l,n.findIndex=function(n,r){for(var t=0;t<r.length;t++)if(n(r[t]))return t;return-1},n.findKey=function(r,t){return l(function(n){return r(t[n])},Object.keys(t))},n.findLast=function(n,r){for(var t=r.length-1;0<=t;t--)if(n(r[t]))return r[t]},n.findLastIndex=function(n,r){return s(n,r.length-1,r)},n.findLastIndexFrom=s,n.filledArray=function(n,r){for(var t=[];n--;)t.push(r);return t},n.flatMap=u,n.flatten=function(n){return u(p,n)},n.forOwn=y,n.fromPairs=function(n){return n.reduce(function(n,r){return n[r[0]]=r[1],n},{})},n.generateRandomId=v,n.generateUniqueId=function n(r){var t=v();return a(t,r)?n(r):t},n.get=d,n.getOr=function(n,r,t){var e=d(r,t);return null!=e?e:n},n.groupBy=function(u,o){return Object.keys(o).reduce(function(n,r){var t=o[r],e=u(t);return n[e]=n[e]||[],n[e].push(t),n},{})},n.groupKeys=function(e,u){return Object.keys(u).reduce(function(n,r){var t=e(r);return n[t]=n[t]||{},n[t][r]=u[r],n},{})},n.hasOwn=a,n.identity=p,n.includes=function(n,r){return-1!=r.indexOf(n)},n.isArray=c,n.isEmpty=h,n.isFalsy=function(n){return!n},n.isNil=i,n.isObject=f,n.isTruthy=function(n){return!!n},n.isPromise=function(n){return!!n&&"function"==typeof n.then},n.keyBy=function(t,n){return n.reduce(function(n,r){return n[r[t]]=r,n},{})},n.keys=function(n){var r=[];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&r.push(t);return r},n.last=function(n){return 0<n.length?n[n.length-1]:null},n.mapKeys=function(t,e){return Object.keys(e).reduce(function(n,r){return n[t(r)]=e[r],n},{})},n.mapValues=o,n.mapValuesIndexed=function(t,e){return Object.keys(e).reduce(function(n,r){return n[r]=t(e[r],r),n},{})},n.merge=g,n.mergeAll=function(n){if(0===n.length)return{};var r=n[0];return n.slice(1).reduce(function(n,r){return g(n,r)},r)},n.memoize=function(n){return m(p,n)},n.memoizeOne=function(n){var r,t,e=!1;return function(){return e&&(0<arguments.length?arguments[0]:void 0)===t?r:(e=!0,t=0<arguments.length?arguments[0]:void 0,r=n.apply(void 0,arguments))}},n.memoizeWith=m,n.noop=function(){},n.numericSortBy=function(r,n){var t="function"==typeof r?r:function(n){return d(r,n)};return(c(n)?[].concat(n):O(n)).sort(function(n,r){return t(n)-t(r)})},n.omit=function(t,n){return b(function(n,r){return-1!=t.indexOf(r)},n)},n.omitBy=function(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r])||(n[r]=e[r]),n},{})},n.omitByIndexed=b,n.once=function(n){var r,t=!1;return function(){return t?r:(t=!0,r=n.apply(void 0,arguments))}},n.over=function(e){return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.map(function(n){return n.apply(void 0,r)})}},n.overArgs=function(u,o){return function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];var e=o.map(function(n,r){return n(t[r])});return u.apply(void 0,e.length<t.length?e.concat(j(t.length-e.length,t)):e)}},n.pair=k,n.partitionObject=function(t,e){return Object.keys(e).reduce(function(n,r){return n[t(e[r])?0:1][r]=e[r],n},[{},{}])},n.pick=function(n,t){return n.reduce(function(n,r){return n[r]=t[r],n},{})},n.pickBy=function(t,e){return Object.keys(e).reduce(function(n,r){return t(e[r])&&(n[r]=e[r]),n},{})},n.pickByIndexed=A,n.pickOwn=function(n,t){return n.reduce(function(n,r){return a(r,t)&&(n[r]=t[r]),n},{})},n.range=function(n){for(var r=[],t=0;t<=n;)r.push(t++);return r},n.reject=function(r,n){return n.filter(function(n){return!r(n)})},n.removeAt=function(n,r){var t=[].concat(r);return t.splice(n,1),t},n.set=function n(r,t,e){var u,o=r.split?r.split("."):r,i=o[0],c=t;if(1<o.length){var f=null!=e&&a(i,e)?e[i]:{};c=n(o.slice(1),t,f)}return w({},e,((u={})[i]=c,u))},n.shallowEqual=function(n,r){if(x(n,r))return!0;if("object"!=typeof n||null===n||"object"!=typeof r||null===r)return!1;var t=Object.keys(n);if(t.length!==Object.keys(r).length)return!1;for(var e=0;e<t.length;e++)if(!a(t[e],r)||!x(n[t[e]],r[t[e]]))return!1;return!0},n.sliceDiff=function(n,t){var r=A(function(n,r){return n!==t[r]},n);return h(r)?null:r},n.snakeCase=function(n){var r=n.replace(/[A-Z]|([-_ ]+)/g,function(n){var r=n.charCodeAt(0);return 64<r&&r<91?"_"+n.toLowerCase():"_"});return"_"===r[0]?r.substr(1):r},n.someAreTruthy=function(n){return n.some(p)},n.splitAt=C,n.splitRightWhenAccum=function(n,r,t){for(var e=t.length;0<e;e--){var u=n(t[e-1],r);if(r=u[1],u[0])return C(e-1,t)}return[[],t]},n.spread=function(r){return function(n){return r.apply(void 0,n)}},n.sum=function(n){return n.reduce(r,0)},n.take=function(n,r){return r.slice(0,n)},n.takeLast=j,n.takeRightWhile=function(n,r){return D(n,r.length-1,r)},n.takeRightWhileFrom=D,n.throttle=function(u,n){var o,i=Date.now()-2*u,c=function(){i=Date.now(),n.apply(void 0,arguments)};return function(){for(var n=Date.now(),r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];n-i<u?(clearTimeout(o),o=setTimeout.apply(void 0,[c,i-n+u].concat(t))):c.apply(void 0,t)}},n.toArray=function(n){return Array.prototype.slice.call(n)},n.toPairs=function(r){return Object.keys(r).map(function(n){return[n,r[n]]})},n.trailingThrottle=function(u,o){var i,c=Date.now()-2*u;return function(){var n=Date.now();n-c<u||(c=Date.now()),clearTimeout(i);for(var r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];i=setTimeout.apply(void 0,[function(){return c=Date.now(),o.apply(void 0,arguments)},c-n+u].concat(t))}},n.leadingThrottle=function(n,r){var t=0;return function(){Date.now()-t<n||(t=Date.now(),r.apply(void 0,arguments))}},n.stringCompare=function(n,r){return n===r?0:n<r?-1:1},n.trimStart=function(n){return n.replace(T,"")},n.trimEnd=function(n){return n.replace(L,"")},n.repeat=function(n,r){return Array(n+1).join(r)},n.uniq=function(n){return z(p,n)},n.uniqBy=z,n.update=function(n,r,t){return[].concat(t.slice(0,n),[r],t.slice(n+1,t.length))},n.values=O,n.without=function(r,n){return n.filter(function(n){return-1==r.indexOf(n)})},n.zip=function(n,r){return B(k,n,r)},n.zipWith=B,Object.defineProperty(n,"__esModule",{value:!0})});
{
"name": "@livechat/data-utils",
"version": "0.2.9",
"version": "0.2.10",
"description": "Collections utility functions",

@@ -5,0 +5,0 @@ "contributors": [

@@ -83,5 +83,7 @@ export { default as add } from './add';

export { default as throttle } from './throttle';
export { default as toArray } from './toArray';
export { default as toPairs } from './toPairs';
export { default as trailingThrottle } from './trailingThrottle';
export { default as leadingThrottle } from './leadingThrottle';
export { default as stringCompare } from './stringCompare';
export { default as trimStart } from './trimStart';

@@ -88,0 +90,0 @@ export { default as trimEnd } from './trimEnd';

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