New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-buffer-cache-worker

Package Overview
Dependencies
Maintainers
1
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-buffer-cache-worker - npm Package Compare versions

Comparing version

to
3.0.12

156

build/es5/bundle.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('babel-runtime/helpers/classCallCheck'), require('babel-runtime/helpers/createClass'), require('worker-factory')) :
typeof define === 'function' && define.amd ? define(['babel-runtime/helpers/classCallCheck', 'babel-runtime/helpers/createClass', 'worker-factory'], factory) :
(factory(global._classCallCheck,global._createClass,global.workerFactory));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('babel-runtime/helpers/classCallCheck'), require('babel-runtime/helpers/createClass'), require('worker-factory')) :
typeof define === 'function' && define.amd ? define(['babel-runtime/helpers/classCallCheck', 'babel-runtime/helpers/createClass', 'worker-factory'], factory) :
(factory(global._classCallCheck,global._createClass,global.workerFactory));
}(this, (function (_classCallCheck,_createClass,workerFactory) { 'use strict';
_classCallCheck = _classCallCheck && _classCallCheck.hasOwnProperty('default') ? _classCallCheck['default'] : _classCallCheck;
_createClass = _createClass && _createClass.hasOwnProperty('default') ? _createClass['default'] : _createClass;
_classCallCheck = _classCallCheck && _classCallCheck.hasOwnProperty('default') ? _classCallCheck['default'] : _classCallCheck;
_createClass = _createClass && _createClass.hasOwnProperty('default') ? _createClass['default'] : _createClass;
var ArrayBufferStore = function () {
function ArrayBufferStore() {
_classCallCheck(this, ArrayBufferStore);
var ArrayBufferStore = function () {
function ArrayBufferStore() {
_classCallCheck(this, ArrayBufferStore);
this._store = new Map();
}
this._store = new Map();
}
_createClass(ArrayBufferStore, [{
key: "clone",
value: function clone(id) {
var arrayBuffer = this._store.get(id);
if (arrayBuffer === undefined) {
throw new Error("There is no arrayBuffer stored with an id called \"" + id + "\".");
_createClass(ArrayBufferStore, [{
key: "clone",
value: function clone(id) {
var arrayBuffer = this._store.get(id);
if (arrayBuffer === undefined) {
throw new Error("There is no arrayBuffer stored with an id called \"" + id + "\".");
}
return arrayBuffer.slice(0);
}
return arrayBuffer.slice(0);
}
}, {
key: "purge",
value: function purge(id) {
var arrayBufferExisted = this._store.delete(id);
if (!arrayBufferExisted) {
throw new Error("There is no arrayBuffer stored with an id called \"" + id + "\".");
}, {
key: "purge",
value: function purge(id) {
var arrayBufferExisted = this._store.delete(id);
if (!arrayBufferExisted) {
throw new Error("There is no arrayBuffer stored with an id called \"" + id + "\".");
}
}
}
}, {
key: "slice",
value: function slice(id, begin, end) {
var arrayBuffer = this._store.get(id);
if (arrayBuffer === undefined) {
throw new Error("There is no arrayBuffer stored with an id called \"" + id + "\".");
}
if (begin < 0 || begin > arrayBuffer.byteLength) {
throw new Error("The given value for begin \"" + begin + "\" is out of bounds.");
}
if (end !== null) {
if (end > arrayBuffer.byteLength) {
throw new Error("The given value for end \"" + end + "\" is out of bounds.");
}, {
key: "slice",
value: function slice(id, begin, end) {
var arrayBuffer = this._store.get(id);
if (arrayBuffer === undefined) {
throw new Error("There is no arrayBuffer stored with an id called \"" + id + "\".");
}
if (end < begin) {
throw new Error("The given value for end \"" + end + "\" is below the given value for begin \"" + begin + "\".");
if (begin < 0 || begin > arrayBuffer.byteLength) {
throw new Error("The given value for begin \"" + begin + "\" is out of bounds.");
}
if (end !== null) {
if (end > arrayBuffer.byteLength) {
throw new Error("The given value for end \"" + end + "\" is out of bounds.");
}
if (end < begin) {
throw new Error("The given value for end \"" + end + "\" is below the given value for begin \"" + begin + "\".");
}
}
return arrayBuffer.slice(begin, end === null ? arrayBuffer.byteLength : end);
}
return arrayBuffer.slice(begin, end === null ? arrayBuffer.byteLength : end);
}
}, {
key: "store",
value: function store(id, arrayBuffer) {
if (this._store.has(id)) {
throw new Error("There is already an arrayBuffer stored with an id called \"" + id + "\".");
}, {
key: "store",
value: function store(id, arrayBuffer) {
if (this._store.has(id)) {
throw new Error("There is already an arrayBuffer stored with an id called \"" + id + "\".");
}
this._store.set(id, arrayBuffer);
}
this._store.set(id, arrayBuffer);
}
}]);
}]);
return ArrayBufferStore;
}();
return ArrayBufferStore;
}();
var arrayBufferStore = new ArrayBufferStore();
workerFactory.createWorker(self, {
clone: function clone(_ref) {
var arrayBufferId = _ref.arrayBufferId;
var arrayBufferStore = new ArrayBufferStore();
workerFactory.createWorker(self, {
clone: function clone(_ref) {
var arrayBufferId = _ref.arrayBufferId;
var arrayBuffer = arrayBufferStore.clone(arrayBufferId);
return { result: arrayBuffer, transferables: [arrayBuffer] };
},
purge: function purge(_ref2) {
var arrayBufferId = _ref2.arrayBufferId;
var arrayBuffer = arrayBufferStore.clone(arrayBufferId);
return { result: arrayBuffer, transferables: [arrayBuffer] };
},
purge: function purge(_ref2) {
var arrayBufferId = _ref2.arrayBufferId;
arrayBufferStore.purge(arrayBufferId);
return { result: null };
},
slice: function slice(_ref3) {
var arrayBufferId = _ref3.arrayBufferId,
begin = _ref3.begin,
end = _ref3.end;
arrayBufferStore.purge(arrayBufferId);
return { result: null };
},
slice: function slice(_ref3) {
var arrayBufferId = _ref3.arrayBufferId,
begin = _ref3.begin,
end = _ref3.end;
var arrayBuffer = arrayBufferStore.slice(arrayBufferId, begin, end);
return { result: arrayBuffer, transferables: [arrayBuffer] };
},
store: function store(_ref4) {
var arrayBuffer = _ref4.arrayBuffer,
arrayBufferId = _ref4.arrayBufferId;
var arrayBuffer = arrayBufferStore.slice(arrayBufferId, begin, end);
return { result: arrayBuffer, transferables: [arrayBuffer] };
},
store: function store(_ref4) {
var arrayBuffer = _ref4.arrayBuffer,
arrayBufferId = _ref4.arrayBufferId;
arrayBufferStore.store(arrayBufferId, arrayBuffer);
return { result: null };
}
});
arrayBufferStore.store(arrayBufferId, arrayBuffer);
return { result: null };
}
});
})));

@@ -6,11 +6,18 @@ {

},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"dependencies": {
"babel-runtime": "^6.26.0",
"tslib": "^1.9.0",
"worker-factory": "^2.2.1"
"worker-factory": "^2.2.3"
},
"description": "The worker which is used by the array-buffer-cache package.",
"devDependencies": {
"@commitlint/cli": "^6.1.3",
"@commitlint/config-angular": "^6.1.3",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.3",
"babel-loader": "^7.1.4",
"babel-plugin-external-helpers": "^6.22.0",

@@ -20,5 +27,7 @@ "babel-plugin-transform-runtime": "^6.23.0",

"chai": "^4.1.2",
"eslint": "^4.18.1",
"eslint-config-holy-grail": "^25.0.0",
"greenkeeper-lockfile": "^1.13.2",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.1.0",
"eslint": "^4.19.0",
"eslint-config-holy-grail": "^26.0.0",
"greenkeeper-lockfile": "^1.14.0",
"grunt": "^1.0.2",

@@ -30,3 +39,3 @@ "grunt-cli": "^1.2.0",

"grunt-tslint": "^5.0.0",
"grunt-webpack": "^3.0.2",
"grunt-webpack": "^3.1.1",
"gruntify-eslint": "^4.0.0",

@@ -42,19 +51,19 @@ "husky": "^0.14.3",

"karma-sinon-chai": "^1.3.3",
"karma-webpack": "^2.0.11",
"karma-webpack": "^2.0.13",
"load-grunt-config": "^0.19.2",
"mocha": "^5.0.1",
"rollup": "^0.56.3",
"mocha": "^5.0.4",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.3",
"sinon": "^4.4.2",
"sinon-chai": "^2.14.0",
"ts-loader": "^4.0.0",
"tsconfig-holy-grail": "^4.0.0",
"sinon": "^4.4.6",
"sinon-chai": "^3.0.0",
"ts-loader": "^4.1.0",
"tsconfig-holy-grail": "^4.0.1",
"tslint": "^5.9.1",
"tslint-config-holy-grail": "^22.0.6",
"tslint-config-holy-grail": "^23.0.3",
"typescript": "^2.7.2",
"webpack": "^4.0.0"
"webpack": "^4.1.1"
},
"files": [
"build/es2015/",
"build/es5/",
"build/es2015/",
"build/esm/",

@@ -73,2 +82,3 @@ "src/"

"scripts": {
"commitmsg": "commitlint --edit --extends @commitlint/config-angular",
"precommit": "grunt lint",

@@ -79,3 +89,3 @@ "prepublishOnly": "grunt build",

"types": "build/es2015/module.d.ts",
"version": "3.0.11"
"version": "3.0.12"
}