forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.min.js
More file actions
1 lines (1 loc) · 1.73 KB
/
Copy pathindex.min.js
File metadata and controls
1 lines (1 loc) · 1.73 KB
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).urlSlug=t()}(this,(function(){"use strict";const e="(?:[a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))";const t=function(e,t){return e.join(t).toLowerCase()};var n=Object.freeze({__proto__:null,LOWERCASE_TRANSFORMER:t,SENTENCECASE_TRANSFORMER:function(e,t){const n=e.join(t);return n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()},TITLECASE_TRANSFORMER:function(e,t){const n=[];for(let t=0;t<e.length;t++)n.push(e[t].charAt(0).toUpperCase()+e[t].slice(1).toLowerCase());return n.join(t)},UPPERCASE_TRANSFORMER:function(e,t){return e.join(t).toUpperCase()}});const o=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF]+/g,r=/[A-Za-z\d]+/g,i=new RegExp("[A-Za-z\\d]*?"+e+"|[A-Za-z\\d]+","g");function s(e,n){const s=void 0===(n=n||{}).camelCase||n.camelCase,a=void 0!==n.separator?n.separator:"-",c=void 0!==n.transformer?n.transformer:t,u=(n.dictionary?function(e,t){for(let n=0,o=e.length;n<o;n++){const r=t[e[n]];if(void 0!==r){e=e.substr(0,n)+r+e.substr(n+1);const t=String(r).length-1;n+=t,o+=t}}return e}(String(e),n.dictionary):String(e)).normalize("NFKD").replace(o,"").match(s?i:r);return u?c?c(u,a):u.join(a):""}const a=/[^-._~!$&'()*+,;=]+/g,c=new RegExp("[^-._~!$&'()*+,;=]*?"+e+"|[^-._~!$&'()*+,;=]+","g"),u=new RegExp(".*?"+e+"|.+","g");const f=function(e,t){return s(e,t)};for(const e in n)f[e]=n[e];return f.convert=s,f.revert=function(e,t){const n=void 0!==(t=t||{}).camelCase&&t.camelCase,o=t.separator,r=void 0!==t.transformer&&t.transformer;let i;return e=String(e),i=""===o?n?e.match(u):[String(e)]:"string"==typeof o?e.split(o):e.match(n?c:a),i?r?r(i," "):i.join(" "):""},f}));