Skip to content

Commit

Permalink
now passes jshint test.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanbrujo committed Jun 25, 2015
1 parent 61cd3cd commit 15758a0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Sluggin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"pretty url",
"SEO"
],
"version": "0.1.0",
"version": "0.1.1",
"author": {
"name": "Jorge Epuñan H.",
"url": "https://github.com/juanbrujo",
Expand Down
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sluggin",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/juanbrujo/Sluggin.js",
"authors": [
"Jorge Epuñan <juanbrujo@gmail.com>"
Expand All @@ -11,7 +11,8 @@
"javascript",
"slug",
"convert",
"string"
"string",
"url"
],
"license": "MIT",
"ignore": [
Expand Down
8 changes: 4 additions & 4 deletions dist/Sluggin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Sluggin.js - v0.1.0
* Sluggin.js - v0.1.1
* Converts string into websafe-friendly-clean piece of text
*
* https://github.com/juanbrujo/Sluggin.js
Expand All @@ -9,7 +9,7 @@
* License: MIT
* ©2015
*/
var Sluggin = function Sluggin() {
var Sluggin = function() {
"use strict";
function convert(text) {
return string = str_replace(characters, latin, text).toLowerCase().replace(/^\s+|\s+$/g, "").replace(/[_|\s]+/g, "-").replace(/[^a-z\u0400-\u04FF0-9-]+/g, "").replace(/[-]+/g, "-").replace(/^-+|-+$/g, "").replace(/[-]+/g, "-");
Expand All @@ -21,7 +21,7 @@ var Sluggin = function Sluggin() {
s[i] = temp.split(f[j]).join(repl), count && s[i] !== temp && (window[count] += (temp.length - s[i].length) / f[j].length);
return sa ? s : s[0];
}
function Sluggin(text) {
function InitSluggin(text) {
var output;
if ("string" == typeof text) return output = convert(text);
if ("[object Array]" === Object.prototype.toString.call(text)) {
Expand All @@ -32,7 +32,7 @@ var Sluggin = function Sluggin() {
return "";
}
var characters = [ "а", "б", "в", "г", "д", "е", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ь", "ю", "я", "А", "Б", "В", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ", "Ъ", "Ь", "Ю", "Я", "Ї", "ї", "Є", "є", "Ы", "ы", "Ё", "ё", "ı", "İ", "ğ", "Ğ", "ü", "Ü", "ş", "Ş", "ö", "Ö", "ç", "Ç", "Á", "á", "Â", "â", "Ã", "ã", "À", "à", "Ç", "ç", "É", "é", "Ê", "ê", "È", "è", "Ä", "ä", "Í", "í", "Ó", "ó", "Ô", "ô", "Õ", "õ", "Ú", "ú", "Ñ", "ñ", "ą", "ć", "ę", "ł", "ń", "ó", "ś", "ź", "ż", "Ą", "Ć", "Ę", "Ł", "Ń", "Ó", "Ś", "Ź", "Ż" ], latin = [ "a", "b", "v", "g", "d", "e", "zh", "z", "i", "y", "k", "l", "m", "n", "o", "p", "r", "s", "t", "u", "f", "h", "ts", "ch", "sh", "sht", "a", "y", "yu", "ya", "A", "B", "B", "G", "D", "E", "Zh", "Z", "I", "Y", "K", "L", "M", "N", "O", "P", "R", "S", "T", "U", "F", "H", "Ts", "Ch", "Sh", "Sht", "A", "Y", "Yu", "Ya", "I", "i", "Ye", "ye", "I", "i", "Yo", "yo", "i", "I", "g", "G", "u", "U", "s", "S", "o", "O", "c", "C", "A", "a", "A", "a", "A", "a", "A", "a", "C", "c", "E", "e", "E", "e", "E", "e", "A", "a", "I", "i", "O", "o", "O", "o", "O", "o", "U", "u", "N", "n", "a", "c", "e", "l", "n", "o", "s", "z", "z", "A", "C", "E", "L", "N", "O", "S", "Z", "Z" ], string = "";
return Sluggin;
return InitSluggin;
}(this);

"undefined" != typeof module && module.exports ? module.exports.Sluggin = function(text) {
Expand Down
4 changes: 2 additions & 2 deletions dist/Sluggin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sluggin",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/juanbrujo/Sluggin.js",
"authors": [
"Jorge Epuñan <juanbrujo@gmail.com>"
Expand All @@ -11,7 +11,8 @@
"javascript",
"slug",
"convert",
"string"
"string",
"url"
],
"license": "MIT",
"devDependencies": {
Expand All @@ -23,6 +24,6 @@
"grunt-contrib-watch": "^0.6.1"
},
"scripts": {
"test": "node test.js"
"test": "grunt testjs --verbose"
}
}
4 changes: 2 additions & 2 deletions src/Sluggin.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var Sluggin = (function Sluggin() {
return sa ? s : s[0];
}

function Sluggin( text ) {
function InitSluggin( text ) {

var output;

Expand All @@ -92,7 +92,7 @@ var Sluggin = (function Sluggin() {

}

return Sluggin;
return InitSluggin;

})( this );

Expand Down

0 comments on commit 15758a0

Please sign in to comment.