@bekiryilmaz/jstoolbox
v1.0.4
Published
This package contains a collection of utility functions and components for JavaScript and React development. It includes functions for data manipulation, DOM manipulation, and more. The package is designed to be lightweight and easy to use, making it a gr
Readme
jstoolbox
A lightweight utility library for JavaScript and TypeScript projects, providing helpers for text manipulation, Turkish character handling, object utilities, and more.
Installation
npm install @bekiryilmaz/jstoolboxUsage
// Turkish case conversions
TextHelper.TurkishToUpper('istanbul'); // "İSTANBUL"
TextHelper.TurkishToLower('İSTANBUL'); // "istanbul"
// Remove Turkish characters
TextHelper.RemoveTurkishChars('Çalışma'); // "Calisma"
// Create a slug
TextHelper.CreateSlug('Merhaba Dünya!'); // "merhaba-dunya"
// Shorten text
TextHelper.ShortenText('Lorem ipsum dolor sit amet', 10); // "Lorem ips..."
// Sanitize string
TextHelper.SanitizeString('Hello@#% World!'); // "Hello World"
// Check if string is lower case
TextHelper.IsLowerCase('istanbul'); // true
// Validate JSON
TextHelper.isValidJson('{"a":1}'); // true
// Encode/Decode HTML
TextHelper.EncodeHTML('<div>'); // "<div>"
TextHelper.DecodeHTML('<div>'); // "<div>"
// Format number
TextHelper.FormatNumber(1234567); // "1,234,567"
// Check if value is null
IsNull(null); // true
IsNull(""); // true
IsNull("null"); // true
IsNull("something"); // false