Skip to content

Instantly share code, notes, and snippets.

View 8mist's full-sized avatar

Grégoire Ciles 8mist

View GitHub Profile
export type RecursiveKeyOf<
TObj,
TPrefix extends string = ''
> = TObj extends Record<string, any>
? {
[K in keyof TObj & string]:
| `${TPrefix}${K}`
| RecursiveKeyOf<TObj[K], `${TPrefix}${K}.`>;
}[keyof TObj & string]
: never;
@8mist
8mist / spanify.js
Last active November 16, 2022 08:18
const createSpan = (text) => {
const node = document.createElement("span");
node.textContent = text;
return node;
};
const insertBetweenElementWhitespace = (elements) =>
elements.reduce((acc, span) => acc.concat(span, " "), []).slice(0, -1);
const spanifyText = text => {