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

task

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

task - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

2

package.json
{
"name": "task",
"version": "1.0.2",
"version": "1.1.0",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "bin": {

const getFn = require('./util/get-fn')
const DONE_COMPUTE = ['done', 'compute']
const DONE = ['done']

@@ -15,3 +17,7 @@ exports.props = {

const afterall = (val, stamp, d) => {
if (aftertasks.every(key => tasks.get([key, 'done', 'compute']))) {
const alldone = aftertasks.every(key => Array.isArray(key)
? tasks.get(key.concat(DONE_COMPUTE))
: tasks.get([key, 'done', 'compute'])
)
if (alldone) {
if (fn) {

@@ -25,3 +31,5 @@ task.set({ done: false }, false)

aftertasks.forEach(key => {
const done = tasks.get([key, 'done'], {})
const done = Array.isArray(key)
? tasks.get(key.concat(DONE), {})
: tasks.get([key, 'done'], {})
done.on(afterall, after.path().join('.'))

@@ -28,0 +36,0 @@ afterall(done.compute(), stamp)

@@ -64,1 +64,31 @@ const test = require('tape')

})
test('use after paths', { timeout: 500 }, t => {
t.plan(1)
ploy.get('tasks', {}).set({
bla: {
tasks: {
one: () => new Promise(resolve => resolve({
result: 'xxx',
done: true
}))
}
},
foo: {
val: task => new Promise(resolve => resolve({
result: task.get('options', {}).serialize(true),
done: true
})),
options: {
val: [ '@', 'root', 'tasks', 'bla', 'tasks', 'one', 'result' ],
$transform: val => val + '!'
},
after: [ ['bla', 'tasks', 'one'] ]
}
})
ploy.get(['tasks', 'foo', 'result'], {})
.once(val => val.val === 'xxx!')
.then(() => t.pass('correct output'))
})
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