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

conclure

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conclure - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

4

package.json
{
"name": "conclure",
"version": "2.0.1",
"version": "2.1.0",
"description": "Generator runner",

@@ -41,4 +41,4 @@ "type": "module",

"devDependencies": {
"ava": "^3.15.0"
"ava": "^4.3.3"
}
}

@@ -27,18 +27,10 @@ const TYPE = '@@conclude-effect';

const running = new WeakMap();
const resultCache = new WeakMap();
const finishWatchers = new WeakMap();
const running = Symbol.for('@@conclude-running');
const resultCache = Symbol.for('@@conclude-result');
const finishWatchers = Symbol.for('@@conclude-watchers');
export function inProgress(it) {
return running.has(it);
}
export const inProgress = it => running in it;
export const finished = it => resultCache in it;
export const getResult = it =>it[resultCache];
export function finished(it) {
return resultCache.has(it);
}
export function getResult(it) {
return resultCache.get(it);
}
export function whenFinished(it, callback) {

@@ -50,10 +42,10 @@ if (!isFlow(it)) {

if (resultCache.has(it)) {
callback(resultCache.get(it));
if (resultCache in it) {
callback(it[resultCache]);
return noop;
}
let watchers = finishWatchers.get(it);
let watchers = it[finishWatchers];
if (!watchers) finishWatchers.set(it, watchers = new Set([callback]));
if (!watchers) watchers = it[finishWatchers] = new Set([callback]);
else watchers.add(callback);

@@ -65,7 +57,7 @@

function finalize(it, payload) {
resultCache.set(it, payload);
running.delete(it);
it[resultCache] = payload;
delete it[running];
for (let cb of finishWatchers.get(it) || []) cb(payload);
finishWatchers.delete(it);
for (let cb of it[finishWatchers] || []) cb(payload);
delete it[finishWatchers];
}

@@ -81,4 +73,4 @@

if (resultCache.has(it)) {
const { result, error, cancelled } = resultCache.get(it);
if (resultCache in it) {
const { result, error, cancelled } = it[resultCache];

@@ -93,4 +85,4 @@ if (cancelled) return noop;

if (running.has(it)) {
const subscribe = running.get(it);
if (running in it) {
const subscribe = it[running];
return subscribe(callback);

@@ -113,3 +105,3 @@ }

if (subscribers.size === 0 && !resultCache.has(it)) {
if (subscribers.size === 0 && !(resultCache in it)) {
finalize(it, { cancelled: true });

@@ -121,3 +113,3 @@ cancel();

running.set(it, subscribe);
it[running] = subscribe;

@@ -124,0 +116,0 @@ const unsubscribe = subscribe(callback);

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