Comparing version 2.4.7 to 2.5.1
@@ -88,3 +88,3 @@ 'use strict'; | ||
function disableCompatibilityMode() { | ||
compatibilityModeData_ = null; | ||
compatibilityModeData_ = undefined; | ||
} | ||
@@ -121,3 +121,3 @@ | ||
// Compatibility mode can be set via the __METAL_COMPATIBILITY__ global var. | ||
if (!compatibilityModeData_) { | ||
if (compatibilityModeData_ === undefined) { | ||
if (typeof window !== 'undefined' && window.__METAL_COMPATIBILITY__) { | ||
@@ -124,0 +124,0 @@ enableCompatibilityMode(window.__METAL_COMPATIBILITY__); |
@@ -17,5 +17,25 @@ 'use strict'; | ||
_createClass(string, null, [{ | ||
key: 'collapseBreakingSpaces', | ||
key: 'caseInsensitiveCompare', | ||
/** | ||
* Compares the given strings without taking the case into account. | ||
* @param {string|number} str1 | ||
* @param {string|number} str2 | ||
* @return {number} Either -1, 0 or 1, according to if the first string is | ||
* "smaller", equal or "bigger" than the second given string. | ||
*/ | ||
value: function caseInsensitiveCompare(str1, str2) { | ||
var test1 = String(str1).toLowerCase(); | ||
var test2 = String(str2).toLowerCase(); | ||
if (test1 < test2) { | ||
return -1; | ||
} else if (test1 === test2) { | ||
return 0; | ||
} else { | ||
return 1; | ||
} | ||
} | ||
/** | ||
* Removes the breaking spaces from the left and right of the string and | ||
@@ -27,2 +47,5 @@ * collapses the sequences of breaking spaces in the middle into single spaces. | ||
*/ | ||
}, { | ||
key: 'collapseBreakingSpaces', | ||
value: function collapseBreakingSpaces(str) { | ||
@@ -29,0 +52,0 @@ return str.replace(/[\t\r\n ]+/g, ' ').replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ''); |
{ | ||
"name": "metal", | ||
"version": "2.4.7", | ||
"version": "2.5.1", | ||
"description": "Core functions from Metal.js, with utilities for dealing with arrays, objects and others.", | ||
@@ -5,0 +5,0 @@ "license": "BSD-3-Clause", |
@@ -60,3 +60,3 @@ 'use strict'; | ||
export function disableCompatibilityMode() { | ||
compatibilityModeData_ = null; | ||
compatibilityModeData_ = undefined; | ||
} | ||
@@ -91,3 +91,3 @@ | ||
// Compatibility mode can be set via the __METAL_COMPATIBILITY__ global var. | ||
if (!compatibilityModeData_) { | ||
if (compatibilityModeData_ === undefined) { | ||
if (typeof window !== 'undefined' && window.__METAL_COMPATIBILITY__) { | ||
@@ -94,0 +94,0 @@ enableCompatibilityMode(window.__METAL_COMPATIBILITY__); |
@@ -5,2 +5,22 @@ 'use strict'; | ||
/** | ||
* Compares the given strings without taking the case into account. | ||
* @param {string|number} str1 | ||
* @param {string|number} str2 | ||
* @return {number} Either -1, 0 or 1, according to if the first string is | ||
* "smaller", equal or "bigger" than the second given string. | ||
*/ | ||
static caseInsensitiveCompare(str1, str2) { | ||
var test1 = String(str1).toLowerCase(); | ||
var test2 = String(str2).toLowerCase(); | ||
if (test1 < test2) { | ||
return -1; | ||
} else if (test1 === test2) { | ||
return 0; | ||
} else { | ||
return 1; | ||
} | ||
} | ||
/** | ||
* Removes the breaking spaces from the left and right of the string and | ||
@@ -7,0 +27,0 @@ * collapses the sequences of breaking spaces in the middle into single spaces. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58760
1695