node-ejs-renderer/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v15.js
2024-06-09 13:55:01 -04:00

18 lines
717 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const v10_1 = tslib_1.__importDefault(require("./v10"));
const hasBuffer = typeof Buffer !== 'undefined';
const utf8Slice = hasBuffer ? Buffer.prototype.utf8Slice : null;
const from = hasBuffer ? Buffer.from : null;
exports.default = (buf, start, length) => {
const end = start + length;
return length > 8
? utf8Slice
? utf8Slice.call(buf, start, end)
: from
? from(buf).subarray(start, end).toString('utf8')
: (0, v10_1.default)(buf, start, length)
: (0, v10_1.default)(buf, start, length);
};
//# sourceMappingURL=v15.js.map