UNPKG

mongo2elastic

Version:
14 lines (13 loc) 484 B
export const indexFromCollection = (collection) => collection.collectionName.toLowerCase(); export const indexFromDbAndCollection = (collection) => `${collection.dbName.toLowerCase()}_${collection.collectionName.toLowerCase()}`; /** * Does arr start with startsWith array. */ export const arrayStartsWith = (arr, startsWith) => { for (let i = 0; i < startsWith.length; i++) { if (arr[i] !== startsWith[i]) { return false; } } return true; };