123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.copy = exports.isBuffer = void 0;
- const isBufferExists = typeof Buffer !== 'undefined';
- const isBufferFromExists = isBufferExists && typeof Buffer.from !== 'undefined';
- const isBuffer = isBufferExists ?
- function isBuffer(value) {
- return Buffer.isBuffer(value);
- } :
- function isBuffer() {
- return false;
- };
- exports.isBuffer = isBuffer;
- const copy = isBufferFromExists ?
- function copy(value) {
- return Buffer.from(value);
- } : isBufferExists ?
- function copy(value) {
- return new Buffer(value);
- } :
- function copy(value) {
- return value;
- };
- exports.copy = copy;
|