chore: coding style fixes

This commit is contained in:
Julien Fontanet 2018-04-05 15:53:57 +02:00
parent da62cba3f8
commit 7400bd657a
18 changed files with 157 additions and 148 deletions

View File

@ -3,7 +3,7 @@ declare module 'promise-toolbox' {
declare export function defer<T>(): {| declare export function defer<T>(): {|
promise: Promise<T>, promise: Promise<T>,
reject: T => void, reject: T => void,
resolve: T => void resolve: T => void,
|} |}
declare export function fromEvent(emitter: mixed, string): Promise<mixed> declare export function fromEvent(emitter: mixed, string): Promise<mixed>
declare export function ignoreErrors(): Promise<void> declare export function ignoreErrors(): Promise<void>

View File

@ -58,7 +58,8 @@ export const configurationSchema = {
}, },
port: { port: {
type: 'integer', type: 'integer',
description: 'port of the SMTP server (defaults to 25 or 465 for TLS)', description:
'port of the SMTP server (defaults to 25 or 465 for TLS)',
}, },
secure: { secure: {
default: false, default: false,

View File

@ -8,12 +8,14 @@ try {
const filtered = frames.filter(function (frame) { const filtered = frames.filter(function (frame) {
const name = frame && frame.getFileName() const name = frame && frame.getFileName()
return (// has a filename return (
// has a filename
name && name &&
// contains a separator (no internal modules) // contains a separator (no internal modules)
name.indexOf(sep) !== -1 && name.indexOf(sep) !== -1 &&
// does not start with `internal` // does not start with `internal`
name.lastIndexOf('internal', 0) !== -1) name.lastIndexOf('internal', 0) !== -1
)
}) })
// depd (used amongst other by express requires at least 3 frames // depd (used amongst other by express requires at least 3 frames

View File

@ -42,7 +42,9 @@ function handleGetAllObjects (req, res, { filter, limit }) {
export function getAllObjects ({ filter, limit, ndjson = false }) { export function getAllObjects ({ filter, limit, ndjson = false }) {
return ndjson return ndjson
? this.registerHttpRequest(handleGetAllObjects, { filter, limit }).then($getFrom => ({ $getFrom })) ? this.registerHttpRequest(handleGetAllObjects, { filter, limit }).then(
$getFrom => ({ $getFrom })
)
: this.getObjects({ filter, limit }) : this.getObjects({ filter, limit })
} }

View File

@ -154,7 +154,8 @@ export default class {
id: await generateToken(), id: await generateToken(),
user_id: userId, user_id: userId,
expiration: expiration:
Date.now() + (typeof expiresIn === 'string' ? ms(expiresIn) : expiresIn), Date.now() +
(typeof expiresIn === 'string' ? ms(expiresIn) : expiresIn),
}) })
await this._tokens.add(token) await this._tokens.add(token)

View File

@ -15,7 +15,7 @@ export type Schedule = {|
jobId: string, jobId: string,
name: string, name: string,
timezone?: string, timezone?: string,
userId: string userId: string,
|} |}
const normalize = schedule => { const normalize = schedule => {
@ -45,7 +45,7 @@ export default class Scheduling {
first: Function, first: Function,
get: Function, get: Function,
remove: Function, remove: Function,
update: Function update: Function,
|} |}
_runs: { __proto__: null, [string]: () => void } _runs: { __proto__: null, [string]: () => void }

View File

@ -42,7 +42,10 @@ import styles from './index.css'
}) })
@connectStore(() => ({ @connectStore(() => ({
container: createGetObject((_, props) => props.item.$container), container: createGetObject((_, props) => props.item.$container),
totalDiskSize: createSumBy(createGetVmDisks((_, props) => props.item), 'size'), totalDiskSize: createSumBy(
createGetVmDisks((_, props) => props.item),
'size'
),
})) }))
export default class VmItem extends Component { export default class VmItem extends Component {
get _isRunning () { get _isRunning () {