Skip to content

Commit

Permalink
Merge pull request #99 from Cox-Automotive/suppress-buffer-warnings
Browse files Browse the repository at this point in the history
Suppress buffer warnings
  • Loading branch information
americk0 authored May 24, 2021
2 parents 0f2a7b8 + 86b9d02 commit ceea378
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 521 deletions.
2 changes: 1 addition & 1 deletion dist/alks.min.js

Large diffs are not rendered by default.

133 changes: 109 additions & 24 deletions dist/alks.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@
var require$$0 = /*@__PURE__*/getAugmentedNamespace(tslib_es6);

var name = "alks.js";
var version = "1.12.6";
var version$1 = "1.12.6";
var description = "JavaScript client for the ALKS API, usable in both modern browsers and node.js";
var main = "dist/alks.cjs.js";
var types = "dist/src/alks.d.ts";
var unpkg = "dist/alks.min.js";
var browser = "dist/alks.umd.js";
var browser$2 = "dist/alks.umd.js";
var module = "dist/alks.esm.js";
var scripts = {
rmdirs: "rimraf dist lib",
Expand Down Expand Up @@ -360,8 +360,7 @@
rimraf: "^3.0.2",
rollup: "^2.47.0",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"rollup-plugin-replace": "^2.2.0",
sinon: "^10.0.0",
tslib: "^2.2.0",
Expand All @@ -379,12 +378,12 @@
};
var require$$1 = {
name: name,
version: version,
version: version$1,
description: description,
main: main,
types: types,
unpkg: unpkg,
browser: browser,
browser: browser$2,
module: module,
scripts: scripts,
files: files,
Expand All @@ -404,8 +403,8 @@
};

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});

var lookup = [];
var revLookup = [];
Expand Down Expand Up @@ -608,6 +607,13 @@
return toString.call(arr) == '[object Array]';
};

/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @license MIT
*/

var INSPECT_MAX_BYTES = 50;

/**
Expand Down Expand Up @@ -2382,11 +2388,11 @@

var bufferEs6 = /*#__PURE__*/Object.freeze({
__proto__: null,
INSPECT_MAX_BYTES: INSPECT_MAX_BYTES,
kMaxLength: _kMaxLength,
Buffer: Buffer$1,
INSPECT_MAX_BYTES: INSPECT_MAX_BYTES,
SlowBuffer: SlowBuffer,
isBuffer: isBuffer
isBuffer: isBuffer,
kMaxLength: _kMaxLength
});

var require$$2 = /*@__PURE__*/getAugmentedNamespace(bufferEs6);
Expand Down Expand Up @@ -2990,16 +2996,95 @@
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
var title = 'browser';
var platform = 'browser';
var browser = true;
var env = {};
var argv = [];
var version = ''; // empty string to avoid regexp issues
var versions = {};
var release = {};
var config = {};

function noop() {}

var on = noop;
var addListener = noop;
var once = noop;
var off = noop;
var removeListener = noop;
var removeAllListeners = noop;
var emit = noop;

function binding$1(name) {
throw new Error('process.binding is not supported');
}

function cwd () { return '/' }
function chdir (dir) {
throw new Error('process.chdir is not supported');
}function umask() { return 0; }

// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
var performance = global$1.performance || {};
performance.now ||
var performanceNow =
performance.now ||
performance.mozNow ||
performance.msNow ||
performance.oNow ||
performance.webkitNow ||
function(){ return (new Date()).getTime() };

// generate timestamp or delta
// see http://nodejs.org/api/process.html#process_process_hrtime
function hrtime(previousTimestamp){
var clocktime = performanceNow.call(performance)*1e-3;
var seconds = Math.floor(clocktime);
var nanoseconds = Math.floor((clocktime%1)*1e9);
if (previousTimestamp) {
seconds = seconds - previousTimestamp[0];
nanoseconds = nanoseconds - previousTimestamp[1];
if (nanoseconds<0) {
seconds--;
nanoseconds += 1e9;
}
}
return [seconds,nanoseconds]
}

var startTime = new Date();
function uptime() {
var currentTime = new Date();
var dif = currentTime - startTime;
return dif / 1000;
}

var browser$1 = {
nextTick: nextTick,
title: title,
browser: browser,
env: env,
argv: argv,
version: version,
versions: versions,
on: on,
addListener: addListener,
once: once,
off: off,
removeListener: removeListener,
removeAllListeners: removeAllListeners,
emit: emit,
binding: binding$1,
cwd: cwd,
chdir: chdir,
umask: umask,
hrtime: hrtime,
platform: platform,
release: release,
config: config,
uptime: uptime
};

var inherits;
if (typeof Object.create === 'function'){
inherits = function inherits(ctor, superCtor) {
Expand Down Expand Up @@ -4103,7 +4188,7 @@

function chunkInvalid(state, chunk) {
var er = null;
if (!isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
if (!Buffer$1.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
er = new TypeError('Invalid non-string/buffer chunk');
}
return er;
Expand Down Expand Up @@ -5471,7 +5556,7 @@
// Fake the 'close' event, but only once 'end' fires
self.on('end', function() {
// The nextTick is necessary to prevent the 'request' module from causing an infinite loop
nextTick(function() {
browser$1.nextTick(function() {
self.emit('close');
});
});
Expand Down Expand Up @@ -5806,7 +5891,7 @@
try {
xhr.open(self._opts.method, self._opts.url, true);
} catch (err) {
nextTick(function() {
browser$1.nextTick(function() {
self.emit('error', err);
});
return
Expand Down Expand Up @@ -5852,7 +5937,7 @@
try {
xhr.send(body);
} catch (err) {
nextTick(function() {
browser$1.nextTick(function() {
self.emit('error', err);
});
return
Expand Down Expand Up @@ -12660,7 +12745,7 @@
this.write_in_progress = true;

var self = this;
nextTick(function() {
browser$1.nextTick(function() {
self.write_in_progress = false;
var res = self._write(flush, input, in_off, in_len, out, out_off, out_len);
self.callback(res[0], res[1]);
Expand Down Expand Up @@ -13020,7 +13105,7 @@
function zlibBufferSync(engine, buffer) {
if (typeof buffer === 'string')
buffer = new Buffer$1(buffer);
if (!isBuffer(buffer))
if (!Buffer$1.isBuffer(buffer))
throw new TypeError('Not a string or buffer');

var flushFlag = binding.Z_FINISH;
Expand Down Expand Up @@ -13136,7 +13221,7 @@
}

if (opts.dictionary) {
if (!isBuffer(opts.dictionary)) {
if (!Buffer$1.isBuffer(opts.dictionary)) {
throw new Error('Invalid dictionary: it should be a Buffer instance');
}
}
Expand Down Expand Up @@ -13204,7 +13289,7 @@
}
});
} else {
nextTick(callback);
browser$1.nextTick(callback);
}
};

Expand All @@ -13228,7 +13313,7 @@

if (ws.ended) {
if (callback)
nextTick(callback);
browser$1.nextTick(callback);
} else if (ws.ending) {
if (callback)
this.once('end', callback);
Expand All @@ -13245,7 +13330,7 @@

Zlib.prototype.close = function(callback) {
if (callback)
nextTick(callback);
browser$1.nextTick(callback);

if (this._closed)
return;
Expand All @@ -13255,7 +13340,7 @@
this._binding.close();

var self = this;
nextTick(function() {
browser$1.nextTick(function() {
self.emit('close');
});
};
Expand All @@ -13266,7 +13351,7 @@
var ending = ws.ending || ws.ended;
var last = ending && (!chunk || ws.length === chunk.length);

if (!chunk === null && !isBuffer(chunk))
if (!chunk === null && !Buffer$1.isBuffer(chunk))
return cb(new Error('invalid input'));

// If it's the last chunk, or a final flush, we use the Z_FINISH flush flag.
Expand Down
Loading

0 comments on commit ceea378

Please sign in to comment.