UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

18 lines (17 loc) 555 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.detokenize = void 0; /** * Rebuilds a string from tokens with a specified glue (separator). * * Example: detokenize(["Hello", "world"], " ") → "Hello world" * * @author @dailker * @param {string[]} tokens - Array of tokens. * @param {string} [glue=" "] - Separator to use between tokens. * @returns {string} The detokenized string. */ function detokenize(tokens, glue = ' ') { return tokens.join(glue); } exports.detokenize = detokenize;