Comparing version 3.0.3 to 3.0.4
@@ -19,6 +19,6 @@ "use strict"; | ||
return typeof p === 'number' ? '[' + p + ']' : /[.\[\]]/.test(p) || p === '' // match any character . or [ or ] and handle an empty string | ||
? '["' + escapeQuote(p) + '"]' : (index > 0 ? '.' : '') + p; | ||
? '["' + escapeQuotes(p) + '"]' : (index > 0 ? '.' : '') + p; | ||
}).join(''); | ||
} | ||
function escapeQuote(prop) { | ||
function escapeQuotes(prop) { | ||
return prop.replace(/"/g, '\\"'); | ||
@@ -25,0 +25,0 @@ } |
@@ -12,6 +12,6 @@ /** | ||
return typeof p === 'number' ? '[' + p + ']' : /[.\[\]]/.test(p) || p === '' // match any character . or [ or ] and handle an empty string | ||
? '["' + escapeQuote(p) + '"]' : (index > 0 ? '.' : '') + p; | ||
? '["' + escapeQuotes(p) + '"]' : (index > 0 ? '.' : '') + p; | ||
}).join(''); | ||
} | ||
function escapeQuote(prop) { | ||
function escapeQuotes(prop) { | ||
return prop.replace(/"/g, '\\"'); | ||
@@ -18,0 +18,0 @@ } |
import { JsonOptions, NestedObject } from './types.js'; | ||
export declare function csv2json(csv: string, options?: JsonOptions): NestedObject[]; | ||
//# sourceMappingURL=csv2json.d.ts.map |
@@ -0,0 +0,0 @@ import { CsvField, FlattenCallback, JsonField, NestedObject, Path } from './types.js'; |
@@ -0,0 +0,0 @@ export { json2csv } from './json2csv.js'; |
import { CsvOptions, NestedObject } from './types.js'; | ||
export declare function json2csv(json: NestedObject[], options?: CsvOptions): string; | ||
//# sourceMappingURL=json2csv.d.ts.map |
@@ -0,0 +0,0 @@ import { NestedObject, Path } from './types'; |
@@ -0,0 +0,0 @@ import { Path } from './types.js'; |
export type Path = (string | number)[]; | ||
/** @ts-ignore **/ | ||
export type NestedObject = Record<string, NestedObject>; | ||
@@ -3,0 +4,0 @@ export type ValueGetter = (object: NestedObject) => unknown; |
@@ -0,0 +0,0 @@ export declare function validateDelimiter(delimiter: string): string; |
@@ -0,0 +0,0 @@ import { ValueFormatter } from './types'; |
@@ -54,6 +54,6 @@ (function (global, factory) { | ||
return typeof p === 'number' ? '[' + p + ']' : /[.\[\]]/.test(p) || p === '' // match any character . or [ or ] and handle an empty string | ||
? '["' + escapeQuote(p) + '"]' : (index > 0 ? '.' : '') + p; | ||
? '["' + escapeQuotes(p) + '"]' : (index > 0 ? '.' : '') + p; | ||
}).join(''); | ||
} | ||
function escapeQuote(prop) { | ||
function escapeQuotes(prop) { | ||
return prop.replace(/"/g, '\\"'); | ||
@@ -60,0 +60,0 @@ } |
{ | ||
"name": "csv42", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "A small and fast CSV parser with support for nested JSON", | ||
@@ -63,10 +63,10 @@ "repository": { | ||
"devDependencies": { | ||
"@babel/cli": "7.21.0", | ||
"@babel/core": "7.21.0", | ||
"@babel/plugin-transform-typescript": "7.21.0", | ||
"@babel/preset-env": "7.20.2", | ||
"@babel/preset-typescript": "7.21.0", | ||
"@commitlint/cli": "17.4.4", | ||
"@commitlint/config-conventional": "17.4.4", | ||
"@vitest/coverage-c8": "0.29.2", | ||
"@babel/cli": "7.21.5", | ||
"@babel/core": "7.22.1", | ||
"@babel/plugin-transform-typescript": "7.22.3", | ||
"@babel/preset-env": "7.22.4", | ||
"@babel/preset-typescript": "7.21.5", | ||
"@commitlint/cli": "17.6.5", | ||
"@commitlint/config-conventional": "17.6.5", | ||
"@vitest/coverage-c8": "0.31.3", | ||
"cpy-cli": "4.2.0", | ||
@@ -77,8 +77,8 @@ "csv-spectrum": "1.0.0", | ||
"npm-run-all": "4.1.5", | ||
"prettier": "2.8.4", | ||
"prettier": "2.8.8", | ||
"standard-version": "9.5.0", | ||
"typescript": "4.9.5", | ||
"typescript": "5.0.4", | ||
"uglify-js": "3.17.4", | ||
"vite": "4.1.4", | ||
"vitest": "0.29.2" | ||
"vite": "4.3.9", | ||
"vitest": "0.31.3" | ||
}, | ||
@@ -85,0 +85,0 @@ "files": [ |
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
1477
190321