refactor: Small code changes

Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-01-11 10:36:54 +00:00
parent 6a3148ff80
commit 9a98fc4c84
No known key found for this signature in database
GPG Key ID: 49690ED87032539F
3 changed files with 8 additions and 11 deletions

View File

@ -23,7 +23,7 @@ export const fnSchema = {
return config
.getMany(['uuid', 'apiEndpoint', 'registered_at', 'deviceId'])
.then(requiredValues => {
return _.every(_.values(requiredValues), Boolean);
return _.every(_.values(requiredValues));
});
},
osVersion: () => {

View File

@ -78,7 +78,7 @@ export class Config extends EventEmitter {
});
} else if (FnSchema.fnSchema.hasOwnProperty(key)) {
const fnKey = key as FnSchema.FnSchemaKey;
// Cast the promise as something that produes an unknown, and this means that
// Cast the promise as something that produces an unknown, and this means that
// we can validate the output of the function as well, ensuring that the type matches
const promiseValue = FnSchema.fnSchema[fnKey](this) as Bluebird<
unknown
@ -220,15 +220,12 @@ export class Config extends EventEmitter {
value = await this.configJsonBackend.get(key);
break;
case 'db':
value = await db('config')
const [conf] = await db('config')
.select('value')
.where({ key })
.then(([conf]: [{ value: string }]) => {
if (conf != null) {
return conf.value;
}
return;
});
.where({ key });
if (conf != null) {
return conf.value;
}
break;
}

View File

@ -24,7 +24,7 @@ export const schemaTypes = {
},
deltaEndpoint: {
type: t.string,
default: 'https://delta.resin.io',
default: 'https://delta.balena-cloud.com',
},
uuid: {
type: t.string,