diff --git a/notNeededPackages.json b/notNeededPackages.json index 6b0df92f42..406a96327d 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -660,6 +660,12 @@ "sourceRepoURL": "https://github.com/adaltas/node-csv-parse", "asOfVersion": "1.2.2" }, + { + "libraryName": "csv-stringify", + "typingsPackageName": "csv-stringify", + "sourceRepoURL": "https://github.com/wdavidw/node-csv-stringify", + "asOfVersion": "3.1.0" + }, { "libraryName": "cycled", "typingsPackageName": "cycled", diff --git a/types/csv-stringify/csv-stringify-tests.ts b/types/csv-stringify/csv-stringify-tests.ts deleted file mode 100644 index 7aabdc728c..0000000000 --- a/types/csv-stringify/csv-stringify-tests.ts +++ /dev/null @@ -1,60 +0,0 @@ -import stringify = require("csv-stringify"); - -let stream: stringify.Stringifier; - -stringify([["1", "2", "3"], ["4", "5", "6"]], (error: Error, output: string): void => { - // nothing -}); - -stringify([["1", "2", "3"], ["4", "5", "6"]], { - delimiter: "," -}, (error: Error, output: string): void => { - // nothing -}); - -stringify([{a: "1", b: "2", c: "3"}, {c: "4", b: "5", a: "6"}], { - delimiter: "," -}, (error: Error, output: string): void => { - // nothing -}); - -stringify([["1", true, new Date()], ["4", false, new Date()]], { - delimiter: ",", - formatters: { - bool: value => value ? 'yes' : 'no', - date: value => value.toISOString() - } -}, (error: Error, output: string): void => { - // nothing -}); - -// test for columns -stringify( - [{key1: "a", key2: "b"}], - { - header: true, - columns: { key1: "Key1", key2: "Key2" }, - }, - (error: Error, output: string): void => { - // nothing - }); -stringify( - [{key1: "a", key2: "b"}], - { - header: true, - columns: ["key1"], - }, - (error: Error, output: string): void => { - // nothing - }); - -stream = stringify({ delimiter: "," }); - -stream.write(["1", "2", "3"]); -stream.write(["4", true, new Date()], 'utf8', (err: Error, output: string): void => { - // nothing -}); - -const transform: NodeJS.ReadWriteStream = stream; - -stream = stringify(); diff --git a/types/csv-stringify/index.d.ts b/types/csv-stringify/index.d.ts deleted file mode 100644 index c7cd4fd900..0000000000 --- a/types/csv-stringify/index.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -// Type definitions for csv-stringify 1.4 -// Project: https://github.com/wdavidw/node-csv-stringify, https://csv.js.org/stringify -// Definitions by: Rogier Schouten -// Arjen van der Ende -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace stringify { - interface StringifyOpts { - /** - * List of fields, applied when transform returns an object. - * Order matters, read the transformer documentation for additionnal information, - * columns are auto discovered when the user write object, see the "header" option on how to print columns names on the first line. - */ - columns?: { [index: string]: string } | string[]; - /** - * Set the field delimiter, one character only, defaults to a comma. - */ - delimiter?: string; - /** - * Add the value of "options.rowDelimiter" on the last line, default to true. - */ - eof?: boolean; - /** - * Defaults to the escape read option. - */ - escape?: boolean; - /** - * Display the column names on the first line if the columns option is provided or discovered. - */ - header?: boolean; - /** - * String used to delimit record rows or a special value; - * special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). - */ - lineBreaks?: string; - /** - * Defaults to the quote read option. - */ - quote?: string; - /** - * Boolean, default to false, quote all the non-empty fields even if not required. - */ - quoted?: boolean; - /** - * Boolean, no default, quote empty fields? If specified, overrides quotedString for empty strings. - */ - quotedEmpty?: boolean; - /** - * Boolean, default to false, quote all fields of type string even if not required. - */ - quotedString?: boolean; - /** - * String used to delimit record rows or a special value; - * special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). - */ - rowDelimiter?: string; - /** - * Override serialization of boolean, dates and complex objects. - */ - formatters?: FormatterOpts; - } - - interface FormatterOpts { - bool?: (value: boolean) => string; - date?: (value: Date) => string; - object?: (value: any) => string; - } - - interface Stringifier extends NodeJS.ReadWriteStream { - // Stringifier stream takes array of strings or Object, and optional encoding and callback - write(line: string[] | any, encoding?: string, cb?: (error: Error | undefined, output: string) => void): boolean; - - // repeat declarations from NodeJS.WritableStream to avoid compile error - write(buffer: string | Buffer, cb?: (error: Error | undefined, output: string) => void): boolean; - } -} - -/** - * Streaming stringifier - */ -declare function stringify(opts?: stringify.StringifyOpts): stringify.Stringifier; - -/** - * Callback version: string in --> callback with string out - */ -declare function stringify(input: any[][] | Array<{}>, opts: stringify.StringifyOpts, callback: (error: Error | undefined, output: string) => void): void; -declare function stringify(input: any[][] | Array<{}>, callback: (error: Error | undefined, output: string) => void): void; - -export = stringify; diff --git a/types/csv-stringify/tsconfig.json b/types/csv-stringify/tsconfig.json deleted file mode 100644 index 766e9c084e..0000000000 --- a/types/csv-stringify/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "csv-stringify-tests.ts" - ] -} \ No newline at end of file diff --git a/types/csv-stringify/tslint.json b/types/csv-stringify/tslint.json deleted file mode 100644 index 412d86e9a7..0000000000 --- a/types/csv-stringify/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "no-any-union": false, - "prefer-method-signature": false, - "npm-naming": false - } -} \ No newline at end of file