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

@react-dnd/asap

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-dnd/asap - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

babel.config.cjs.js

25

package.json
{
"name": "@react-dnd/asap",
"version": "3.0.0",
"version": "4.0.0",
"description": "High-priority task queue for Node.js and browsers",

@@ -15,13 +15,18 @@ "keywords": [

},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/asap.esm.js",
"main": "dist/cjs/node/index.js",
"module": "dist/esm/browser/index.js",
"types": "lib/node/index.d.ts",
"react-native": {
"domain": false
},
"browser": {
"./asap": "./dist/esm/browser/asap.js",
"./asap.js": "./dist/esm/browser/asap.js",
"./raw": "./dist/esm/browser/raw.js",
"./raw.js": "./dist/esm/browser/raw.js"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"lint": "tsdx lint"
"build": "./scripts/build.sh",
"lint": "tsdx lint",
"test": "tsdx test"
},

@@ -42,2 +47,6 @@ "peerDependencies": {},

"@types/jest": "^24.0.23",
"@babel/core": "^7.7.5",
"@babel/cli": "^7.7.5",
"@babel/preset-env": "^7.7.5",
"babel-preset-env": "^1.7.0",
"husky": "^3.1.0",

@@ -44,0 +53,0 @@ "tsdx": "^0.11.0",

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

import { Task, Domain } from './types';
import { rawAsap } from './raw';
const freeTasks: Task[] = [];
/**
* Calls a task as soon as possible after returning, in its own event, with
* priority over IO events. An exception thrown in a task can be handled by
* `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
* crash the process. If the error is handled, all subsequent tasks will
* resume.
*
* @param {{call}} task A callable object, typically a function that takes no
* arguments.
*/
export function asap(task: Task) {
var rawTask;
if (freeTasks.length) {
rawTask = freeTasks.pop();
} else {
rawTask = new RawTask();
}
rawTask.task = task;
rawTask.domain = process.domain;
rawAsap(rawTask);
}
class RawTask {
public task: Task;
public domain: Domain;
public call() {
if (this.domain) {
this.domain.enter();
}
var threw = true;
try {
this.task.call();
threw = false;
// If the task throws an exception (presumably) Node.js restores the
// domain stack for the next event.
if (this.domain) {
this.domain.exit();
}
} finally {
// We use try/finally and a threw flag to avoid messing up stack traces
// when we catch and release errors.
if (threw) {
// In Node.js, uncaught exceptions are considered fatal errors.
// Re-throw them to interrupt flushing!
// Ensure that flushing continues if an uncaught exception is
// suppressed listening process.on("uncaughtException") or
// domain.on("error").
rawAsap.requestFlush();
}
// If the task threw an error, we do not want to exit the domain here.
// Exiting the domain would prevent the domain from catching the error.
this.task = null;
this.domain = null;
freeTasks.push(this);
}
}
}
export { asap as nodeAsap } from './node/asap';
export { asap as browserAsap } from './node/asap';
{
"include": ["src", "types", "test"],
"compilerOptions": {

@@ -10,3 +9,3 @@ "target": "es5",

"sourceMap": true,
"rootDir": "./",
"rootDir": "./src",
"strict": true,

@@ -24,3 +23,3 @@ "noImplicitAny": true,

"moduleResolution": "node",
"baseUrl": "./",
"baseUrl": "./src",
"paths": {

@@ -30,4 +29,6 @@ "*": ["src/*", "node_modules/*"]

"jsx": "react",
"esModuleInterop": true
}
"esModuleInterop": true,
"outDir": "lib"
},
"files": ["src/browser/index.ts", "src/node/index.ts"],
}
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