@sajari/react-sdk-utils
Advanced tools
Comparing version 1.0.0-alpha.9 to 1.0.0-alpha.10
@@ -6,2 +6,8 @@ # Change Log | ||
# [1.0.0-alpha.10](https://github.com/sajari/sdk-react/compare/@sajari/react-sdk-utils@1.0.0-alpha.9...@sajari/react-sdk-utils@1.0.0-alpha.10) (2020-11-26) | ||
### Features | ||
- only pinSelected if item count is over limit ([33ded9a](https://github.com/sajari/sdk-react/commit/33ded9a50465af2c0a273b821a15bc879a980638)) | ||
# [1.0.0-alpha.9](https://github.com/sajari/sdk-react/compare/@sajari/react-sdk-utils@1.0.0-alpha.8...@sajari/react-sdk-utils@1.0.0-alpha.9) (2020-11-26) | ||
@@ -8,0 +14,0 @@ |
@@ -0,1 +1,2 @@ | ||
export declare function isBoolean(value: any): value is boolean; | ||
export declare function isNumber(value: any): value is number; | ||
@@ -2,0 +3,0 @@ export declare function isArray<T>(value: any): value is T[]; |
import { parseURL } from './url.esm.js'; | ||
function isBoolean(value) { | ||
return typeof value === 'boolean'; | ||
} | ||
function isNumber(value) { | ||
@@ -57,3 +60,3 @@ return typeof value === 'number' && !Number.isNaN(value); | ||
export { isArray, isEmpty, isEmptyArray, isEmptyObject, isNullOrUndefined, isNumber, isObject, isValidURL }; | ||
export { isArray, isBoolean, isEmpty, isEmptyArray, isEmptyObject, isNullOrUndefined, isNumber, isObject, isValidURL }; | ||
//# sourceMappingURL=assertion.esm.js.map |
@@ -1,2 +0,2 @@ | ||
export { isArray, isEmpty, isEmptyArray, isEmptyObject, isNullOrUndefined, isNumber, isObject, isValidURL } from './assertion.esm.js'; | ||
export { isArray, isBoolean, isEmpty, isEmptyArray, isEmptyObject, isNullOrUndefined, isNumber, isObject, isValidURL } from './assertion.esm.js'; | ||
export { __DEV__ } from './constant.esm.js'; | ||
@@ -3,0 +3,0 @@ export { default as createContext } from './context.esm.js'; |
@@ -30,2 +30,5 @@ 'use strict'; | ||
function isBoolean(value) { | ||
return typeof value === 'boolean'; | ||
} | ||
function isNumber(value) { | ||
@@ -491,2 +494,3 @@ return typeof value === 'number' && !Number.isNaN(value); | ||
exports.isArray = isArray; | ||
exports.isBoolean = isBoolean; | ||
exports.isEmpty = isEmpty; | ||
@@ -493,0 +497,0 @@ exports.isEmptyArray = isEmptyArray; |
@@ -1,2 +0,2 @@ | ||
"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r.default:r}var e=require("react"),t=r(e),n=require("@emotion/core"),i=r(require("@emotion/styled")),o=require("emotion-theming"),u=r(require("@emotion/cache"));function a(r){return Array.isArray(r)}var s=function(r){return a(r)&&0===r.length},c=function(r){var e=typeof r;return null!==r&&("object"===e||"function"===e)&&!a(r)},f=function(r){return c(r)&&0===Object.keys(r).length},l=function(r){return null==r},d=function(r){return!!l(r)||(a(r)?s(r):c(r)?f(r):"string"==typeof r&&""===r.trim())};function m(r){var e=(""+r).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function p(r,e,t){if(void 0===r&&(r=0),void 0===e&&(e=""),void 0===t&&(t=!0),"number"!=typeof r)return r;if(!e)return(new Intl.NumberFormat).format(r);var n="en-US";return"undefined"!=typeof window&&(n=navigator.language),new Intl.NumberFormat(t?n.split("-")[0]:n,{style:"currency",currency:e}).format(r)}function v(){return(v=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}).apply(this,arguments)}function h(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(!c(r)||!t.length)return r;var i=t.shift();return i&&c(i)?(Object.keys(i).forEach((function(e){var t=r[e],n=i[e];r[e]=Array.isArray(t)&&Array.isArray(n)?t.concat(n):c(t)&&c(n)?h(v({},t),n):n})),r):r}function y(r,e){void 0===r&&(r=null),r&&("function"==typeof r?r(e):r.current=e)}function b(r,e){if(null!=r)try{y(r,e)}catch(t){throw new Error('Cannot assign value "'+e+'" to ref "'+r+'"')}}function x(r,e,t){return r.split(e).join(t)}var g={future:{},purge:[],theme:{backdropFilter:{none:"none","blur-1":"blur(0.25rem)","blur-2":"blur(0.5rem)","blur-3":"blur(0.75rem)","blur-4":"blur(1rem)","blur-5":"blur(1.25rem)","blur-6":"blur(1.5rem)"},truncate:{lines:{2:"2",3:"3",4:"4",5:"5"}},extend:{borderRadius:{inherit:"inherit"},fontSize:{"code-inline":"0.9375em"},fontFamily:{inherit:"inherit"},lineHeight:{inherit:"inherit"}}},plugins:[require("@tailwindcss/ui"),require("tailwindcss-filters"),require("tailwindcss-truncate-multiline")()]},w=["letter-spacing"],A=u({stylisPlugins:function(r,e,t){var n=t[0];if(n&&n.endsWith("*"))return e;switch(r){case 1:return e+" !important";case 3:return"@font-face"===n||n.startsWith("@")&&n.includes("keyframes")?x(e," !important",""):e;default:return e}},prefix:function(r){return!w.includes(r)}}),j={color:{primary:{base:"#667eea".toString(),text:"#fff".toString(),active:"#5a67d8".toString()}}};exports.ThemeProvider=function(r){var t=r.theme,i=r.importantStyles,u=void 0===i||i,a=r.children;return e.createElement(o.ThemeProvider,{theme:h(j,void 0===t?j:t)},u?e.createElement(n.CacheProvider,{value:A},a):a)},exports.__DEV__=!1,exports.assignRef=b,exports.clamp=function(r,e,t){return void 0===r&&(r=0),void 0===e&&(e=0),void 0===t&&(t=255),Math.min(Math.max(r,e),t)},exports.cleanChildren=function(r){return e.Children.toArray(r).filter((function(r){return e.isValidElement(r)}))},exports.closest=function(r,e){var t=e.reduce((function(e,t){return Math.abs(t-r)<Math.abs(e-r)?t:e}));return[e.indexOf(t),t]},exports.createContext=function(r){void 0===r&&(r={});var e=r.strict,n=void 0===e||e,i=r.errorMessage,o=void 0===i?"useContext must be inside a Provider with a value":i,u=r.name,a=t.createContext(void 0);return a.displayName=u,[a.Provider,function(){var r=t.useContext(a);if(!r&&n)throw new Error(o);return r},a]},exports.decodeHTML=function(r){void 0===r&&(r="");var e=document.createElement("textarea");return e.innerHTML=r,e.value},exports.filterObject=function(r,e,t){return void 0===t&&(t=!1),Object.keys(r).filter((function(r){return t?!e.includes(r):e.includes(r)})).reduce((function(e,t){var n;return Object.assign(e,((n={})[t]=r[t],n))}),{})},exports.formatNumber=p,exports.formatPrice=function(r,e){void 0===e&&(e="");var t=r,n=function(r){return p(r,e,!0)};if(!Array.isArray(t))return n(Number(t));var i=t.map(Number),o=Math.min.apply(Math,i),u=Math.max.apply(Math,i);return o===u?n(Number(o)):n(Number(o))+"–"+n(Number(u))},exports.forwardRefWithAs=function(r){return t.forwardRef(r)},exports.getDecimalPlaces=m,exports.isArray=a,exports.isEmpty=d,exports.isEmptyArray=s,exports.isEmptyObject=f,exports.isNullOrUndefined=l,exports.isNumber=function(r){return"number"==typeof r&&!Number.isNaN(r)},exports.isObject=c,exports.isValidURL=function(r,e){return void 0===e&&(e=!1),!(!r||d(r)||(!e||!r.startsWith("/"))&&null===function(r){void 0===r&&(r="");var e=r;/^https?:\/\/*/.test(r)||(e="http://"+r);try{return new URL(e)}catch(r){return null}}(r))},exports.mapStyles=function(r){return Object.entries(r).reduce((function(r,e){var t;return Object.assign(r,((t={})[e[0]]=n.css(e[1]),t))}),{})},exports.merge=h,exports.mergeRefs=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(r){e.forEach((function(e){return b(e,r)}))}},exports.replaceAll=x,exports.round=function(r,e){if(e<1){var t=m(e);return parseFloat(r.toFixed(t))}return Math.round(r/e)*e},exports.setRef=y,exports.styled=i,exports.tailwindConfig=g,exports.useDebounce=function(r,t,n){void 0===t&&(t=50),void 0===n&&(n={isImmediate:!1});var i=e.useRef();return function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];i.current&&clearTimeout(i.current);var a=this,s=function(){i.current=void 0,n.isImmediate||r.apply(a,o)},c=n.isImmediate&&void 0===i.current;i.current=setTimeout(s,t),c&&r.apply(a,o)}},exports.useTheme=function(){return o.useTheme()}; | ||
"use strict";function r(r){return r&&"object"==typeof r&&"default"in r?r.default:r}var e=require("react"),t=r(e),n=require("@emotion/core"),i=r(require("@emotion/styled")),o=require("emotion-theming"),u=r(require("@emotion/cache"));function a(r){return Array.isArray(r)}var s=function(r){return a(r)&&0===r.length},c=function(r){var e=typeof r;return null!==r&&("object"===e||"function"===e)&&!a(r)},f=function(r){return c(r)&&0===Object.keys(r).length},l=function(r){return null==r},d=function(r){return!!l(r)||(a(r)?s(r):c(r)?f(r):"string"==typeof r&&""===r.trim())};function m(r){var e=(""+r).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function p(r,e,t){if(void 0===r&&(r=0),void 0===e&&(e=""),void 0===t&&(t=!0),"number"!=typeof r)return r;if(!e)return(new Intl.NumberFormat).format(r);var n="en-US";return"undefined"!=typeof window&&(n=navigator.language),new Intl.NumberFormat(t?n.split("-")[0]:n,{style:"currency",currency:e}).format(r)}function v(){return(v=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r}).apply(this,arguments)}function h(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(!c(r)||!t.length)return r;var i=t.shift();return i&&c(i)?(Object.keys(i).forEach((function(e){var t=r[e],n=i[e];r[e]=Array.isArray(t)&&Array.isArray(n)?t.concat(n):c(t)&&c(n)?h(v({},t),n):n})),r):r}function y(r,e){void 0===r&&(r=null),r&&("function"==typeof r?r(e):r.current=e)}function b(r,e){if(null!=r)try{y(r,e)}catch(t){throw new Error('Cannot assign value "'+e+'" to ref "'+r+'"')}}function x(r,e,t){return r.split(e).join(t)}var g={future:{},purge:[],theme:{backdropFilter:{none:"none","blur-1":"blur(0.25rem)","blur-2":"blur(0.5rem)","blur-3":"blur(0.75rem)","blur-4":"blur(1rem)","blur-5":"blur(1.25rem)","blur-6":"blur(1.5rem)"},truncate:{lines:{2:"2",3:"3",4:"4",5:"5"}},extend:{borderRadius:{inherit:"inherit"},fontSize:{"code-inline":"0.9375em"},fontFamily:{inherit:"inherit"},lineHeight:{inherit:"inherit"}}},plugins:[require("@tailwindcss/ui"),require("tailwindcss-filters"),require("tailwindcss-truncate-multiline")()]},w=["letter-spacing"],A=u({stylisPlugins:function(r,e,t){var n=t[0];if(n&&n.endsWith("*"))return e;switch(r){case 1:return e+" !important";case 3:return"@font-face"===n||n.startsWith("@")&&n.includes("keyframes")?x(e," !important",""):e;default:return e}},prefix:function(r){return!w.includes(r)}}),j={color:{primary:{base:"#667eea".toString(),text:"#fff".toString(),active:"#5a67d8".toString()}}};exports.ThemeProvider=function(r){var t=r.theme,i=r.importantStyles,u=void 0===i||i,a=r.children;return e.createElement(o.ThemeProvider,{theme:h(j,void 0===t?j:t)},u?e.createElement(n.CacheProvider,{value:A},a):a)},exports.__DEV__=!1,exports.assignRef=b,exports.clamp=function(r,e,t){return void 0===r&&(r=0),void 0===e&&(e=0),void 0===t&&(t=255),Math.min(Math.max(r,e),t)},exports.cleanChildren=function(r){return e.Children.toArray(r).filter((function(r){return e.isValidElement(r)}))},exports.closest=function(r,e){var t=e.reduce((function(e,t){return Math.abs(t-r)<Math.abs(e-r)?t:e}));return[e.indexOf(t),t]},exports.createContext=function(r){void 0===r&&(r={});var e=r.strict,n=void 0===e||e,i=r.errorMessage,o=void 0===i?"useContext must be inside a Provider with a value":i,u=r.name,a=t.createContext(void 0);return a.displayName=u,[a.Provider,function(){var r=t.useContext(a);if(!r&&n)throw new Error(o);return r},a]},exports.decodeHTML=function(r){void 0===r&&(r="");var e=document.createElement("textarea");return e.innerHTML=r,e.value},exports.filterObject=function(r,e,t){return void 0===t&&(t=!1),Object.keys(r).filter((function(r){return t?!e.includes(r):e.includes(r)})).reduce((function(e,t){var n;return Object.assign(e,((n={})[t]=r[t],n))}),{})},exports.formatNumber=p,exports.formatPrice=function(r,e){void 0===e&&(e="");var t=r,n=function(r){return p(r,e,!0)};if(!Array.isArray(t))return n(Number(t));var i=t.map(Number),o=Math.min.apply(Math,i),u=Math.max.apply(Math,i);return o===u?n(Number(o)):n(Number(o))+"–"+n(Number(u))},exports.forwardRefWithAs=function(r){return t.forwardRef(r)},exports.getDecimalPlaces=m,exports.isArray=a,exports.isBoolean=function(r){return"boolean"==typeof r},exports.isEmpty=d,exports.isEmptyArray=s,exports.isEmptyObject=f,exports.isNullOrUndefined=l,exports.isNumber=function(r){return"number"==typeof r&&!Number.isNaN(r)},exports.isObject=c,exports.isValidURL=function(r,e){return void 0===e&&(e=!1),!(!r||d(r)||(!e||!r.startsWith("/"))&&null===function(r){void 0===r&&(r="");var e=r;/^https?:\/\/*/.test(r)||(e="http://"+r);try{return new URL(e)}catch(r){return null}}(r))},exports.mapStyles=function(r){return Object.entries(r).reduce((function(r,e){var t;return Object.assign(r,((t={})[e[0]]=n.css(e[1]),t))}),{})},exports.merge=h,exports.mergeRefs=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(r){e.forEach((function(e){return b(e,r)}))}},exports.replaceAll=x,exports.round=function(r,e){if(e<1){var t=m(e);return parseFloat(r.toFixed(t))}return Math.round(r/e)*e},exports.setRef=y,exports.styled=i,exports.tailwindConfig=g,exports.useDebounce=function(r,t,n){void 0===t&&(t=50),void 0===n&&(n={isImmediate:!1});var i=e.useRef();return function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];i.current&&clearTimeout(i.current);var a=this,s=function(){i.current=void 0,n.isImmediate||r.apply(a,o)},c=n.isImmediate&&void 0===i.current;i.current=setTimeout(s,t),c&&r.apply(a,o)}},exports.useTheme=function(){return o.useTheme()}; | ||
//# sourceMappingURL=react-sdk-utils.cjs.production.min.js.map |
{ | ||
"name": "@sajari/react-sdk-utils", | ||
"version": "1.0.0-alpha.9", | ||
"version": "1.0.0-alpha.10", | ||
"description": "TBD", | ||
@@ -39,3 +39,3 @@ "repository": { | ||
}, | ||
"gitHead": "82cde00f99fb7e570825cfcbce9b7a4d38e1d9e6" | ||
"gitHead": "56e4ac293378d0e0d8656fa47dcc100061df8606" | ||
} |
Sorry, the diff of this file is not supported yet
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
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
116839
1007