diff --git a/__tests__/__snapshots__/createCSVData.spec.ts.snap b/__tests__/__snapshots__/createCSVData.spec.ts.snap index 525853f..5d19156 100644 --- a/__tests__/__snapshots__/createCSVData.spec.ts.snap +++ b/__tests__/__snapshots__/createCSVData.spec.ts.snap @@ -4,26 +4,26 @@ exports[`createCSVData works correctly 1`] = ` "greeting,foo,bar,a,b,c,d,e,f hello,,,,,,,, ,foo,bar,,,,,, -,,,100,\\"[1,2,3]\\",\\"{\\"\\"x\\"\\":200,\\"\\"y\\"\\":300}\\",D,null," +,,,100,"[1,2,3]","{""x"":200,""y"":300}",D,null," `; exports[`createCSVData works correctly 2`] = ` "greeting,foo,bar,a,b,c,d,e,f -\\"hel\\"\\"lo\\",,,,,,,, -,foo,\\"b\\"\\"a\\"\\"r\\",,,,,, -,,,100,\\"[1,2,3]\\",\\"{\\"\\"x\\"\\":200,\\"\\"y\\"\\":300}\\",D,null," +"hel""lo",,,,,,,, +,foo,"b""a""r",,,,,, +,,,100,"[1,2,3]","{""x"":200,""y"":300}",D,null," `; exports[`createCSVData works correctly with delimiter option 1`] = ` "greeting;foo;bar;a;b;c;d;e;f hello;;;;;;;; ;foo;bar;;;;;; -;;;100;\\"[1,2,3]\\";\\"{\\"\\"x\\"\\":200,\\"\\"y\\"\\":300}\\";D;null;" +;;;100;"[1,2,3]";"{""x"":200,""y"":300}";D;null;" `; exports[`createCSVData works correctly with specifying beforeTableEncode option 1`] = ` "greeting,foo,bar,a,b,c,d,e,f hello,0,0,0,0,0,0,0,0 0,foo,bar,0,0,0,0,0,0 -0,0,0,1000,\\"[1,2,3]\\",\\"{\\"\\"x\\"\\":200,\\"\\"y\\"\\":300}\\",D,null,0" +0,0,0,1000,"[1,2,3]","{""x"":200,""y"":300}",D,null,0" `; diff --git a/__tests__/__snapshots__/createJSONData.spec.ts.snap b/__tests__/__snapshots__/createJSONData.spec.ts.snap index 7834801..ad025f8 100644 --- a/__tests__/__snapshots__/createJSONData.spec.ts.snap +++ b/__tests__/__snapshots__/createJSONData.spec.ts.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`_createJSONData convert the plain object as the JSON.stringify does 1`] = `"[{\\"greeting\\":\\"hello\\"},{\\"foo\\":\\"foo\\",\\"bar\\":\\"bar\\"},{\\"a\\":100,\\"b\\":[1,2,3],\\"c\\":{\\"x\\":200,\\"y\\":300},\\"d\\":\\"D\\",\\"e\\":null}]"`; +exports[`_createJSONData convert the plain object as the JSON.stringify does 1`] = `"[{"greeting":"hello"},{"foo":"foo","bar":"bar"},{"a":100,"b":[1,2,3],"c":{"x":200,"y":300},"d":"D","e":null}]"`; diff --git a/__tests__/__snapshots__/createTableMap.spec.ts.snap b/__tests__/__snapshots__/createTableMap.spec.ts.snap index 3dd46a6..74c8497 100644 --- a/__tests__/__snapshots__/createTableMap.spec.ts.snap +++ b/__tests__/__snapshots__/createTableMap.spec.ts.snap @@ -1,48 +1,48 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`_createTableMap works correctly 1`] = ` -Object { - "a": Array [ +{ + "a": [ "", "", "100", ], - "b": Array [ + "b": [ "", "", "[1,2,3]", ], - "bar": Array [ + "bar": [ "", "bar", "", ], - "c": Array [ + "c": [ "", "", - "{\\"x\\":200,\\"y\\":300}", + "{"x":200,"y":300}", ], - "d": Array [ + "d": [ "", "", "D", ], - "e": Array [ + "e": [ "", "", "null", ], - "f": Array [ + "f": [ "", "", "", ], - "foo": Array [ + "foo": [ "", "foo", "", ], - "greeting": Array [ + "greeting": [ "hello", "", "", diff --git a/__tests__/__snapshots__/createXLSData.spec.ts.snap b/__tests__/__snapshots__/createXLSData.spec.ts.snap index 9686b6c..f63fb03 100644 --- a/__tests__/__snapshots__/createXLSData.spec.ts.snap +++ b/__tests__/__snapshots__/createXLSData.spec.ts.snap @@ -3,7 +3,7 @@ exports[`createXLSData works correctly 1`] = ` " - + @@ -14,7 +14,7 @@ exports[`createXLSData works correctly 1`] = ` hello foobar - 100[1,2,3]{\\"x\\":200,\\"y\\":300}Dnull + 100[1,2,3]{"x":200,"y":300}Dnull diff --git a/__tests__/__snapshots__/createXMLData.spec.ts.snap b/__tests__/__snapshots__/createXMLData.spec.ts.snap index d7f6257..f4d8a40 100644 --- a/__tests__/__snapshots__/createXMLData.spec.ts.snap +++ b/__tests__/__snapshots__/createXMLData.spec.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`createXMLData works correctly 1`] = ` -" +" @@ -50,7 +50,7 @@ exports[`createXMLData works correctly 1`] = ` `; exports[`createXMLData works with empty array 1`] = ` -" +" diff --git a/package.json b/package.json index 6961fa7..14346ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "export-from-json", - "version": "1.7.2", + "version": "1.7.3", "description": "Export to txt, json, csv, xls, xml format file from valid JavaScript JSON object.", "keywords": [ "json", @@ -23,7 +23,7 @@ "build": "npm run build:esm && npm run build:es2015 && npm run build:umd", "build:es2015": "tsc -p ./config/tsconfig.es2015.json", "build:esm": "tsc -p ./config/tsconfig.esm.json", - "build:umd": "rollup -c ./config/rollup.config.js", + "build:umd": "rollup -c ./config/rollup.config.js --bundleConfigAsCjs", "test": "npm run test:lint && npm run test:spec", "test:spec": "jest", "test:update": "jest --updateSnapshot", @@ -48,16 +48,17 @@ "./package.json": "./package.json" }, "devDependencies": { - "@types/jest": "^29.0.0", - "husky": "^8.0.0", - "jest": "^29.0.0", - "rollup": "^3.0.0", + "@types/jest": "^29.5.3", + "@types/node": "^20.4.4", + "husky": "^8.0.3", + "jest": "^29.6.1", + "rollup": "^3.26.3", "rollup-plugin-typescript2": "^0.35.0", "rollup-plugin-uglify": "^6.0.4", - "ts-jest": "^29.0.0", - "tslib": "^2.3.1", + "ts-jest": "^29.1.1", + "tslib": "^2.6.1", "tslint": "^6.1.3", - "typescript": "^5.0.2" + "typescript": "^5.1.6" }, "jest": { "extensionsToTreatAsEsm": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5286d57..6d1c2bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,40 +1,39 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - devDependencies: '@types/jest': - specifier: ^29.0.0 + specifier: ^29.5.3 version: 29.5.3 + '@types/node': + specifier: ^20.4.4 + version: 20.4.4 husky: - specifier: ^8.0.0 + specifier: ^8.0.3 version: 8.0.3 jest: - specifier: ^29.0.0 - version: 29.6.1 + specifier: ^29.6.1 + version: 29.6.1(@types/node@20.4.4) rollup: - specifier: ^3.0.0 + specifier: ^3.26.3 version: 3.26.3 rollup-plugin-typescript2: specifier: ^0.35.0 - version: 0.35.0(rollup@3.26.3)(typescript@5.1.3) + version: 0.35.0(rollup@3.26.3)(typescript@5.1.6) rollup-plugin-uglify: specifier: ^6.0.4 version: 6.0.4(rollup@3.26.3) ts-jest: - specifier: ^29.0.0 - version: 29.1.0(@babel/core@7.17.8)(jest@29.6.1)(typescript@5.1.3) + specifier: ^29.1.1 + version: 29.1.1(@babel/core@7.17.8)(jest@29.6.1)(typescript@5.1.6) tslib: - specifier: ^2.3.1 + specifier: ^2.6.1 version: 2.6.1 tslint: specifier: ^6.1.3 - version: 6.1.3(typescript@5.1.3) + version: 6.1.3(typescript@5.1.6) typescript: - specifier: ^5.0.2 - version: 5.1.3 + specifier: ^5.1.6 + version: 5.1.6 packages: @@ -401,7 +400,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 chalk: 4.1.2 jest-message-util: 29.6.1 jest-util: 29.6.1 @@ -422,14 +421,14 @@ packages: '@jest/test-result': 29.6.1 '@jest/transform': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.3.0 exit: 0.1.2 graceful-fs: 4.2.9 jest-changed-files: 29.5.0 - jest-config: 29.6.1(@types/node@17.0.21) + jest-config: 29.6.1(@types/node@20.4.4) jest-haste-map: 29.6.1 jest-message-util: 29.6.1 jest-regex-util: 29.4.3 @@ -456,7 +455,7 @@ packages: dependencies: '@jest/fake-timers': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 jest-mock: 29.6.1 dev: true @@ -483,7 +482,7 @@ packages: dependencies: '@jest/types': 29.6.1 '@sinonjs/fake-timers': 10.2.0 - '@types/node': 17.0.21 + '@types/node': 20.4.4 jest-message-util: 29.6.1 jest-mock: 29.6.1 jest-util: 29.6.1 @@ -516,7 +515,7 @@ packages: '@jest/transform': 29.6.1 '@jest/types': 29.6.1 '@jridgewell/trace-mapping': 0.3.18 - '@types/node': 17.0.21 + '@types/node': 20.4.4 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -604,7 +603,7 @@ packages: '@jest/schemas': 29.6.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 '@types/yargs': 17.0.24 chalk: 4.1.2 dev: true @@ -682,7 +681,7 @@ packages: /@types/graceful-fs@4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 17.0.21 + '@types/node': 20.4.4 dev: true /@types/istanbul-lib-coverage@2.0.4: @@ -708,8 +707,8 @@ packages: pretty-format: 29.6.1 dev: true - /@types/node@17.0.21: - resolution: {integrity: sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==} + /@types/node@20.4.4: + resolution: {integrity: sha512-CukZhumInROvLq3+b5gLev+vgpsIqC2D0deQr/yS1WnxvmYLlJXZpaQrQiseMY+6xusl79E04UjWoqyr+t1/Ew==} dev: true /@types/prettier@2.4.4: @@ -1123,7 +1122,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/expect-utils': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 jest-get-type: 29.4.3 jest-matcher-utils: 29.6.1 jest-message-util: 29.6.1 @@ -1382,7 +1381,7 @@ packages: '@jest/expect': 29.6.1 '@jest/test-result': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -1402,7 +1401,7 @@ packages: - supports-color dev: true - /jest-cli@29.6.1: + /jest-cli@29.6.1(@types/node@20.4.4): resolution: {integrity: sha512-607dSgTA4ODIN6go9w6xY3EYkyPFGicx51a69H7yfvt7lN53xNswEVLovq+E77VsTRi5fWprLH0yl4DJgE8Ing==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -1419,7 +1418,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.9 import-local: 3.1.0 - jest-config: 29.6.1(@types/node@17.0.21) + jest-config: 29.6.1(@types/node@20.4.4) jest-util: 29.6.1 jest-validate: 29.6.1 prompts: 2.4.2 @@ -1430,7 +1429,7 @@ packages: - ts-node dev: true - /jest-config@29.6.1(@types/node@17.0.21): + /jest-config@29.6.1(@types/node@20.4.4): resolution: {integrity: sha512-XdjYV2fy2xYixUiV2Wc54t3Z4oxYPAELUzWnV6+mcbq0rh742X2p52pii5A3oeRzYjLnQxCsZmp0qpI6klE2cQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1445,7 +1444,7 @@ packages: '@babel/core': 7.17.8 '@jest/test-sequencer': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 babel-jest: 29.6.1(@babel/core@7.17.8) chalk: 4.1.2 ci-info: 3.3.0 @@ -1504,7 +1503,7 @@ packages: '@jest/environment': 29.6.1 '@jest/fake-timers': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 jest-mock: 29.6.1 jest-util: 29.6.1 dev: true @@ -1520,7 +1519,7 @@ packages: dependencies: '@jest/types': 29.6.1 '@types/graceful-fs': 4.1.5 - '@types/node': 17.0.21 + '@types/node': 20.4.4 anymatch: 3.1.2 fb-watchman: 2.0.1 graceful-fs: 4.2.9 @@ -1571,7 +1570,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 jest-util: 29.6.1 dev: true @@ -1626,7 +1625,7 @@ packages: '@jest/test-result': 29.6.1 '@jest/transform': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.9 @@ -1657,7 +1656,7 @@ packages: '@jest/test-result': 29.6.1 '@jest/transform': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 @@ -1705,24 +1704,12 @@ packages: - supports-color dev: true - /jest-util@29.5.0: - resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.6.1 - '@types/node': 17.0.21 - chalk: 4.1.2 - ci-info: 3.3.0 - graceful-fs: 4.2.9 - picomatch: 2.3.1 - dev: true - /jest-util@29.6.1: resolution: {integrity: sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 chalk: 4.1.2 ci-info: 3.3.0 graceful-fs: 4.2.9 @@ -1747,7 +1734,7 @@ packages: dependencies: '@jest/test-result': 29.6.1 '@jest/types': 29.6.1 - '@types/node': 17.0.21 + '@types/node': 20.4.4 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -1767,13 +1754,13 @@ packages: resolution: {integrity: sha512-U+Wrbca7S8ZAxAe9L6nb6g8kPdia5hj32Puu5iOqBCMTMWFHXuK6dOV2IFrpedbTV8fjMFLdWNttQTBL6u2MRA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 17.0.21 + '@types/node': 20.4.4 jest-util: 29.6.1 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.6.1: + /jest@29.6.1(@types/node@20.4.4): resolution: {integrity: sha512-Nirw5B4nn69rVUZtemCQhwxOBhm0nsp3hmtF4rzCeWD7BkjAXRIji7xWQfnTNbz9g0aVsBX6aZK3n+23LM6uDw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -1786,7 +1773,7 @@ packages: '@jest/core': 29.6.1 '@jest/types': 29.6.1 import-local: 3.1.0 - jest-cli: 29.6.1 + jest-cli: 29.6.1(@types/node@20.4.4) transitivePeerDependencies: - '@types/node' - supports-color @@ -2085,7 +2072,7 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /rollup-plugin-typescript2@0.35.0(rollup@3.26.3)(typescript@5.1.3): + /rollup-plugin-typescript2@0.35.0(rollup@3.26.3)(typescript@5.1.6): resolution: {integrity: sha512-szcIO9hPUx3PhQl91u4pfNAH2EKbtrXaES+m163xQVE5O1CC0ea6YZV/5woiDDW3CR9jF2CszPrKN+AFiND0bg==} peerDependencies: rollup: '>=1.26.3' @@ -2097,7 +2084,7 @@ packages: rollup: 3.26.3 semver: 7.5.1 tslib: 2.6.1 - typescript: 5.1.3 + typescript: 5.1.6 dev: true /rollup-plugin-uglify@6.0.4(rollup@3.26.3): @@ -2134,14 +2121,6 @@ packages: hasBin: true dev: true - /semver@7.3.5: - resolution: {integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - /semver@7.5.1: resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} engines: {node: '>=10'} @@ -2312,8 +2291,8 @@ packages: is-number: 7.0.0 dev: true - /ts-jest@29.1.0(@babel/core@7.17.8)(jest@29.6.1)(typescript@5.1.3): - resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} + /ts-jest@29.1.1(@babel/core@7.17.8)(jest@29.6.1)(typescript@5.1.6): + resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -2336,13 +2315,13 @@ packages: '@babel/core': 7.17.8 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.6.1 - jest-util: 29.5.0 + jest: 29.6.1(@types/node@20.4.4) + jest-util: 29.6.1 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 - semver: 7.3.5 - typescript: 5.1.3 + semver: 7.5.3 + typescript: 5.1.6 yargs-parser: 21.1.1 dev: true @@ -2354,7 +2333,7 @@ packages: resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} dev: true - /tslint@6.1.3(typescript@5.1.3): + /tslint@6.1.3(typescript@5.1.6): resolution: {integrity: sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==} engines: {node: '>=4.8.0'} deprecated: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information. @@ -2374,17 +2353,17 @@ packages: resolve: 1.22.0 semver: 5.7.1 tslib: 1.14.1 - tsutils: 2.29.0(typescript@5.1.3) - typescript: 5.1.3 + tsutils: 2.29.0(typescript@5.1.6) + typescript: 5.1.6 dev: true - /tsutils@2.29.0(typescript@5.1.3): + /tsutils@2.29.0(typescript@5.1.6): resolution: {integrity: sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==} peerDependencies: typescript: '>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev' dependencies: tslib: 1.14.1 - typescript: 5.1.3 + typescript: 5.1.6 dev: true /type-detect@4.0.8: @@ -2397,8 +2376,8 @@ packages: engines: {node: '>=10'} dev: true - /typescript@5.1.3: - resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} + /typescript@5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -2489,3 +2468,7 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false diff --git a/src/converters.ts b/src/converters.ts index 544f502..c612b20 100644 --- a/src/converters.ts +++ b/src/converters.ts @@ -117,7 +117,7 @@ function encloser (value: string) { return `${enclosingCharacter}${escaped}${enclosingCharacter}` } -type CreateCSVDataOptions = { +interface CreateCSVDataOptions { beforeTableEncode?: (entries: ITableEntries) => ITableEntries, delimiter?: ',' | ';', } @@ -127,7 +127,7 @@ const defaultCreateCSVDataOption: Required = { beforeTable // Reference: https://techterms.com/definition/csv export function createCSVData ( data: any[], - options: CreateCSVDataOptions = {} + options: CreateCSVDataOptions = {}, ) { const { beforeTableEncode, delimiter } = { ...defaultCreateCSVDataOption, ...options } @@ -178,7 +178,7 @@ export function _renderTableHTMLText ( ` } -type CreateXLSDataOptions = { +interface CreateXLSDataOptions { beforeTableEncode?: (entries: ITableEntries) => ITableEntries, }