paliari-js-utils
Advanced tools
Comparing version 0.2.25 to 0.3.0
@@ -1,1 +0,1 @@ | ||
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=6)}([function(t,e,n){"use strict";n.r(e);n(5),n(4),n(3),n(2),n(1);var r=function(t){return new Promise(function(e,n){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){e(),r.remove()},r.onerror=function(t){return n(t)},document.body.appendChild(r)})},o=function(t,e){return String(e).split(".").forEach(function(e){if(!t)return t;t=t[e]}),t};function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var u=function(t){return null!==t&&"object"===i(t)},c=function(t){return Object.prototype.toString.call(t).slice(8,-1)},a=function(t){return"[object Object]"===Object.prototype.toString.call(t)},f={"à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","ÿ":"y"},l=function(t){return t&&(t=(t=t.toLocaleLowerCase()).replace(/[^a-z0-9\s_-]/g,function(t){return f[t]||t.replace(/\W/," ")})),t},s=function(t){return"[object Date]"===Object.prototype.toString.call(t)},d=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},p=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},h=function(t){return u(t)?function t(e){if(s(e))return new Date(e);if(d(e))return e;var n=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(r){n[r]=u(e[r])?t(e[r]):e[r]}),n}(t):t};function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(!r.length)return e;var i=r.shift();return u(e)&&u(i)&&Object.keys(i).forEach(function(n){u(i[n])?(e[n]||Object.assign(e,y({},n,{})),t(e[n],i[n])):Object.assign(e,y({},n,i[n]))}),t.apply(void 0,[e].concat(r))},m=function(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object.getOwnPropertyNames(e).reduce(function(r,i){return o.push(i),a(e[i])?t(e[i],n,r,o):r[o.join(n)]=e[i],o.pop(),r},r)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/")},v="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};v.split("").sort().forEach(function(t,e){b[v.charAt(e)]=t});var _=function(t){if(!t)return t;var e="";return t.split("").forEach(function(t){e+=b[t]||t}),e},w=[100,200,500,750],j=function(t){return w.find(function(e){if(t<=e)return e})},S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;Object.keys(t).forEach(function(e){r+=Number(e)*t[e],n+=t[e]});var o=Math.pow(10,e);return n?Math.round(r/n*o)/o:0},O=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},E=function(t,e){return function t(e,n){return a(n)&&a(e)?Object.keys(n).reduce(function(r,o){return void 0!==e[o]&&(r[o]=a(n[o])?t(e[o],n[o]):e[o]),r},{}):e}(t,e)},k=function(t,e){return t.sort(function(t){return function(e,n){return t.map(function(t){return e[t]===n[t]?0:void 0===e[t]?1:void 0===n[t]?-1:e[t]>n[t]?1:e[t]<n[t]?-1:0}).reduce(function(t,e){return t||e},0)}}(e))},A=function(t,e,n){if(!e||!n)throw{message:"Locale not found!",code:"locale_not_found"};return"".concat(l(t),"_").concat(l(e),"_").concat(l(n)).replace(/ /g,"_")},x=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},L=function(t){return A(x(t,"country").short_name,x(t,"administrative_area_level_1").short_name,x(t,"administrative_area_level_2").long_name)},P=function(t){if(!t.address_components)throw{code:"convert_place_no_address_componentes"};var e={};return e.geometry={viewport:{northeast:{lat:t.geometry.viewport.na.l,lng:t.geometry.viewport.ia.l},southwest:{lat:t.geometry.viewport.na.j,lng:t.geometry.viewport.ia.j}},location:{lat:t.geometry.location.lat(),lng:t.geometry.location.lng()}},e.formatted_address=t.formatted_address,e.place_id=t.place_id,e.cidade_id=L(t.address_components),e},C=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},M=function(t){return"".concat(C(t,"administrative_area_level_2").long_name," - ").concat(C(t,"administrative_area_level_1").short_name," - ").concat(C(t,"country").long_name)},F=function(){return function(t){return"desc"===t?9999999999999-Date.now():Date.now()}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"desc").toString()+Math.random().toString().substr(2,7)},I="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",D=0,R=[],T=function(){var t=Date.now(),e=t===D;D=t;for(var n=new Array(8),r=7;r>=0;r--)n[r]=I.charAt(t%64),t=Math.floor(t/64);if(0!==t)throw new Error("We should have converted the entire timestamp.");var o=n.join("");if(e){for(r=11;r>=0&&63===R[r];r--)R[r]=0;R[r]++}else for(r=0;r<12;r++)R[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)o+=I.charAt(R[r]);if(20!=o.length)throw new Error("Length should be 20.");return o},N=function(t){for(var e=0,n=0;n<8;n++){var r=I.indexOf(t.charAt(n));if(-1===r)throw new Error("Invalid id!");e=64*e+r}return e},z=function t(e,n){var r=e.split(""),o=r.pop(),i=n[n.indexOf(o)+1];return i?r.join("")+i:t(r.join(""),n)+n[0]},J=function(t){return z(t,I.split(""))},B=function(t){return z(t,I.split("").sort())},G={items:{},get namespace(){return this._n},set namespace(t){this._n=t+"_"},_k:function(t){return this.namespace+t},setItem:function(t,e){var n=this._k(t);this.items[n]=e,localStorage.setItem(n,JSON.stringify(e))},getItem:function(t){var e=this._k(t);if(void 0===this.items[e]){var n=localStorage.getItem(e);this.items[e]=n?JSON.parse(n):""}return this.items[e]},removeItem:function(t){var e=this._k(t);delete this.items[e],localStorage.removeItem(e)},clear:function(){this.items={},localStorage.clear()}};function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.keys(e).forEach(function(t){"function"==typeof e[t]?n[t]=null===r[t]?null:e[t](r[t]):n[t]=void 0===r[t]?e[t]:r[t]})}return function(t,e,n){e&&K(t.prototype,e),n&&K(t,n)}(t,[{key:"sanitize",value:function(t){return E(this,t)}},{key:"_liteRules",value:function(){throw new Error("Lite Rules not defined!")}},{key:"lite",value:function(){return this.sanitize(this._liteRules())}}]),t}();function H(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var U="pt_br",q=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.locales=e,this.locale=n}return function(t,e,n){e&&H(t.prototype,e),n&&H(t,n)}(t,[{key:"t",value:function(t,e){return function(t,e){return t&&e?(Object.keys(e).forEach(function(n){t=t.replace(new RegExp("%{"+n+"}","g"),e[n])}),t):t}(o(this.current,t),e)}},{key:"setLocale",value:function(t){if(this.getAvailableLocales().includes(t))return this.locale=t,this;throw new Error("Locale not found!")}},{key:"getLocale",value:function(){return this.locale}},{key:"getAvailableLocales",value:function(){return Object.keys(this.locales)}},{key:"current",get:function(){return this.locales[this.locale]}}]),t}();function Q(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(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){V(t,e,n[e])})}return t}function V(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Y="current_locale",Z=function(t){var e=localStorage.getItem(Y)||window.navigator.language.toLowerCase().replace("-","_");return t.getAvailableLocales().includes(e)?e:(e=e.substr(0,2),t.getAvailableLocales().includes(e)?e:U)},$=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.i18n=e,this.fecha=n,this.current=Z(e)}return function(t,e,n){e&&X(t.prototype,e),n&&X(t,n)}(t,[{key:"reset",value:function(t){t!==this.current&&(this.current=t)}},{key:"current",set:function(t){localStorage.setItem(Y,t),this.i18n.setLocale(t),this.fecha&&(this.fecha.i18n=Q({},this.fecha.i18n,this.i18n.t("date_time.names")),this.fecha.masks=Q({},this.fecha.masks,this.i18n.t("date_time.formats")))},get:function(){return localStorage.getItem(Y)}}]),t}();n.d(e,"asyncJs",function(){return r}),n.d(e,"deepKey",function(){return o}),n.d(e,"isObject",function(){return u}),n.d(e,"getClassName",function(){return c}),n.d(e,"isHash",function(){return a}),n.d(e,"transliterate",function(){return l}),n.d(e,"isDate",function(){return s}),n.d(e,"isRegExp",function(){return d}),n.d(e,"ucfirst",function(){return p}),n.d(e,"deepClone",function(){return h}),n.d(e,"deepMerge",function(){return g}),n.d(e,"flattenObject",function(){return m}),n.d(e,"jsEncode",function(){return _}),n.d(e,"thumbRange",function(){return j}),n.d(e,"starRating",function(){return S}),n.d(e,"prepareKey",function(){return O}),n.d(e,"sortBy",function(){return k}),n.d(e,"convertPlace",function(){return P}),n.d(e,"idCidade",function(){return A}),n.d(e,"idCidadeAddressComponent",function(){return L}),n.d(e,"nomeCidadeAddressComponent",function(){return M}),n.d(e,"idGeneratorDesc",function(){return T}),n.d(e,"idGeneratorNumeric",function(){return F}),n.d(e,"idDescTimestamp",function(){return N}),n.d(e,"prevId",function(){return J}),n.d(e,"nextId",function(){return B}),n.d(e,"BaseModel",function(){return W}),n.d(e,"I18n",function(){return q}),n.d(e,"Language",function(){return $}),n.d(e,"sanitize",function(){return E}),n.d(e,"LocalStorageFacade",function(){return G})},function(t,e){String.prototype.trimStart||(String.prototype.trimStart=function(){return this.replace(/^[\s\uFEFF\xA0]+/,"")},String.prototype.trimLeft=String.prototype.trimStart)},function(t,e){String.prototype.trimEnd||(String.prototype.trimEnd=function(){return this.replace(/[\s\uFEFF\xA0]+$/,"")},String.prototype.trimRight=String.prototype.trimEnd)},function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},function(t,e){String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)})},function(t,e){Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;for(var o=0|e,i=Math.max(o>=0?o:r-Math.abs(o),0);i<r;){if(n[i]===t)return!0;i++}return!1}})},function(t,e,n){t.exports=n(0)}]); | ||
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=6)}([function(t,e,n){"use strict";n.r(e);n(5),n(4),n(3),n(2),n(1);var r=function(t){return new Promise(function(e,n){var r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=function(){e(),r.remove()},r.onerror=function(t){return n(t)},document.body.appendChild(r)})},o=function(t,e){return String(e).split(".").forEach(function(e){if(!t)return t;t=t[e]}),t};function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var u=function(t){return null!==t&&"object"===i(t)},c=function(t){return Object.prototype.toString.call(t).slice(8,-1)},a=function(t){return"[object Object]"===Object.prototype.toString.call(t)},f={"à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ő":"o","ù":"u","ú":"u","û":"u","ü":"u","ű":"u","ý":"y","ÿ":"y"},l=function(t){return t&&(t=(t=t.toLocaleLowerCase()).replace(/[^a-z0-9\s_-]/g,function(t){return f[t]||t.replace(/\W/," ")})),t},s=function(t){return"[object Date]"===Object.prototype.toString.call(t)},d=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},p=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},h=function(t){return u(t)?function t(e){if(s(e))return new Date(e);if(d(e))return e;var n=Array.isArray(e)?[]:{};return Object.keys(e).forEach(function(r){n[r]=u(e[r])?t(e[r]):e[r]}),n}(t):t};function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g=function t(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];if(!r.length)return e;var i=r.shift();return u(e)&&u(i)&&Object.keys(i).forEach(function(n){u(i[n])?(e[n]||Object.assign(e,y({},n,{})),t(e[n],i[n])):Object.assign(e,y({},n,i[n]))}),t.apply(void 0,[e].concat(r))},m=function(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object.getOwnPropertyNames(e).reduce(function(r,i){return o.push(i),a(e[i])?t(e[i],n,r,o):r[o.join(n)]=e[i],o.pop(),r},r)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/")},v="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};v.split("").sort().forEach(function(t,e){b[v.charAt(e)]=t});var _=function(t){if(!t)return t;var e="";return t.split("").forEach(function(t){e+=b[t]||t}),e},w=[100,200,500,750],j=function(t){return w.find(function(e){if(t<=e)return e})},S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;Object.keys(t).forEach(function(e){r+=Number(e)*t[e],n+=t[e]});var o=Math.pow(10,e);return n?Math.round(r/n*o)/o:0},O=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},E=function(t,e){return function t(e,n){return a(n)&&a(e)?Object.keys(n).reduce(function(r,o){return void 0!==e[o]&&(r[o]=a(n[o])?t(e[o],n[o]):e[o]),r},{}):e}(t,e)},k=function(t,e){return t.sort(function(t){return function(e,n){return t.map(function(t){return e[t]===n[t]?0:void 0===e[t]?1:void 0===n[t]?-1:e[t]>n[t]?1:e[t]<n[t]?-1:0}).reduce(function(t,e){return t||e},0)}}(e))},A=function(t,e,n){if(!e||!n)throw{message:"Locale not found!",code:"locale_not_found"};return"".concat(l(t),"_").concat(l(e),"_").concat(l(n)).replace(/ /g,"_")},x=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},L=function(t){return A(x(t,"country").short_name,x(t,"administrative_area_level_1").short_name,x(t,"administrative_area_level_2").long_name)},P=function(t){if(!t.address_components)throw{code:"convert_place_no_address_componentes"};var e={};return e.geometry={viewport:{northeast:{lat:t.geometry.viewport.na.l,lng:t.geometry.viewport.ia.l},southwest:{lat:t.geometry.viewport.na.j,lng:t.geometry.viewport.ia.j}},location:{lat:t.geometry.location.lat(),lng:t.geometry.location.lng()}},e.formatted_address=t.formatted_address,e.place_id=t.place_id,e.cidade_id=L(t.address_components),e},C=function(t,e){return t.find(function(t){return t.types.includes(e)})||{}},M=function(t){return"".concat(C(t,"administrative_area_level_2").long_name," - ").concat(C(t,"administrative_area_level_1").short_name," - ").concat(C(t,"country").long_name)},F=function(){return function(t){return"desc"===t?9999999999999-Date.now():Date.now()}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"desc").toString()+Math.random().toString().substr(2,7)},I="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",D=0,R=[],T=function(){var t=Date.now(),e=t===D;D=t;for(var n=new Array(8),r=7;r>=0;r--)n[r]=I.charAt(t%64),t=Math.floor(t/64);if(0!==t)throw new Error("We should have converted the entire timestamp.");var o=n.join("");if(e){for(r=11;r>=0&&63===R[r];r--)R[r]=0;R[r]++}else for(r=0;r<12;r++)R[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)o+=I.charAt(R[r]);if(20!=o.length)throw new Error("Length should be 20.");return o},N=function(t){for(var e=0,n=0;n<8;n++){var r=I.indexOf(t.charAt(n));if(-1===r)throw new Error("Invalid id!");e=64*e+r}return e},z=function t(e,n){var r=e.split(""),o=r.pop(),i=n[n.indexOf(o)+1];return i?r.join("")+i:t(r.join(""),n)+n[0]},J=function(t){return z(t,I.split(""))},B=function(t){return z(t,I.split("").sort())},G={items:{},get namespace(){return this._n||""},set namespace(t){this._n=t+"_"},_k:function(t){return this.namespace+t},setItem:function(t,e){var n=this._k(t);this.items[n]=e,localStorage.setItem(n,JSON.stringify(e))},getItem:function(t){var e=this._k(t);if(void 0===this.items[e]){var n=localStorage.getItem(e);this.items[e]=n?JSON.parse(n):""}return this.items[e]},removeItem:function(t){var e=this._k(t);delete this.items[e],localStorage.removeItem(e)},clear:function(){this.items={},localStorage.clear()}};function K(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var W=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.keys(e).forEach(function(t){"function"==typeof e[t]?n[t]=null===r[t]?null:e[t](r[t]):n[t]=void 0===r[t]?e[t]:r[t]})}return function(t,e,n){e&&K(t.prototype,e),n&&K(t,n)}(t,[{key:"sanitize",value:function(t){return E(this,t)}},{key:"_liteRules",value:function(){throw new Error("Lite Rules not defined!")}},{key:"lite",value:function(){return this.sanitize(this._liteRules())}}]),t}();function H(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var U="pt_br",q=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.locales=e,this.locale=n}return function(t,e,n){e&&H(t.prototype,e),n&&H(t,n)}(t,[{key:"t",value:function(t,e){return function(t,e){return t&&e?(Object.keys(e).forEach(function(n){t=t.replace(new RegExp("%{"+n+"}","g"),e[n])}),t):t}(o(this.current,t),e)}},{key:"setLocale",value:function(t){if(this.getAvailableLocales().includes(t))return this.locale=t,this;throw new Error("Locale not found!")}},{key:"getLocale",value:function(){return this.locale}},{key:"getAvailableLocales",value:function(){return Object.keys(this.locales)}},{key:"current",get:function(){return this.locales[this.locale]}}]),t}();function Q(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(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){V(t,e,n[e])})}return t}function V(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function X(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Y="current_locale",Z=function(t){var e=localStorage.getItem(Y)||window.navigator.language.toLowerCase().replace("-","_");return t.getAvailableLocales().includes(e)?e:(e=e.substr(0,2),t.getAvailableLocales().includes(e)?e:U)},$=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.i18n=e,this.fecha=n,this.current=Z(e)}return function(t,e,n){e&&X(t.prototype,e),n&&X(t,n)}(t,[{key:"reset",value:function(t){t!==this.current&&(this.current=t)}},{key:"current",set:function(t){localStorage.setItem(Y,t),this.i18n.setLocale(t),this.fecha&&(this.fecha.i18n=Q({},this.fecha.i18n,this.i18n.t("date_time.names")),this.fecha.masks=Q({},this.fecha.masks,this.i18n.t("date_time.formats")))},get:function(){return localStorage.getItem(Y)}}]),t}();n.d(e,"asyncJs",function(){return r}),n.d(e,"deepKey",function(){return o}),n.d(e,"isObject",function(){return u}),n.d(e,"getClassName",function(){return c}),n.d(e,"isHash",function(){return a}),n.d(e,"transliterate",function(){return l}),n.d(e,"isDate",function(){return s}),n.d(e,"isRegExp",function(){return d}),n.d(e,"ucfirst",function(){return p}),n.d(e,"deepClone",function(){return h}),n.d(e,"deepMerge",function(){return g}),n.d(e,"flattenObject",function(){return m}),n.d(e,"jsEncode",function(){return _}),n.d(e,"thumbRange",function(){return j}),n.d(e,"starRating",function(){return S}),n.d(e,"prepareKey",function(){return O}),n.d(e,"sortBy",function(){return k}),n.d(e,"convertPlace",function(){return P}),n.d(e,"idCidade",function(){return A}),n.d(e,"idCidadeAddressComponent",function(){return L}),n.d(e,"nomeCidadeAddressComponent",function(){return M}),n.d(e,"idGeneratorDesc",function(){return T}),n.d(e,"idGeneratorNumeric",function(){return F}),n.d(e,"idDescTimestamp",function(){return N}),n.d(e,"prevId",function(){return J}),n.d(e,"nextId",function(){return B}),n.d(e,"BaseModel",function(){return W}),n.d(e,"I18n",function(){return q}),n.d(e,"Language",function(){return $}),n.d(e,"sanitize",function(){return E}),n.d(e,"LocalStorageFacade",function(){return G})},function(t,e){String.prototype.trimStart||(String.prototype.trimStart=function(){return this.replace(/^[\s\uFEFF\xA0]+/,"")},String.prototype.trimLeft=String.prototype.trimStart)},function(t,e){String.prototype.trimEnd||(String.prototype.trimEnd=function(){return this.replace(/[\s\uFEFF\xA0]+$/,"")},String.prototype.trimRight=String.prototype.trimEnd)},function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})},function(t,e){String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)})},function(t,e){Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return!1;for(var o=0|e,i=Math.max(o>=0?o:r-Math.abs(o),0);i<r;){if(n[i]===t)return!0;i++}return!1}})},function(t,e,n){t.exports=n(0)}]); |
{ | ||
"name": "paliari-js-utils", | ||
"version": "0.2.25", | ||
"version": "0.3.0", | ||
"description": "Biblioteca de utilidades para JS", | ||
@@ -5,0 +5,0 @@ "main": "dist/paliari-js-utils.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
24460
1