const main = (dictionary: Record, data: string, onNotFound: string = "", seperator: string = " ") => { const arr: number[] = [] data.split(seperator).forEach(word => { const lookup: number | undefined = dictionary[word] if (typeof lookup === "number" && lookup !== NaN && lookup !== undefined) { arr.push(lookup) } }) return arr } export default main