UNPKG

actionhero

Version:

actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks

25 lines (24 loc) 561 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.arrayStartingMatch = void 0; /** Compare the first n elements of an array with another, longer array */ function arrayStartingMatch(a, b) { if (a.length === 0) { return false; } if (b.length === 0) { return false; } let matching = true; let i = 0; while (i < a.length) { if (a[i] !== b[i]) { matching = false; } i++; } return matching; } exports.arrayStartingMatch = arrayStartingMatch;