data.map((e, i) => (e ? i : -1)).filter((e) => e >= 0) Read more →
Month: July 2022
typescript camel case to snake case
// https://stackoverflow.com/a/54246501/1515209 export function camelToSnakeCase(str: string) { return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); } Read more →