UNPKG

@qntm-code/utils

Version:

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

11 lines (10 loc) 337 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.insertAtIndex = void 0; /** * Inserts a string value at a given index in a source string */ function insertAtIndex(source, value, index) { return `${source.slice(0, index)}${value}${source.slice(index)}`; } exports.insertAtIndex = insertAtIndex;