-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chainy data type checking troubles #20
Comments
not sure what the exact problem is, however your |
That's how I had it originally but it just appended one file and then stopped the loop instead of eaching through. The problem above is that the each isn't iterating. It's treating the object as a single piece of data instead of iterating through it. Maybe I need to work with complete() here is the issue. |
.each((itemValue, itemIndex, complete) => {
let name = mpath.get(item_name, itemValue);
debugger;
fs.appendFile(path, template(itemValue, name), (err) => {
if (err) return complete(err);
console.log(`The ${name} was appended to file!`);
return complete();
});
}, {concurrency: 0}) |
For the each issue, check how it works: https://github.com/chainy-plugins/each Perhaps use |
Yes I tried it with an chainy.set().
.action('currentValue', function(){
if (typeof data === object){
return next(null, data.feed());
} Something like that. |
Howdy, I've been trying to do a type check in my data before it runs through a chainy.each() but the way it is now it keeps thinking the data in chainy.set() is the entire object and it doesn't each() through it. However .set(data) was the exact same way I had it written before my type checking so am not sure what's going astray here:
Thanks for any tips. 😃
The text was updated successfully, but these errors were encountered: