Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paliari-js-utils

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paliari-js-utils - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

dist/paliari-js-utils.js

@@ -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){var r=!0,e=!1,o=void 0;try{for(var i,u=String(n).split(".")[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var a=i.value;if(!t)return t;t=t[a]}}catch(t){e=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(e)throw o}}return 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 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"},c=function(t){return t.toLocaleLowerCase().replace(/[^a-z0-9\s_-]/g,function(t){return a[t]||t})},f=function(t){return"[object Date]"===Object.prototype.toString.call(t)},l=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},d=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},s=function(t){return i(t)?function t(n){if(f(n))return new Date(n);if(l(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 p(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var v=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,p({},a,{})),t(n[a],u[a])):Object.assign(n,p({},a,u[a]));return t.apply(void 0,[n].concat(e))},y=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]:"/")},h="aiCOVlB8Ws3ZSMyJ64dwtqAI5TDG1ejgcFH2YfXErxbRKhzo90pvUPNnL7umkQ",b={};h.split("").sort().forEach(function(t,n){b[h.charAt(n)]=t});var g=function(t){if(!t)return t;var n="";return t.split("").forEach(function(t){n+=b[t]||t}),n},m=[100,200,500,750],w=function(t){return m.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},j=function(t){return t.replace(/-/g,"_").replace(/\//g,".").toLocaleLowerCase()},O=function(t,n){return"".concat(c(t),"_").concat(c(n)).replace(/ /g,"_")},S=function(t){return O(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))},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)},E="zyxwvutsrqponmlkjihgfedcba_ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210-",M=0,L=[],C=function(){var t=Date.now(),n=t===M;M=t;for(var r=new Array(8),e=7;e>=0;e--)r[e]=E.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+=E.charAt(L[e]);if(20!=o.length)throw new Error("Length should be 20.");return o},P=function(t){for(var n=0,r=0;r<8;r++){var e=E.indexOf(t.charAt(r));if(-1===e)throw new Error("Invalid id!");n=64*n+e}return n},D=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]},R=function(t){return D(t,E.split(""))},T=function(t){return D(t,E.split("").sort())};var I=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 N(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 G="pt_br",K=function(){function t(n){var r=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=r}return function(t,n,r){n&&N(t.prototype,n),r&&N(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,"isHash",function(){return u}),r.d(n,"transliterate",function(){return c}),r.d(n,"isDate",function(){return f}),r.d(n,"isRegExp",function(){return l}),r.d(n,"ucfirst",function(){return d}),r.d(n,"deepClone",function(){return s}),r.d(n,"deepMerge",function(){return v}),r.d(n,"flattenObject",function(){return y}),r.d(n,"jsEncode",function(){return g}),r.d(n,"thumbRange",function(){return w}),r.d(n,"starRating",function(){return _}),r.d(n,"prepareKey",function(){return j}),r.d(n,"convertPlace",function(){return x}),r.d(n,"idCidade",function(){return O}),r.d(n,"idCidadeAddressComponent",function(){return S}),r.d(n,"idGeneratorDesc",function(){return C}),r.d(n,"idGeneratorNumeric",function(){return A}),r.d(n,"idDescTimestamp",function(){return P}),r.d(n,"prevId",function(){return R}),r.d(n,"nextId",function(){return T}),r.d(n,"BaseModel",function(){return I}),r.d(n,"I18n",function(){return K})},function(t,n,r){t.exports=r(0)}]);
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)}]);
{
"name": "paliari-js-utils",
"version": "0.1.1",
"version": "0.1.2",
"description": "Biblioteca de utilidades para JS",

@@ -17,4 +17,5 @@ "main": "dist/paliari-js-utils.js",

"devDependencies": {
"@babel/core": "^7.0.0-beta.51",
"poi": "^10.2.9"
}
}

@@ -202,2 +202,18 @@ # paliari-js-utils

### getClassName
```js
import { getClassName } from 'paliari-js-utils'
getClassName({}) // Object
getClassName(function() {}) // Function
getClassName([]) // Array
getClassName(new Date()) // Date
getClassName(/a/) // RegExp
getClassName(1) // Number
getClassName('') // String
getClassName(null) // Null
getClassName(undefined) // Undefined
```
### isObject

@@ -204,0 +220,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc