@clickhouse/client
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -1,2 +0,2 @@ | ||
declare const supportedJSONFormats: readonly ["JSON", "JSONObjectEachRow", "JSONEachRow", "JSONStringsEachRow", "JSONCompactEachRow", "JSONCompactStringsEachRow", "JSONCompactEachRowWithNames", "JSONCompactEachRowWithNamesAndTypes", "JSONCompactStringsEachRowWithNames", "JSONCompactStringsEachRowWithNamesAndTypes"]; | ||
declare const supportedJSONFormats: readonly ["JSON", "JSONStrings", "JSONCompact", "JSONCompactStrings", "JSONColumnsWithMetadata", "JSONObjectEachRow", "JSONEachRow", "JSONStringsEachRow", "JSONCompactEachRow", "JSONCompactStringsEachRow", "JSONCompactEachRowWithNames", "JSONCompactEachRowWithNamesAndTypes", "JSONCompactStringsEachRowWithNames", "JSONCompactStringsEachRowWithNamesAndTypes"]; | ||
declare const supportedRawFormats: readonly ["CSV", "CSVWithNames", "CSVWithNamesAndTypes", "TabSeparated", "TabSeparatedRaw", "TabSeparatedWithNames", "TabSeparatedWithNamesAndTypes", "CustomSeparated", "CustomSeparatedWithNames", "CustomSeparatedWithNamesAndTypes"]; | ||
@@ -3,0 +3,0 @@ export type JSONDataFormat = (typeof supportedJSONFormats)[number]; |
@@ -14,5 +14,12 @@ "use strict"; | ||
]; | ||
const supportedJSONFormats = [ | ||
const singleDocumentJSONFormats = [ | ||
'JSON', | ||
'JSONStrings', | ||
'JSONCompact', | ||
'JSONCompactStrings', | ||
'JSONColumnsWithMetadata', | ||
'JSONObjectEachRow', | ||
]; | ||
const supportedJSONFormats = [ | ||
...singleDocumentJSONFormats, | ||
...streamableJSONFormats, | ||
@@ -37,2 +44,6 @@ ]; | ||
]; | ||
function isNotStreamableJSONFamily(format) { | ||
// @ts-expect-error JSON is not assignable to notStreamableJSONFormats | ||
return singleDocumentJSONFormats.includes(format); | ||
} | ||
function isStreamableJSONFamily(format) { | ||
@@ -59,3 +70,3 @@ // @ts-expect-error JSON is not assignable to streamableJSONFormats | ||
function decode(text, format) { | ||
if (format === 'JSON') { | ||
if (isNotStreamableJSONFamily(format)) { | ||
return JSON.parse(text); | ||
@@ -62,0 +73,0 @@ } |
@@ -1,2 +0,2 @@ | ||
declare const _default: "0.0.13"; | ||
declare const _default: "0.0.14"; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '0.0.13'; | ||
exports.default = '0.0.14'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@clickhouse/client", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Official JS client for ClickHouse DB", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
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
262237
4124