@rzl-zone/utils-js
Version:
A modern, lightweight set of JavaScript utility functions with TypeScript support for everyday development, crafted to enhance code readability and maintainability.
25 lines (22 loc) • 670 B
JavaScript
/*!
* ====================================================
* Rzl Utils-JS.
* ----------------------------------------------------
* Version: 3.11.0.
* Author: Rizalvin Dwiky.
* Repository: https://github.com/rzl-zone/utils-js.
* ====================================================
*/
import { isNonEmptyString, isPlainObject } from './chunk-MSUW5VHZ.js';
var removeSpaces = (value, options = {
trimOnly: false
}) => {
if (!isNonEmptyString(value)) return "";
if (!isPlainObject(options)) {
options = {};
}
const { trimOnly = false } = options;
if (trimOnly) return value.trim();
return value.replace(/\s+/g, "");
};
export { removeSpaces };