UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

7 lines (6 loc) 196 B
/** * Inserts a string value at a given index in a source string */ export function insertAtIndex(source, value, index) { return `${source.slice(0, index)}${value}${source.slice(index)}`; }