Skip to content

Commit

Permalink
fix: correct type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Aug 7, 2018
1 parent 1afae08 commit ca5972e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
},
"description": "JSON logger for Node.js and browser.",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.55",
"@babel/core": "^7.0.0-beta.55",
"@babel/node": "^7.0.0-beta.55",
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.55",
"@babel/preset-env": "^7.0.0-beta.55",
"@babel/register": "^7.0.0-beta.55",
"@babel/cli": "^7.0.0-beta.56",
"@babel/core": "^7.0.0-beta.56",
"@babel/node": "^7.0.0-beta.56",
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.56",
"@babel/preset-env": "^7.0.0-beta.56",
"@babel/register": "^7.0.0-beta.56",
"ava": "^1.0.0-beta.6",
"babel-plugin-istanbul": "^5.0.1",
"coveralls": "^3.0.2",
"eslint": "^5.2.0",
"eslint": "^5.3.0",
"eslint-config-canonical": "^11.0.0",
"flow-bin": "^0.77.0",
"flow-bin": "^0.78.0",
"flow-copy-source": "^2.0.2",
"husky": "^1.0.0-rc.13",
"nock": "^9.4.4",
"nyc": "^13.0.1",
"semantic-release": "^15.9.3",
"semantic-release": "^15.9.5",
"sinon": "^6.1.4"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions src/factories/createLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const logLevels = {
warn: 40
};

const createLogger = (onMessage: OnMessageEventHandlerType, parentContext: MessageContextType = {}) => {
const createLogger = (onMessage: OnMessageEventHandlerType, parentContext?: MessageContextType): LoggerType => {
// eslint-disable-next-line id-length
const log: LoggerType = (a, b, c, d, e, f, g, h, i, k) => {
const time = Date.now();
Expand All @@ -34,7 +34,7 @@ const createLogger = (onMessage: OnMessageEventHandlerType, parentContext: Messa

if (typeof a === 'string') {
context = {
...parentContext
...parentContext || {}
};
message = sprintf(a, b, c, d, e, f, g, h, i, k);
} else {
Expand All @@ -43,7 +43,7 @@ const createLogger = (onMessage: OnMessageEventHandlerType, parentContext: Messa
}

context = {
...parentContext,
...parentContext || {},
...a
};

Expand All @@ -59,7 +59,7 @@ const createLogger = (onMessage: OnMessageEventHandlerType, parentContext: Messa
});
};

log.child = (context: TranslateMessageFunctionType | MessageContextType) => {
log.child = (context: TranslateMessageFunctionType | MessageContextType): LoggerType => {
if (typeof context === 'function') {
return createLogger((message) => {
if (typeof context !== 'function') {
Expand Down
4 changes: 2 additions & 2 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

/* eslint-disable import/exports-last, flowtype/require-types-at-top */

export type SerializableObjectType = {
export type SerializableObjectType = {|
+[key: string]: string | number | null | SerializableObjectType
};
|};

export type RoarrGlobalStateType = {|
buffer: string,
Expand Down

0 comments on commit ca5972e

Please sign in to comment.