diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index daccc324..da75e772 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,6 +1,15 @@ # Changelog +### 3.1.0 + +* Meteor integration [baeb0da](https://github.com/epeli/underscore.string/commit/baeb0da0053549e5346184630a7e0c5007b8be4f) +* Add flag to capitalize to lowercase remaining characters [#408](https://github.com/epeli/underscore.string/pull/408) +* Move to mocha [#409](https://github.com/epeli/underscore.string/pull/409) +* Add support for more htmlEntites in escapeHTML and unescapeHTML [#417](https://github.com/epeli/underscore.string/pull/417) +* Performance improvement in levenshtein [#427](https://github.com/epeli/underscore.string/pull/427) +* [Full changelog](https://github.com/epeli/underscore.string/compare/3.0.3...3.1.0) + ### 3.0.3 * Provide `dist` in npm package [#402](https://github.com/epeli/underscore.string/pull/402) diff --git a/bower.json b/bower.json index 3d4402de..f8e1f1d9 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "underscore.string", - "version": "3.0.3", + "version": "3.1.0", "description": "String manipulation extensions for Underscore.js javascript library.", "homepage": "http://epeli.github.com/underscore.string/", "contributors": [ diff --git a/component.json b/component.json index 3cbca84e..2d82fbe7 100644 --- a/component.json +++ b/component.json @@ -2,7 +2,7 @@ "name": "underscore.string", "repo": "epeli/underscore.string", "description": "String manipulation extensions for Underscore.js javascript library", - "version": "3.0.3", + "version": "3.1.0", "keywords": [ "underscore", "string" diff --git a/dist/underscore.string.js b/dist/underscore.string.js index 037ad21b..9b566f5c 100644 --- a/dist/underscore.string.js +++ b/dist/underscore.string.js @@ -14,22 +14,24 @@ module.exports = function camelize(str, decapitalize) { } }; -},{"./decapitalize":9,"./trim":60}],2:[function(_dereq_,module,exports){ +},{"./decapitalize":9,"./trim":61}],2:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); -module.exports = function capitalize(str) { +module.exports = function capitalize(str, lowercaseRest) { str = makeString(str); - return str.charAt(0).toUpperCase() + str.slice(1); + var remainingChars = !lowercaseRest ? str.slice(1) : str.slice(1).toLowerCase(); + + return str.charAt(0).toUpperCase() + remainingChars; }; -},{"./helper/makeString":19}],3:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],3:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function chars(str) { return makeString(str).split(''); }; -},{"./helper/makeString":19}],4:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],4:[function(_dereq_,module,exports){ module.exports = function chop(str, step) { if (str == null) return []; str = String(str); @@ -47,14 +49,14 @@ module.exports = function classify(str) { return capitalize(camelize(str.replace(/[\W_]/g, ' ')).replace(/\s/g, '')); }; -},{"./camelize":1,"./capitalize":2,"./helper/makeString":19}],6:[function(_dereq_,module,exports){ +},{"./camelize":1,"./capitalize":2,"./helper/makeString":20}],6:[function(_dereq_,module,exports){ var trim = _dereq_('./trim'); module.exports = function clean(str) { return trim(str).replace(/\s+/g, ' '); }; -},{"./trim":60}],7:[function(_dereq_,module,exports){ +},{"./trim":61}],7:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function(str, substr) { @@ -62,29 +64,18 @@ module.exports = function(str, substr) { substr = makeString(substr); if (str.length === 0 || substr.length === 0) return 0; - - var count = 0, - pos = 0, - length = substr.length; - - while (true) { - pos = str.indexOf(substr, pos); - if (pos === -1) break; - count++; - pos += length; - } - - return count; + + return str.split(substr).length - 1; }; -},{"./helper/makeString":19}],8:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],8:[function(_dereq_,module,exports){ var trim = _dereq_('./trim'); module.exports = function dasherize(str) { return trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase(); }; -},{"./trim":60}],9:[function(_dereq_,module,exports){ +},{"./trim":61}],9:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function decapitalize(str) { @@ -92,7 +83,7 @@ module.exports = function decapitalize(str) { return str.charAt(0).toLowerCase() + str.slice(1); }; -},{"./helper/makeString":19}],10:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],10:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); function getIndent(str) { @@ -122,7 +113,7 @@ module.exports = function dedent(str, pattern) { return str.replace(reg, ''); }; -},{"./helper/makeString":19}],11:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],11:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var toPositive = _dereq_('./helper/toPositive'); @@ -137,21 +128,27 @@ module.exports = function endsWith(str, ends, position) { return position >= 0 && str.indexOf(ends, position) === position; }; -},{"./helper/makeString":19,"./helper/toPositive":21}],12:[function(_dereq_,module,exports){ +},{"./helper/makeString":20,"./helper/toPositive":22}],12:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var escapeChars = _dereq_('./helper/escapeChars'); var reversedEscapeChars = {}; -for(var key in escapeChars) reversedEscapeChars[escapeChars[key]] = key; -reversedEscapeChars["'"] = '#39'; +var regexString = "["; +for(var key in escapeChars) { + regexString += key; +} +regexString += "]"; + +var regex = new RegExp( regexString, 'g'); module.exports = function escapeHTML(str) { - return makeString(str).replace(/[&<>"']/g, function(m) { - return '&' + reversedEscapeChars[m] + ';'; + + return makeString(str).replace(regex, function(m) { + return '&' + escapeChars[m] + ';'; }); }; -},{"./helper/escapeChars":17,"./helper/makeString":19}],13:[function(_dereq_,module,exports){ +},{"./helper/escapeChars":17,"./helper/makeString":20}],13:[function(_dereq_,module,exports){ module.exports = function() { var result = {}; @@ -169,7 +166,7 @@ module.exports = function() { // Underscore.string is freely distributable under the terms of the MIT license. // Documentation: https://github.com/epeli/underscore.string // Some code is borrowed from MooTools and Alexandru Marasteanu. -// Version '3.0.3' +// Version '3.1.0' 'use strict'; @@ -179,7 +176,7 @@ function s(value) { this._wrapped = value; } -s.VERSION = '3.0.3'; +s.VERSION = '3.1.0'; s.isBlank = _dereq_('./isBlank'); s.stripTags = _dereq_('./stripTags'); @@ -301,7 +298,7 @@ for (var key in prototypeMethods) prototype2method(prototypeMethods[key]); module.exports = s; -},{"./camelize":1,"./capitalize":2,"./chars":3,"./chop":4,"./classify":5,"./clean":6,"./count":7,"./dasherize":8,"./decapitalize":9,"./dedent":10,"./endsWith":11,"./escapeHTML":12,"./exports":13,"./helper/escapeRegExp":18,"./humanize":22,"./include":23,"./insert":24,"./isBlank":25,"./join":26,"./levenshtein":27,"./lines":28,"./lpad":29,"./lrpad":30,"./ltrim":31,"./naturalCmp":32,"./numberFormat":33,"./pad":34,"./pred":35,"./prune":36,"./quote":37,"./repeat":38,"./replaceAll":39,"./reverse":40,"./rpad":41,"./rtrim":42,"./slugify":43,"./splice":44,"./sprintf":45,"./startsWith":46,"./strLeft":47,"./strLeftBack":48,"./strRight":49,"./strRightBack":50,"./stripTags":51,"./succ":52,"./surround":53,"./swapCase":54,"./titleize":55,"./toBoolean":56,"./toNumber":57,"./toSentence":58,"./toSentenceSerial":59,"./trim":60,"./truncate":61,"./underscored":62,"./unescapeHTML":63,"./unquote":64,"./vsprintf":65,"./words":66}],15:[function(_dereq_,module,exports){ +},{"./camelize":1,"./capitalize":2,"./chars":3,"./chop":4,"./classify":5,"./clean":6,"./count":7,"./dasherize":8,"./decapitalize":9,"./dedent":10,"./endsWith":11,"./escapeHTML":12,"./exports":13,"./helper/escapeRegExp":18,"./humanize":23,"./include":24,"./insert":25,"./isBlank":26,"./join":27,"./levenshtein":28,"./lines":29,"./lpad":30,"./lrpad":31,"./ltrim":32,"./naturalCmp":33,"./numberFormat":34,"./pad":35,"./pred":36,"./prune":37,"./quote":38,"./repeat":39,"./replaceAll":40,"./reverse":41,"./rpad":42,"./rtrim":43,"./slugify":44,"./splice":45,"./sprintf":46,"./startsWith":47,"./strLeft":48,"./strLeftBack":49,"./strRight":50,"./strRightBack":51,"./stripTags":52,"./succ":53,"./surround":54,"./swapCase":55,"./titleize":56,"./toBoolean":57,"./toNumber":58,"./toSentence":59,"./toSentenceSerial":60,"./trim":61,"./truncate":62,"./underscored":63,"./unescapeHTML":64,"./unquote":65,"./vsprintf":66,"./words":67}],15:[function(_dereq_,module,exports){ var makeString = _dereq_('./makeString'); module.exports = function adjacent(str, direction) { @@ -312,7 +309,7 @@ module.exports = function adjacent(str, direction) { return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + direction); }; -},{"./makeString":19}],16:[function(_dereq_,module,exports){ +},{"./makeString":20}],16:[function(_dereq_,module,exports){ var escapeRegExp = _dereq_('./escapeRegExp'); module.exports = function defaultToWhiteSpace(characters) { @@ -325,12 +322,22 @@ module.exports = function defaultToWhiteSpace(characters) { }; },{"./escapeRegExp":18}],17:[function(_dereq_,module,exports){ +/* We're explicitly defining the list of entities we want to escape. +nbsp is an HTML entity, but we don't want to escape all space characters in a string, hence its omission in this map. + +*/ var escapeChars = { - lt: '<', - gt: '>', - quot: '"', - amp: '&', - apos: "'" + '¢' : 'cent', + '£' : 'pound', + '¥' : 'yen', + '€': 'euro', + '©' :'copy', + '®' : 'reg', + '<' : 'lt', + '>' : 'gt', + '"' : 'quot', + '&' : 'amp', + "'": '#39' }; module.exports = escapeChars; @@ -342,7 +349,28 @@ module.exports = function escapeRegExp(str) { return makeString(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; -},{"./makeString":19}],19:[function(_dereq_,module,exports){ +},{"./makeString":20}],19:[function(_dereq_,module,exports){ +/* +We're explicitly defining the list of entities that might see in escape HTML strings +*/ +var htmlEntities = { + nbsp: ' ', + cent: '¢', + pound: '£', + yen: '¥', + euro: '€', + copy: '©', + reg: '®', + lt: '<', + gt: '>', + quot: '"', + amp: '&', + apos: "'" +}; + +module.exports = htmlEntities; + +},{}],20:[function(_dereq_,module,exports){ /** * Ensure some object is a coerced to a string **/ @@ -351,7 +379,7 @@ module.exports = function makeString(object) { return '' + object; }; -},{}],20:[function(_dereq_,module,exports){ +},{}],21:[function(_dereq_,module,exports){ module.exports = function strRepeat(str, qty){ if (qty < 1) return ''; var result = ''; @@ -362,12 +390,12 @@ module.exports = function strRepeat(str, qty){ return result; }; -},{}],21:[function(_dereq_,module,exports){ +},{}],22:[function(_dereq_,module,exports){ module.exports = function toPositive(number) { return number < 0 ? 0 : (+number || 0); }; -},{}],22:[function(_dereq_,module,exports){ +},{}],23:[function(_dereq_,module,exports){ var capitalize = _dereq_('./capitalize'); var underscored = _dereq_('./underscored'); var trim = _dereq_('./trim'); @@ -376,7 +404,7 @@ module.exports = function humanize(str) { return capitalize(trim(underscored(str).replace(/_id$/, '').replace(/_/g, ' '))); }; -},{"./capitalize":2,"./trim":60,"./underscored":62}],23:[function(_dereq_,module,exports){ +},{"./capitalize":2,"./trim":61,"./underscored":63}],24:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function include(str, needle) { @@ -384,21 +412,21 @@ module.exports = function include(str, needle) { return makeString(str).indexOf(needle) !== -1; }; -},{"./helper/makeString":19}],24:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],25:[function(_dereq_,module,exports){ var splice = _dereq_('./splice'); module.exports = function insert(str, i, substr) { return splice(str, i, 0, substr); }; -},{"./splice":44}],25:[function(_dereq_,module,exports){ +},{"./splice":45}],26:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function isBlank(str) { return (/^\s*$/).test(makeString(str)); }; -},{"./helper/makeString":19}],26:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],27:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var slice = [].slice; @@ -409,54 +437,81 @@ module.exports = function join() { return args.join(makeString(separator)); }; -},{"./helper/makeString":19}],27:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],28:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); +/** + * Based on the implementation here: https://github.com/hiddentao/fast-levenshtein + */ module.exports = function levenshtein(str1, str2) { + 'use strict'; str1 = makeString(str1); str2 = makeString(str2); - var current = [], - prev, value; - - for (var i = 0; i <= str2.length; i++) - for (var j = 0; j <= str1.length; j++) { - if (i && j) - if (str1.charAt(j - 1) === str2.charAt(i - 1)) - value = prev; - else - value = Math.min(current[j], current[j - 1], prev) + 1; - else - value = i + j; - - prev = current[j]; - current[j] = value; + // Short cut cases + if (str1 === str2) return 0; + if (!str1 || !str2) return Math.max(str1.length, str2.length); + + // two rows + var prevRow = new Array(str2.length + 1); + + // initialise previous row + for (var i = 0; i < prevRow.length; ++i) { + prevRow[i] = i; + } + + // calculate current row distance from previous row + for (i = 0; i < str1.length; ++i) { + var nextCol = i + 1; + + for (var j = 0; j < str2.length; ++j) { + var curCol = nextCol; + + // substution + nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 ); + // insertion + var tmp = curCol + 1; + if (nextCol > tmp) { + nextCol = tmp; + } + // deletion + tmp = prevRow[j + 1] + 1; + if (nextCol > tmp) { + nextCol = tmp; + } + + // copy current col value into previous (in preparation for next iteration) + prevRow[j] = curCol; } - return current.pop(); + // copy last col value into previous (in preparation for next iteration) + prevRow[j] = nextCol; + } + + return nextCol; }; -},{"./helper/makeString":19}],28:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],29:[function(_dereq_,module,exports){ module.exports = function lines(str) { if (str == null) return []; return String(str).split(/\r?\n/); }; -},{}],29:[function(_dereq_,module,exports){ +},{}],30:[function(_dereq_,module,exports){ var pad = _dereq_('./pad'); module.exports = function lpad(str, length, padStr) { return pad(str, length, padStr); }; -},{"./pad":34}],30:[function(_dereq_,module,exports){ +},{"./pad":35}],31:[function(_dereq_,module,exports){ var pad = _dereq_('./pad'); module.exports = function lrpad(str, length, padStr) { return pad(str, length, padStr, 'both'); }; -},{"./pad":34}],31:[function(_dereq_,module,exports){ +},{"./pad":35}],32:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var defaultToWhiteSpace = _dereq_('./helper/defaultToWhiteSpace'); var nativeTrimLeft = String.prototype.trimLeft; @@ -468,13 +523,13 @@ module.exports = function ltrim(str, characters) { return str.replace(new RegExp('^' + characters + '+'), ''); }; -},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":19}],32:[function(_dereq_,module,exports){ +},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],33:[function(_dereq_,module,exports){ module.exports = function naturalCmp(str1, str2) { if (str1 == str2) return 0; if (!str1) return -1; if (!str2) return 1; - var cmpRegex = /(\.\d+)|(\d+)|(\D+)/g, + var cmpRegex = /(\.\d+|\d+|\D+)/g, tokens1 = String(str1).match(cmpRegex), tokens2 = String(str2).match(cmpRegex), count = Math.min(tokens1.length, tokens2.length); @@ -499,7 +554,7 @@ module.exports = function naturalCmp(str1, str2) { return str1 < str2 ? -1 : 1; }; -},{}],33:[function(_dereq_,module,exports){ +},{}],34:[function(_dereq_,module,exports){ module.exports = function numberFormat(number, dec, dsep, tsep) { if (isNaN(number) || number == null) return ''; @@ -513,7 +568,7 @@ module.exports = function numberFormat(number, dec, dsep, tsep) { return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals; }; -},{}],34:[function(_dereq_,module,exports){ +},{}],35:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var strRepeat = _dereq_('./helper/strRepeat'); @@ -541,14 +596,14 @@ module.exports = function pad(str, length, padStr, type) { } }; -},{"./helper/makeString":19,"./helper/strRepeat":20}],35:[function(_dereq_,module,exports){ +},{"./helper/makeString":20,"./helper/strRepeat":21}],36:[function(_dereq_,module,exports){ var adjacent = _dereq_('./helper/adjacent'); module.exports = function succ(str) { return adjacent(str, -1); }; -},{"./helper/adjacent":15}],36:[function(_dereq_,module,exports){ +},{"./helper/adjacent":15}],37:[function(_dereq_,module,exports){ /** * _s.prune: a more elegant version of truncate * prune extra chars, never leaving a half-chopped word. @@ -577,14 +632,14 @@ module.exports = function prune(str, length, pruneStr) { return (template + pruneStr).length > str.length ? str : str.slice(0, template.length) + pruneStr; }; -},{"./helper/makeString":19,"./rtrim":42}],37:[function(_dereq_,module,exports){ +},{"./helper/makeString":20,"./rtrim":43}],38:[function(_dereq_,module,exports){ var surround = _dereq_('./surround'); module.exports = function quote(str, quoteChar) { return surround(str, quoteChar || '"'); }; -},{"./surround":53}],38:[function(_dereq_,module,exports){ +},{"./surround":54}],39:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var strRepeat = _dereq_('./helper/strRepeat'); @@ -601,7 +656,7 @@ module.exports = function repeat(str, qty, separator) { return repeat.join(separator); }; -},{"./helper/makeString":19,"./helper/strRepeat":20}],39:[function(_dereq_,module,exports){ +},{"./helper/makeString":20,"./helper/strRepeat":21}],40:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function replaceAll(str, find, replace, ignorecase) { @@ -611,21 +666,21 @@ module.exports = function replaceAll(str, find, replace, ignorecase) { return makeString(str).replace(reg, replace); }; -},{"./helper/makeString":19}],40:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],41:[function(_dereq_,module,exports){ var chars = _dereq_('./chars'); module.exports = function reverse(str) { return chars(str).reverse().join(''); }; -},{"./chars":3}],41:[function(_dereq_,module,exports){ +},{"./chars":3}],42:[function(_dereq_,module,exports){ var pad = _dereq_('./pad'); module.exports = function rpad(str, length, padStr) { return pad(str, length, padStr, 'right'); }; -},{"./pad":34}],42:[function(_dereq_,module,exports){ +},{"./pad":35}],43:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var defaultToWhiteSpace = _dereq_('./helper/defaultToWhiteSpace'); var nativeTrimRight = String.prototype.trimRight; @@ -637,7 +692,7 @@ module.exports = function rtrim(str, characters) { return str.replace(new RegExp(characters + '+$'), ''); }; -},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":19}],43:[function(_dereq_,module,exports){ +},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],44:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var defaultToWhiteSpace = _dereq_('./helper/defaultToWhiteSpace'); var trim = _dereq_('./trim'); @@ -656,7 +711,7 @@ module.exports = function slugify(str) { return trim(dasherize(str.replace(/[^\w\s-]/g, '-')), '-'); }; -},{"./dasherize":8,"./helper/defaultToWhiteSpace":16,"./helper/makeString":19,"./trim":60}],44:[function(_dereq_,module,exports){ +},{"./dasherize":8,"./helper/defaultToWhiteSpace":16,"./helper/makeString":20,"./trim":61}],45:[function(_dereq_,module,exports){ var chars = _dereq_('./chars'); module.exports = function splice(str, i, howmany, substr) { @@ -665,7 +720,7 @@ module.exports = function splice(str, i, howmany, substr) { return arr.join(''); }; -},{"./chars":3}],45:[function(_dereq_,module,exports){ +},{"./chars":3}],46:[function(_dereq_,module,exports){ // sprintf() for JavaScript 0.7-beta1 // http://www.diveintojavascript.com/projects/javascript-sprintf // @@ -791,7 +846,7 @@ var sprintf = (function() { module.exports = sprintf; -},{"./helper/strRepeat":20}],46:[function(_dereq_,module,exports){ +},{"./helper/strRepeat":21}],47:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var toPositive = _dereq_('./helper/toPositive'); @@ -802,7 +857,7 @@ module.exports = function startsWith(str, starts, position) { return str.lastIndexOf(starts, position) === position; }; -},{"./helper/makeString":19,"./helper/toPositive":21}],47:[function(_dereq_,module,exports){ +},{"./helper/makeString":20,"./helper/toPositive":22}],48:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function strLeft(str, sep) { @@ -812,7 +867,7 @@ module.exports = function strLeft(str, sep) { return~ pos ? str.slice(0, pos) : str; }; -},{"./helper/makeString":19}],48:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],49:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function strLeftBack(str, sep) { @@ -822,7 +877,7 @@ module.exports = function strLeftBack(str, sep) { return~ pos ? str.slice(0, pos) : str; }; -},{"./helper/makeString":19}],49:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],50:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function strRight(str, sep) { @@ -832,7 +887,7 @@ module.exports = function strRight(str, sep) { return~ pos ? str.slice(pos + sep.length, str.length) : str; }; -},{"./helper/makeString":19}],50:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],51:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function strRightBack(str, sep) { @@ -842,26 +897,26 @@ module.exports = function strRightBack(str, sep) { return~ pos ? str.slice(pos + sep.length, str.length) : str; }; -},{"./helper/makeString":19}],51:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],52:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function stripTags(str) { return makeString(str).replace(/<\/?[^>]+>/g, ''); }; -},{"./helper/makeString":19}],52:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],53:[function(_dereq_,module,exports){ var adjacent = _dereq_('./helper/adjacent'); module.exports = function succ(str) { return adjacent(str, 1); }; -},{"./helper/adjacent":15}],53:[function(_dereq_,module,exports){ +},{"./helper/adjacent":15}],54:[function(_dereq_,module,exports){ module.exports = function surround(str, wrapper) { return [wrapper, str, wrapper].join(''); }; -},{}],54:[function(_dereq_,module,exports){ +},{}],55:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function swapCase(str) { @@ -870,7 +925,7 @@ module.exports = function swapCase(str) { }); }; -},{"./helper/makeString":19}],55:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],56:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function titleize(str) { @@ -879,7 +934,7 @@ module.exports = function titleize(str) { }); }; -},{"./helper/makeString":19}],56:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],57:[function(_dereq_,module,exports){ var trim = _dereq_('./trim'); function boolMatch(s, matchers) { @@ -901,11 +956,8 @@ module.exports = function toBoolean(str, trueValues, falseValues) { if (boolMatch(str, falseValues || ["false", "0"])) return false; }; -},{"./trim":60}],57:[function(_dereq_,module,exports){ +},{"./trim":61}],58:[function(_dereq_,module,exports){ var trim = _dereq_('./trim'); -var parseNumber = function(source) { - return source * 1 || 0; -}; module.exports = function toNumber(num, precision) { if (num == null) return 0; @@ -913,7 +965,7 @@ module.exports = function toNumber(num, precision) { return Math.round(num * factor) / factor; }; -},{"./trim":60}],58:[function(_dereq_,module,exports){ +},{"./trim":61}],59:[function(_dereq_,module,exports){ var rtrim = _dereq_('./rtrim'); module.exports = function toSentence(array, separator, lastSeparator, serial) { @@ -927,14 +979,14 @@ module.exports = function toSentence(array, separator, lastSeparator, serial) { return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember; }; -},{"./rtrim":42}],59:[function(_dereq_,module,exports){ +},{"./rtrim":43}],60:[function(_dereq_,module,exports){ var toSentence = _dereq_('./toSentence'); module.exports = function toSentenceSerial(array, sep, lastSep) { return toSentence(array, sep, lastSep, true); }; -},{"./toSentence":58}],60:[function(_dereq_,module,exports){ +},{"./toSentence":59}],61:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); var defaultToWhiteSpace = _dereq_('./helper/defaultToWhiteSpace'); var nativeTrim = String.prototype.trim; @@ -946,7 +998,7 @@ module.exports = function trim(str, characters) { return str.replace(new RegExp('^' + characters + '+|' + characters + '+$', 'g'), ''); }; -},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":19}],61:[function(_dereq_,module,exports){ +},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],62:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); module.exports = function truncate(str, length, truncateStr) { @@ -956,23 +1008,23 @@ module.exports = function truncate(str, length, truncateStr) { return str.length > length ? str.slice(0, length) + truncateStr : str; }; -},{"./helper/makeString":19}],62:[function(_dereq_,module,exports){ +},{"./helper/makeString":20}],63:[function(_dereq_,module,exports){ var trim = _dereq_('./trim'); module.exports = function underscored(str) { return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); }; -},{"./trim":60}],63:[function(_dereq_,module,exports){ +},{"./trim":61}],64:[function(_dereq_,module,exports){ var makeString = _dereq_('./helper/makeString'); -var escapeChars = _dereq_('./helper/escapeChars'); +var htmlEntities = _dereq_('./helper/htmlEntities'); module.exports = function unescapeHTML(str) { return makeString(str).replace(/\&([^;]+);/g, function(entity, entityCode) { var match; - if (entityCode in escapeChars) { - return escapeChars[entityCode]; + if (entityCode in htmlEntities) { + return htmlEntities[entityCode]; } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { return String.fromCharCode(parseInt(match[1], 16)); } else if (match = entityCode.match(/^#(\d+)$/)) { @@ -983,7 +1035,7 @@ module.exports = function unescapeHTML(str) { }); }; -},{"./helper/escapeChars":17,"./helper/makeString":19}],64:[function(_dereq_,module,exports){ +},{"./helper/htmlEntities":19,"./helper/makeString":20}],65:[function(_dereq_,module,exports){ module.exports = function unquote(str, quoteChar) { quoteChar = quoteChar || '"'; if (str[0] === quoteChar && str[str.length - 1] === quoteChar) @@ -991,7 +1043,7 @@ module.exports = function unquote(str, quoteChar) { else return str; }; -},{}],65:[function(_dereq_,module,exports){ +},{}],66:[function(_dereq_,module,exports){ var sprintf = _dereq_('./sprintf'); module.exports = function vsprintf(fmt, argv) { @@ -999,7 +1051,7 @@ module.exports = function vsprintf(fmt, argv) { return sprintf.apply(null, argv); }; -},{"./sprintf":45}],66:[function(_dereq_,module,exports){ +},{"./sprintf":46}],67:[function(_dereq_,module,exports){ var isBlank = _dereq_('./isBlank'); var trim = _dereq_('./trim'); @@ -1008,6 +1060,6 @@ module.exports = function words(str, delimiter) { return trim(str, delimiter).split(delimiter || /\s+/); }; -},{"./isBlank":25,"./trim":60}]},{},[14]) +},{"./isBlank":26,"./trim":61}]},{},[14]) (14) }); \ No newline at end of file diff --git a/dist/underscore.string.min.js b/dist/underscore.string.min.js index 2d635372..f8d2c4ef 100644 --- a/dist/underscore.string.min.js +++ b/dist/underscore.string.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var r;"undefined"!=typeof window?r=window:"undefined"!=typeof global?r=global:"undefined"!=typeof self&&(r=self),r.s=e()}}(function(){return function e(r,t,n){function i(o,p){if(!t[o]){if(!r[o]){var u="function"==typeof require&&require;if(!p&&u)return u(o,!0);if(a)return a(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=t[o]={exports:{}};r[o][0].call(c.exports,function(e){var t=r[o][1][e];return i(t?t:e)},c,c.exports,e,r,t,n)}return t[o].exports}for(var a="function"==typeof require&&require,o=0;o0?e.match(new RegExp(".{1,"+r+"}","g")):[e])}},{}],5:[function(e,r){var t=e("./capitalize"),n=e("./camelize"),i=e("./helper/makeString");r.exports=function(e){return e=i(e),t(n(e.replace(/[\W_]/g," ")).replace(/\s/g,""))}},{"./camelize":1,"./capitalize":2,"./helper/makeString":19}],6:[function(e,r){var t=e("./trim");r.exports=function(e){return t(e).replace(/\s+/g," ")}},{"./trim":60}],7:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){if(e=t(e),r=t(r),0===e.length||0===r.length)return 0;for(var n=0,i=0,a=r.length;;){if(i=e.indexOf(r,i),-1===i)break;n++,i+=a}return n}},{"./helper/makeString":19}],8:[function(e,r){var t=e("./trim");r.exports=function(e){return t(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()}},{"./trim":60}],9:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return e=t(e),e.charAt(0).toLowerCase()+e.slice(1)}},{"./helper/makeString":19}],10:[function(e,r){function t(e){for(var r=e.match(/^[\s\\t]*/gm),t=r[0].length,n=1;n=0&&e.indexOf(r,i)===i}},{"./helper/makeString":19,"./helper/toPositive":21}],12:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/escapeChars"),i={};for(var a in n)i[n[a]]=a;i["'"]="#39",r.exports=function(e){return t(e).replace(/[&<>"']/g,function(e){return"&"+i[e]+";"})}},{"./helper/escapeChars":17,"./helper/makeString":19}],13:[function(e,r){r.exports=function(){var e={};for(var r in this)this.hasOwnProperty(r)&&!r.match(/^(?:include|contains|reverse|join)$/)&&(e[r]=this[r]);return e}},{}],14:[function(e,r){"use strict";function t(e){return this instanceof t?void(this._wrapped=e):new t(e)}function n(e,r){"function"==typeof r&&(t.prototype[e]=function(){var e=[this._wrapped].concat(Array.prototype.slice.call(arguments)),n=r.apply(null,e);return"string"==typeof n?new t(n):n})}function i(e){n(e,function(r){var t=Array.prototype.slice.call(arguments,1);return String.prototype[e].apply(r,t)})}t.VERSION="3.0.3",t.isBlank=e("./isBlank"),t.stripTags=e("./stripTags"),t.capitalize=e("./capitalize"),t.decapitalize=e("./decapitalize"),t.chop=e("./chop"),t.trim=e("./trim"),t.clean=e("./clean"),t.count=e("./count"),t.chars=e("./chars"),t.swapCase=e("./swapCase"),t.escapeHTML=e("./escapeHTML"),t.unescapeHTML=e("./unescapeHTML"),t.splice=e("./splice"),t.insert=e("./insert"),t.replaceAll=e("./replaceAll"),t.include=e("./include"),t.join=e("./join"),t.lines=e("./lines"),t.dedent=e("./dedent"),t.reverse=e("./reverse"),t.startsWith=e("./startsWith"),t.endsWith=e("./endsWith"),t.pred=e("./pred"),t.succ=e("./succ"),t.titleize=e("./titleize"),t.camelize=e("./camelize"),t.underscored=e("./underscored"),t.dasherize=e("./dasherize"),t.classify=e("./classify"),t.humanize=e("./humanize"),t.ltrim=e("./ltrim"),t.rtrim=e("./rtrim"),t.truncate=e("./truncate"),t.prune=e("./prune"),t.words=e("./words"),t.pad=e("./pad"),t.lpad=e("./lpad"),t.rpad=e("./rpad"),t.lrpad=e("./lrpad"),t.sprintf=e("./sprintf"),t.vsprintf=e("./vsprintf"),t.toNumber=e("./toNumber"),t.numberFormat=e("./numberFormat"),t.strRight=e("./strRight"),t.strRightBack=e("./strRightBack"),t.strLeft=e("./strLeft"),t.strLeftBack=e("./strLeftBack"),t.toSentence=e("./toSentence"),t.toSentenceSerial=e("./toSentenceSerial"),t.slugify=e("./slugify"),t.surround=e("./surround"),t.quote=e("./quote"),t.unquote=e("./unquote"),t.repeat=e("./repeat"),t.naturalCmp=e("./naturalCmp"),t.levenshtein=e("./levenshtein"),t.toBoolean=e("./toBoolean"),t.exports=e("./exports"),t.escapeRegExp=e("./helper/escapeRegExp"),t.strip=t.trim,t.lstrip=t.ltrim,t.rstrip=t.rtrim,t.center=t.lrpad,t.rjust=t.lpad,t.ljust=t.rpad,t.contains=t.include,t.q=t.quote,t.toBool=t.toBoolean,t.camelcase=t.camelize,t.prototype={value:function(){return this._wrapped}};for(var a in t)n(a,t[a]);n("tap",function(e,r){return r(e)});var o=["toUpperCase","toLowerCase","split","replace","slice","substring","substr","concat"];for(var a in o)i(o[a]);r.exports=t},{"./camelize":1,"./capitalize":2,"./chars":3,"./chop":4,"./classify":5,"./clean":6,"./count":7,"./dasherize":8,"./decapitalize":9,"./dedent":10,"./endsWith":11,"./escapeHTML":12,"./exports":13,"./helper/escapeRegExp":18,"./humanize":22,"./include":23,"./insert":24,"./isBlank":25,"./join":26,"./levenshtein":27,"./lines":28,"./lpad":29,"./lrpad":30,"./ltrim":31,"./naturalCmp":32,"./numberFormat":33,"./pad":34,"./pred":35,"./prune":36,"./quote":37,"./repeat":38,"./replaceAll":39,"./reverse":40,"./rpad":41,"./rtrim":42,"./slugify":43,"./splice":44,"./sprintf":45,"./startsWith":46,"./strLeft":47,"./strLeftBack":48,"./strRight":49,"./strRightBack":50,"./stripTags":51,"./succ":52,"./surround":53,"./swapCase":54,"./titleize":55,"./toBoolean":56,"./toNumber":57,"./toSentence":58,"./toSentenceSerial":59,"./trim":60,"./truncate":61,"./underscored":62,"./unescapeHTML":63,"./unquote":64,"./vsprintf":65,"./words":66}],15:[function(e,r){var t=e("./makeString");r.exports=function(e,r){return e=t(e),0===e.length?"":e.slice(0,-1)+String.fromCharCode(e.charCodeAt(e.length-1)+r)}},{"./makeString":19}],16:[function(e,r){var t=e("./escapeRegExp");r.exports=function(e){return null==e?"\\s":e.source?e.source:"["+t(e)+"]"}},{"./escapeRegExp":18}],17:[function(e,r){var t={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"};r.exports=t},{}],18:[function(e,r){var t=e("./makeString");r.exports=function(e){return t(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}},{"./makeString":19}],19:[function(e,r){r.exports=function(e){return null==e?"":""+e}},{}],20:[function(e,r){r.exports=function(e,r){if(1>r)return"";for(var t="";r>0;)1&r&&(t+=e),r>>=1,e+=e;return t}},{}],21:[function(e,r){r.exports=function(e){return 0>e?0:+e||0}},{}],22:[function(e,r){var t=e("./capitalize"),n=e("./underscored"),i=e("./trim");r.exports=function(e){return t(i(n(e).replace(/_id$/,"").replace(/_/g," ")))}},{"./capitalize":2,"./trim":60,"./underscored":62}],23:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){return""===r?!0:-1!==t(e).indexOf(r)}},{"./helper/makeString":19}],24:[function(e,r){var t=e("./splice");r.exports=function(e,r,n){return t(e,r,0,n)}},{"./splice":44}],25:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return/^\s*$/.test(t(e))}},{"./helper/makeString":19}],26:[function(e,r){var t=e("./helper/makeString"),n=[].slice;r.exports=function(){var e=n.call(arguments),r=e.shift();return e.join(t(r))}},{"./helper/makeString":19}],27:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);for(var n,i,a=[],o=0;o<=r.length;o++)for(var p=0;p<=e.length;p++)i=o&&p?e.charAt(p-1)===r.charAt(o-1)?n:Math.min(a[p],a[p-1],n)+1:o+p,n=a[p],a[p]=i;return a.pop()}},{"./helper/makeString":19}],28:[function(e,r){r.exports=function(e){return null==e?[]:String(e).split(/\r?\n/)}},{}],29:[function(e,r){var t=e("./pad");r.exports=function(e,r,n){return t(e,r,n)}},{"./pad":34}],30:[function(e,r){var t=e("./pad");r.exports=function(e,r,n){return t(e,r,n,"both")}},{"./pad":34}],31:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=String.prototype.trimLeft;r.exports=function(e,r){return e=t(e),!r&&i?i.call(e):(r=n(r),e.replace(new RegExp("^"+r+"+"),""))}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":19}],32:[function(e,r){r.exports=function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,n=String(e).match(t),i=String(r).match(t),a=Math.min(n.length,i.length),o=0;a>o;o++){var p=n[o],u=i[o];if(p!==u){var c=+p,s=+u;return c===c&&s===s?c>s?1:-1:u>p?-1:1}}return n.length!=i.length?n.length-i.length:r>e?-1:1}},{}],33:[function(e,r){r.exports=function(e,r,t,n){if(isNaN(e)||null==e)return"";e=e.toFixed(~~r),n="string"==typeof n?n:",";var i=e.split("."),a=i[0],o=i[1]?(t||".")+i[1]:"";return a.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+n)+o}},{}],34:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/strRepeat");r.exports=function(e,r,i,a){e=t(e),r=~~r;var o=0;switch(i?i.length>1&&(i=i.charAt(0)):i=" ",a){case"right":return o=r-e.length,e+n(i,o);case"both":return o=r-e.length,n(i,Math.ceil(o/2))+e+n(i,Math.floor(o/2));default:return o=r-e.length,n(i,o)+e}}},{"./helper/makeString":19,"./helper/strRepeat":20}],35:[function(e,r){var t=e("./helper/adjacent");r.exports=function(e){return t(e,-1)}},{"./helper/adjacent":15}],36:[function(e,r){var t=e("./helper/makeString"),n=e("./rtrim");r.exports=function(e,r,i){if(e=t(e),r=~~r,i=null!=i?String(i):"...",e.length<=r)return e;var a=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},o=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,a);return o=o.slice(o.length-2).match(/\w\w/)?o.replace(/\s*\S+$/,""):n(o.slice(0,o.length-1)),(o+i).length>e.length?e:e.slice(0,o.length)+i}},{"./helper/makeString":19,"./rtrim":42}],37:[function(e,r){var t=e("./surround");r.exports=function(e,r){return t(e,r||'"')}},{"./surround":53}],38:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/strRepeat");r.exports=function i(e,r,a){if(e=t(e),r=~~r,null==a)return n(e,r);for(var i=[];r>0;i[--r]=e);return i.join(a)}},{"./helper/makeString":19,"./helper/strRepeat":20}],39:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r,n,i){var a=i===!0?"gi":"g",o=new RegExp(r,a);return t(e).replace(o,n)}},{"./helper/makeString":19}],40:[function(e,r){var t=e("./chars");r.exports=function(e){return t(e).reverse().join("")}},{"./chars":3}],41:[function(e,r){var t=e("./pad");r.exports=function(e,r,n){return t(e,r,n,"right")}},{"./pad":34}],42:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=String.prototype.trimRight;r.exports=function(e,r){return e=t(e),!r&&i?i.call(e):(r=n(r),e.replace(new RegExp(r+"+$"),""))}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":19}],43:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=e("./trim"),a=e("./dasherize");r.exports=function(e){var r="ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșšŝťțŭùúüűûñÿýçżźž",o="aaaaaaaaaccceeeeeghiiiijllnnoooooooossssttuuuuuunyyczzz",p=new RegExp(n(r),"g");return e=t(e).toLowerCase().replace(p,function(e){var t=r.indexOf(e);return o.charAt(t)||"-"}),i(a(e.replace(/[^\w\s-]/g,"-")),"-")}},{"./dasherize":8,"./helper/defaultToWhiteSpace":16,"./helper/makeString":19,"./trim":60}],44:[function(e,r){var t=e("./chars");r.exports=function(e,r,n,i){var a=t(e);return a.splice(~~r,~~n,i),a.join("")}},{"./chars":3}],45:[function(e,r){var t=e("./helper/strRepeat"),n=Object.prototype.toString,i=function(){function e(e){return n.call(e).slice(8,-1).toLowerCase()}var r=t,a=function(){return a.cache.hasOwnProperty(arguments[0])||(a.cache[arguments[0]]=a.parse(arguments[0])),a.format.call(null,a.cache[arguments[0]],arguments)};return a.format=function(t,n){var a,o,p,u,c,s,l,f=1,h=t.length,g="",m=[];for(o=0;h>o;o++)if(g=e(t[o]),"string"===g)m.push(t[o]);else if("array"===g){if(u=t[o],u[2])for(a=n[f],p=0;p=0?"+"+a:a,s=u[4]?"0"==u[4]?"0":u[4].charAt(1):" ",l=u[6]-String(a).length,c=u[6]?r(s,l):"",m.push(u[5]?a+c:c+a)}return m.join("")},a.cache={},a.parse=function(e){for(var r=e,t=[],n=[],i=0;r;){if(null!==(t=/^[^\x25]+/.exec(r)))n.push(t[0]);else if(null!==(t=/^\x25{2}/.exec(r)))n.push("%");else{if(null===(t=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r)))throw new Error("[_.sprintf] huh?");if(t[2]){i|=1;var a=[],o=t[2],p=[];if(null===(p=/^([a-z_][a-z_\d]*)/i.exec(o)))throw new Error("[_.sprintf] huh?");for(a.push(p[1]);""!==(o=o.substring(p[0].length));)if(null!==(p=/^\.([a-z_][a-z_\d]*)/i.exec(o)))a.push(p[1]);else{if(null===(p=/^\[(\d+)\]/.exec(o)))throw new Error("[_.sprintf] huh?");a.push(p[1])}t[2]=a}else i|=2;if(3===i)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");n.push(t)}r=r.substring(t[0].length)}return n},a}();r.exports=i},{"./helper/strRepeat":20}],46:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/toPositive");r.exports=function(e,r,i){return e=t(e),r=""+r,i=null==i?0:Math.min(n(i),e.length),e.lastIndexOf(r,i)===i}},{"./helper/makeString":19,"./helper/toPositive":21}],47:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=r?e.indexOf(r):-1;return~n?e.slice(0,n):e}},{"./helper/makeString":19}],48:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=e.lastIndexOf(r);return~n?e.slice(0,n):e}},{"./helper/makeString":19}],49:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=r?e.indexOf(r):-1;return~n?e.slice(n+r.length,e.length):e}},{"./helper/makeString":19}],50:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=r?e.lastIndexOf(r):-1;return~n?e.slice(n+r.length,e.length):e}},{"./helper/makeString":19}],51:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return t(e).replace(/<\/?[^>]+>/g,"")}},{"./helper/makeString":19}],52:[function(e,r){var t=e("./helper/adjacent");r.exports=function(e){return t(e,1)}},{"./helper/adjacent":15}],53:[function(e,r){r.exports=function(e,r){return[r,e,r].join("")}},{}],54:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return t(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})}},{"./helper/makeString":19}],55:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return t(e).toLowerCase().replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()})}},{"./helper/makeString":19}],56:[function(e,r){function t(e,r){var t,n,i=e.toLowerCase();for(r=[].concat(r),t=0;t2&&i&&(n=t(r)+n),a.length?a.join(r)+n+o:o}},{"./rtrim":42}],59:[function(e,r){var t=e("./toSentence");r.exports=function(e,r,n){return t(e,r,n,!0)}},{"./toSentence":58}],60:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=String.prototype.trim;r.exports=function(e,r){return e=t(e),!r&&i?i.call(e):(r=n(r),e.replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":19}],61:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r,n){return e=t(e),n=n||"...",r=~~r,e.length>r?e.slice(0,r)+n:e}},{"./helper/makeString":19}],62:[function(e,r){var t=e("./trim");r.exports=function(e){return t(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()}},{"./trim":60}],63:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/escapeChars");r.exports=function(e){return t(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in n?n[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?String.fromCharCode(~~t[1]):e})}},{"./helper/escapeChars":17,"./helper/makeString":19}],64:[function(e,r){r.exports=function(e,r){return r=r||'"',e[0]===r&&e[e.length-1]===r?e.slice(1,e.length-1):e}},{}],65:[function(e,r){var t=e("./sprintf");r.exports=function(e,r){return r.unshift(e),t.apply(null,r)}},{"./sprintf":45}],66:[function(e,r){var t=e("./isBlank"),n=e("./trim");r.exports=function(e,r){return t(e)?[]:n(e,r).split(r||/\s+/)}},{"./isBlank":25,"./trim":60}]},{},[14])(14)}); \ No newline at end of file +!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var r;"undefined"!=typeof window?r=window:"undefined"!=typeof global?r=global:"undefined"!=typeof self&&(r=self),r.s=e()}}(function(){return function e(r,t,n){function i(o,p){if(!t[o]){if(!r[o]){var u="function"==typeof require&&require;if(!p&&u)return u(o,!0);if(a)return a(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=t[o]={exports:{}};r[o][0].call(c.exports,function(e){var t=r[o][1][e];return i(t?t:e)},c,c.exports,e,r,t,n)}return t[o].exports}for(var a="function"==typeof require&&require,o=0;o0?e.match(new RegExp(".{1,"+r+"}","g")):[e])}},{}],5:[function(e,r){var t=e("./capitalize"),n=e("./camelize"),i=e("./helper/makeString");r.exports=function(e){return e=i(e),t(n(e.replace(/[\W_]/g," ")).replace(/\s/g,""))}},{"./camelize":1,"./capitalize":2,"./helper/makeString":20}],6:[function(e,r){var t=e("./trim");r.exports=function(e){return t(e).replace(/\s+/g," ")}},{"./trim":61}],7:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){return e=t(e),r=t(r),0===e.length||0===r.length?0:e.split(r).length-1}},{"./helper/makeString":20}],8:[function(e,r){var t=e("./trim");r.exports=function(e){return t(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()}},{"./trim":61}],9:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return e=t(e),e.charAt(0).toLowerCase()+e.slice(1)}},{"./helper/makeString":20}],10:[function(e,r){function t(e){for(var r=e.match(/^[\s\\t]*/gm),t=r[0].length,n=1;n=0&&e.indexOf(r,i)===i}},{"./helper/makeString":20,"./helper/toPositive":22}],12:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/escapeChars"),i="[";for(var a in n)i+=a;i+="]";var o=new RegExp(i,"g");r.exports=function(e){return t(e).replace(o,function(e){return"&"+n[e]+";"})}},{"./helper/escapeChars":17,"./helper/makeString":20}],13:[function(e,r){r.exports=function(){var e={};for(var r in this)this.hasOwnProperty(r)&&!r.match(/^(?:include|contains|reverse|join)$/)&&(e[r]=this[r]);return e}},{}],14:[function(e,r){"use strict";function t(e){return this instanceof t?void(this._wrapped=e):new t(e)}function n(e,r){"function"==typeof r&&(t.prototype[e]=function(){var e=[this._wrapped].concat(Array.prototype.slice.call(arguments)),n=r.apply(null,e);return"string"==typeof n?new t(n):n})}function i(e){n(e,function(r){var t=Array.prototype.slice.call(arguments,1);return String.prototype[e].apply(r,t)})}t.VERSION="3.1.0",t.isBlank=e("./isBlank"),t.stripTags=e("./stripTags"),t.capitalize=e("./capitalize"),t.decapitalize=e("./decapitalize"),t.chop=e("./chop"),t.trim=e("./trim"),t.clean=e("./clean"),t.count=e("./count"),t.chars=e("./chars"),t.swapCase=e("./swapCase"),t.escapeHTML=e("./escapeHTML"),t.unescapeHTML=e("./unescapeHTML"),t.splice=e("./splice"),t.insert=e("./insert"),t.replaceAll=e("./replaceAll"),t.include=e("./include"),t.join=e("./join"),t.lines=e("./lines"),t.dedent=e("./dedent"),t.reverse=e("./reverse"),t.startsWith=e("./startsWith"),t.endsWith=e("./endsWith"),t.pred=e("./pred"),t.succ=e("./succ"),t.titleize=e("./titleize"),t.camelize=e("./camelize"),t.underscored=e("./underscored"),t.dasherize=e("./dasherize"),t.classify=e("./classify"),t.humanize=e("./humanize"),t.ltrim=e("./ltrim"),t.rtrim=e("./rtrim"),t.truncate=e("./truncate"),t.prune=e("./prune"),t.words=e("./words"),t.pad=e("./pad"),t.lpad=e("./lpad"),t.rpad=e("./rpad"),t.lrpad=e("./lrpad"),t.sprintf=e("./sprintf"),t.vsprintf=e("./vsprintf"),t.toNumber=e("./toNumber"),t.numberFormat=e("./numberFormat"),t.strRight=e("./strRight"),t.strRightBack=e("./strRightBack"),t.strLeft=e("./strLeft"),t.strLeftBack=e("./strLeftBack"),t.toSentence=e("./toSentence"),t.toSentenceSerial=e("./toSentenceSerial"),t.slugify=e("./slugify"),t.surround=e("./surround"),t.quote=e("./quote"),t.unquote=e("./unquote"),t.repeat=e("./repeat"),t.naturalCmp=e("./naturalCmp"),t.levenshtein=e("./levenshtein"),t.toBoolean=e("./toBoolean"),t.exports=e("./exports"),t.escapeRegExp=e("./helper/escapeRegExp"),t.strip=t.trim,t.lstrip=t.ltrim,t.rstrip=t.rtrim,t.center=t.lrpad,t.rjust=t.lpad,t.ljust=t.rpad,t.contains=t.include,t.q=t.quote,t.toBool=t.toBoolean,t.camelcase=t.camelize,t.prototype={value:function(){return this._wrapped}};for(var a in t)n(a,t[a]);n("tap",function(e,r){return r(e)});var o=["toUpperCase","toLowerCase","split","replace","slice","substring","substr","concat"];for(var a in o)i(o[a]);r.exports=t},{"./camelize":1,"./capitalize":2,"./chars":3,"./chop":4,"./classify":5,"./clean":6,"./count":7,"./dasherize":8,"./decapitalize":9,"./dedent":10,"./endsWith":11,"./escapeHTML":12,"./exports":13,"./helper/escapeRegExp":18,"./humanize":23,"./include":24,"./insert":25,"./isBlank":26,"./join":27,"./levenshtein":28,"./lines":29,"./lpad":30,"./lrpad":31,"./ltrim":32,"./naturalCmp":33,"./numberFormat":34,"./pad":35,"./pred":36,"./prune":37,"./quote":38,"./repeat":39,"./replaceAll":40,"./reverse":41,"./rpad":42,"./rtrim":43,"./slugify":44,"./splice":45,"./sprintf":46,"./startsWith":47,"./strLeft":48,"./strLeftBack":49,"./strRight":50,"./strRightBack":51,"./stripTags":52,"./succ":53,"./surround":54,"./swapCase":55,"./titleize":56,"./toBoolean":57,"./toNumber":58,"./toSentence":59,"./toSentenceSerial":60,"./trim":61,"./truncate":62,"./underscored":63,"./unescapeHTML":64,"./unquote":65,"./vsprintf":66,"./words":67}],15:[function(e,r){var t=e("./makeString");r.exports=function(e,r){return e=t(e),0===e.length?"":e.slice(0,-1)+String.fromCharCode(e.charCodeAt(e.length-1)+r)}},{"./makeString":20}],16:[function(e,r){var t=e("./escapeRegExp");r.exports=function(e){return null==e?"\\s":e.source?e.source:"["+t(e)+"]"}},{"./escapeRegExp":18}],17:[function(e,r){var t={"¢":"cent","£":"pound","¥":"yen","€":"euro","©":"copy","®":"reg","<":"lt",">":"gt",'"':"quot","&":"amp","'":"#39"};r.exports=t},{}],18:[function(e,r){var t=e("./makeString");r.exports=function(e){return t(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}},{"./makeString":20}],19:[function(e,r){var t={nbsp:" ",cent:"¢",pound:"£",yen:"¥",euro:"€",copy:"©",reg:"®",lt:"<",gt:">",quot:'"',amp:"&",apos:"'"};r.exports=t},{}],20:[function(e,r){r.exports=function(e){return null==e?"":""+e}},{}],21:[function(e,r){r.exports=function(e,r){if(1>r)return"";for(var t="";r>0;)1&r&&(t+=e),r>>=1,e+=e;return t}},{}],22:[function(e,r){r.exports=function(e){return 0>e?0:+e||0}},{}],23:[function(e,r){var t=e("./capitalize"),n=e("./underscored"),i=e("./trim");r.exports=function(e){return t(i(n(e).replace(/_id$/,"").replace(/_/g," ")))}},{"./capitalize":2,"./trim":61,"./underscored":63}],24:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){return""===r?!0:-1!==t(e).indexOf(r)}},{"./helper/makeString":20}],25:[function(e,r){var t=e("./splice");r.exports=function(e,r,n){return t(e,r,0,n)}},{"./splice":45}],26:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return/^\s*$/.test(t(e))}},{"./helper/makeString":20}],27:[function(e,r){var t=e("./helper/makeString"),n=[].slice;r.exports=function(){var e=n.call(arguments),r=e.shift();return e.join(t(r))}},{"./helper/makeString":20}],28:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){"use strict";if(e=t(e),r=t(r),e===r)return 0;if(!e||!r)return Math.max(e.length,r.length);for(var n=new Array(r.length+1),i=0;iu&&(a=u),u=n[o+1]+1,a>u&&(a=u),n[o]=p}n[o]=a}return a}},{"./helper/makeString":20}],29:[function(e,r){r.exports=function(e){return null==e?[]:String(e).split(/\r?\n/)}},{}],30:[function(e,r){var t=e("./pad");r.exports=function(e,r,n){return t(e,r,n)}},{"./pad":35}],31:[function(e,r){var t=e("./pad");r.exports=function(e,r,n){return t(e,r,n,"both")}},{"./pad":35}],32:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=String.prototype.trimLeft;r.exports=function(e,r){return e=t(e),!r&&i?i.call(e):(r=n(r),e.replace(new RegExp("^"+r+"+"),""))}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],33:[function(e,r){r.exports=function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+|\d+|\D+)/g,n=String(e).match(t),i=String(r).match(t),a=Math.min(n.length,i.length),o=0;a>o;o++){var p=n[o],u=i[o];if(p!==u){var c=+p,s=+u;return c===c&&s===s?c>s?1:-1:u>p?-1:1}}return n.length!=i.length?n.length-i.length:r>e?-1:1}},{}],34:[function(e,r){r.exports=function(e,r,t,n){if(isNaN(e)||null==e)return"";e=e.toFixed(~~r),n="string"==typeof n?n:",";var i=e.split("."),a=i[0],o=i[1]?(t||".")+i[1]:"";return a.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+n)+o}},{}],35:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/strRepeat");r.exports=function(e,r,i,a){e=t(e),r=~~r;var o=0;switch(i?i.length>1&&(i=i.charAt(0)):i=" ",a){case"right":return o=r-e.length,e+n(i,o);case"both":return o=r-e.length,n(i,Math.ceil(o/2))+e+n(i,Math.floor(o/2));default:return o=r-e.length,n(i,o)+e}}},{"./helper/makeString":20,"./helper/strRepeat":21}],36:[function(e,r){var t=e("./helper/adjacent");r.exports=function(e){return t(e,-1)}},{"./helper/adjacent":15}],37:[function(e,r){var t=e("./helper/makeString"),n=e("./rtrim");r.exports=function(e,r,i){if(e=t(e),r=~~r,i=null!=i?String(i):"...",e.length<=r)return e;var a=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},o=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,a);return o=o.slice(o.length-2).match(/\w\w/)?o.replace(/\s*\S+$/,""):n(o.slice(0,o.length-1)),(o+i).length>e.length?e:e.slice(0,o.length)+i}},{"./helper/makeString":20,"./rtrim":43}],38:[function(e,r){var t=e("./surround");r.exports=function(e,r){return t(e,r||'"')}},{"./surround":54}],39:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/strRepeat");r.exports=function i(e,r,a){if(e=t(e),r=~~r,null==a)return n(e,r);for(var i=[];r>0;i[--r]=e);return i.join(a)}},{"./helper/makeString":20,"./helper/strRepeat":21}],40:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r,n,i){var a=i===!0?"gi":"g",o=new RegExp(r,a);return t(e).replace(o,n)}},{"./helper/makeString":20}],41:[function(e,r){var t=e("./chars");r.exports=function(e){return t(e).reverse().join("")}},{"./chars":3}],42:[function(e,r){var t=e("./pad");r.exports=function(e,r,n){return t(e,r,n,"right")}},{"./pad":35}],43:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=String.prototype.trimRight;r.exports=function(e,r){return e=t(e),!r&&i?i.call(e):(r=n(r),e.replace(new RegExp(r+"+$"),""))}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],44:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=e("./trim"),a=e("./dasherize");r.exports=function(e){var r="ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșšŝťțŭùúüűûñÿýçżźž",o="aaaaaaaaaccceeeeeghiiiijllnnoooooooossssttuuuuuunyyczzz",p=new RegExp(n(r),"g");return e=t(e).toLowerCase().replace(p,function(e){var t=r.indexOf(e);return o.charAt(t)||"-"}),i(a(e.replace(/[^\w\s-]/g,"-")),"-")}},{"./dasherize":8,"./helper/defaultToWhiteSpace":16,"./helper/makeString":20,"./trim":61}],45:[function(e,r){var t=e("./chars");r.exports=function(e,r,n,i){var a=t(e);return a.splice(~~r,~~n,i),a.join("")}},{"./chars":3}],46:[function(e,r){var t=e("./helper/strRepeat"),n=Object.prototype.toString,i=function(){function e(e){return n.call(e).slice(8,-1).toLowerCase()}var r=t,a=function(){return a.cache.hasOwnProperty(arguments[0])||(a.cache[arguments[0]]=a.parse(arguments[0])),a.format.call(null,a.cache[arguments[0]],arguments)};return a.format=function(t,n){var a,o,p,u,c,s,l,f=1,h=t.length,g="",m=[];for(o=0;h>o;o++)if(g=e(t[o]),"string"===g)m.push(t[o]);else if("array"===g){if(u=t[o],u[2])for(a=n[f],p=0;p=0?"+"+a:a,s=u[4]?"0"==u[4]?"0":u[4].charAt(1):" ",l=u[6]-String(a).length,c=u[6]?r(s,l):"",m.push(u[5]?a+c:c+a)}return m.join("")},a.cache={},a.parse=function(e){for(var r=e,t=[],n=[],i=0;r;){if(null!==(t=/^[^\x25]+/.exec(r)))n.push(t[0]);else if(null!==(t=/^\x25{2}/.exec(r)))n.push("%");else{if(null===(t=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r)))throw new Error("[_.sprintf] huh?");if(t[2]){i|=1;var a=[],o=t[2],p=[];if(null===(p=/^([a-z_][a-z_\d]*)/i.exec(o)))throw new Error("[_.sprintf] huh?");for(a.push(p[1]);""!==(o=o.substring(p[0].length));)if(null!==(p=/^\.([a-z_][a-z_\d]*)/i.exec(o)))a.push(p[1]);else{if(null===(p=/^\[(\d+)\]/.exec(o)))throw new Error("[_.sprintf] huh?");a.push(p[1])}t[2]=a}else i|=2;if(3===i)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");n.push(t)}r=r.substring(t[0].length)}return n},a}();r.exports=i},{"./helper/strRepeat":21}],47:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/toPositive");r.exports=function(e,r,i){return e=t(e),r=""+r,i=null==i?0:Math.min(n(i),e.length),e.lastIndexOf(r,i)===i}},{"./helper/makeString":20,"./helper/toPositive":22}],48:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=r?e.indexOf(r):-1;return~n?e.slice(0,n):e}},{"./helper/makeString":20}],49:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=e.lastIndexOf(r);return~n?e.slice(0,n):e}},{"./helper/makeString":20}],50:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=r?e.indexOf(r):-1;return~n?e.slice(n+r.length,e.length):e}},{"./helper/makeString":20}],51:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r){e=t(e),r=t(r);var n=r?e.lastIndexOf(r):-1;return~n?e.slice(n+r.length,e.length):e}},{"./helper/makeString":20}],52:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return t(e).replace(/<\/?[^>]+>/g,"")}},{"./helper/makeString":20}],53:[function(e,r){var t=e("./helper/adjacent");r.exports=function(e){return t(e,1)}},{"./helper/adjacent":15}],54:[function(e,r){r.exports=function(e,r){return[r,e,r].join("")}},{}],55:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return t(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})}},{"./helper/makeString":20}],56:[function(e,r){var t=e("./helper/makeString");r.exports=function(e){return t(e).toLowerCase().replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()})}},{"./helper/makeString":20}],57:[function(e,r){function t(e,r){var t,n,i=e.toLowerCase();for(r=[].concat(r),t=0;t2&&i&&(n=t(r)+n),a.length?a.join(r)+n+o:o}},{"./rtrim":43}],60:[function(e,r){var t=e("./toSentence");r.exports=function(e,r,n){return t(e,r,n,!0)}},{"./toSentence":59}],61:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/defaultToWhiteSpace"),i=String.prototype.trim;r.exports=function(e,r){return e=t(e),!r&&i?i.call(e):(r=n(r),e.replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],62:[function(e,r){var t=e("./helper/makeString");r.exports=function(e,r,n){return e=t(e),n=n||"...",r=~~r,e.length>r?e.slice(0,r)+n:e}},{"./helper/makeString":20}],63:[function(e,r){var t=e("./trim");r.exports=function(e){return t(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()}},{"./trim":61}],64:[function(e,r){var t=e("./helper/makeString"),n=e("./helper/htmlEntities");r.exports=function(e){return t(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in n?n[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?String.fromCharCode(~~t[1]):e})}},{"./helper/htmlEntities":19,"./helper/makeString":20}],65:[function(e,r){r.exports=function(e,r){return r=r||'"',e[0]===r&&e[e.length-1]===r?e.slice(1,e.length-1):e}},{}],66:[function(e,r){var t=e("./sprintf");r.exports=function(e,r){return r.unshift(e),t.apply(null,r)}},{"./sprintf":46}],67:[function(e,r){var t=e("./isBlank"),n=e("./trim");r.exports=function(e,r){return t(e)?[]:n(e,r).split(r||/\s+/)}},{"./isBlank":26,"./trim":61}]},{},[14])(14)}); \ No newline at end of file diff --git a/index.js b/index.js index 2be14c08..6e609298 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ // Underscore.string is freely distributable under the terms of the MIT license. // Documentation: https://github.com/epeli/underscore.string // Some code is borrowed from MooTools and Alexandru Marasteanu. -// Version '3.0.3' +// Version '3.1.0' 'use strict'; @@ -13,7 +13,7 @@ function s(value) { this._wrapped = value; } -s.VERSION = '3.0.3'; +s.VERSION = '3.1.0'; s.isBlank = require('./isBlank'); s.stripTags = require('./stripTags'); diff --git a/package.js b/package.js index d1fbd49a..2b5f42fe 100644 --- a/package.js +++ b/package.js @@ -3,7 +3,7 @@ Package.describe({ name: 'underscorestring:underscore.string', summary: 'underscore.string (official): String manipulation extensions for Underscore.js javascript library.', - version: '3.0.3', + version: '3.1.0', git: 'https://github.com/epeli/underscore.string.git', documentation: 'README.markdown' }); diff --git a/package.json b/package.json index 2fb67954..01261be6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "underscore.string", - "version": "3.0.3", + "version": "3.1.0", "description": "String manipulation extensions for Underscore.js javascript library.", "homepage": "http://epeli.github.com/underscore.string/", "contributors": [