From 824a2d9f587ca017fc71b84d835e72f54f9c87c4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Nov 2018 18:02:36 +0100 Subject: Began rewrite --- node_modules/locutus/php/strings/strcoll.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 node_modules/locutus/php/strings/strcoll.js (limited to 'node_modules/locutus/php/strings/strcoll.js') diff --git a/node_modules/locutus/php/strings/strcoll.js b/node_modules/locutus/php/strings/strcoll.js new file mode 100644 index 0000000..f175527 --- /dev/null +++ b/node_modules/locutus/php/strings/strcoll.js @@ -0,0 +1,23 @@ +'use strict'; + +module.exports = function strcoll(str1, str2) { + // discuss at: http://locutus.io/php/strcoll/ + // original by: Brett Zamir (http://brett-zamir.me) + // improved by: Brett Zamir (http://brett-zamir.me) + // example 1: strcoll('a', 'b') + // returns 1: -1 + + var setlocale = require('../strings/setlocale'); + + var $global = typeof window !== 'undefined' ? window : global; + $global.$locutus = $global.$locutus || {}; + var $locutus = $global.$locutus; + $locutus.php = $locutus.php || {}; + + setlocale('LC_ALL', 0); // ensure setup of localization variables takes place + + var cmp = $locutus.php.locales[$locutus.php.localeCategories.LC_COLLATE].LC_COLLATE; + + return cmp(str1, str2); +}; +//# sourceMappingURL=strcoll.js.map \ No newline at end of file -- cgit v1.2.3