MCPcopy Create free account
hub / github.com/sql-js/sql.js / trim

Function trim

js/sql-debug.js:1634–1645  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

1632 from = PATH.resolve(from).substr(1);
1633 to = PATH.resolve(to).substr(1);
1634 function trim(arr) {
1635 var start = 0;
1636 for (; start < arr.length; start++) {
1637 if (arr[start] !== '') break;
1638 }
1639 var end = arr.length - 1;
1640 for (; end >= 0; end--) {
1641 if (arr[end] !== '') break;
1642 }
1643 if (start > end) return [];
1644 return arr.slice(start, end - start + 1);
1645 }
1646 var fromParts = trim(from.split('/'));
1647 var toParts = trim(to.split('/'));
1648 var length = Math.min(fromParts.length, toParts.length);

Callers 1

sql-debug.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…