diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..6767e7b --- /dev/null +++ b/bower.json @@ -0,0 +1,17 @@ +{ + "name": "javascript-natural-sort", + "version": "0.7.1", + "description": "Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license", + "main": "naturalSort.js", + "keywords": [ + "natural", + "sort", + "javascript", + "array", + "sort", + "sorting" + ], + "author": "Jim Palmer (based on chunking idea from Dave Koelle, packaged by @khous of Bill4Time)", + "license": "MIT", + "homepage": "https://github.com/Bill4Time/javascript-natural-sort" +} diff --git a/naturalSort.js b/naturalSort.js index 28dd64d..b9a6810 100644 --- a/naturalSort.js +++ b/naturalSort.js @@ -3,7 +3,7 @@ * Author: Jim Palmer (based on chunking idea from Dave Koelle) */ /*jshint unused:false */ -module.exports = function naturalSort (a, b) { +function naturalSort (a, b) { "use strict"; var re = /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, sre = /(^[ ]*|[ ]*$)/g, @@ -43,3 +43,10 @@ module.exports = function naturalSort (a, b) { } return 0; }; + +if(typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = moduleName; + } + exports = moduleName; +}