Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('.'),
);
};

Expand Down Expand Up @@ -170,7 +170,7 @@ Connector.getNestedPropertyDefinition = function(definition, propPath) {
} else {
return Connector.getNestedPropertyDefinition(
nextDefinition,
propPath.slice(1)
propPath.slice(1),
);
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/model-key-composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions lib/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
);
}
}
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions test/connector.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/model-key-composer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('ModelKeyComposer', function() {
},
function onError(err) {
expect(err).to.have.property('code', 'NO_MODEL_PREFIX');
}
},
);
});

Expand Down
8 changes: 4 additions & 4 deletions test/sql.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]},
);
});

Expand Down Expand Up @@ -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']},
);
});

Expand All @@ -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']},
);
});

Expand Down