diginext-utils
Version:
README.md
21 lines (20 loc) • 630 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.trimNull = void 0;
const trim_1 = __importDefault(require("lodash/trim"));
function trimNull(str) {
if (!str)
return "";
str = str.toString();
str = str.replace(/\0/g, "");
while (str.indexOf(" ") >= 0) {
str = str.replace(/ /g, " ");
}
str = (0, trim_1.default)(str);
return str;
}
exports.trimNull = trimNull;
exports.default = trimNull;