diff --git a/notNeededPackages.json b/notNeededPackages.json index 6b9d74701e..f1eb5e081a 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -2034,6 +2034,12 @@ "sourceRepoURL": "https://github.com/nomiddlename/log4js-node", "asOfVersion": "2.3.5" }, + { + "libraryName": "logform", + "typingsPackageName": "logform", + "sourceRepoURL": "https://github.com/winstonjs/logform", + "asOfVersion": "1.10.0" + }, { "libraryName": "loglevel", "typingsPackageName": "loglevel", diff --git a/types/logform/index.d.ts b/types/logform/index.d.ts deleted file mode 100644 index ca751f5bfd..0000000000 --- a/types/logform/index.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -// Type definitions for logform 1.2 -// Project: https://github.com/winstonjs/logform -// Definitions by: DABH -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 - -export interface TransformableInfo { - level: string; - message: string; - [key: string]: any; -} - -export type TransformFunction = (info: TransformableInfo, opts?: any) => TransformableInfo | boolean; -export type Colors = { [key: string]: string | string[] }; // tslint:disable-line interface-over-type-literal -export type FormatWrap = (opts?: any) => Format; - -export class Format { - constructor(opts?: object); - - options?: object; - transform: TransformFunction; -} - -export class Colorizer extends Format { - constructor(opts?: object); - - createColorize: (opts?: object) => Colorizer; - addColors: (colors: Colors) => Colors; - colorize: (level: string, message: string) => string; -} - -export function format(transform: TransformFunction): FormatWrap; - -export function levels(config: object): object; - -export namespace format { - function align(opts?: object): Format; - function cli(opts?: object): Format; - function colorize(opts?: object): Colorizer; - function combine(...formats: Format[]): Format; - function json(opts?: object): Format; - function label(opts?: object): Format; - function logstash(opts?: object): Format; - function padLevels(opts?: object): Format; - function prettyPrint(opts?: object): Format; - function printf(templateFunction: (info: TransformableInfo) => string): Format; - function simple(opts?: object): Format; - function splat(opts?: object): Format; - function timestamp(opts?: object): Format; - function uncolorize(opts?: object): Format; -} diff --git a/types/logform/logform-tests.ts b/types/logform/logform-tests.ts deleted file mode 100644 index 72ec622869..0000000000 --- a/types/logform/logform-tests.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as logform from 'logform'; -const format = logform.format; -const { combine, timestamp, label } = format; - -const labelTimestamp = combine( - label({ label: 'right meow!' }), - timestamp() -); - -const info = labelTimestamp.transform({ - level: 'info', - message: 'What time is the testing at?' -}); - -const ignorePrivate = format((info, opts) => { - if (info.private) { return false; } - return info; -})(); - -ignorePrivate.transform({ - level: 'error', - message: 'Public error to share' -}); - -ignorePrivate.transform({ - level: 'error', - private: true, - message: 'This is super secret - hide it.' -}); - -const willNeverThrow = format.combine( - format(info => false)(), // Ignores everything - format(info => { throw new Error('Never reached'); })() -); - -const volume = format((info, opts) => { - if (opts && opts.yell) { - info.message = info.message.toUpperCase(); - } else if (opts && opts.whisper) { - info.message = info.message.toLowerCase(); - } - - return info; -}); - -// `volume` is now a function that returns instances of the format. -const scream = volume({ yell: true }); -scream.transform({ - level: 'info', - message: `sorry for making you YELL in your head!` -}, scream.options); - -// `volume` can be used multiple times to create different formats. -const whisper = volume({ whisper: true }); -whisper.transform({ - level: 'info', - message: `WHY ARE THEY MAKING US YELL SO MUCH!` -}, whisper.options); diff --git a/types/logform/tsconfig.json b/types/logform/tsconfig.json deleted file mode 100644 index e583eef148..0000000000 --- a/types/logform/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "logform-tests.ts" - ] -} \ No newline at end of file diff --git a/types/logform/tslint.json b/types/logform/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/logform/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }