Drenmi/sludge

View on GitHub
src/traits/container.js

Summary

Maintainability
A
0 mins
Test Coverage
const _ = require("lodash")
 
const Container = {
name: "container",
attributes: {
contents: []
},
actions: {
add: function(...things) {
_.each(things, (thing) => this.contents.push(thing))
},
remove: function(...things) {
_.each(things, (thing) => _.pull(this.contents, thing))
}
}
}
 
module.exports = Container