tethys-feature-service/node_modules/proj4/lib/match.js

18 lines
444 B
JavaScript
Raw Normal View History

2023-10-02 13:04:02 +00:00
var ignoredChar = /[\s_\-\/\(\)]/g;
export default function match(obj, key) {
if (obj[key]) {
return obj[key];
}
var keys = Object.keys(obj);
var lkey = key.toLowerCase().replace(ignoredChar, '');
var i = -1;
var testkey, processedKey;
while (++i < keys.length) {
testkey = keys[i];
processedKey = testkey.toLowerCase().replace(ignoredChar, '');
if (processedKey === lkey) {
return obj[testkey];
}
}
}