Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tipe/databox-loader

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tipe/databox-loader - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

2

package.json
{
"name": "@tipe/databox-loader",
"version": "0.3.6",
"version": "0.3.7",
"description": "Tipe Databox Loader for talking with Databox",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -15,20 +15,18 @@ const fetch = require('node-fetch')

function execBatch(url) {
setTimeout(function() {
const _queue = []
const _defers = []
exports.queue.forEach(task => {
_queue.push(task.task)
_defers.push(task.deferred)
task.task = null
task.deferred = null
})
databoxFetch(url, _queue)
exports.queue = []
exports._defer = defer()
exports._batching = null
exports._timer = null
}, exports.delay)
const _queue = []
const _defers = []
exports.queue.forEach(task => {
_queue.push(task.task)
_defers.push(task.deferred)
task.task = null
task.deferred = null
})
execDataboxFetch(url, _queue, _defers)
exports.queue = []
exports._defer = defer()
exports._batching = null
exports._timer = null
}
function databoxFetch(url, tasks, promises) {
function execDataboxFetch(url, tasks, promises) {
return fetch(`${url}/batch`, {

@@ -52,4 +50,4 @@ method: 'POST',

function databoxFetch(url, model, action, body, methods = []) {
const task = { model, action, body: {query: body, methods} }
function databoxFetch(url, model, action, query, methods = []) {
const task = { model, action, body: {query, methods} }
const deferred = defer()

@@ -60,3 +58,4 @@ if (exports._batching) {

exports._batching = true
exports._timer = setTimeout(execBatch.bind(null, url))
exports.queue.push({task: task, deferred: deferred})
exports._timer = setTimeout(execBatch.bind(null, url), exports.delay)
}

@@ -63,0 +62,0 @@ return deferred.promise

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