diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-19 02:27:52 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-19 02:27:52 +0200 |
| commit | 9c5b96aec109f7b37cb2c861525a084a65a817ea (patch) | |
| tree | 3aa2f97b5134892a9f227c6c8fdc8cd778679771 /lib | |
| parent | 2f2c1ef4029dee17be0d16acdd60b7d1718d519f (diff) | |
adding tasks
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/db/model.js | 5 | ||||
| -rw-r--r-- | lib/vendor/Loader.js | 9 |
2 files changed, 3 insertions, 11 deletions
diff --git a/lib/db/model.js b/lib/db/model.js index f174656..1f729f6 100644 --- a/lib/db/model.js +++ b/lib/db/model.js @@ -108,7 +108,6 @@ module.exports = function modelScope(type, db_model, _props) { create: (data) => { return new Promise( (resolve, reject) => { crud.create( model.sanitize(data) ).then( (data) => { - console.log('yooooooo') resolve(data.toJSON()) props.afterCreate && props.afterCreate(data) }).catch( (e) => { @@ -140,16 +139,12 @@ module.exports = function modelScope(type, db_model, _props) { sanitize: (data) => { var valid = {} - console.log('yooooooo') Object.keys(data).forEach(key => { - console.log('yooooooo2', key) if (props.hasOne[key]) { return } - console.log('yooooooo3') valid[key] = data[key] }) - console.log('yooooooo4') console.log(valid) return valid }, diff --git a/lib/vendor/Loader.js b/lib/vendor/Loader.js index 2668267..ad42b17 100644 --- a/lib/vendor/Loader.js +++ b/lib/vendor/Loader.js @@ -41,12 +41,9 @@ module.exports = (function(){ // (boolean) Is the loader ready? Loader.prototype.isReady = function(){ - for (var s in this.assets) { - if (this.assets.hasOwnProperty(s) && this.assets[s] != true) { - return false; - } - } - return true; + return ! Object.keys(this.assets).some( (key) => { + return ! this.assets[key] + }) } // (float) Percentage of assets remaining |
