UNPKG

framework-entersol-web

Version:

Framework based on bootstrap 5

4 lines 2.07 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.slugify=exports.sanitizedTags=exports.sanitizedAttributes=exports.randomS4=exports.price=exports.pluralize=exports.number=exports.normalize=exports.i18n=exports.hash=void 0;var _pluralizeEs=_interopRequireDefault(require("pluralize-es"));function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}var normalize=exports.normalize=function normalize(str){return(str||"").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")};var slugify=exports.slugify=function slugify(){var str=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";return normalize(str).replace(/\s/g,"-").replace(/[^a-zA-Z\d\-]+/g,"").replace(/-+/g,"-")};var number=exports.number=function number(){return null};var pluralize=exports.pluralize=function pluralize(num){var value=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";if(num==1)return value;switch(value){case"Kg":case"kg":return value+"s";case"L":case"l":return value+"ts";default:return(0,_pluralizeEs["default"])(value)}};var price=exports.price=function price(){var value=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";return new Intl.NumberFormat("us-MX",{style:"currency",currency:"MXN",currencyDisplay:"symbol"}).format(value)};var sanitizedTags=exports.sanitizedTags=["b","i","em","strong","a","small","h5","h6","blockquote","p","ul","ol","nl","li","strike","code","hr","br","table","thead","caption","tbody","tr","th","td","pre"];var sanitizedAttributes=exports.sanitizedAttributes={a:["href","target"],"*":["class","style"]};var randomS4=exports.randomS4=function randomS4(){return((1+Math.random())*65536|0).toString(16).substring(1)};var hash=exports.hash=function hash(string){var hash=0,i,chr;for(i=0;i<string.length;i++){chr=string.charCodeAt(i);hash=(hash<<5)-hash+chr;hash|=0;// Convert to 32bit integer }return hash};// TODO: configurar esta función, por el momento solo devuelve el mismo texto que se ingrese var i18n=exports.i18n=function i18n(t){return t}; //# sourceMappingURL=index.js.map