summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/strings/strnatcasecmp.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/strings/strnatcasecmp.js')
-rw-r--r--node_modules/locutus/php/strings/strnatcasecmp.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/locutus/php/strings/strnatcasecmp.js b/node_modules/locutus/php/strings/strnatcasecmp.js
new file mode 100644
index 0000000..5c7437a
--- /dev/null
+++ b/node_modules/locutus/php/strings/strnatcasecmp.js
@@ -0,0 +1,27 @@
+'use strict';
+
+module.exports = function strnatcasecmp(a, b) {
+ // discuss at: http://locutus.io/php/strnatcasecmp/
+ // original by: Martin Pool
+ // reimplemented by: Pierre-Luc Paour
+ // reimplemented by: Kristof Coomans (SCK-CEN (Belgian Nucleair Research Centre))
+ // reimplemented by: Brett Zamir (http://brett-zamir.me)
+ // bugfixed by: Kevin van Zonneveld (http://kvz.io)
+ // input by: Devan Penner-Woelk
+ // improved by: Kevin van Zonneveld (http://kvz.io)
+ // reimplemented by: RafaƂ Kukawski
+ // example 1: strnatcasecmp(10, 1)
+ // returns 1: 1
+ // example 2: strnatcasecmp('1', '10')
+ // returns 2: -1
+
+ var strnatcmp = require('../strings/strnatcmp');
+ var _phpCastString = require('../_helpers/_phpCastString');
+
+ if (arguments.length !== 2) {
+ return null;
+ }
+
+ return strnatcmp(_phpCastString(a).toLowerCase(), _phpCastString(b).toLowerCase());
+};
+//# sourceMappingURL=strnatcasecmp.js.map \ No newline at end of file