Comparing version 1.0.0 to 1.1.0
@@ -1,2 +0,2 @@ | ||
var n=Array.prototype.push;var e=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:e,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:e&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};exports.compactArray=function(n){for(var e=[],r=0;r<n.length;++r){var t=n[r];null!=t&&e.push(t)}return e},exports.concatAllArray=function(e){for(var r=[],t=0;t<e.length;t++){var o=e[t];if(Array.isArray(o))n.apply(r,o);else if(null!=o)throw new TypeError('concatAllArray: All items in the array must be an array or null, got "'+o+'" at index "'+t+'" instead')}return r},exports.ExecutionEnvironment=r,exports.fromPhoneE164=function(n){return 12===n.length?n.substring(2,5)+"-"+n.substring(5,8)+"-"+n.substring(8,12):n},exports.toPhoneE164=function(n){return 10===(n=n.replace(/[^0-9]/g,"")).length&&(n="1"+n),"+"+n},exports.makeCancelable=function(n){var e=!1;return[new Promise(function(r,t){n.then(function(n){return e?t({isCanceled:!0}):r(n)},function(n){return t(e?{isCanceled:!0}:n)})}),function(){e=!0}]},exports.uniq=function(n){var e=new Set;return n.filter(function(n){if(!e.has(n))return e.add(n),!0})},exports.getActiveElement=function(n){if(void 0===(n=n||("undefined"!=typeof document?document:void 0)))return null;try{return n.activeElement||n.body}catch(e){return n.body}}; | ||
var e=Array.prototype.push;var n=!("undefined"==typeof window||!window.document||!window.document.createElement),t={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};exports.compactArray=function(e){for(var n=[],t=0;t<e.length;++t){var r=e[t];null!=r&&n.push(r)}return n},exports.concatAllArray=function(n){for(var t=[],r=0;r<n.length;r++){var o=n[r];if(Array.isArray(o))e.apply(t,o);else if(null!=o)throw new TypeError('concatAllArray: All items in the array must be an array or null, got "'+o+'" at index "'+r+'" instead')}return t},exports.copyToClipboard=function(e,n){void 0===n&&(n=document.body);var t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",n.appendChild(t);var r=document.getSelection(),o=!!(r&&r.rangeCount>0)&&r.getRangeAt(0);t.select(),document.execCommand("copy"),n.removeChild(t),o&&r&&(r.removeAllRanges(),r.addRange(o))},exports.dataUriToBlob=function(e){var n;n=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):decodeURI(e.split(",")[1]);for(var t=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(n.length),o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new Blob([r],{type:t})},exports.debounce=function(e,n,t){var r;return function(){var o=this,a=arguments,i=t&&!r;clearTimeout(r),r=setTimeout(function(){r=null,t||e.apply(o,a)},n),i&&e.apply(o,a)}},exports.encodeSVGAsDataUri=function(e){return"data:image/svg+xml,"+encodeURIComponent(e).replace(/%0A/g,"").replace(/%20/g," ").replace(/%3D/g,"=").replace(/%3A/g,":").replace(/%2F/g,"/").replace(/%22/g,"'")},exports.ExecutionEnvironment=t,exports.fromPhoneE164=function(e){return 12===e.length?e.substring(2,5)+"-"+e.substring(5,8)+"-"+e.substring(8,12):e},exports.getActiveElement=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(n){return e.body}},exports.humanizeList=function(e,n){if(void 0===n&&(n={oxfordComma:!0,skipConjunction:!1,conjunction:"and"}),!Array.isArray(e))throw new TypeError("humanize-list expected an array");var t=e.length;if(1===t)return e[0];if(n.skipConjunction)return e.join(", ");var r="";if(2===t)return e.join(" "+n.conjunction+" ");for(var o=0;o<t;o++)o===t-1?(n.oxfordComma&&(r+=","),r+=" "+n.conjunction+" "):0!==o&&(r+=", "),r+=e[o];return r},exports.makeCancelable=function(e){var n=!1;return[new Promise(function(t,r){e.then(function(e){return n?r({isCanceled:!0}):t(e)},function(e){return r(n?{isCanceled:!0}:e)})}),function(){n=!0}]},exports.throttle=function(e,n){var t=null,r=null,o=this,a=function(){e.apply(o,r),t=null};return function(){t||(r=arguments,t=setTimeout(a,n))}},exports.toPhoneE164=function(e){return 10===(e=e.replace(/[^0-9]/g,"")).length&&(e="1"+e),"+"+e},exports.toRadian=function(e){return e*Math.PI/180},exports.toSlug=function(e){var n=e;return n?n=(n=(n=(n=(n=n.toLowerCase().trim()).replace(/ & /g," and ")).replace(/[ ]+/g,"-")).replace(/[-]+/g,"-")).replace(/[^a-z0-9-]+/g,""):""},exports.uniq=function(e){var n=new Set;return e.filter(function(e){if(!n.has(e))return n.add(e),!0})}; | ||
//# sourceMappingURL=jpjs.js.map |
{ | ||
"name": "jpjs", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "dist/jpjs.js", | ||
@@ -28,2 +28,2 @@ "umd:main": "dist/jpjs.umd.js", | ||
} | ||
} | ||
} |
export * from './compactArray'; | ||
export * from './concatAllArray'; | ||
export * from './copyToClipboard'; | ||
export * from './dataUriToBlob'; | ||
export * from './debounce'; | ||
export * from './encodeSvgAsDataUri'; | ||
export * from './ExecutionEnvironment'; | ||
export * from './fromPhoneE164'; | ||
export * from './getActiveElement'; | ||
export * from './humanizeList'; | ||
export * from './makeCancellablePromise'; | ||
export * from './throttle'; | ||
export * from './toPhoneE164'; | ||
export * from './makeCancellablePromise'; | ||
export * from './toRadian'; | ||
export * from './toSlug'; | ||
export * from './types'; | ||
export * from './uniq'; | ||
export * from './types'; | ||
export * from './getActiveElement'; |
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
478
20451
23