Socket
Socket
Sign inDemoInstall

chober

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chober - npm Package Compare versions

Comparing version 1.2.4 to 1.2.5

43

dist/chober.js

@@ -1213,11 +1213,13 @@ (function webpackUniversalModuleDefinition(root, factory) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ "./node_modules/@babel/runtime/helpers/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _getQuery__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getQuery */ "./lib/getQuery.js");
/* harmony import */ var _isEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isEmpty */ "./lib/isEmpty.js");
/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray */ "./lib/isArray.js");
/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./uniq */ "./lib/uniq.js");
/* harmony import */ var _flattenDeep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flattenDeep */ "./lib/flattenDeep.js");
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "./node_modules/@babel/runtime/helpers/toConsumableArray.js");
/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ "./node_modules/@babel/runtime/helpers/objectSpread.js");
/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _getQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getQuery */ "./lib/getQuery.js");
/* harmony import */ var _isEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isEmpty */ "./lib/isEmpty.js");
/* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray */ "./lib/isArray.js");
/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uniq */ "./lib/uniq.js");
/* harmony import */ var _flattenDeep__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flattenDeep */ "./lib/flattenDeep.js");

@@ -1230,2 +1232,3 @@

/**

@@ -1269,11 +1272,11 @@ * Set query to url.

var fieldName = field[0];
var fieldValue = Object(_isArray__WEBPACK_IMPORTED_MODULE_4__["default"])(field[1]) ? Object(_uniq__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_flattenDeep__WEBPACK_IMPORTED_MODULE_6__["default"])(field[1]).map(function (value) {
var fieldValue = Object(_isArray__WEBPACK_IMPORTED_MODULE_5__["default"])(field[1]) ? Object(_uniq__WEBPACK_IMPORTED_MODULE_6__["default"])(Object(_flattenDeep__WEBPACK_IMPORTED_MODULE_7__["default"])(field[1]).map(function (value) {
return String(value);
})) : field[1];
return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, acc, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, fieldName, fieldValue));
return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_2___default()({}, acc, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, fieldName, fieldValue));
}, {}) : {};
var oldQuery = isSaveOld && Object(_getQuery__WEBPACK_IMPORTED_MODULE_2__["default"])();
var oldQuery = isSaveOld && Object(_getQuery__WEBPACK_IMPORTED_MODULE_3__["default"])();
var mergedQueries = isSaveOld && Object.entries(localQuery).concat(Object.entries(oldQuery));
var hash = isSaveHash && window.location.href.split('#')[1];
var newQueryObject = isSaveOld && !Object(_isEmpty__WEBPACK_IMPORTED_MODULE_3__["default"])(oldQuery) ? mergedQueries.reduce(function (newQuery, field) {
var newQueryObject = isSaveOld && !Object(_isEmpty__WEBPACK_IMPORTED_MODULE_4__["default"])(oldQuery) ? mergedQueries.reduce(function (newQuery, field) {
var fieldName = field[0];

@@ -1286,5 +1289,5 @@ var fieldValue = field[1];

var textValue = newQuery[fieldName] === fieldValue ? fieldValue : [newQuery[fieldName], fieldValue];
var arrayValue = Object(_isArray__WEBPACK_IMPORTED_MODULE_4__["default"])(newQuery[fieldName]) ? Object(_uniq__WEBPACK_IMPORTED_MODULE_5__["default"])(newQuery[fieldName].concat(fieldValue)) : textValue;
var newValue = Object(_isArray__WEBPACK_IMPORTED_MODULE_4__["default"])(fieldValue) ? Object(_uniq__WEBPACK_IMPORTED_MODULE_5__["default"])(fieldValue.concat(newQuery[fieldName])) : arrayValue;
return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, newQuery, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, fieldName, newValue));
var arrayValue = Object(_isArray__WEBPACK_IMPORTED_MODULE_5__["default"])(newQuery[fieldName]) ? Object(_uniq__WEBPACK_IMPORTED_MODULE_6__["default"])(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(newQuery[fieldName]).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(fieldValue))) : textValue;
var newValue = Object(_isArray__WEBPACK_IMPORTED_MODULE_5__["default"])(fieldValue) ? Object(_uniq__WEBPACK_IMPORTED_MODULE_6__["default"])(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(fieldValue).concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(newQuery[fieldName]))) : arrayValue;
return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_2___default()({}, newQuery, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, fieldName, newValue));
}

@@ -1296,3 +1299,3 @@

return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({}, newQuery, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, fieldName, fieldValue));
return _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_2___default()({}, newQuery, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()({}, fieldName, fieldValue));
}, {}) : localQuery;

@@ -1310,3 +1313,3 @@ var newQueryString = Object.keys(newQueryObject).map(function (key) {

return Object(_isArray__WEBPACK_IMPORTED_MODULE_4__["default"])(value) ? value.map(function (arrayValue) {
return Object(_isArray__WEBPACK_IMPORTED_MODULE_5__["default"])(value) ? value.map(function (arrayValue) {
if (isSaveEmptyFields) {

@@ -1325,3 +1328,3 @@ return key ? "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(arrayValue)) : '';

.join('&');
window.history.pushState({}, document.title, newQueryString ? "?".concat(decodeURIComponent(newQueryString)).concat(hash ? "#".concat(hash) : '') : window.location.href.split('?')[0].split('#')[0] + (hash ? "#".concat(hash) : ''));
window.history.pushState({}, document.title, newQueryString ? "?".concat(newQueryString).concat(hash ? "#".concat(hash) : '') : window.location.href.split('?')[0].split('#')[0] + (hash ? "#".concat(hash) : ''));
}

@@ -1552,3 +1555,3 @@

module.exports = {"name":"chober","version":"1.2.3","description":"Chober.js - is a collection of methods that are used by programmers every day. We decided to put all the methods together so as not to copy them from project to project.","main":"dist/chober.js","scripts":{"prod":"webpack --env production --config webpack.config.js","dev":"webpack --env development --config webpack.config.js","watch":"webpack --env development --config webpack.config.js --watch","build":"npm run docs && npm run prod && npm run dev","docs":"jsdoc2md --template README.hbs --files lib/*.js > docs/README.md","docs-server":"docsify serve docs -p 35730"},"repository":{"type":"git","url":"git+https://github.com/BrooonS/chober.git"},"keywords":["webpack","js","javascript","library","es6","commonjs","methods","chober","isEmpty","isArray","isNumber","isString","isObject","isBoolean","isEqual","isUndefined","getQuery","getNumbers","getScrollbarWidth","getCookie","getOffset","getType","setQuery","setCookie","removeCookie","decodeHtml","clone","invertObject","first","flatten","formatNumber","debounce","scrollTo","uniq"],"author":"Valery Strelets","license":"MIT","bugs":{"url":"https://github.com/BrooonS/chober/issues"},"homepage":"https://github.com/BrooonS/chober#readme","devDependencies":{"@babel/core":"^7.1.6","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-object-assign":"^7.0.0","@babel/plugin-transform-runtime":"^7.1.0","@babel/preset-env":"^7.1.6","@babel/runtime":"^7.1.5","babel-eslint":"^10.0.1","babel-loader":"^8.0.4","docsify-cli":"^4.3.0","eslint":"^5.9.0","eslint-config-airbnb":"^17.1.0","eslint-loader":"^2.1.1","eslint-plugin-import":"^2.14.0","eslint-plugin-jsx-a11y":"^6.1.2","eslint-plugin-react":"^7.11.1","jsdoc-to-markdown":"^4.0.1","uglifyjs-webpack-plugin":"^2.0.1","webpack":"^4.26.0","webpack-cli":"^3.1.2"}};
module.exports = {"name":"chober","version":"1.2.5","description":"Chober.js - is a collection of methods that are used by programmers every day. We decided to put all the methods together so as not to copy them from project to project.","main":"dist/chober.js","scripts":{"prod":"webpack --env production --config webpack.config.js","dev":"webpack --env development --config webpack.config.js","watch":"webpack --env development --config webpack.config.js --watch","build":"npm run docs && npm run prod && npm run dev","docs":"jsdoc2md --template README.hbs --files lib/*.js > docs/README.md","docs-server":"docsify serve docs -p 35730"},"repository":{"type":"git","url":"git+https://github.com/BrooonS/chober.git"},"keywords":["webpack","js","javascript","library","es6","commonjs","methods","chober","isEmpty","isArray","isNumber","isString","isObject","isBoolean","isEqual","isUndefined","getQuery","getNumbers","getScrollbarWidth","getCookie","getOffset","getType","setQuery","setCookie","removeCookie","decodeHtml","clone","invertObject","first","flatten","formatNumber","debounce","scrollTo","uniq"],"author":"Valery Strelets","license":"MIT","bugs":{"url":"https://github.com/BrooonS/chober/issues"},"homepage":"https://github.com/BrooonS/chober#readme","devDependencies":{"@babel/core":"^7.1.6","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-object-assign":"^7.0.0","@babel/plugin-transform-runtime":"^7.1.0","@babel/preset-env":"^7.1.6","@babel/runtime":"^7.1.5","babel-eslint":"^10.0.1","babel-loader":"^8.0.4","docsify-cli":"^4.3.0","eslint":"^5.9.0","eslint-config-airbnb":"^17.1.0","eslint-loader":"^2.1.1","eslint-plugin-import":"^2.14.0","eslint-plugin-jsx-a11y":"^6.1.2","eslint-plugin-react":"^7.11.1","jsdoc-to-markdown":"^4.0.1","uglifyjs-webpack-plugin":"^2.0.1","webpack":"^4.26.0","webpack-cli":"^3.1.2"}};

@@ -1555,0 +1558,0 @@ /***/ })

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("_c",[],e):"object"==typeof exports?exports._c=e():t._c=e()}("undefined"==typeof self?this:self,function(){return function(n){var r={};function o(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=n,o.c=r,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=8)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){var o=n(0);t.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}},function(t,e,n){var r=n(5),o=n(6),c=n(7);t.exports=function(t){return r(t)||o(t)||c()}},function(t){t.exports={a:"1.2.3"}},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,n){"use strict";n.r(e);var r=n(3);var b=function(t){return!(t&&(t.length||Object.keys(t).length))};var o=function(t){return Object.prototype.toString.call(t).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};var y=function(t){return"array"===o(t)};var c=function(t){return"number"===o(t)};var i=function(t){return"string"===o(t)};var a=function(t){return"object"===o(t)};var u=function(t){return"boolean"===o(t)},f=n(0),h=n.n(f),s=n(1),m=n.n(s),l=n(2),p=n.n(l);var d=function(t){return"undefined"===o(t)},v="[Circular]";var g=function(e){if(d(e))throw new Error("[chober]: nothing to clone.");var n,r,o,c;try{return JSON.parse(JSON.stringify(e))}catch(t){if(a(e)){var i=(o=e,c=Object.keys(o).reduce(function(e,n){try{return JSON.stringify(o[n]),e}catch(t){return p()(e).concat([n])}},[]).reduce(function(t,e){return m()({},t,h()({},e,v))},o),JSON.parse(JSON.stringify(c)));if(!b(i))return i}if(y(e)){var u=(r=(n=e).reduce(function(e,t,n){try{return JSON.stringify(t),e}catch(t){return p()(e).concat([n])}},[]).reduce(function(t,e){return t[e]=v,t},n),JSON.parse(JSON.stringify(r)));if(!b(u))return u}throw new Error(t)}};var w=function(t,e){return JSON.stringify(g(t))===JSON.stringify(g(e))},O=n(4),j=n.n(O);var S=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=window.location.search.substr(1),r={};return e?(t.length&&j()(r,t.reduce(function(t,e){return m()({},t,h()({},e,[]))},{})),e.split("&").forEach(function(t){if(t){var n=t.split("=");Object.prototype.hasOwnProperty.call(r,n[0])&&(y(r[n[0]])?r[n[0]].push(n[1]):r[n[0]]=[r[n[0]],n[1]]),y(r[n[0]])?r[n[0]].forEach(function(t,e){r[n[0]][e]=decodeURIComponent(t)}):r[n[0]]=decodeURIComponent(n[1])}}),r):{}};var x=function(t){return d(t)||!i(t)?"":String(t).replace(/\D+/g,"")};var E=function(){return window.innerWidth-document.documentElement.clientWidth};var C=function(t){if(d(t))throw new Error("[chober]: key is not passed.");if(!i(t))throw new Error("[chober]: key must to be a string.");var e="; ".concat(document.cookie).split("; ".concat(t,"="));return 2===e.length?e.pop().split(";").shift():""};var N=function(t){if(d(t))throw new Error("[chober]: selector is not passed.");var e=document.querySelector(t).getBoundingClientRect(),n=window.pageXOffset,r=window.pageYOffset;return{x:e.left+n,y:e.top+r,left:e.left+n,top:e.top+r,right:e.right+n,bottom:e.bottom+r}};var k=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];if(!y(t))throw new Error("[chober]: param must to be an array.");return g(t).map(function(t){return JSON.stringify(t)}).filter(function(t,e,n){return n.indexOf(t)===e}).map(function(t){return JSON.parse(t)})};var I=function n(t){return y(t)?t.reduce(function(t,e){return y(e)?t.concat(n(e)):t.concat(e)},[]):[]};var J=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.isSaveOld,r=void 0!==n&&n,o=e.isSaveHash,c=void 0===o||o,i=e.isSaveEmptyFields,u=void 0!==i&&i,f=Object.prototype.hasOwnProperty,a=t?Object.entries(t).reduce(function(t,e){var n=e[0],r=y(e[1])?k(I(e[1]).map(function(t){return String(t)})):e[1];return m()({},t,h()({},n,r))},{}):{},s=r&&S(),l=r&&Object.entries(a).concat(Object.entries(s)),p=c&&window.location.href.split("#")[1],d=r&&!b(s)?l.reduce(function(t,e){var n=e[0],r=e[1],o=f.call(t,n),c=f.call(s,n);if(!o||c)return o&&c?t:m()({},t,h()({},n,r));var i=t[n]===r?r:[t[n],r],u=y(t[n])?k(t[n].concat(r)):i,a=y(r)?k(r.concat(t[n])):u;return m()({},t,h()({},n,a))},{}):a,v=Object.keys(d).map(function(e){if("&"===e)return"";var t,n=d[e];return t=u?e?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n)):"":e&&n?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n)):"",y(n)?n.map(function(t){return u?e?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t)):"":e&&t?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t)):""}).filter(function(t){return t}).join("&"):t}).filter(function(t){return t}).join("&");window.history.pushState({},document.title,v?"?".concat(decodeURIComponent(v)).concat(p?"#".concat(p):""):window.location.href.split("?")[0].split("#")[0]+(p?"#".concat(p):""))};var R=function(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(d(t)||d(e))throw new Error("[chober]: key or value is not passed.");var r=n&&(new Date).getTime()+n,o=n&&new Date(r).toUTCString(),c="".concat(t,"=").concat(e,"; path=/"),i="; expires=".concat(o);document.cookie=n?c:c+i};var U=function(t){if(d(t))throw new Error("[chober]: key is not passed.");document.cookie="".concat(t,"=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;")};var P=function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.value};var T=function(t){if(d(t))throw new Error("[chober]: object is not passed.");return t&&Object.entries(t).reduce(function(t,e){return m()({},t,h()({},e[1],e[0]))},{})};var _=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return y(t)?t.slice(0,e):[]};var A=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:" ";return String(t||0).replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g,"$1".concat(e))};var M=function(r,o){var c=this;if(!r&&!o)throw new Error("[chober]: function or delay is not passed.");var i=null;return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];i&&clearTimeout(i),i=setTimeout(function(){r.apply(c,e),i=null},o)}};var D=function(t){if(d(t))throw new Error("[chober]: element is not passed.");t.scrollIntoView({behavior:"smooth"})},$=r.a;
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("_c",[],e):"object"==typeof exports?exports._c=e():t._c=e()}("undefined"==typeof self?this:self,function(){return function(n){var r={};function o(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=n,o.c=r,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=8)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){var o=n(0);t.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(t){o(e,t,n[t])})}return e}},function(t,e,n){var r=n(5),o=n(6),c=n(7);t.exports=function(t){return r(t)||o(t)||c()}},function(t){t.exports={a:"1.2.5"}},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n.apply(this,arguments)}t.exports=n},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e,n){"use strict";n.r(e);var r=n(3);var b=function(t){return!(t&&(t.length||Object.keys(t).length))};var o=function(t){return Object.prototype.toString.call(t).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};var y=function(t){return"array"===o(t)};var c=function(t){return"number"===o(t)};var i=function(t){return"string"===o(t)};var a=function(t){return"object"===o(t)};var u=function(t){return"boolean"===o(t)},f=n(0),h=n.n(f),s=n(1),m=n.n(s),l=n(2),g=n.n(l);var p=function(t){return"undefined"===o(t)},d="[Circular]";var v=function(e){if(p(e))throw new Error("[chober]: nothing to clone.");var n,r,o,c;try{return JSON.parse(JSON.stringify(e))}catch(t){if(a(e)){var i=(o=e,c=Object.keys(o).reduce(function(e,n){try{return JSON.stringify(o[n]),e}catch(t){return g()(e).concat([n])}},[]).reduce(function(t,e){return m()({},t,h()({},e,d))},o),JSON.parse(JSON.stringify(c)));if(!b(i))return i}if(y(e)){var u=(r=(n=e).reduce(function(e,t,n){try{return JSON.stringify(t),e}catch(t){return g()(e).concat([n])}},[]).reduce(function(t,e){return t[e]=d,t},n),JSON.parse(JSON.stringify(r)));if(!b(u))return u}throw new Error(t)}};var w=function(t,e){return JSON.stringify(v(t))===JSON.stringify(v(e))},O=n(4),j=n.n(O);var S=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=window.location.search.substr(1),r={};return e?(t.length&&j()(r,t.reduce(function(t,e){return m()({},t,h()({},e,[]))},{})),e.split("&").forEach(function(t){if(t){var n=t.split("=");Object.prototype.hasOwnProperty.call(r,n[0])&&(y(r[n[0]])?r[n[0]].push(n[1]):r[n[0]]=[r[n[0]],n[1]]),y(r[n[0]])?r[n[0]].forEach(function(t,e){r[n[0]][e]=decodeURIComponent(t)}):r[n[0]]=decodeURIComponent(n[1])}}),r):{}};var x=function(t){return p(t)||!i(t)?"":String(t).replace(/\D+/g,"")};var E=function(){return window.innerWidth-document.documentElement.clientWidth};var C=function(t){if(p(t))throw new Error("[chober]: key is not passed.");if(!i(t))throw new Error("[chober]: key must to be a string.");var e="; ".concat(document.cookie).split("; ".concat(t,"="));return 2===e.length?e.pop().split(";").shift():""};var N=function(t){if(p(t))throw new Error("[chober]: selector is not passed.");var e=document.querySelector(t).getBoundingClientRect(),n=window.pageXOffset,r=window.pageYOffset;return{x:e.left+n,y:e.top+r,left:e.left+n,top:e.top+r,right:e.right+n,bottom:e.bottom+r}};var k=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];if(!y(t))throw new Error("[chober]: param must to be an array.");return v(t).map(function(t){return JSON.stringify(t)}).filter(function(t,e,n){return n.indexOf(t)===e}).map(function(t){return JSON.parse(t)})};var I=function n(t){return y(t)?t.reduce(function(t,e){return y(e)?t.concat(n(e)):t.concat(e)},[]):[]};var J=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=e.isSaveOld,r=void 0!==n&&n,o=e.isSaveHash,c=void 0===o||o,i=e.isSaveEmptyFields,u=void 0!==i&&i,f=Object.prototype.hasOwnProperty,a=t?Object.entries(t).reduce(function(t,e){var n=e[0],r=y(e[1])?k(I(e[1]).map(function(t){return String(t)})):e[1];return m()({},t,h()({},n,r))},{}):{},s=r&&S(),l=r&&Object.entries(a).concat(Object.entries(s)),p=c&&window.location.href.split("#")[1],d=r&&!b(s)?l.reduce(function(t,e){var n=e[0],r=e[1],o=f.call(t,n),c=f.call(s,n);if(!o||c)return o&&c?t:m()({},t,h()({},n,r));var i=t[n]===r?r:[t[n],r],u=y(t[n])?k(g()(t[n]).concat(g()(r))):i,a=y(r)?k(g()(r).concat(g()(t[n]))):u;return m()({},t,h()({},n,a))},{}):a,v=Object.keys(d).map(function(e){if("&"===e)return"";var t,n=d[e];return t=u?e?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n)):"":e&&n?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n)):"",y(n)?n.map(function(t){return u?e?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t)):"":e&&t?"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t)):""}).filter(function(t){return t}).join("&"):t}).filter(function(t){return t}).join("&");window.history.pushState({},document.title,v?"?".concat(v).concat(p?"#".concat(p):""):window.location.href.split("?")[0].split("#")[0]+(p?"#".concat(p):""))};var P=function(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(p(t)||p(e))throw new Error("[chober]: key or value is not passed.");var r=n&&(new Date).getTime()+n,o=n&&new Date(r).toUTCString(),c="".concat(t,"=").concat(e,"; path=/"),i="; expires=".concat(o);document.cookie=n?c:c+i};var R=function(t){if(p(t))throw new Error("[chober]: key is not passed.");document.cookie="".concat(t,"=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;")};var T=function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.value};var U=function(t){if(p(t))throw new Error("[chober]: object is not passed.");return t&&Object.entries(t).reduce(function(t,e){return m()({},t,h()({},e[1],e[0]))},{})};var _=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return y(t)?t.slice(0,e):[]};var A=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:" ";return String(t||0).replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g,"$1".concat(e))};var M=function(r,o){var c=this;if(!r&&!o)throw new Error("[chober]: function or delay is not passed.");var i=null;return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];i&&clearTimeout(i),i=setTimeout(function(){r.apply(c,e),i=null},o)}};var D=function(t){if(p(t))throw new Error("[chober]: element is not passed.");t.scrollIntoView({behavior:"smooth"})},$=r.a;
/**

@@ -9,2 +9,2 @@ * Chober.js - is a collection of useful methods that are used by programmers every day.

* @license https://github.com/BrooonS/chober/blob/master/LICENSE
*/e.default={VERSION:$,isEmpty:b,isArray:y,isNumber:c,isString:i,isObject:a,isBoolean:u,isEqual:w,isUndefined:d,getQuery:S,getNumbers:x,getScrollbarWidth:E,getCookie:C,getOffset:N,getType:o,setQuery:J,setCookie:R,removeCookie:U,decodeHtml:P,clone:g,invertObject:T,first:_,flattenDeep:I,formatNumber:A,debounce:M,scrollTo:D,uniq:k}}]).default});
*/e.default={VERSION:$,isEmpty:b,isArray:y,isNumber:c,isString:i,isObject:a,isBoolean:u,isEqual:w,isUndefined:p,getQuery:S,getNumbers:x,getScrollbarWidth:E,getCookie:C,getOffset:N,getType:o,setQuery:J,setCookie:P,removeCookie:R,decodeHtml:T,clone:v,invertObject:U,first:_,flattenDeep:I,formatNumber:A,debounce:M,scrollTo:D,uniq:k}}]).default});

@@ -220,4 +220,3 @@ # Chober.js

```JS
flattenDeep([123, [456, [567, [890]]]])
// => [123, 456, 567, 890]
flattenDeep([123, [456, [567, [890]]]]) // => [123, 456, 567, 890]
```

@@ -556,7 +555,3 @@ <a href="https://github.com/BrooonS/chober/blob/master/lib/flattenDeep.js" target="_blank">Source code</a>

```JS
isUndefined(undefined)
// => true
isUndefined('testValue')
// => false
isUndefined(undefined) // => true isUndefined('testValue') // => false
```

@@ -563,0 +558,0 @@ <a href="https://github.com/BrooonS/chober/blob/master/lib/isUndefined.js" target="_blank">Source code</a>

@@ -64,6 +64,6 @@ import getQuery from './getQuery';

const arrayValue = isArray(newQuery[fieldName])
? uniq(newQuery[fieldName].concat(fieldValue))
? uniq([...newQuery[fieldName], ...fieldValue])
: textValue;
const newValue = isArray(fieldValue)
? uniq(fieldValue.concat(newQuery[fieldName]))
? uniq([...fieldValue, ...newQuery[fieldName]])
: arrayValue;

@@ -123,3 +123,3 @@

newQueryString
? `?${decodeURIComponent(newQueryString)}${hash ? `#${hash}` : ''}`
? `?${newQueryString}${hash ? `#${hash}` : ''}`
: window.location.href.split('?')[0].split('#')[0] + (hash ? `#${hash}` : ''),

@@ -126,0 +126,0 @@ );

{
"name": "chober",
"version": "1.2.4",
"version": "1.2.5",
"description": "Chober.js - is a collection of methods that are used by programmers every day. We decided to put all the methods together so as not to copy them from project to project.",

@@ -5,0 +5,0 @@ "main": "dist/chober.js",

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