@n3okill/utils
Version:
Many javascript helpers
18 lines • 801 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.trimLeft = trimLeft;
const detectEncoding_1 = require("./detectEncoding");
const toString_1 = require("./toString");
const trimLeft_1 = require("../string/trimLeft");
const _internal_1 = require("./_internal");
/**
* Remove given characters from the left side of the buffer
* @param s Buffer to remove the characters from
* @param chars The characters to remove if not defined removes empty spaces.
* @returns Trimmed Buffer
*/
function trimLeft(s, chars = []) {
const encoding = (0, detectEncoding_1.detectEncoding)(s);
return Buffer.from((0, trimLeft_1.trimLeft)((0, toString_1.toString)(s, encoding), chars.map((s) => (0, _internal_1._toString)(s))), encoding);
}
//# sourceMappingURL=trimLeft.js.map
;