v15.js 717 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const tslib_1 = require("tslib");
  4. const v10_1 = tslib_1.__importDefault(require("./v10"));
  5. const hasBuffer = typeof Buffer !== 'undefined';
  6. const utf8Slice = hasBuffer ? Buffer.prototype.utf8Slice : null;
  7. const from = hasBuffer ? Buffer.from : null;
  8. exports.default = (buf, start, length) => {
  9. const end = start + length;
  10. return length > 8
  11. ? utf8Slice
  12. ? utf8Slice.call(buf, start, end)
  13. : from
  14. ? from(buf).subarray(start, end).toString('utf8')
  15. : (0, v10_1.default)(buf, start, length)
  16. : (0, v10_1.default)(buf, start, length);
  17. };
  18. //# sourceMappingURL=v15.js.map