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

speakingurl

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

speakingurl - npm Package Compare versions

Comparing version 0.15.0 to 0.16.0

2

bower.json
{
"name": "speakingurl",
"version": "0.15.0",
"version": "0.16.0",
"description": "Generate a slug – transliteration with a lot of options",

@@ -5,0 +5,0 @@ "main": "speakingurl.min.js",

@@ -5,3 +5,3 @@ {

"description": "Generate of so called 'static' or 'Clean URL' or 'Pretty URL' or 'nice-looking URL' or 'Speaking URL' or 'user-friendly URL' or 'SEO-friendly URL' or 'slug' from a string.",
"version": "0.15.0",
"version": "0.16.0",
"keywords": [

@@ -8,0 +8,0 @@ "slug",

@@ -1,2 +0,2 @@

(function () {
(function() {
'use strict';

@@ -41,3 +41,3 @@

// custom config is an Array, rewrite to object format
titleCase.forEach(function (v) {
titleCase.forEach(function(v) {
customReplacements[v + ""] = v + "";

@@ -69,3 +69,3 @@ });

// custom replacements
Object.keys(customReplacements).forEach(function (v) {
Object.keys(customReplacements).forEach(function(v) {

@@ -85,3 +85,3 @@ var r;

input = input.replace(/(\w)(\S*)/g, function (_, i, r) {
input = input.replace(/(\w)(\S*)/g, function(_, i, r) {
var j = i.toUpperCase() + (r !== null ? r : "");

@@ -800,2 +800,14 @@ return (Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0) ? j : j.toLowerCase();

'it': {
'∆': 'delta',
'∞': 'infinito',
'♥': 'amore',
'&': 'e',
'|': 'o',
'<': 'minore di',
'>': 'maggiore di',
'∑': 'somma',
'¤': 'moneta'
},
'pt': {

@@ -871,3 +883,3 @@ '∆': 'delta',

// export function for use in AMD
define([], function () {
define([], function() {
return getSlug;

@@ -874,0 +886,0 @@ });

{
"name": "speakingurl",
"version": "0.15.0",
"version": "0.16.0",
"description": "Generate a slug – transliteration with a lot of options",

@@ -37,3 +37,3 @@ "homepage": "http://pid.github.io/speakingurl/",

"scripts": {
"test": "./node_modules/mocha/bin/mocha"
"test": "mocha"
},

@@ -51,7 +51,7 @@ "author": {

"gulp-bump": "^0.1.11",
"gulp-header": "^1.1.1",
"gulp-jsbeautifier": "0.0.2",
"gulp-jshint": "^1.8.4",
"gulp-header": "^1.2.2",
"gulp-jsbeautifier": "0.0.3",
"gulp-jshint": "^1.8.5",
"gulp-load-plugins": "^0.7.0",
"gulp-mocha": "^1.1.0",
"gulp-mocha": "^1.1.1",
"gulp-rename": "^1.2.0",

@@ -62,4 +62,4 @@ "gulp-replace": "^0.4.0",

"minimist": "^1.1.0",
"mocha": "^1.18.2",
"should": "^4.0.4"
"mocha": "^2.0.1",
"should": "^4.1.0"
},

@@ -66,0 +66,0 @@ "jam": {

@@ -12,4 +12,4 @@ Speaking URL [![NPM version](https://badge.fury.io/js/speakingurl.png)](http://badge.fury.io/js/speakingurl) [![Build Status](https://travis-ci.org/pid/speakingurl.png)](https://travis-ci.org/pid/speakingurl) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/pid/speakingurl?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

1. Use a unique reference to the record – e.g. a unique key "12345" => /my-little-title-12345.html
2. Store all historical slugs in the page record; but you have to re-calculate the slug from all pages – every time you update speakingurl
1. Use a unique reference to the record – e.g. a unique key "12345" => /my-little-title-12345.html
2. Store all historical slugs in the page record; but you have to re-calculate the slug from all pages – every time you update speakingurl

@@ -55,9 +55,9 @@ Redirect with 301 to the last/current slug.

- available versions: http://cdnjs.com/libraries/speakingurl/
- use //cdnjs.cloudflare.com/ajax/libs/speakingurl/0.15.0/speakingurl.min.js
- available versions: http://cdnjs.com/libraries/speakingurl/
- use //cdnjs.cloudflare.com/ajax/libs/speakingurl/0.16.0/speakingurl.min.js
#### [CDN/maxcdn](https://www.maxcdn.com/)
- available versions: http://www.jsdelivr.com/#!speakingurl
- use //cdn.jsdelivr.net/speakingurl/0.15.0/speakingurl.min.js
- available versions: http://www.jsdelivr.com/#!speakingurl
- use //cdn.jsdelivr.net/speakingurl/0.16.0/speakingurl.min.js

@@ -73,29 +73,30 @@ Usage

- `options` {object}
- `options` {object}
- `separator` {string} default: '-'
- char that replace the whitespaces
- `lang` {string} default: 'en'
- language for symbol translation ('ar', 'cz', 'de', 'en', 'es', 'fr', 'nl', pt', 'ru', 'sk', 'tr' and 'vn'; more coming soon, please help!)
- false -> don't convert symbols
- `maintainCase` {boolean} default: false
- true -> maintain case chars
- false -> convert all chars to lower case
- `titleCase` {boolean|array} default: false
- true -> convert input string to title-case
- array -> exclude words
- `truncate` {number} default: 0
- 0 -> don't trim length
- &gt;= 1 -> trim to max length while not breaking any words
- `uric` {boolean} default: false
- true -> additionally allow chars: ";", "?", ":", "@", "&", "=", "+", "$", ",", "/"
- false
- `uricNoSlash` {boolean} default: false
- true -> additionally allow chars: ";", "?", ":", "@", "&", "=", "+", "$", ","
- `mark` {boolean} default: false
- true -> additionally allow chars: "-", "_", ".", "!", "~", "*", "'", "(", ")"
- `custom` {object} default: {}
- custom map for translation, overwrites all i.e. { '&': '#', '*': ' star ' }
- `options` {string} separator
- `separator` {string} default: '-'
- char that replace the whitespaces
- `lang` {string} default: 'en'
- language for symbol translation ('ar', 'cz', 'de', 'en', 'es', 'fr', 'nl', pt', 'ru', 'sk', 'tr' and 'vn'; more coming soon, please help!)
- false -> don't convert symbols
- `maintainCase` {boolean} default: false
- true -> maintain case chars
- false -> convert all chars to lower case
- `titleCase` {boolean|array} default: false
- true -> convert input string to title-case
- array -> exclude words
- `truncate` {number} default: 0
- 0 -> don't trim length
- &gt;= 1 -> trim to max length while not breaking any words
- `uric` {boolean} default: false
- true -> additionally allow chars: ";", "?", ":", "@", "&", "=", "+", "$", ",", "/"
- false
- `uricNoSlash` {boolean} default: false
- true -> additionally allow chars: ";", "?", ":", "@", "&", "=", "+", "$", ","
- `mark` {boolean} default: false
- true -> additionally allow chars: "-", "_", ".", "!", "~", "*", "'", "(", ")"
- `custom` {object} default: {}
- custom map for translation, overwrites all i.e. { '&': '#', '*': ' star ' }
- `options` {string} separator
notes: default only Base64 chars are allowed (/A-Za-z0-9_-/), setting `uric`, `uricNoSlash` or/and `mark` to `true` will add the specified chars to the list of allowed characters. The separator-character is always allowed.

@@ -277,3 +278,2 @@

$ npm install
$ npm install -g grunt-cli
# add your stuff

@@ -310,4 +310,4 @@ # add tests

- http://tools.ietf.org/html/rfc3986
- http://en.wikipedia.org/wiki/Transliteration
- http://tools.ietf.org/html/rfc3986
- http://en.wikipedia.org/wiki/Transliteration

@@ -317,11 +317,10 @@ Ports

- Java https://github.com/Weltraumschaf/speakingurl thanks to [@Weltraumschaf](https://github.com/Weltraumschaf/)
- Java https://github.com/Weltraumschaf/speakingurl thanks to [@Weltraumschaf](https://github.com/Weltraumschaf/)
Credits
-------
- [@dypsilon](https://github.com/dypsilon/)
- [@simov](https://github.com/simov/)
- [@henrikjoreteg](https://github.com/henrikjoreteg/)
- [@dypsilon](https://github.com/dypsilon/)
- [@simov](https://github.com/simov/)
- [@henrikjoreteg](https://github.com/henrikjoreteg/)

@@ -337,6 +336,6 @@ [License](https://raw.github.com/pid/speakingurl/master/LICENSE)

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/**
* speakingurl
* @version v0.15.0
* @version v0.16.0
* @link http://pid.github.io/speakingurl/
* @license BSD
* @author Sascha Droste
*/!function(){"use strict";var e=function(e,a){var l,u,r,s,c,f="object"==typeof a&&a.maintainCase||!1,g="object"==typeof a&&a.titleCase?a.titleCase:!1,d="object"==typeof a&&"object"==typeof a.custom&&a.custom?a.custom:{},m="object"==typeof a&&a.separator||"-",h="object"==typeof a&&+a.truncate>1&&a.truncate||!1,p="object"==typeof a&&a.uric||!1,y="object"==typeof a&&a.uricNoSlash||!1,A="object"==typeof a&&a.mark||!1,j="object"==typeof a&&a.lang&&i[a.lang]?i[a.lang]:"object"!=typeof a||a.lang!==!1&&a.lang!==!0?i.en:{},b="object"==typeof a&&a.lang&&t[a.lang]?t[a.lang]:"object"!=typeof a||a.lang!==!1&&a.lang!==!0?t.en:{},k=[";","?",":","@","&","=","+","$",",","/"],E=[";","?",":","@","&","=","+","$",","],O=[".","!","~","*","'","(",")"],S="",w=m;if(g&&"number"==typeof g.length&&Array.prototype.toString.call(g)&&g.forEach(function(e){d[e+""]=e+""}),"string"!=typeof e)return"";for("string"==typeof a?m=a:"object"==typeof a&&(p&&(w+=k.join("")),y&&(w+=E.join("")),A&&(w+=O.join(""))),Object.keys(d).forEach(function(a){var n;n=a.length>1?new RegExp("\\b"+o(a)+"\\b","gi"):new RegExp(o(a),"gi"),e=e.replace(n,d[a])}),g&&(e=e.replace(/(\w)(\S*)/g,function(e,a,o){var n=a.toUpperCase()+(null!==o?o:"");return Object.keys(d).indexOf(n.toLowerCase())<0?n:n.toLowerCase()})),w=o(w),e=e.replace(/(^\s+|\s+$)/g,""),c=!1,u=0,s=e.length;s>u;u++)r=e[u],b[r]?(r=c&&b[r].match(/[A-Za-z0-9]/)?" "+b[r]:b[r],c=!1):r in n?(r=c&&n[r].match(/[A-Za-z0-9]/)?" "+n[r]:n[r],c=!1):!j[r]||p&&-1!==k.join("").indexOf(r)||y&&-1!==E.join("").indexOf(r)||A&&-1!==O.join("").indexOf(r)?(c&&(/[A-Za-z0-9]/.test(r)||S.substr(-1).match(/A-Za-z0-9]/))&&(r=" "+r),c=!1):(r=c||S.substr(-1).match(/[A-Za-z0-9]/)?m+j[r]:j[r],r+=void 0!==e[u+1]&&e[u+1].match(/[A-Za-z0-9]/)?m:"",c=!0),S+=r.replace(new RegExp("[^\\w\\s"+w+"_-]","g"),m);return S=S.replace(/\s+/g,m).replace(new RegExp("\\"+m+"+","g"),m).replace(new RegExp("(^\\"+m+"+|\\"+m+"+$)","g"),""),h&&S.length>h&&(l=S.charAt(h)===m,S=S.slice(0,h),l||(S=S.slice(0,S.lastIndexOf(m)))),f||g||g.length||(S=S.toLowerCase()),S},a=function(a){return function(o){return e(o,a)}},o=function(e){return e.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"Ae","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"Oe","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"Ue","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"ae","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"oe","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"ue","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","α":"a","β":"v","γ":"g","δ":"d","ε":"e","ζ":"z","η":"i","θ":"th","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"ks","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"o","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"i","ώ":"o","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"I","Θ":"TH","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"KS","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"I","Ώ":"O","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","Ќ":"Kj","ќ":"kj","Љ":"Lj","љ":"lj","Њ":"Nj","њ":"nj","Тс":"Ts","тс":"ts","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ľ":"l","ĺ":"l","ŕ":"r","Ľ":"L","Ĺ":"L","Ŕ":"R","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"E","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"I","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"U","ا":"a","أ":"a","إ":"i","آ":"aa","ؤ":"u","ئ":"e","ء":"a","ب":"b","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ي":"y","ى":"a","ة":"h","ﻻ":"la","ﻷ":"laa","ﻹ":"lai","ﻵ":"laa","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","“":'"',"”":'"',"‘":"'","’":"'","∂":"d","ƒ":"f","™":"(TM)","©":"(C)","œ":"oe","Œ":"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o","º":"o","ª":"a","•":"*",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY","元":"CNY","円":"YEN","﷼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","đ":"d","Đ":"D","ẹ":"e","Ẹ":"E","ẽ":"e","Ẽ":"E","ế":"e","Ế":"E","ề":"e","Ề":"E","ệ":"e","Ệ":"E","ễ":"e","Ễ":"E","ọ":"o","Ọ":"o","ố":"o","Ố":"O","ồ":"o","Ồ":"O","ộ":"o","Ộ":"O","ỗ":"o","Ỗ":"O","ơ":"o","Ơ":"O","ớ":"o","Ớ":"O","ờ":"o","Ờ":"O","ợ":"o","Ợ":"O","ỡ":"o","Ỡ":"O","ị":"i","Ị":"I","ĩ":"i","Ĩ":"I","ụ":"u","Ụ":"U","ũ":"u","Ũ":"U","ư":"u","Ư":"U","ứ":"u","Ứ":"U","ừ":"u","Ừ":"U","ự":"u","Ự":"U","ữ":"u","Ữ":"U","ỳ":"y","Ỳ":"Y","ỵ":"y","Ỵ":"Y","ỹ":"y","Ỹ":"Y","ạ":"a","Ạ":"A","ấ":"a","Ấ":"A","ầ":"a","Ầ":"A","ậ":"a","Ậ":"A","ẫ":"a","Ẫ":"A","ă":"a","Ă":"A","ắ":"a","Ắ":"A","ằ":"a","Ằ":"A","ặ":"a","Ặ":"A","ẵ":"a","Ẵ":"A"},t={en:{},sk:{"ä":"a","Ä":"A"}},i={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},cz:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mene jako",">":"vice jako","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}};if("undefined"!=typeof module&&module.exports)module.exports=e,module.exports.createSlug=a;else if("undefined"!=typeof define&&define.amd)define([],function(){return e});else try{if(window.getSlug||window.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";window.getSlug=e,window.createSlug=a}catch(l){}}();
*/!function(){"use strict";var e=function(e,a){var l,r,u,s,c,m="object"==typeof a&&a.maintainCase||!1,d="object"==typeof a&&a.titleCase?a.titleCase:!1,g="object"==typeof a&&"object"==typeof a.custom&&a.custom?a.custom:{},f="object"==typeof a&&a.separator||"-",h="object"==typeof a&&+a.truncate>1&&a.truncate||!1,p="object"==typeof a&&a.uric||!1,y="object"==typeof a&&a.uricNoSlash||!1,A="object"==typeof a&&a.mark||!1,j="object"==typeof a&&a.lang&&i[a.lang]?i[a.lang]:"object"!=typeof a||a.lang!==!1&&a.lang!==!0?i.en:{},b="object"==typeof a&&a.lang&&t[a.lang]?t[a.lang]:"object"!=typeof a||a.lang!==!1&&a.lang!==!0?t.en:{},k=[";","?",":","@","&","=","+","$",",","/"],E=[";","?",":","@","&","=","+","$",","],O=[".","!","~","*","'","(",")"],S="",w=f;if(d&&"number"==typeof d.length&&Array.prototype.toString.call(d)&&d.forEach(function(e){g[e+""]=e+""}),"string"!=typeof e)return"";for("string"==typeof a?f=a:"object"==typeof a&&(p&&(w+=k.join("")),y&&(w+=E.join("")),A&&(w+=O.join(""))),Object.keys(g).forEach(function(a){var n;n=a.length>1?new RegExp("\\b"+o(a)+"\\b","gi"):new RegExp(o(a),"gi"),e=e.replace(n,g[a])}),d&&(e=e.replace(/(\w)(\S*)/g,function(e,a,o){var n=a.toUpperCase()+(null!==o?o:"");return Object.keys(g).indexOf(n.toLowerCase())<0?n:n.toLowerCase()})),w=o(w),e=e.replace(/(^\s+|\s+$)/g,""),c=!1,r=0,s=e.length;s>r;r++)u=e[r],b[u]?(u=c&&b[u].match(/[A-Za-z0-9]/)?" "+b[u]:b[u],c=!1):u in n?(u=c&&n[u].match(/[A-Za-z0-9]/)?" "+n[u]:n[u],c=!1):!j[u]||p&&-1!==k.join("").indexOf(u)||y&&-1!==E.join("").indexOf(u)||A&&-1!==O.join("").indexOf(u)?(c&&(/[A-Za-z0-9]/.test(u)||S.substr(-1).match(/A-Za-z0-9]/))&&(u=" "+u),c=!1):(u=c||S.substr(-1).match(/[A-Za-z0-9]/)?f+j[u]:j[u],u+=void 0!==e[r+1]&&e[r+1].match(/[A-Za-z0-9]/)?f:"",c=!0),S+=u.replace(new RegExp("[^\\w\\s"+w+"_-]","g"),f);return S=S.replace(/\s+/g,f).replace(new RegExp("\\"+f+"+","g"),f).replace(new RegExp("(^\\"+f+"+|\\"+f+"+$)","g"),""),h&&S.length>h&&(l=S.charAt(h)===f,S=S.slice(0,h),l||(S=S.slice(0,S.lastIndexOf(f)))),m||d||d.length||(S=S.toLowerCase()),S},a=function(a){return function(o){return e(o,a)}},o=function(e){return e.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},n={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"Ae","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"Oe","Ő":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"Ue","Ű":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"ae","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"oe","ő":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"ue","ű":"u","ý":"y","þ":"th","ÿ":"y","ẞ":"SS","α":"a","β":"v","γ":"g","δ":"d","ε":"e","ζ":"z","η":"i","θ":"th","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"ks","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"o","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"i","ώ":"o","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"I","Θ":"TH","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"KS","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"I","Ώ":"O","Ϊ":"I","Ϋ":"Y","ş":"s","Ş":"S","ı":"i","İ":"I","ğ":"g","Ğ":"G","Ќ":"Kj","ќ":"kj","Љ":"Lj","љ":"lj","Њ":"Nj","њ":"nj","Тс":"Ts","тс":"ts","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ё":"yo","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"Yo","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","Є":"Ye","І":"I","Ї":"Yi","Ґ":"G","є":"ye","і":"i","ї":"yi","ґ":"g","č":"c","ď":"d","ě":"e","ň":"n","ř":"r","š":"s","ť":"t","ů":"u","ž":"z","Č":"C","Ď":"D","Ě":"E","Ň":"N","Ř":"R","Š":"S","Ť":"T","Ů":"U","Ž":"Z","ľ":"l","ĺ":"l","ŕ":"r","Ľ":"L","Ĺ":"L","Ŕ":"R","ą":"a","ć":"c","ę":"e","ł":"l","ń":"n","ś":"s","ź":"z","ż":"z","Ą":"A","Ć":"C","Ę":"E","Ł":"L","Ń":"N","Ś":"S","Ź":"Z","Ż":"Z","ā":"a","ē":"e","ģ":"g","ī":"i","ķ":"k","ļ":"l","ņ":"n","ū":"u","Ā":"A","Ē":"E","Ģ":"G","Ī":"I","Ķ":"k","Ļ":"L","Ņ":"N","Ū":"U","ا":"a","أ":"a","إ":"i","آ":"aa","ؤ":"u","ئ":"e","ء":"a","ب":"b","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ي":"y","ى":"a","ة":"h","ﻻ":"la","ﻷ":"laa","ﻹ":"lai","ﻵ":"laa","َ":"a","ً":"an","ِ":"e","ٍ":"en","ُ":"u","ٌ":"on","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","“":'"',"”":'"',"‘":"'","’":"'","∂":"d","ƒ":"f","™":"(TM)","©":"(C)","œ":"oe","Œ":"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o","º":"o","ª":"a","•":"*",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY","元":"CNY","円":"YEN","﷼":"IRR","₠":"EWE","฿":"THB","₨":"INR","₹":"INR","₰":"PF","đ":"d","Đ":"D","ẹ":"e","Ẹ":"E","ẽ":"e","Ẽ":"E","ế":"e","Ế":"E","ề":"e","Ề":"E","ệ":"e","Ệ":"E","ễ":"e","Ễ":"E","ọ":"o","Ọ":"o","ố":"o","Ố":"O","ồ":"o","Ồ":"O","ộ":"o","Ộ":"O","ỗ":"o","Ỗ":"O","ơ":"o","Ơ":"O","ớ":"o","Ớ":"O","ờ":"o","Ờ":"O","ợ":"o","Ợ":"O","ỡ":"o","Ỡ":"O","ị":"i","Ị":"I","ĩ":"i","Ĩ":"I","ụ":"u","Ụ":"U","ũ":"u","Ũ":"U","ư":"u","Ư":"U","ứ":"u","Ứ":"U","ừ":"u","Ừ":"U","ự":"u","Ự":"U","ữ":"u","Ữ":"U","ỳ":"y","Ỳ":"Y","ỵ":"y","Ỵ":"Y","ỹ":"y","Ỹ":"Y","ạ":"a","Ạ":"A","ấ":"a","Ấ":"A","ầ":"a","Ầ":"A","ậ":"a","Ậ":"A","ẫ":"a","Ẫ":"A","ă":"a","Ă":"A","ắ":"a","Ắ":"A","ằ":"a","Ằ":"A","ặ":"a","Ặ":"A","ẵ":"a","Ẵ":"A"},t={en:{},sk:{"ä":"a","Ä":"A"}},i={ar:{"∆":"delta","∞":"la-nihaya","♥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","∑":"majmou","¤":"omla"},cz:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"nebo","<":"mene jako",">":"vice jako","∑":"soucet","¤":"mena"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},nl:{"∆":"delta","∞":"oneindig","♥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","∑":"som","¤":"valuta"},it:{"∆":"delta","∞":"infinito","♥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","∑":"somma","¤":"moneta"},pt:{"∆":"delta","∞":"infinito","♥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","∑":"soma","¤":"moeda"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"},sk:{"∆":"delta","∞":"nekonecno","♥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","∑":"sucet","¤":"mena"},tr:{"∆":"delta","∞":"sonsuzluk","♥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","∑":"toplam","¤":"para birimi"},vn:{"∆":"delta","∞":"vo cuc","♥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","∑":"tong","¤":"tien te"}};if("undefined"!=typeof module&&module.exports)module.exports=e,module.exports.createSlug=a;else if("undefined"!=typeof define&&define.amd)define([],function(){return e});else try{if(window.getSlug||window.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";window.getSlug=e,window.createSlug=a}catch(l){}}();
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