@startlibs/utils 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +37 -22
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -1479,30 +1479,21 @@ var will = function will(fn) {
1479
1479
  return fn.apply(void 0, props.concat(more));
1480
1480
  };
1481
1481
  };
1482
- var unWill = function unWill(fn) {
1483
- for (var _len5 = arguments.length, props = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
1484
- props[_key5 - 1] = arguments[_key5];
1485
- }
1486
-
1487
- return function () {
1488
- return fn.apply(void 0, props);
1489
- };
1490
- };
1491
1482
  var lazyValue = function lazyValue(v) {
1492
1483
  return function () {
1493
1484
  return v;
1494
1485
  };
1495
1486
  };
1496
1487
  var callIfFunction = function callIfFunction(prop) {
1497
- for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
1498
- args[_key6 - 1] = arguments[_key6];
1488
+ for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
1489
+ args[_key5 - 1] = arguments[_key5];
1499
1490
  }
1500
1491
 
1501
1492
  return typeof prop === "function" ? prop.apply(void 0, args) : prop;
1502
1493
  };
1503
1494
  var callIfFunctions = function callIfFunctions(prop) {
1504
- for (var _len7 = arguments.length, args = new Array(_len7 > 1 ? _len7 - 1 : 0), _key7 = 1; _key7 < _len7; _key7++) {
1505
- args[_key7 - 1] = arguments[_key7];
1495
+ for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
1496
+ args[_key6 - 1] = arguments[_key6];
1506
1497
  }
1507
1498
 
1508
1499
  return typeof prop === "function" ? prop.apply(void 0, _toConsumableArray(args.map(function (e) {
@@ -1510,13 +1501,13 @@ var callIfFunctions = function callIfFunctions(prop) {
1510
1501
  }))) : prop;
1511
1502
  };
1512
1503
  var callMany = function callMany() {
1513
- for (var _len8 = arguments.length, many = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
1514
- many[_key8] = arguments[_key8];
1504
+ for (var _len7 = arguments.length, many = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1505
+ many[_key7] = arguments[_key7];
1515
1506
  }
1516
1507
 
1517
1508
  return function () {
1518
- for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
1519
- args[_key9] = arguments[_key9];
1509
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
1510
+ args[_key8] = arguments[_key8];
1520
1511
  }
1521
1512
 
1522
1513
  return many.map(function (_) {
@@ -1525,15 +1516,15 @@ var callMany = function callMany() {
1525
1516
  };
1526
1517
  };
1527
1518
  var ifUndefined = function ifUndefined(v) {
1528
- for (var _len10 = arguments.length, or = new Array(_len10 > 1 ? _len10 - 1 : 0), _key10 = 1; _key10 < _len10; _key10++) {
1529
- or[_key10 - 1] = arguments[_key10];
1519
+ for (var _len9 = arguments.length, or = new Array(_len9 > 1 ? _len9 - 1 : 0), _key9 = 1; _key9 < _len9; _key9++) {
1520
+ or[_key9 - 1] = arguments[_key9];
1530
1521
  }
1531
1522
 
1532
1523
  return v !== undefined ? v : or.length === 1 ? or[0] : ifUndefined.apply(void 0, [or[0]].concat(_toConsumableArray(or.slice(1))));
1533
1524
  };
1534
1525
  var using = function using() {
1535
- for (var _len11 = arguments.length, v = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
1536
- v[_key11] = arguments[_key11];
1526
+ for (var _len10 = arguments.length, v = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
1527
+ v[_key10] = arguments[_key10];
1537
1528
  }
1538
1529
 
1539
1530
  return function (fn) {
@@ -1930,6 +1921,30 @@ var getUID = function getUID() {
1930
1921
  var getUrlParams = function getUrlParams() {
1931
1922
  return _fromPairs(Array.from(new URLSearchParams(location.search).entries()));
1932
1923
  };
1924
+ var isShallowEqualSameKeys = function isShallowEqualSameKeys(a, b) {
1925
+ for (var key in a) {
1926
+ if (a[key] !== b[key]) {
1927
+ return false;
1928
+ }
1929
+ }
1930
+
1931
+ return true;
1932
+ };
1933
+ var isShallowEqual = function isShallowEqual(a, b) {
1934
+ for (var key in a) {
1935
+ if (!(key in b) || a[key] !== b[key]) {
1936
+ return false;
1937
+ }
1938
+ }
1939
+
1940
+ for (var key in b) {
1941
+ if (!(key in a) || a[key] !== b[key]) {
1942
+ return false;
1943
+ }
1944
+ }
1945
+
1946
+ return true;
1947
+ };
1933
1948
 
1934
1949
  var disableSelect = function disableSelect(e) {
1935
1950
  e.preventDefault();
@@ -2364,4 +2379,4 @@ var parseDecimalToNumber = function parseDecimalToNumber(v) {
2364
2379
  return _isString(v) ? Number(v.replace(/\./g, '').replace(',', ".")) : v || 0;
2365
2380
  };
2366
2381
 
2367
- export { Action, COMPLETE_ACTION, DAY, FETCH, HOUR, MINUTE, MONTH, REDUCE, SECOND, SKIPPED_ACTION, SKIP_DISPATCH, SKIP_FETCH, SkipAction, WEEK, YEAR, _s, activateActions, addExtraProp, addHttp, addQueryString, addZero, animationTiming, asciify, asyncDebounce, blockDiffIntervals, callIfFunction, callIfFunctions, callMany, cancelableTimer, compareBest, concatSelectors, constrainEvent, createPressAndHoldEvent, createPressAndMoveEvent, createPressEvent, createPromiseQueue, createPromiseResolverPair, createSimplePromiseLock, customTheme, diffIntervals, digitsToPattern, ellipsis, fixMediaQuery, formFetch, formFetchWithResponse, formatDate, formatDateToPattern, formatHour, formatJoin, formatJoinArr, formatPath, getClosestOffsetScroll, getColor, getFetcher, getFetcherWithResponse, getMargin, getNumberInputType, getNumberInputType2, getScrollParent, getStartOfDay, getUID, getUrlParams, identityFn, identityOpacityFrames, identityTranslateFrames, ifNotProp, ifProp, ifPropEquals, ifUndefined, intToHour, intervalsIntersect, intervalsIntersectExclusive, intervalsIntersection, intsToHour, isElementInView, isEmptyHtml, isHighDensity, isIOS, isIPad, isMobile, isPWA, isRetina, isSameDay, isSmallDevice, isTouchDevice, isUrl, lazyValue, linkRegex, mapGetOrSet, media, normalizeMouse, normalizePress, normalizeText, normalizeTextUrl, normalizeTouch, notPrinterMedia, oneWayAnimation, parseDate, parseDecimalToNumber, postFetcher, postFetcherWithResponse, preventDefault, printerMedia, promiseMapReduce, prop, queryStringToObj, rafThrottle, removeAccents, safeNewLineToBr, scrollIntoViewWithOffset, scrollWidth, selectPath, smoothScroll, startBlockDiffIntervals, stopPropagation, styledExtend, timerPromise, toHighest, toLowest, touchClick, twoWayAnimation, unWill, useEventListener, useEventListenerFor, using, vheight, will, willFormatDecimal, willRafThrottle, wrapLazy };
2382
+ export { Action, COMPLETE_ACTION, DAY, FETCH, HOUR, MINUTE, MONTH, REDUCE, SECOND, SKIPPED_ACTION, SKIP_DISPATCH, SKIP_FETCH, SkipAction, WEEK, YEAR, _s, activateActions, addExtraProp, addHttp, addQueryString, addZero, animationTiming, asciify, asyncDebounce, blockDiffIntervals, callIfFunction, callIfFunctions, callMany, cancelableTimer, compareBest, concatSelectors, constrainEvent, createPressAndHoldEvent, createPressAndMoveEvent, createPressEvent, createPromiseQueue, createPromiseResolverPair, createSimplePromiseLock, customTheme, diffIntervals, digitsToPattern, ellipsis, fixMediaQuery, formFetch, formFetchWithResponse, formatDate, formatDateToPattern, formatHour, formatJoin, formatJoinArr, formatPath, getClosestOffsetScroll, getColor, getFetcher, getFetcherWithResponse, getMargin, getNumberInputType, getNumberInputType2, getScrollParent, getStartOfDay, getUID, getUrlParams, identityFn, identityOpacityFrames, identityTranslateFrames, ifNotProp, ifProp, ifPropEquals, ifUndefined, intToHour, intervalsIntersect, intervalsIntersectExclusive, intervalsIntersection, intsToHour, isElementInView, isEmptyHtml, isHighDensity, isIOS, isIPad, isMobile, isPWA, isRetina, isSameDay, isShallowEqual, isShallowEqualSameKeys, isSmallDevice, isTouchDevice, isUrl, lazyValue, linkRegex, mapGetOrSet, media, normalizeMouse, normalizePress, normalizeText, normalizeTextUrl, normalizeTouch, notPrinterMedia, oneWayAnimation, parseDate, parseDecimalToNumber, postFetcher, postFetcherWithResponse, preventDefault, printerMedia, promiseMapReduce, prop, queryStringToObj, rafThrottle, removeAccents, safeNewLineToBr, scrollIntoViewWithOffset, scrollWidth, selectPath, smoothScroll, startBlockDiffIntervals, stopPropagation, styledExtend, timerPromise, toHighest, toLowest, touchClick, twoWayAnimation, useEventListener, useEventListenerFor, using, vheight, will, willFormatDecimal, willRafThrottle, wrapLazy };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startlibs/utils",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Startlibs Utils",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,