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

dexie-batch

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dexie-batch - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

2

dist/dexie-batch.js

@@ -1,2 +0,2 @@

/*! dexie-batch v0.4.0 | github.com/raphinesse/dexie-batch | MIT License */
/*! dexie-batch v0.4.1 | github.com/raphinesse/dexie-batch | MIT License */
(function (global, factory) {

@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('dexie')) :

@@ -1,3 +0,3 @@

/*! dexie-batch v0.4.0 | github.com/raphinesse/dexie-batch | MIT License */
/*! dexie-batch v0.4.1 | github.com/raphinesse/dexie-batch | MIT License */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dexie")):"function"==typeof define&&define.amd?define(["dexie"],e):t.DexieBatch=e(t.Dexie)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},n=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),r=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&l.return&&l.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=t.Promise;function o(t,e){if(arguments.length<2)throw new Error('Arguments "collection" and "callback" are mandatory');if(!(n=t)||!["clone","offset","limit","toArray"].every(function(t){return"function"==typeof n[t]}))throw new Error('"collection" must be of type Collection');var n;if("function"!=typeof e)throw new TypeError('"callback" must be a function')}return function(){function t(n){e(this,t),function(t){var e=t&&t.batchSize;if(!(e&&Number.isInteger(e)&&e>0))throw new Error('Mandatory option "batchSize" must be a positive integer');if("limit"in t&&!(Number.isInteger(t.limit)&&t.limit>=0))throw new Error('Option "limit" must be a non-negative integer')}(n),this.opts=n}return n(t,[{key:"isParallel",value:function(){return Boolean(this.opts.limit)}},{key:"each",value:function(t,e){var n=this;return o.apply(void 0,arguments),this.eachBatch(t,function(t,r){var o=r*n.opts.batchSize;return i.all(t.map(function(t,n){return e(t,o+n)}))})}},{key:"eachBatch",value:function(t,e){return o.apply(void 0,arguments),this[this.isParallel()?"eachBatchParallel":"eachBatchSerial"](t,e)}},{key:"eachBatchParallel",value:function(t,e){if(o.apply(void 0,arguments),!this.opts.limit)throw new Error('Option "limit" must be set for parallel operation');for(var n=this.opts.batchSize,r=[],a=function(i){var o=t.clone().offset(i*n).limit(n).toArray().then(function(t){return e(t,i)});r.push(o)},l=0;l*n<this.opts.limit;l++)a(l);return i.all(r).then(function(t){return t.length})}},{key:"eachBatchSerial",value:function(t,e){var n=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;o.apply(void 0,arguments);var l=this.opts.batchSize;return t.clone().limit(l).toArray().then(function(o){if(0===o.length)return 0;var u=e(o,a),c=n.eachBatchSerial(t.clone().offset(l),e,a+1);return i.all([u,c]).then(function(t){return r(t,2)[1]+1})})}}]),t}()});
//# sourceMappingURL=dexie-batch.min.js.map
{
"name": "dexie-batch",
"version": "0.4.0",
"version": "0.4.1",
"description": "Fetch DB entries in batches to improve performance while respecting IPC size constraints",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1,2 +0,2 @@

# `dexie-batch`
# dexie-batch [![Build Status](https://travis-ci.org/raphinesse/dexie-batch.svg?branch=master)](https://travis-ci.org/raphinesse/dexie-batch)

@@ -3,0 +3,0 @@ Fetch IndexedDB entries in batches to improve performance while avoiding errors like *Maximum IPC message size exceeded*.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc