speakingurl
Advanced tools
Comparing version 0.2.15 to 0.2.16
{ | ||
"name": "speakingurl", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"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.", | ||
@@ -12,3 +12,4 @@ "main": "speakingurl.min.js", | ||
}, | ||
"licenses": [{ | ||
"licenses": [ | ||
{ | ||
"type": "BSD", | ||
@@ -19,6 +20,6 @@ "url": "https://raw.github.com/pid/speakingurl/master/LICENCE" | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"components" | ||
"**/.*", | ||
"node_modules", | ||
"components" | ||
] | ||
} |
@@ -5,4 +5,11 @@ { | ||
"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.2.15", | ||
"keywords": ["slug", "seo", "url", "speakingurl", "nice url", "static url"], | ||
"version": "0.2.16", | ||
"keywords": [ | ||
"slug", | ||
"seo", | ||
"url", | ||
"speakingurl", | ||
"nice url", | ||
"static url" | ||
], | ||
"dependencies": {}, | ||
@@ -13,4 +20,4 @@ "development": {}, | ||
"scripts": [ | ||
"speakingurl.min.js" | ||
"speakingurl.min.js" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
module.exports = function (grunt) { | ||
module.exports = function(grunt) { | ||
'use strict'; | ||
@@ -38,2 +38,14 @@ | ||
replace: { | ||
readme: { | ||
src: ['README.md'], | ||
overwrite: true, | ||
replacements: [{ | ||
from: /\d{1,1}\.\d{1,2}\.\d{1,2}/g, | ||
to: '<%= pkg.version %>' | ||
} | ||
] | ||
} | ||
}, | ||
// files | ||
@@ -45,5 +57,6 @@ buildSourceFile: 'lib/index.js', | ||
grunt.registerTask('mocha', 'run mocha', function () { | ||
grunt.registerTask('mocha', 'run mocha', function() { | ||
var done = this.async(); | ||
require('child_process').exec('mocha', function (err, stdout) { | ||
require('child_process') | ||
.exec('mocha', function(err, stdout) { | ||
grunt.log.write(stdout); | ||
@@ -54,3 +67,3 @@ done(err); | ||
grunt.event.on('watch', function (action, filepath) { | ||
grunt.event.on('watch', function(action, filepath) { | ||
grunt.log.writeln(filepath + ' has ' + action); | ||
@@ -64,6 +77,8 @@ }); | ||
grunt.loadNpmTasks('grunt-bumpup'); | ||
grunt.loadNpmTasks('grunt-text-replace'); | ||
grunt.loadNpmTasks('grunt-blanket'); | ||
// Default task(s). | ||
grunt.registerTask('default', ['uglify', 'jshint', 'mocha']); | ||
grunt.registerTask('default', ['uglify', 'jshint', 'mocha', 'replace']); | ||
}; |
@@ -1,2 +0,2 @@ | ||
(function () { | ||
(function() { | ||
'use strict'; | ||
@@ -55,3 +55,3 @@ | ||
allowedChars = (allowedChars.join('') + separator) | ||
.replace(/[-\\^$*+?.()|[\]{}\/]/g, "\\$&"); | ||
.replace(/[-\\^$*+?.()|[\]{}\/]/g, '\\$&'); | ||
@@ -76,10 +76,11 @@ // trim whitspaces | ||
} else if ( | ||
// process symbol chars | ||
symbol[ch] && | ||
!(uricFlag && uricChars.join('').indexOf(ch) !== -1) && | ||
!(uricNoSlashFlag && uricNoSlashChars.join('').indexOf(ch) !== -1) && | ||
!(markFlag && markChars.join('').indexOf(ch) !== -1) ) { | ||
// process symbol chars | ||
symbol[ch] && !(uricFlag && uricChars.join('') | ||
.indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars.join('') | ||
.indexOf(ch) !== -1) && !(markFlag && markChars.join('') | ||
.indexOf(ch) !== -1)) { | ||
ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch]; | ||
ch += input[i+1].match(/[A-Za-z0-9]/) ? separator : ''; | ||
ch = lastCharWasSymbol || result.substr(-1) | ||
.match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch]; | ||
ch += input[i + 1].match(/[A-Za-z0-9]/) ? separator : ''; | ||
@@ -89,3 +90,4 @@ lastCharWasSymbol = true; | ||
// process latin chars | ||
if (lastCharWasSymbol && (ch.match(/A-Za-z0-9]/) || result.substr(-1).match(/A-Za-z0-9]/) )) { | ||
if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1) | ||
.match(/A-Za-z0-9]/))) { | ||
ch = ' ' + ch; | ||
@@ -101,4 +103,4 @@ } | ||
result = result.replace(/\s+/g, separator) // eliminate duplicate separators | ||
.replace(new RegExp('\\' + separator + '+', 'g'), separator) // add separator | ||
.replace(new RegExp('(^\\' + separator + '+|\\' + separator + '+$)', 'g'), ''); // trim separators from start and end | ||
.replace(new RegExp('\\' + separator + '+', 'g'), separator) // add separator | ||
.replace(new RegExp('(^\\' + separator + '+|\\' + separator + '+$)', 'g'), ''); // trim separators from start and end | ||
@@ -105,0 +107,0 @@ if (truncate && result.length > truncate) { |
161
package.json
{ | ||
"name": "speakingurl", | ||
"version": "0.2.15", | ||
"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.", | ||
"homepage": "https://github.com/pid/speakingurl", | ||
"github": "https://github.com/pid/speakingurl", | ||
"keywords": ["slug", "seo", "url", "speakingurl", "nice url", "static url"], | ||
"categories": ["Utilities", "Parsers & Compilers"], | ||
"author": { | ||
"name": "Sascha Droste", | ||
"email": "sascha.droste@gmail.com", | ||
"url": "https://plus.google.com/118215422942628160262/about" | ||
}, | ||
"main": "index", | ||
"filename": "speakingurl.min.js", | ||
"name": "speakingurl", | ||
"version": "0.2.16", | ||
"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.", | ||
"homepage": "https://github.com/pid/speakingurl", | ||
"github": "https://github.com/pid/speakingurl", | ||
"keywords": [ | ||
"slug", | ||
"seo", | ||
"url", | ||
"speakingurl", | ||
"nice url", | ||
"static url" | ||
], | ||
"categories": [ | ||
"Utilities", | ||
"Parsers & Compilers" | ||
], | ||
"author": { | ||
"name": "Sascha Droste", | ||
"email": "sascha.droste@gmail.com", | ||
"url": "https://plus.google.com/118215422942628160262/about" | ||
}, | ||
"main": "index", | ||
"filename": "speakingurl.min.js", | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"mocha": "~1.10.0", | ||
"should": "~1.2.2", | ||
"grunt-contrib-uglify": "~0.2.1", | ||
"grunt-contrib-jshint": "~0.5.4", | ||
"grunt-contrib-watch": "~0.4.4", | ||
"grunt-release": "~0.3.4", | ||
"grunt-bumpup": "~0.2.0", | ||
"grunt-text-replace": "~0.3.4" | ||
}, | ||
"testling": { | ||
"harness": "mocha", | ||
"files": "test/*.js", | ||
"browsers": { | ||
"ie": [ | ||
6, | ||
7, | ||
8, | ||
9, | ||
10 | ||
], | ||
"firefox": [ | ||
19 | ||
], | ||
"chrome": [ | ||
25 | ||
], | ||
"safari": [ | ||
5.1, | ||
6 | ||
], | ||
"opera": [ | ||
10, | ||
12 | ||
] | ||
} | ||
}, | ||
"jam": { | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"mocha": "~1.10.0", | ||
"should": "~1.2.2", | ||
"grunt-contrib-uglify": "~0.2.1", | ||
"grunt-contrib-jshint": "~0.5.4", | ||
"grunt-contrib-watch": "~0.4.4", | ||
"grunt-release": "~0.3.4", | ||
"grunt-bumpup": "~0.2.0" | ||
"main": "speakingurl.min.js", | ||
"shim": { | ||
"deps": [], | ||
"exports": "speakingurl" | ||
}, | ||
"testling": { | ||
"harness": "mocha", | ||
"files": "test/*.js", | ||
"browsers": { | ||
"ie": [6, 7, 8, 9, 10], | ||
"firefox": [19], | ||
"chrome": [25], | ||
"safari": [5.1, 6], | ||
"opera": [10, 12] | ||
} | ||
}, | ||
"jam": { | ||
"dependencies": {}, | ||
"main": "speakingurl.min.js", | ||
"shim": { | ||
"deps": [], | ||
"exports": "speakingurl" | ||
}, | ||
"include": [ | ||
"speakingurl.min.js", | ||
"README.md" | ||
] | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com:pid/speakingurl.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/pid/speakingurl/issues" | ||
}, | ||
"licenses": [{ | ||
"type": "BSD", | ||
"url": "https://raw.github.com/pid/speakingurl/master/LICENCE" | ||
} | ||
], | ||
"engines": { | ||
"node": ">=0.8.0" | ||
"include": [ | ||
"speakingurl.min.js", | ||
"README.md" | ||
] | ||
}, | ||
"scripts": { | ||
"test": "mocha", | ||
"blanket": { | ||
"pattern": [ | ||
"/lib/" | ||
] | ||
} | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com:pid/speakingurl.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/pid/speakingurl/issues" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "BSD", | ||
"url": "https://raw.github.com/pid/speakingurl/master/LICENCE" | ||
} | ||
], | ||
"engines": { | ||
"node": ">=0.8.0" | ||
} | ||
} |
@@ -32,3 +32,3 @@ # 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) | ||
or | ||
use //cdnjs.cloudflare.com/ajax/libs/speakingurl/0.2.15/speakingurl.min.js | ||
use //cdnjs.cloudflare.com/ajax/libs/speakingurl/0.2.16/speakingurl.min.js | ||
@@ -35,0 +35,0 @@ ## Usage |
@@ -1,1 +0,1 @@ | ||
/* speakingurl v0.2.15 (c) 2013 Sascha Droste https://github.com/pid/speakingurl */!function(){"use strict";var a=function(a,b){var e,f,g,h,i,j="object"==typeof b&&b.maintainCase||!1,k="object"==typeof b&&b.separator||"-",l="object"==typeof b&&b.truncate,m="object"==typeof b&&b.lang||"en",n="object"==typeof b&&b.uric||!1,o="object"==typeof b&&b.uricNoSlash||!1,p="object"==typeof b&&b.mark||!1,q=d[m]||d.en,r="object"==typeof b&&b.custom||{},s=[";","?",":","@","&","=","+","$",",","/"],t=[";","?",":","@","&","=","+","$",","],u=[".","!","~","*","'","(",")"],v="",w=[];if("string"!=typeof a)return"";for("string"==typeof b?k=b:"object"==typeof b&&(n&&(w=w.concat(s)),o&&(w=w.concat(t)),p&&(w=w.concat(u))),w=(w.join("")+k).replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&"),a=a.replace(/(^\s+|\s+$)/g,""),i=!1,f=0,h=a.length;h>f;f++)g=a[f],r[g]?(g=i&&r[g].match(/[A-Za-z0-9]/)?" "+r[g]:r[g],i=!1):c[g]?(g=i&&c[g].match(/[A-Za-z0-9]/)?" "+c[g]:c[g],i=!1):!q[g]||n&&-1!==s.join("").indexOf(g)||o&&-1!==t.join("").indexOf(g)||p&&-1!==u.join("").indexOf(g)?(i&&(g.match(/A-Za-z0-9]/)||v.substr(-1).match(/A-Za-z0-9]/))&&(g=" "+g),i=!1):(g=i||v.substr(-1).match(/[A-Za-z0-9]/)?k+q[g]:q[g],g+=a[f+1].match(/[A-Za-z0-9]/)?k:"",i=!0),v+=g.replace(new RegExp("[^\\w\\s"+w+"_-]","g"),k);return v=v.replace(/\s+/g,k).replace(new RegExp("\\"+k+"+","g"),k).replace(new RegExp("(^\\"+k+"+|\\"+k+"+$)","g"),""),l&&v.length>l&&(e=v.charAt(l)===k,v=v.slice(0,l),e||(v=v.slice(0,v.lastIndexOf(k)))),j||(v=v.toLowerCase()),v},b=function(b){return function(c){return a(c,b)}},c={"À":"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","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"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","ъ":"u","ы":"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","Ъ":"U","Ы":"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","ą":"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","“":'"',"”":'"',"‘":"'","’":"'","∂":"d","ƒ":"f","™":"(TM)","©":"(C)","œ":"oe","Œ":"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o","º":"o","ª":"a","•":"*",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₨":"INR","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY","元":"CNY","円":"YEN","﷼":"IRR","₠":"EWE","฿":"THB"},d={en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"}};if("undefined"!=typeof module)module.exports=a,module.exports.createSlug=b;else try{if(window.getSlug||window.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";window.getSlug=a,window.createSlug=b}catch(e){}}(); | ||
/* speakingurl v0.2.16 (c) 2013 Sascha Droste https://github.com/pid/speakingurl */!function(){"use strict";var a=function(a,b){var e,f,g,h,i,j="object"==typeof b&&b.maintainCase||!1,k="object"==typeof b&&b.separator||"-",l="object"==typeof b&&b.truncate,m="object"==typeof b&&b.lang||"en",n="object"==typeof b&&b.uric||!1,o="object"==typeof b&&b.uricNoSlash||!1,p="object"==typeof b&&b.mark||!1,q=d[m]||d.en,r="object"==typeof b&&b.custom||{},s=[";","?",":","@","&","=","+","$",",","/"],t=[";","?",":","@","&","=","+","$",","],u=[".","!","~","*","'","(",")"],v="",w=[];if("string"!=typeof a)return"";for("string"==typeof b?k=b:"object"==typeof b&&(n&&(w=w.concat(s)),o&&(w=w.concat(t)),p&&(w=w.concat(u))),w=(w.join("")+k).replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&"),a=a.replace(/(^\s+|\s+$)/g,""),i=!1,f=0,h=a.length;h>f;f++)g=a[f],r[g]?(g=i&&r[g].match(/[A-Za-z0-9]/)?" "+r[g]:r[g],i=!1):c[g]?(g=i&&c[g].match(/[A-Za-z0-9]/)?" "+c[g]:c[g],i=!1):!q[g]||n&&-1!==s.join("").indexOf(g)||o&&-1!==t.join("").indexOf(g)||p&&-1!==u.join("").indexOf(g)?(i&&(/[A-Za-z0-9]/.test(g)||v.substr(-1).match(/A-Za-z0-9]/))&&(g=" "+g),i=!1):(g=i||v.substr(-1).match(/[A-Za-z0-9]/)?k+q[g]:q[g],g+=a[f+1].match(/[A-Za-z0-9]/)?k:"",i=!0),v+=g.replace(new RegExp("[^\\w\\s"+w+"_-]","g"),k);return v=v.replace(/\s+/g,k).replace(new RegExp("\\"+k+"+","g"),k).replace(new RegExp("(^\\"+k+"+|\\"+k+"+$)","g"),""),l&&v.length>l&&(e=v.charAt(l)===k,v=v.slice(0,l),e||(v=v.slice(0,v.lastIndexOf(k)))),j||(v=v.toLowerCase()),v},b=function(b){return function(c){return a(c,b)}},c={"À":"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","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ά":"a","έ":"e","ί":"i","ό":"o","ύ":"y","ή":"h","ώ":"w","ς":"s","ϊ":"i","ΰ":"y","ϋ":"y","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ά":"A","Έ":"E","Ί":"I","Ό":"O","Ύ":"Y","Ή":"H","Ώ":"W","Ϊ":"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","ъ":"u","ы":"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","Ъ":"U","Ы":"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","ą":"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","“":'"',"”":'"',"‘":"'","’":"'","∂":"d","ƒ":"f","™":"(TM)","©":"(C)","œ":"oe","Œ":"OE","®":"(R)","†":"+","℠":"(SM)","…":"...","˚":"o","º":"o","ª":"a","•":"*",$:"USD","€":"EUR","₢":"BRN","₣":"FRF","£":"GBP","₤":"ITL","₦":"NGN","₧":"ESP","₨":"INR","₩":"KRW","₪":"ILS","₫":"VND","₭":"LAK","₮":"MNT","₯":"GRD","₱":"ARS","₲":"PYG","₳":"ARA","₴":"UAH","₵":"GHS","¢":"cent","¥":"CNY","元":"CNY","円":"YEN","﷼":"IRR","₠":"EWE","฿":"THB"},d={en:{"∆":"delta","∞":"infinity","♥":"love","&":"and","|":"or","<":"less than",">":"greater than","∑":"sum","¤":"currency"},de:{"∆":"delta","∞":"unendlich","♥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","∑":"Summe von","¤":"Waehrung"},fr:{"∆":"delta","∞":"infiniment","♥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","∑":"somme des","¤":"monnaie"},es:{"∆":"delta","∞":"infinito","♥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","∑":"suma de los","¤":"moneda"},ru:{"∆":"delta","∞":"beskonechno","♥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","∑":"summa","¤":"valjuta"}};if("undefined"!=typeof module)module.exports=a,module.exports.createSlug=b;else try{if(window.getSlug||window.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";window.getSlug=a,window.createSlug=b}catch(e){}}(); |
@@ -105,2 +105,44 @@ /* global describe,it */ | ||
}); | ||
it('with custom chars replacement', function (done) { | ||
var getSlug = require('../lib').createSlug({ | ||
custom: { '*': 'o'} | ||
}); | ||
getSlug('xyl*ph*n').should.eql('xylophon'); | ||
done(); | ||
}); | ||
it('with custom chars replacement with not allowed target char', function (done) { | ||
var getSlug = require('../lib').createSlug({ | ||
custom: { 'o': '*'} | ||
}); | ||
getSlug('xylophon').should.eql('xyl-ph-n'); | ||
done(); | ||
}); | ||
it('with custom chars replacement with allowed target char, option mark', function (done) { | ||
var getSlug = require('../lib').createSlug({ | ||
custom: { 'o': '*'}, | ||
mark: true | ||
}); | ||
getSlug('xylophon').should.eql('xyl*ph*n'); | ||
done(); | ||
}); | ||
it('with custom chars replacement with option mark', function (done) { | ||
var getSlug = require('../lib').createSlug({ | ||
custom: { '*': 'o'}, | ||
mark: true | ||
}); | ||
getSlug('xyl*ph*n').should.eql('xylophon'); | ||
done(); | ||
}); | ||
}); |
@@ -63,2 +63,22 @@ /* global describe,it */ | ||
}); | ||
it('should handle whitespace after symbol', function (done) { | ||
getSlug('∆299').should.eql('delta-299'); | ||
getSlug('∆world').should.eql('delta-world'); | ||
getSlug('∆-299').should.eql('delta-299'); | ||
getSlug('∆-world').should.eql('delta-world'); | ||
getSlug('(∆)299').should.eql('delta-299'); | ||
getSlug('(∆)299', {mark:true}).should.eql('(delta)299'); | ||
getSlug('∆299').should.eql('delta-299'); | ||
getSlug('∆world').should.eql('delta-world'); | ||
getSlug('Hello∆299').should.eql('hello-delta-299'); | ||
getSlug('299∆Hello').should.eql('299-delta-hello'); | ||
done(); | ||
}); | ||
}); |
@@ -138,2 +138,9 @@ /* global describe,it */ | ||
it('should return empty string because of non string input', function (done) { | ||
getSlug(true).should.eql(''); | ||
done(); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
0
1
65239
9
25
1379