steampipes
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -153,2 +153,15 @@ // Generated by CoffeeScript 2.4.1 | ||
//----------------------------------------------------------------------------------------------------------- | ||
this.$filter = function(filter) { | ||
var type; | ||
if ((type = CND.type_of(filter)) !== 'function') { | ||
throw new Error(`^steampipes/$filter@5663^ expected a function, got a ${type}`); | ||
} | ||
return this.$((data, send) => { | ||
if (filter(data)) { | ||
return send(data); | ||
} | ||
}); | ||
}; | ||
//----------------------------------------------------------------------------------------------------------- | ||
this.$as_text = function(settings) { | ||
@@ -155,0 +168,0 @@ return (d, send) => { |
// Generated by CoffeeScript 2.4.1 | ||
(function() { | ||
//########################################################################################################### | ||
var $, $async, $show, $watch, CND, FS, OS, PATH, SP, alert, badge, debug, defer, echo, help, info, inspect, jr, log, read, rpr, test, urge, warn, whisper, xrpr; | ||
var $, $async, $show, $watch, CND, FS, OS, PATH, SP, alert, badge, debug, defer, echo, help, info, inspect, jr, log, read, rpr, test, urge, warn, whisper, xrpr, | ||
modulo = function(a, b) { return (+a % (b = +b) + b) % b; }; | ||
@@ -708,2 +709,31 @@ CND = require('cnd'); | ||
//----------------------------------------------------------------------------------------------------------- | ||
this["$filter"] = async function(T, done) { | ||
var error, matcher, probe; | ||
[probe, matcher, error] = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 3, 5, 7, 9], null]; | ||
await T.perform(probe, matcher, error, function() { | ||
return new Promise(function(resolve, reject) { | ||
var R, pipeline, source; | ||
R = []; | ||
source = probe; | ||
//....................................................................................................... | ||
pipeline = []; | ||
pipeline.push(source); | ||
pipeline.push(SP.$filter(function(d) { | ||
return (modulo(d, 2)) === 1; | ||
})); | ||
// pipeline.push SP.$watch ( d ) -> info xrpr d | ||
pipeline.push(SP.$drain(function(values) { | ||
// urge values | ||
return resolve(values); | ||
})); | ||
SP.pull(...pipeline); | ||
return null; | ||
}); | ||
}); | ||
//......................................................................................................... | ||
done(); | ||
return null; | ||
}; | ||
/* | ||
@@ -1039,5 +1069,4 @@ | ||
if (module.parent == null) { | ||
test(this, { | ||
'timeout': 30000 | ||
}); | ||
// test @, 'timeout': 30000 | ||
test(this["$filter"]); | ||
} | ||
@@ -1044,0 +1073,0 @@ |
{ | ||
"name": "steampipes", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Fast, simple data pipelines", | ||
@@ -31,9 +31,9 @@ "main": "lib/main.js", | ||
"intertype": "^2.5.0", | ||
"letsfreezethat": "^1.1.1", | ||
"multimix": "^2.0.0", | ||
"pipedreams": "^12.0.0" | ||
"letsfreezethat": "^2.2.5", | ||
"multimix": "^2.1.0", | ||
"pipedreams": "^12.1.0" | ||
}, | ||
"devDependencies": { | ||
"guy-test": "^1.4.0" | ||
"guy-test": "^1.4.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
901820
6363
- Removedletsfreezethat@1.1.1(transitive)
Updatedletsfreezethat@^2.2.5
Updatedmultimix@^2.1.0
Updatedpipedreams@^12.1.0