paliari-js-utils
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,1 +0,1 @@ | ||
module.exports=function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="/",r(r.s=1)}([function(t,n,r){"use strict";r.r(n);var e=function(t,n){return String(n).split(".").forEach(function(n){if(!t)return t;t=t[n]}),t};function o(t){return(o="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 i=function(t){return null!==t&&"object"===o(t)},u=function(t){return Object.prototype.toString.call(t).slice(8,-1)},a=function(t){return"[object Object]"===Object.prototype.toString.call(arg)},c={"à":"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"},f=function(t){return t.toLocaleLowerCase().replace(/[^a-z0-9\s_-]/g,function(t){return c[t]||t})},l=function(t){return"[object Date]"===Object.prototype.toString.call(t)},s=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},d=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},p=function(t){return i(t)?function t(n){if(l(n))return new Date(n);if(s(n))return n;var r=Array.isArray(n)?[]:{};for(var e in n)r[e]=i(n[e])?t(n[e]):n[e];return r}(t):t};function v(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var y=function t(n){for(var r=arguments.length,e=new Array(r>1?r-1:0),o=1;o<r;o++)e[o-1]=arguments[o];if(!e.length)return n;var u=e.shift();if(i(n)&&i(u))for(var a in u)i(u[a])?(n[a]||Object.assign(n,v({},a,{})),t(n[a],u[a])):Object.assign(n,v({},a,u[a]));return t.apply(void 0,[n].concat(e))},h=function(t){return function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return Object.getOwnPropertyNames(n).reduce(function(e,u){return o.push(u),i(n[u])?t(n[u],r,e,o):e[o.join(r)]=n[u],o.pop(),e},e)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/")},g="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};g.split("").sort().forEach(function(t,n){b[g.charAt(n)]=t});var m=function(t){if(!t)return t;var n="";return t.split("").forEach(function(t){n+=b[t]||t}),n},w=[100,200,500,750],j=function(t){return w.find(function(n){if(t<=n)return n})},_=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0,e=0;for(k in t)e+=Number(k)*t[k],r+=t[k];var o=Math.pow(10,n);return r?Math.round(e/r*o)/o:0},O=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},S=function(t,n){return"".concat(f(t),"_").concat(f(n)).replace(/ /g,"_")},x=function(t){return S(function(t){var n=!0,r=!1,e=void 0;try{for(var o,i=t[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var u=o.value;if(u.types.indexOf("administrative_area_level_1")>-1)return u.short_name}}catch(t){r=!0,e=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw e}}}(t),function(t){var n=!0,r=!1,e=void 0;try{for(var o,i=t[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var u=o.value;if(u.types.indexOf("administrative_area_level_2")>-1)return u.long_name}}catch(t){r=!0,e=t}finally{try{n||null==i.return||i.return()}finally{if(r)throw e}}}(t))},E=function(t){if(!t.address_components)throw{code:"convert_place_no_address_componentes"};var n={};return n.geometry={viewport:{northeast:{lat:t.geometry.viewport.f.f,lng:t.geometry.viewport.b.f},southwest:{lat:t.geometry.viewport.f.b,lng:t.geometry.viewport.b.b}},location:{lat:t.geometry.location.lat(),lng:t.geometry.location.lng()}},n.formatted_address=t.formatted_address,n.place_id=t.place_id,n.cidade_id=x(t.address_components),n},A=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)},M="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",C=0,L=[],P=function(){var t=Date.now(),n=t===C;C=t;for(var r=new Array(8),e=7;e>=0;e--)r[e]=M.charAt(t%64),t=Math.floor(t/64);if(0!==t)throw new Error("We should have converted the entire timestamp.");var o=r.join("");if(n){for(e=11;e>=0&&63===L[e];e--)L[e]=0;L[e]++}else for(e=0;e<12;e++)L[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)o+=M.charAt(L[e]);if(20!=o.length)throw new Error("Length should be 20.");return o},D=function(t){for(var n=0,r=0;r<8;r++){var e=M.indexOf(t.charAt(r));if(-1===e)throw new Error("Invalid id!");n=64*n+e}return n},R=function t(n,r){var e=n.split(""),o=e.pop(),i=r[r.indexOf(o)+1];return i?e.join("")+i:t(e.join(""),r)+r[0]},T=function(t){return R(t,M.split(""))},I=function(t){return R(t,M.split("").sort())};var N=function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var e in function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),n)"function"==typeof n[e]?this[e]=null===r[e]?null:n[e](r[e]):this[e]=r[e]||n[e]};function G(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}var K="pt_br",z=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.locales=n,this.locale=r}return function(t,n,r){n&&G(t.prototype,n),r&&G(t,r)}(t,[{key:"t",value:function(t,n){return function(t,n){if(!t||!n)return t;for(var r in n)t=t.replace(new RegExp("%{"+r+"}","g"),n[r]);return t}(e(this.current,t),n)}},{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}();r.d(n,"deepKey",function(){return e}),r.d(n,"isObject",function(){return i}),r.d(n,"getClassName",function(){return u}),r.d(n,"isHash",function(){return a}),r.d(n,"transliterate",function(){return f}),r.d(n,"isDate",function(){return l}),r.d(n,"isRegExp",function(){return s}),r.d(n,"ucfirst",function(){return d}),r.d(n,"deepClone",function(){return p}),r.d(n,"deepMerge",function(){return y}),r.d(n,"flattenObject",function(){return h}),r.d(n,"jsEncode",function(){return m}),r.d(n,"thumbRange",function(){return j}),r.d(n,"starRating",function(){return _}),r.d(n,"prepareKey",function(){return O}),r.d(n,"convertPlace",function(){return E}),r.d(n,"idCidade",function(){return S}),r.d(n,"idCidadeAddressComponent",function(){return x}),r.d(n,"idGeneratorDesc",function(){return P}),r.d(n,"idGeneratorNumeric",function(){return A}),r.d(n,"idDescTimestamp",function(){return D}),r.d(n,"prevId",function(){return T}),r.d(n,"nextId",function(){return I}),r.d(n,"BaseModel",function(){return N}),r.d(n,"I18n",function(){return z})},function(t,n,r){t.exports=r(0)}]); | ||
module.exports=function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/",e(e.s=1)}([function(t,n,e){"use strict";e.r(n);var r=function(t,n){return String(n).split(".").forEach(function(n){if(!t)return t;t=t[n]}),t};function o(t){return(o="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 i=function(t){return null!==t&&"object"===o(t)},u=function(t){return Object.prototype.toString.call(t).slice(8,-1)},c=function(t){return"[object Object]"===Object.prototype.toString.call(arg)},a={"à":"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"},f=function(t){return t.toLocaleLowerCase().replace(/[^a-z0-9\s_-]/g,function(t){return a[t]||t})},l=function(t){return"[object Date]"===Object.prototype.toString.call(t)},s=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},d=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},p=function(t){return i(t)?function t(n){if(l(n))return new Date(n);if(s(n))return n;var e=Array.isArray(n)?[]:{};return Object.keys(n).forEach(function(r){e[r]=i(n[r])?t(n[r]):n[r]}),e}(t):t};function v(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var h=function t(n){for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];if(!r.length)return n;var u=r.shift();return i(n)&&i(u)&&Object.keys(u).forEach(function(e){i(u[e])?(n[e]||Object.assign(n,v({},e,{})),t(n[e],u[e])):Object.assign(n,v({},e,u[e]))}),t.apply(void 0,[n].concat(r))},y=function(t){return function t(n){var e=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(n).reduce(function(r,u){return o.push(u),i(n[u])?t(n[u],e,r,o):r[o.join(e)]=n[u],o.pop(),r},r)}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/")},g="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};g.split("").sort().forEach(function(t,n){b[g.charAt(n)]=t});var m=function(t){if(!t)return t;var n="";return t.split("").forEach(function(t){n+=b[t]||t}),n},w=[100,200,500,750],j=function(t){return w.find(function(n){if(t<=n)return n})},_=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=0,r=0;Object.keys(t).forEach(function(n){r+=Number(n)*t[n],e+=t[n]});var o=Math.pow(10,n);return e?Math.round(r/e*o)/o:0},O=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},E=function(t,n){return"".concat(f(t),"_").concat(f(n)).replace(/ /g,"_")},S=function(t){return E(function(t){t.forEach(function(t){if(t.types.indexOf("administrative_area_level_1")>-1)return t.short_name})}(t),function(t){t.forEach(function(t){if(t.types.indexOf("administrative_area_level_2")>-1)return t.long_name})}(t))},x=function(t){if(!t.address_components)throw{code:"convert_place_no_address_componentes"};var n={};return n.geometry={viewport:{northeast:{lat:t.geometry.viewport.f.f,lng:t.geometry.viewport.b.f},southwest:{lat:t.geometry.viewport.f.b,lng:t.geometry.viewport.b.b}},location:{lat:t.geometry.location.lat(),lng:t.geometry.location.lng()}},n.formatted_address=t.formatted_address,n.place_id=t.place_id,n.cidade_id=S(t.address_components),n},A=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)},M="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",k=0,C=[],L=function(){var t=Date.now(),n=t===k;k=t;for(var e=new Array(8),r=7;r>=0;r--)e[r]=M.charAt(t%64),t=Math.floor(t/64);if(0!==t)throw new Error("We should have converted the entire timestamp.");var o=e.join("");if(n){for(r=11;r>=0&&63===C[r];r--)C[r]=0;C[r]++}else for(r=0;r<12;r++)C[r]=Math.floor(64*Math.random());for(r=0;r<12;r++)o+=M.charAt(C[r]);if(20!=o.length)throw new Error("Length should be 20.");return o},P=function(t){for(var n=0,e=0;e<8;e++){var r=M.indexOf(t.charAt(e));if(-1===r)throw new Error("Invalid id!");n=64*n+r}return n},D=function t(n,e){var r=n.split(""),o=r.pop(),i=e[e.indexOf(o)+1];return i?r.join("")+i:t(r.join(""),e)+e[0]},R=function(t){return D(t,M.split(""))},T=function(t){return D(t,M.split("").sort())};var I=function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),n)"function"==typeof n[r]?this[r]=null===e[r]?null:n[r](e[r]):this[r]=e[r]||n[r]};function N(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var G="pt_br",K=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.locales=n,this.locale=e}return function(t,n,e){n&&N(t.prototype,n),e&&N(t,e)}(t,[{key:"t",value:function(t,n){return function(t,n){if(!t||!n)return t;for(var e in n)t=t.replace(new RegExp("%{"+e+"}","g"),n[e]);return t}(r(this.current,t),n)}},{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}();e.d(n,"deepKey",function(){return r}),e.d(n,"isObject",function(){return i}),e.d(n,"getClassName",function(){return u}),e.d(n,"isHash",function(){return c}),e.d(n,"transliterate",function(){return f}),e.d(n,"isDate",function(){return l}),e.d(n,"isRegExp",function(){return s}),e.d(n,"ucfirst",function(){return d}),e.d(n,"deepClone",function(){return p}),e.d(n,"deepMerge",function(){return h}),e.d(n,"flattenObject",function(){return y}),e.d(n,"jsEncode",function(){return m}),e.d(n,"thumbRange",function(){return j}),e.d(n,"starRating",function(){return _}),e.d(n,"prepareKey",function(){return O}),e.d(n,"convertPlace",function(){return x}),e.d(n,"idCidade",function(){return E}),e.d(n,"idCidadeAddressComponent",function(){return S}),e.d(n,"idGeneratorDesc",function(){return L}),e.d(n,"idGeneratorNumeric",function(){return A}),e.d(n,"idDescTimestamp",function(){return P}),e.d(n,"prevId",function(){return R}),e.d(n,"nextId",function(){return T}),e.d(n,"BaseModel",function(){return I}),e.d(n,"I18n",function(){return K})},function(t,n,e){t.exports=e(0)}]); |
{ | ||
"name": "paliari-js-utils", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"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
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
15338