diff --git a/lib/connector.js b/lib/connector.js index 14484d9..604da3c 100644 --- a/lib/connector.js +++ b/lib/connector.js @@ -138,7 +138,7 @@ Connector.prototype.getPropertyDefinition = function(modelName, propName) { const model = this.getModelDefinition(modelName); return Connector.getNestedPropertyDefinition( model.model.definition, - propName.split('.') + propName.split('.'), ); }; @@ -170,7 +170,7 @@ Connector.getNestedPropertyDefinition = function(definition, propPath) { } else { return Connector.getNestedPropertyDefinition( nextDefinition, - propPath.slice(1) + propPath.slice(1), ); } }; diff --git a/lib/model-key-composer.js b/lib/model-key-composer.js index 0a59058..45879ff 100644 --- a/lib/model-key-composer.js +++ b/lib/model-key-composer.js @@ -66,7 +66,7 @@ exports.parse = function(composed, cb) { debug('Invalid key - missing model-name prefix: %s', composed); const err = new Error(g.f( 'Invalid key %j - missing model-name prefix', - composed + composed, )); err.code = 'NO_MODEL_PREFIX'; setImmediate(function() { diff --git a/lib/sql.js b/lib/sql.js index 4176996..085051e 100644 --- a/lib/sql.js +++ b/lib/sql.js @@ -729,7 +729,7 @@ SQLConnector.prototype.exists = function(model, id, options, cb) { where[idName] = id; let selectStmt = new ParameterizedSQL( 'SELECT 1 FROM ' + this.tableEscaped(model) + - ' WHERE ' + this.idColumnEscaped(model) + ' WHERE ' + this.idColumnEscaped(model), ); selectStmt.merge(this.buildWhere(model, where)); selectStmt = this.applyPagination(model, selectStmt, { @@ -834,7 +834,7 @@ SQLConnector.prototype.updateAttributes = function(model, id, data, options, cb) function errorIdNotFoundForUpdate(idValue) { const msg = g.f( - 'Could not update attributes. {{Object}} with {{id}} %s does not exist!', idValue + 'Could not update attributes. {{Object}} with {{id}} %s does not exist!', idValue, ); const error = new Error(msg); error.statusCode = error.status = 404; @@ -1408,7 +1408,7 @@ SQLConnector.prototype.buildSelect = function(model, filter, options) { if (filter.limit || filter.skip || filter.offset) { selectStmt = this.applyPagination( - model, selectStmt, filter + model, selectStmt, filter, ); } } @@ -1467,7 +1467,7 @@ SQLConnector.prototype.all = function find(model, filter, options, cb) { }); if (filter && filter.include) { self.getModelDefinition(model).model.include( - objs, filter.include, options, cb + objs, filter.include, options, cb, ); } else { cb(null, objs); diff --git a/test/connector.test.js b/test/connector.test.js index 76dbe1e..ed45094 100644 --- a/test/connector.test.js +++ b/test/connector.test.js @@ -47,14 +47,14 @@ describe('Connector', () => { it('supports retrieving first level properties definitions', () => { const propDefinition1 = connector.getPropertyDefinition( 'MyModel', - 'phoneList' + 'phoneList', ); expect(propDefinition1.type).to.be.an('array'); const propDefinition2 = connector.getPropertyDefinition( 'MyModel', - 'firstname' + 'firstname', ); expect(propDefinition2.type).to.be.equal(String); @@ -63,7 +63,7 @@ describe('Connector', () => { it('supports first level nested array property definitions', () => { const propDefinition = connector.getPropertyDefinition( 'MyModel', - 'phoneList.number' + 'phoneList.number', ); expect(propDefinition.type).to.equal(Number); @@ -72,7 +72,7 @@ describe('Connector', () => { it('supports second level nested array property definitions', () => { const propDefinition = connector.getPropertyDefinition( 'MyModel', - 'phoneList.label.title' + 'phoneList.label.title', ); expect(propDefinition.type).to.equal(String); @@ -81,7 +81,7 @@ describe('Connector', () => { it('supports nested property definitions on objects', () => { const propDefinition = connector.getPropertyDefinition( 'MyModel', - 'address.line1' + 'address.line1', ); expect(propDefinition.type).to.equal(String); @@ -90,7 +90,7 @@ describe('Connector', () => { it('supports nested property definitions on array within object', () => { const propDefinition = connector.getPropertyDefinition( 'MyModel', - 'someProp.innerArray.date' + 'someProp.innerArray.date', ); expect(propDefinition.type).to.equal(Date); diff --git a/test/model-key-composer.test.js b/test/model-key-composer.test.js index 6f43a62..e833959 100644 --- a/test/model-key-composer.test.js +++ b/test/model-key-composer.test.js @@ -66,7 +66,7 @@ describe('ModelKeyComposer', function() { }, function onError(err) { expect(err).to.have.property('code', 'NO_MODEL_PREFIX'); - } + }, ); }); diff --git a/test/sql.test.js b/test/sql.test.js index 7243f29..51dafb5 100644 --- a/test/sql.test.js +++ b/test/sql.test.js @@ -275,10 +275,10 @@ describe('sql connector', function() { {name: 'John', vip: true, unknown: 'Random'}); expect(fields.names).to.eql(['`NAME`', '`VIP`']); expect(fields.columnValues[0].toJSON()).to.eql( - {sql: '?', params: ['John']} + {sql: '?', params: ['John']}, ); expect(fields.columnValues[1].toJSON()).to.eql( - {sql: '?', params: [true]} + {sql: '?', params: [true]}, ); }); @@ -394,7 +394,7 @@ describe('sql connector', function() { const where = {sql: 'WHERE `NAME`=?', params: ['John']}; stmt1 = ParameterizedSQL.append(stmt1, where); expect(stmt1.toJSON()).to.eql( - {sql: 'SELECT * from `CUSTOMER` WHERE `NAME`=?', params: ['John']} + {sql: 'SELECT * from `CUSTOMER` WHERE `NAME`=?', params: ['John']}, ); }); @@ -403,7 +403,7 @@ describe('sql connector', function() { const where = {sql: 'WHERE `NAME`=?', params: ['John']}; stmt1 = ParameterizedSQL.append(stmt1, where); expect(stmt1.toJSON()).to.eql( - {sql: 'SELECT * from `CUSTOMER` WHERE `NAME`=?', params: ['John']} + {sql: 'SELECT * from `CUSTOMER` WHERE `NAME`=?', params: ['John']}, ); });