MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / commonPrefix

Function commonPrefix

tests/test_code/js/moment/moment.js:2029–2038  ·  view source on GitHub ↗
(arr1, arr2)

Source from the content-addressed store, hash-verified

2027 globalLocale;
2028
2029 function commonPrefix(arr1, arr2) {
2030 var i,
2031 minl = Math.min(arr1.length, arr2.length);
2032 for (i = 0; i < minl; i += 1) {
2033 if (arr1[i] !== arr2[i]) {
2034 return i;
2035 }
2036 }
2037 return minl;
2038 }
2039
2040 function normalizeLocale(key) {
2041 return key ? key.toLowerCase().replace('_', '-') : key;

Callers 1

chooseLocaleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected