UNPKG

@azizbecha/strkit

Version:

strkit is a utility library offering a collection of essential string functions including validation, case conversion, truncation, and more. Ideal for both JavaScript and TypeScript developers to simplify string operations in their applications.

30 lines 897 B
/** * Reverses the characters in a given string. * * This function takes an input string and returns a new string * with the characters in reverse order. * * @param str - The string to reverse. * @returns The reversed string. * * @example * reverse('hello'); // "olleh" * reverse('12345'); // "54321" */ (function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = reverse; function reverse(str) { return str.split('').reverse().join(''); } }); //# sourceMappingURL=reverse.js.map