@fast-csv/parse
Advanced tools
Comparing version 4.1.2 to 4.1.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CsvParserStream = void 0; | ||
const string_decoder_1 = require("string_decoder"); | ||
@@ -4,0 +5,0 @@ const stream_1 = require("stream"); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs = __importStar(require("fs")); | ||
exports.parseString = exports.parseFile = exports.parseStream = exports.parse = void 0; | ||
const tslib_1 = require("tslib"); | ||
const fs = tslib_1.__importStar(require("fs")); | ||
const stream_1 = require("stream"); | ||
const ParserOptions_1 = require("./ParserOptions"); | ||
const CsvParserStream_1 = require("./CsvParserStream"); | ||
__export(require("./types")); | ||
tslib_1.__exportStar(require("./types"), exports); | ||
var CsvParserStream_2 = require("./CsvParserStream"); | ||
exports.CsvParserStream = CsvParserStream_2.CsvParserStream; | ||
Object.defineProperty(exports, "CsvParserStream", { enumerable: true, get: function () { return CsvParserStream_2.CsvParserStream; } }); | ||
var ParserOptions_2 = require("./ParserOptions"); | ||
exports.ParserOptions = ParserOptions_2.ParserOptions; | ||
Object.defineProperty(exports, "ParserOptions", { enumerable: true, get: function () { return ParserOptions_2.ParserOptions; } }); | ||
exports.parse = (args) => new CsvParserStream_1.CsvParserStream(new ParserOptions_1.ParserOptions(args)); | ||
@@ -23,0 +15,0 @@ exports.parseStream = (stream, options) => stream.pipe(new CsvParserStream_1.CsvParserStream(new ParserOptions_1.ParserOptions(options))); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ColumnFormatter = void 0; | ||
class ColumnFormatter { | ||
@@ -4,0 +5,0 @@ constructor(parserOptions) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ColumnParser = void 0; | ||
const NonQuotedColumnParser_1 = require("./NonQuotedColumnParser"); | ||
@@ -4,0 +5,0 @@ const QuotedColumnParser_1 = require("./QuotedColumnParser"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var ColumnParser_1 = require("./ColumnParser"); | ||
exports.ColumnParser = ColumnParser_1.ColumnParser; | ||
Object.defineProperty(exports, "ColumnParser", { enumerable: true, get: function () { return ColumnParser_1.ColumnParser; } }); | ||
var NonQuotedColumnParser_1 = require("./NonQuotedColumnParser"); | ||
exports.NonQuotedColumnParser = NonQuotedColumnParser_1.NonQuotedColumnParser; | ||
Object.defineProperty(exports, "NonQuotedColumnParser", { enumerable: true, get: function () { return NonQuotedColumnParser_1.NonQuotedColumnParser; } }); | ||
var QuotedColumnParser_1 = require("./QuotedColumnParser"); | ||
exports.QuotedColumnParser = QuotedColumnParser_1.QuotedColumnParser; | ||
Object.defineProperty(exports, "QuotedColumnParser", { enumerable: true, get: function () { return QuotedColumnParser_1.QuotedColumnParser; } }); | ||
var ColumnFormatter_1 = require("./ColumnFormatter"); | ||
exports.ColumnFormatter = ColumnFormatter_1.ColumnFormatter; | ||
Object.defineProperty(exports, "ColumnFormatter", { enumerable: true, get: function () { return ColumnFormatter_1.ColumnFormatter; } }); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NonQuotedColumnParser = void 0; | ||
const ColumnFormatter_1 = require("./ColumnFormatter"); | ||
@@ -4,0 +5,0 @@ const Token_1 = require("../Token"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.QuotedColumnParser = void 0; | ||
const ColumnFormatter_1 = require("./ColumnFormatter"); | ||
@@ -4,0 +5,0 @@ const Token_1 = require("../Token"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Parser_1 = require("./Parser"); | ||
exports.Parser = Parser_1.Parser; | ||
Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_1.Parser; } }); | ||
var RowParser_1 = require("./RowParser"); | ||
exports.RowParser = RowParser_1.RowParser; | ||
Object.defineProperty(exports, "RowParser", { enumerable: true, get: function () { return RowParser_1.RowParser; } }); | ||
var Scanner_1 = require("./Scanner"); | ||
exports.Scanner = Scanner_1.Scanner; | ||
Object.defineProperty(exports, "Scanner", { enumerable: true, get: function () { return Scanner_1.Scanner; } }); | ||
var Token_1 = require("./Token"); | ||
exports.Token = Token_1.Token; | ||
Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return Token_1.Token; } }); | ||
var column_1 = require("./column"); | ||
exports.ColumnParser = column_1.ColumnParser; | ||
exports.NonQuotedColumnParser = column_1.NonQuotedColumnParser; | ||
exports.QuotedColumnParser = column_1.QuotedColumnParser; | ||
Object.defineProperty(exports, "ColumnParser", { enumerable: true, get: function () { return column_1.ColumnParser; } }); | ||
Object.defineProperty(exports, "NonQuotedColumnParser", { enumerable: true, get: function () { return column_1.NonQuotedColumnParser; } }); | ||
Object.defineProperty(exports, "QuotedColumnParser", { enumerable: true, get: function () { return column_1.QuotedColumnParser; } }); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Parser = void 0; | ||
const Scanner_1 = require("./Scanner"); | ||
@@ -4,0 +5,0 @@ const RowParser_1 = require("./RowParser"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RowParser = void 0; | ||
const column_1 = require("./column"); | ||
@@ -4,0 +5,0 @@ const Token_1 = require("./Token"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Scanner = void 0; | ||
const Token_1 = require("./Token"); | ||
@@ -4,0 +5,0 @@ const ROW_DELIMITER = /((?:\r\n)|\n|\r)/; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Token = void 0; | ||
class Token { | ||
@@ -4,0 +5,0 @@ constructor(tokenArgs) { |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { HeaderArray, HeaderTransformFunction } from './types'; | ||
@@ -40,3 +41,3 @@ export interface ParserOptionsArgs { | ||
readonly NEXT_TOKEN_REGEXP: RegExp; | ||
readonly encoding: string; | ||
readonly encoding: BufferEncoding; | ||
readonly limitRows: boolean; | ||
@@ -43,0 +44,0 @@ readonly maxRows: number; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_escaperegexp_1 = __importDefault(require("lodash.escaperegexp")); | ||
const lodash_isnil_1 = __importDefault(require("lodash.isnil")); | ||
exports.ParserOptions = void 0; | ||
const tslib_1 = require("tslib"); | ||
const lodash_escaperegexp_1 = tslib_1.__importDefault(require("lodash.escaperegexp")); | ||
const lodash_isnil_1 = tslib_1.__importDefault(require("lodash.isnil")); | ||
class ParserOptions { | ||
@@ -37,3 +36,3 @@ constructor(opts) { | ||
this.escapedDelimiter = lodash_escaperegexp_1.default(this.delimiter); | ||
this.escapeChar = (_a = this.escape, (_a !== null && _a !== void 0 ? _a : this.quote)); | ||
this.escapeChar = (_a = this.escape) !== null && _a !== void 0 ? _a : this.quote; | ||
this.supportsComments = !lodash_isnil_1.default(this.comment); | ||
@@ -40,0 +39,0 @@ this.NEXT_TOKEN_REGEXP = new RegExp(`([^\\s]|\\r\\n|\\n|\\r|${this.escapedDelimiter})`); |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_isundefined_1 = __importDefault(require("lodash.isundefined")); | ||
const lodash_isfunction_1 = __importDefault(require("lodash.isfunction")); | ||
const lodash_uniq_1 = __importDefault(require("lodash.uniq")); | ||
const lodash_groupby_1 = __importDefault(require("lodash.groupby")); | ||
exports.HeaderTransformer = void 0; | ||
const tslib_1 = require("tslib"); | ||
const lodash_isundefined_1 = tslib_1.__importDefault(require("lodash.isundefined")); | ||
const lodash_isfunction_1 = tslib_1.__importDefault(require("lodash.isfunction")); | ||
const lodash_uniq_1 = tslib_1.__importDefault(require("lodash.uniq")); | ||
const lodash_groupby_1 = tslib_1.__importDefault(require("lodash.groupby")); | ||
class HeaderTransformer { | ||
@@ -102,6 +101,6 @@ constructor(parserOptions) { | ||
var _a; | ||
const filteredHeaders = headers.filter(h => !!h); | ||
const filteredHeaders = headers.filter((h) => !!h); | ||
if (lodash_uniq_1.default(filteredHeaders).length !== filteredHeaders.length) { | ||
const grouped = lodash_groupby_1.default(filteredHeaders); | ||
const duplicates = Object.keys(grouped).filter(dup => grouped[dup].length > 1); | ||
const duplicates = Object.keys(grouped).filter((dup) => grouped[dup].length > 1); | ||
throw new Error(`Duplicate headers found ${JSON.stringify(duplicates)}`); | ||
@@ -108,0 +107,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var RowTransformerValidator_1 = require("./RowTransformerValidator"); | ||
exports.RowTransformerValidator = RowTransformerValidator_1.RowTransformerValidator; | ||
Object.defineProperty(exports, "RowTransformerValidator", { enumerable: true, get: function () { return RowTransformerValidator_1.RowTransformerValidator; } }); | ||
var HeaderTransformer_1 = require("./HeaderTransformer"); | ||
exports.HeaderTransformer = HeaderTransformer_1.HeaderTransformer; | ||
Object.defineProperty(exports, "HeaderTransformer", { enumerable: true, get: function () { return HeaderTransformer_1.HeaderTransformer; } }); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const lodash_isfunction_1 = __importDefault(require("lodash.isfunction")); | ||
exports.RowTransformerValidator = void 0; | ||
const tslib_1 = require("tslib"); | ||
const lodash_isfunction_1 = tslib_1.__importDefault(require("lodash.isfunction")); | ||
const types_1 = require("../types"); | ||
@@ -8,0 +7,0 @@ class RowTransformerValidator { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isSyncValidate = exports.isSyncTransform = void 0; | ||
exports.isSyncTransform = (transform) => transform.length === 1; | ||
exports.isSyncValidate = (validate) => validate.length === 1; | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@fast-csv/parse", | ||
"version": "4.1.2", | ||
"version": "4.1.4", | ||
"description": "fast-csv parsing package", | ||
@@ -56,7 +56,7 @@ "keywords": [ | ||
"@types/lodash.uniq": "^4.5.6", | ||
"@types/sinon": "^7.5.1", | ||
"@types/sinon": "^9.0.0", | ||
"lodash.partition": "^4.6.0", | ||
"sinon": "^7.5.0" | ||
"sinon": "^9.0.2" | ||
}, | ||
"gitHead": "5bcbe608066d18aea95098304133ba55915f76e6" | ||
"gitHead": "f4310e7112a81c68229a26d9a8340f982b638a86" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80673
55