Comparing version 0.3.1 to 0.4.0
@@ -103,3 +103,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
\******************/ | ||
/*! exports provided: VERSION, isEmpty, getQuery, clone, getNumbers, getScrollbarWidth, getCookie, removeCookie, invertObject, setCookie, first, formatNumber, debounce, scrollTo, getOffset, preloadImage, getType, setQuery, uniq, default */ | ||
/*! exports provided: VERSION, isEmpty, getQuery, clone, getNumbers, getScrollbarWidth, getCookie, removeCookie, invertObject, setCookie, first, formatNumber, debounce, scrollTo, getOffset, getType, setQuery, uniq, default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
@@ -158,16 +158,13 @@ | ||
/* harmony import */ var _lib_preloadImage__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./lib/preloadImage */ "./lib/preloadImage.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "preloadImage", function() { return _lib_preloadImage__WEBPACK_IMPORTED_MODULE_17__["default"]; }); | ||
/* harmony import */ var _lib_getType__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./lib/getType */ "./lib/getType.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getType", function() { return _lib_getType__WEBPACK_IMPORTED_MODULE_17__["default"]; }); | ||
/* harmony import */ var _lib_getType__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lib/getType */ "./lib/getType.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getType", function() { return _lib_getType__WEBPACK_IMPORTED_MODULE_18__["default"]; }); | ||
/* harmony import */ var _lib_setQuery__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lib/setQuery */ "./lib/setQuery.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setQuery", function() { return _lib_setQuery__WEBPACK_IMPORTED_MODULE_18__["default"]; }); | ||
/* harmony import */ var _lib_setQuery__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/setQuery */ "./lib/setQuery.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setQuery", function() { return _lib_setQuery__WEBPACK_IMPORTED_MODULE_19__["default"]; }); | ||
/* harmony import */ var _lib_uniq__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/uniq */ "./lib/uniq.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _lib_uniq__WEBPACK_IMPORTED_MODULE_19__["default"]; }); | ||
/* harmony import */ var _lib_uniq__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./lib/uniq */ "./lib/uniq.js"); | ||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _lib_uniq__WEBPACK_IMPORTED_MODULE_20__["default"]; }); | ||
/** | ||
@@ -204,3 +201,2 @@ * Chober.js - is a collection of methods that are used by programmers every day. | ||
/** | ||
@@ -241,6 +237,5 @@ * Set version to constant. | ||
getOffset: _lib_getOffset__WEBPACK_IMPORTED_MODULE_16__["default"], | ||
preloadImage: _lib_preloadImage__WEBPACK_IMPORTED_MODULE_17__["default"], | ||
getType: _lib_getType__WEBPACK_IMPORTED_MODULE_18__["default"], | ||
setQuery: _lib_setQuery__WEBPACK_IMPORTED_MODULE_19__["default"], | ||
uniq: _lib_uniq__WEBPACK_IMPORTED_MODULE_20__["default"] | ||
getType: _lib_getType__WEBPACK_IMPORTED_MODULE_17__["default"], | ||
setQuery: _lib_setQuery__WEBPACK_IMPORTED_MODULE_18__["default"], | ||
uniq: _lib_uniq__WEBPACK_IMPORTED_MODULE_19__["default"] | ||
}); | ||
@@ -701,29 +696,2 @@ }; | ||
/***/ "./lib/preloadImage.js": | ||
/*!*****************************!*\ | ||
!*** ./lib/preloadImage.js ***! | ||
\*****************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/** | ||
* Preload an image by its path. | ||
* | ||
* @since 0.1.0 | ||
* @param {String} imgPath Path of an image to preload. | ||
* | ||
* @example | ||
* preloadImage('some/path/to/img') | ||
*/ | ||
function preloadImage(imgPath) { | ||
var img = new Image(); | ||
img.src = imgPath; | ||
} | ||
/* harmony default export */ __webpack_exports__["default"] = (preloadImage); | ||
/***/ }), | ||
/***/ "./lib/removeCookie.js": | ||
@@ -768,6 +736,9 @@ /*!*****************************!*\ | ||
* @since 0.2.0 | ||
* @param {String} selector Class or id. | ||
* @param {DOMElement} element Element to which to scroll. | ||
* | ||
* @example | ||
* scrollTo(document.querySelector('.j-block')) | ||
*/ | ||
function scrollTo(selector) { | ||
document.querySelector(selector).scrollIntoView({ | ||
function scrollTo(element) { | ||
element.scrollIntoView({ | ||
behavior: 'smooth' | ||
@@ -1027,3 +998,3 @@ }); | ||
module.exports = {"name":"chober","version":"0.3.0","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"},"repository":{"type":"git","url":"git+https://github.com/BrooonS/chober.js.git"},"keywords":["webpack","js","javascript","library","methods","chober","isset","isEmpty"],"author":"Valery Strelets","license":"MIT","bugs":{"url":"https://github.com/BrooonS/chober.js/issues"},"homepage":"https://github.com/BrooonS/chober.js#readme","devDependencies":{"@babel/core":"^7.1.2","@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.0","@babel/runtime":"^7.1.2","babel-eslint":"^10.0.1","babel-loader":"^8.0.4","docsify-cli":"^4.2.1","eslint":"^5.6.1","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.20.2","webpack-cli":"^3.1.2"},"dependencies":{}}; | ||
module.exports = {"name":"chober","version":"0.4.0","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"},"repository":{"type":"git","url":"git+https://github.com/BrooonS/chober.js.git"},"keywords":["webpack","js","javascript","library","methods","chober","clone","debounce","first","formatNumber","getCookie","getNumber","getOffset","getQuery","getScrollbarWidth","getType","invertObject","isEmpty","removeCookie","scrollTo","setCookie","setQuery","uniq"],"author":"Valery Strelets","license":"MIT","bugs":{"url":"https://github.com/BrooonS/chober.js/issues"},"homepage":"https://github.com/BrooonS/chober.js#readme","devDependencies":{"@babel/core":"^7.1.2","@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.0","@babel/runtime":"^7.1.2","babel-eslint":"^10.0.1","babel-loader":"^8.0.4","docsify-cli":"^4.2.1","eslint":"^5.6.1","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.20.2","webpack-cli":"^3.1.2"},"dependencies":{}}; | ||
@@ -1030,0 +1001,0 @@ /***/ }) |
@@ -1,2 +0,2 @@ | ||
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports._c=t():e._c=t()}(window,function(){return function(r){var n={};function __webpack_require__(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}return __webpack_require__.m=r,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)__webpack_require__.d(r,n,function(e){return t[e]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=5)}([function(e,t){e.exports=function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){var o=r(0);e.exports=function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(e){o(t,e,r[e])})}return t}},function(e,t){function _extends(){return e.exports=_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}e.exports=_extends},function(e,t){e.exports=function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e){e.exports={a:"0.3.0"}},function(e,t,r){"use strict";r.r(t);var n=r(2),o=r.n(n),c=r(3),u=r.n(c),i=r(4);var a=function isEmpty(e){return!(e&&(e.length||Object.keys(e).length))},f=r(0),l=r.n(f),p=r(1),s=r.n(p);var d=function getQuery(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=window.location.search.substr(1),n={};return t?(e.length&&o()(n,e.reduce(function(e,t){return s()({},e,l()({},t,[]))},{})),t.split("&").forEach(function(e){var r=e.split("=");Object.prototype.hasOwnProperty.call(n,r[0])&&(Array.isArray(n[r[0]])?n[r[0]].push(r[1]):n[r[0]]=[n[r[0]],r[1]]),Array.isArray(n[r[0]])?n[r[0]].forEach(function(e,t){n[r[0]][t]=decodeURIComponent(e)}):n[r[0]]=decodeURIComponent(r[1])}),n):{}};var _=function clone(e){return e&&JSON.parse(JSON.stringify(e))};var b=function getNumbers(e){return e&&e.toString().replace(/\D+/g,"")};var y=function getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth};var g=function getCookie(e){var t="; ".concat(document.cookie).split("; ".concat(e,"="));return 2===t.length?t.pop().split(";").shift():""};var v=function removeCookie(e){document.cookie="".concat(e,"=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;")};var m=function invertObject(e){return e&&Object.entries(e).reduce(function(e,t){return s()({},e,l()({},t[1],t[0]))},{})};var w=function setCookie(e,t){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n=r&&(new Date).getTime()+r,o=r&&new Date(n).toUTCString(),c="".concat(e,"=").concat(t,"; path=/"),u="; expires=".concat(o);document.cookie=r?c:c+u};var h=function first(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return Array.isArray(e)?e.slice(0,t):[]};var O=function formatNumber(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:" ";return String(e).replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g,"$1".concat(t))};var k=function debounce(n,o){var c=this,u=null;return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u&&clearTimeout(u),u=setTimeout(function onComplete(){n.apply(c,t),u=null},o)}};var j=function scrollTo(e){document.querySelector(e).scrollIntoView({behavior:"smooth"})};var C=function getOffset(e){var t=document.querySelector(e).getBoundingClientRect(),r=window.pageXOffset,n=window.pageYOffset;return{x:t.left+r,y:t.top+n,left:t.left+r,top:t.top+n,right:t.right+r,bottom:t.bottom+n}};var x=function preloadImage(e){(new Image).src=e};var q=function getType(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};var S=function uniq(e){return e.filter(function(e,t,r){return r.indexOf(e)===t})};var T=function setQuery(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=d(),n=Object.entries(e).concat(Object.entries(r)),o=t&&!a(r)?n.reduce(function(e,t){var r=t[0],n=t[1];if(Object.prototype.hasOwnProperty.call(e,r)){var o=e[r]===n?n:[e[r],n],c="array"===q(e[r])?S(e[r].concat(n)):o,u="array"===q(n)?S(n.concat(e[r])):c;return s()({},e,l()({},r,u))}return s()({},e,l()({},r,n))},{}):e,c=Object.keys(o).map(function(t){return Array.isArray(o[t])?o[t].map(function(e){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))}).join("&"):"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(o[t]))}).join("&");window.history.pushState("","","?".concat(decodeURIComponent(c)))};r.d(t,"VERSION",function(){return I}),r.d(t,"isEmpty",function(){return a}),r.d(t,"getQuery",function(){return d}),r.d(t,"clone",function(){return _}),r.d(t,"getNumbers",function(){return b}),r.d(t,"getScrollbarWidth",function(){return y}),r.d(t,"getCookie",function(){return g}),r.d(t,"removeCookie",function(){return v}),r.d(t,"invertObject",function(){return m}),r.d(t,"setCookie",function(){return w}),r.d(t,"first",function(){return h}),r.d(t,"formatNumber",function(){return O}),r.d(t,"debounce",function(){return k}),r.d(t,"scrollTo",function(){return j}),r.d(t,"getOffset",function(){return C}),r.d(t,"preloadImage",function(){return x}),r.d(t,"getType",function(){return q}),r.d(t,"setQuery",function(){return T}),r.d(t,"uniq",function(){return S}); | ||
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports._c=t():e._c=t()}(window,function(){return function(n){var r={};function __webpack_require__(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,__webpack_require__),t.l=!0,t.exports}return __webpack_require__.m=n,__webpack_require__.c=r,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)__webpack_require__.d(n,r,function(e){return t[e]}.bind(null,r));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=5)}([function(e,t){e.exports=function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var o=n(0);e.exports=function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(e){o(t,e,n[e])})}return t}},function(e,t){function _extends(){return e.exports=_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_extends.apply(this,arguments)}e.exports=_extends},function(e,t){e.exports=function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e){e.exports={a:"0.4.0"}},function(e,t,n){"use strict";n.r(t);var r=n(2),o=n.n(r),c=n(3),u=n.n(c),i=n(4);var a=function isEmpty(e){return!(e&&(e.length||Object.keys(e).length))},f=n(0),p=n.n(f),l=n(1),s=n.n(l);var _=function getQuery(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=window.location.search.substr(1),r={};return t?(e.length&&o()(r,e.reduce(function(e,t){return s()({},e,p()({},t,[]))},{})),t.split("&").forEach(function(e){var n=e.split("=");Object.prototype.hasOwnProperty.call(r,n[0])&&(Array.isArray(r[n[0]])?r[n[0]].push(n[1]):r[n[0]]=[r[n[0]],n[1]]),Array.isArray(r[n[0]])?r[n[0]].forEach(function(e,t){r[n[0]][t]=decodeURIComponent(e)}):r[n[0]]=decodeURIComponent(n[1])}),r):{}};var d=function clone(e){return e&&JSON.parse(JSON.stringify(e))};var b=function getNumbers(e){return e&&e.toString().replace(/\D+/g,"")};var y=function getScrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth};var v=function getCookie(e){var t="; ".concat(document.cookie).split("; ".concat(e,"="));return 2===t.length?t.pop().split(";").shift():""};var g=function removeCookie(e){document.cookie="".concat(e,"=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;")};var m=function invertObject(e){return e&&Object.entries(e).reduce(function(e,t){return s()({},e,p()({},t[1],t[0]))},{})};var w=function setCookie(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=n&&(new Date).getTime()+n,o=n&&new Date(r).toUTCString(),c="".concat(e,"=").concat(t,"; path=/"),u="; expires=".concat(o);document.cookie=n?c:c+u};var h=function first(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return Array.isArray(e)?e.slice(0,t):[]};var O=function formatNumber(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:" ";return String(e).replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g,"$1".concat(t))};var k=function debounce(r,o){var c=this,u=null;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u&&clearTimeout(u),u=setTimeout(function onComplete(){r.apply(c,t),u=null},o)}};var j=function scrollTo(e){e.scrollIntoView({behavior:"smooth"})};var C=function getOffset(e){var t=document.querySelector(e).getBoundingClientRect(),n=window.pageXOffset,r=window.pageYOffset;return{x:t.left+n,y:t.top+r,left:t.left+n,top:t.top+r,right:t.right+n,bottom:t.bottom+r}};var x=function getType(e){return Object.prototype.toString.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()};var q=function uniq(e){return e.filter(function(e,t,n){return n.indexOf(e)===t})};var S=function setQuery(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=_(),r=Object.entries(e).concat(Object.entries(n)),o=t&&!a(n)?r.reduce(function(e,t){var n=t[0],r=t[1];if(Object.prototype.hasOwnProperty.call(e,n)){var o=e[n]===r?r:[e[n],r],c="array"===x(e[n])?q(e[n].concat(r)):o,u="array"===x(r)?q(r.concat(e[n])):c;return s()({},e,p()({},n,u))}return s()({},e,p()({},n,r))},{}):e,c=Object.keys(o).map(function(t){return Array.isArray(o[t])?o[t].map(function(e){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e))}).join("&"):"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(o[t]))}).join("&");window.history.pushState("","","?".concat(decodeURIComponent(c)))};n.d(t,"VERSION",function(){return T}),n.d(t,"isEmpty",function(){return a}),n.d(t,"getQuery",function(){return _}),n.d(t,"clone",function(){return d}),n.d(t,"getNumbers",function(){return b}),n.d(t,"getScrollbarWidth",function(){return y}),n.d(t,"getCookie",function(){return v}),n.d(t,"removeCookie",function(){return g}),n.d(t,"invertObject",function(){return m}),n.d(t,"setCookie",function(){return w}),n.d(t,"first",function(){return h}),n.d(t,"formatNumber",function(){return O}),n.d(t,"debounce",function(){return k}),n.d(t,"scrollTo",function(){return j}),n.d(t,"getOffset",function(){return C}),n.d(t,"getType",function(){return x}),n.d(t,"setQuery",function(){return S}),n.d(t,"uniq",function(){return q}); | ||
/** | ||
@@ -10,2 +10,2 @@ * Chober.js - is a collection of methods that are used by programmers every day. | ||
*/ | ||
var I=i.a;t.default=new function Chober(){u()(this,Chober),o()(this,{VERSION:I,isEmpty:a,getQuery:d,clone:_,getNumbers:b,getScrollbarWidth:y,getCookie:g,removeCookie:v,invertObject:m,setCookie:w,first:h,formatNumber:O,debounce:k,scrollTo:j,getOffset:C,preloadImage:x,getType:q,setQuery:T,uniq:S})}}])}); | ||
var T=i.a;t.default=new function Chober(){u()(this,Chober),o()(this,{VERSION:T,isEmpty:a,getQuery:_,clone:d,getNumbers:b,getScrollbarWidth:y,getCookie:v,removeCookie:g,invertObject:m,setCookie:w,first:h,formatNumber:O,debounce:k,scrollTo:j,getOffset:C,getType:x,setQuery:S,uniq:q})}}])}); |
@@ -364,19 +364,2 @@ # Chober.js | ||
``` | ||
### preloadImage | ||
Preload an image by its path. | ||
#### Since | ||
- 0.1.0 | ||
#### Params | ||
- `imgPath` | ||
- Type: `String` | ||
- Description: *Path of an image to preload.* | ||
#### Example | ||
```JS | ||
preloadImage('some/path/to/img') | ||
``` | ||
### removeCookie | ||
@@ -407,7 +390,11 @@ | ||
#### Params | ||
- `selector` | ||
- Type: `String` | ||
- Description: *Class or id.* | ||
- `element` | ||
- Type: `DOMElement` | ||
- Description: *Element to which to scroll.* | ||
#### Example | ||
```JS | ||
scrollTo(document.querySelector('.j-block')) | ||
``` | ||
### setCookie | ||
@@ -414,0 +401,0 @@ |
@@ -29,3 +29,2 @@ /** | ||
import getOffset from './lib/getOffset'; | ||
import preloadImage from './lib/preloadImage'; | ||
import getType from './lib/getType'; | ||
@@ -61,3 +60,2 @@ import setQuery from './lib/setQuery'; | ||
getOffset, | ||
preloadImage, | ||
getType, | ||
@@ -89,3 +87,2 @@ setQuery, | ||
getOffset, | ||
preloadImage, | ||
getType, | ||
@@ -92,0 +89,0 @@ setQuery, |
@@ -5,8 +5,11 @@ /** | ||
* @since 0.2.0 | ||
* @param {String} selector Class or id. | ||
* @param {DOMElement} element Element to which to scroll. | ||
* | ||
* @example | ||
* scrollTo(document.querySelector('.j-block')) | ||
*/ | ||
function scrollTo(selector) { | ||
document.querySelector(selector).scrollIntoView({ behavior: 'smooth' }); | ||
function scrollTo(element) { | ||
element.scrollIntoView({ behavior: 'smooth' }); | ||
} | ||
export default scrollTo; |
{ | ||
"name": "chober", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"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.", | ||
@@ -25,4 +25,19 @@ "main": "dist/chober.js", | ||
"chober", | ||
"isset", | ||
"isEmpty" | ||
"clone", | ||
"debounce", | ||
"first", | ||
"formatNumber", | ||
"getCookie", | ||
"getNumber", | ||
"getOffset", | ||
"getQuery", | ||
"getScrollbarWidth", | ||
"getType", | ||
"invertObject", | ||
"isEmpty", | ||
"removeCookie", | ||
"scrollTo", | ||
"setCookie", | ||
"setQuery", | ||
"uniq" | ||
], | ||
@@ -29,0 +44,0 @@ "author": "Valery Strelets", |
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
192706
33
1375