@outburn/format-converter 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,7 +28,7 @@ import { FormatConverter, TypeConverter, FormatDetector } from '@outburn/format-
28
28
 
29
29
  ### Browser (Limited functionality)
30
30
  ```html
31
- <script src="node_modules/@outburn/format-converter/dist/browser/browser.js"></script>
31
+ <script src="node_modules/@outburn/format-converter/dist/browser.js"></script>
32
32
  <script>
33
33
  const { TypeConverter, FormatDetector } = FormatUtils;
34
34
  // FormatConverter is not available in browser due to HL7.js dependency
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@outburn/format-converter",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A TypeScript library for converting between various data formats including CSV, XML, HL7 v2, and JSON with specialized healthcare message parsing",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
- "browser": "./dist/browser/browser.js",
7
+ "browser": "./dist/browser.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "type": "module",
10
10
  "exports": {
@@ -13,7 +13,7 @@
13
13
  "import": "./dist/index.mjs",
14
14
  "require": "./dist/index.cjs"
15
15
  },
16
- "./browser": "./dist/browser/browser.js"
16
+ "./browser": "./dist/browser.js"
17
17
  },
18
18
  "scripts": {
19
19
  "clean": "rimraf dist",
@@ -26,8 +26,8 @@
26
26
  "files": [
27
27
  "dist/**/*.cjs",
28
28
  "dist/**/*.mjs",
29
+ "dist/**/*.js",
29
30
  "dist/**/*.d.ts",
30
- "dist/browser/**",
31
31
  "README.md",
32
32
  "LICENSE"
33
33
  ],
@@ -75,4 +75,4 @@
75
75
  },
76
76
  "bugs": "https://github.com/Outburn-IL/format-converter/issues",
77
77
  "homepage": "https://github.com/Outburn-IL/format-converter#readme"
78
- }
78
+ }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/types/ContentType.ts","../../src/types/ContentFormat.ts","../../src/types/EditorLanguage.ts","../../src/TypeConverter.ts","../../src/FormatDetector.ts"],"names":["ContentType","ContentFormat","EditorLanguage","_TypeConverter","contentType","format","normalizedFormat","value","normalizedContentType","editorLanguage","normalizedLanguage","TypeConverter","isPossiblyHL7","input","isValidJson","e","isJsonLikely","inputWithoutStrings","jsonStats","hasIncompleteJsonPattern","isXmlLikely","xmlStats","isCsvLikely","lines","headerRow","csvStats","line","headerStats","count","_FormatDetector","FormatDetector"],"mappings":"gDAKO,IAAWA,CAAAA,CAAAA,CAAAA,CAAAA,GAEdA,CAAAA,CAAA,IAAA,CAAO,kBAAA,CAEPA,CAAAA,CAAA,GAAA,CAAM,UAAA,CAENA,CAAAA,CAAA,GAAA,CAAM,iBAAA,CAENA,CAAAA,CAAA,KAAA,CAAQ,0BAAA,CARMA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,ECAX,IAAWC,CAAAA,CAAAA,CAAAA,CAAAA,GAEdA,CAAAA,CAAA,IAAA,CAAO,MAAA,CAEPA,CAAAA,CAAA,GAAA,CAAM,KAAA,CAENA,CAAAA,CAAA,GAAA,CAAM,KAAA,CAENA,CAAAA,CAAA,GAAA,CAAM,KAAA,CAENA,CAAAA,CAAA,OAAA,CAAU,SAAA,CAVIA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,ECAX,IAAWC,CAAAA,CAAAA,CAAAA,CAAAA,GAEdA,CAAAA,CAAA,IAAA,CAAO,MAAA,CAEPA,CAAAA,CAAA,GAAA,CAAM,KAAA,CAENA,CAAAA,CAAA,SAAA,CAAY,WAAA,CANEA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,ECHX,IAAMC,CAAAA,CAAN,MAAMA,CAAwC,CA6CnD,0BAAA,CAA2BC,CAAAA,CAAyC,CAClE,OAAOD,CAAAA,CAAc,6BAAA,CAA8BC,CAAW,CAChE,CAEA,2BAAA,CAA4BA,CAAAA,CAA0C,CACpE,IAAMC,CAAAA,C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,CAEA,oBAAA,CAAqBA,CAAAA,CAA+B,CAElD,OADe,IAAA,CAAK,YAAA,CAAaA,CAAK,CAAA,EAEpC,KAAA,MAAA,CACE,OAAA,MAAA,CACF,KAAA,KAAA,CACE,OAAA,KAAA,CACF,QACE,OAAA,WACJ,CACF,CACF,CAAA,CAlCagB,CAAAA,CACa,aAAA,CAAgC,IAAIlB,CAAAA,CADvD,IAAMmB,CAAAA,CAAND","file":"browser.js","sourcesContent":["/**\n * Enumeration of supported MIME types/content types for data format identification.\n * These values correspond to standard HTTP Content-Type header values and are used\n * for format detection and conversion operations.\n */\nexport const enum ContentType {\n /** Standard MIME type for JSON data */\n JSON = 'application/json',\n /** Standard MIME type for CSV data */\n CSV = 'text/csv',\n /** Standard MIME type for XML data */\n XML = 'application/xml',\n /** Custom MIME type for HL7 Version 2.x messages in ER7 encoding */\n HL7V2 = 'x-application/hl7-v2+er7'\n}","/**\n * Enumeration of supported content formats for detection and conversion.\n * Used by format detection algorithms to categorize input data and determine\n * appropriate conversion strategies.\n */\nexport const enum ContentFormat {\n /** JavaScript Object Notation format */\n JSON = 'json',\n /** Comma-Separated Values format */\n CSV = 'csv',\n /** eXtensible Markup Language format */\n XML = 'xml',\n /** Health Level 7 Version 2.x message format */\n HL7 = 'hl7',\n /** Unknown or unsupported format */\n UNKNOWN = 'unknown'\n}","/**\n * Enumeration of supported editor language identifiers for syntax highlighting and editor configuration.\n * These values are used to determine the appropriate language mode for displaying content\n * in code editors or other text editing interfaces.\n */\nexport const enum EditorLanguage {\n /** JSON language mode for syntax highlighting */\n JSON = 'json',\n /** XML language mode for syntax highlighting */\n XML = 'xml',\n /** Plain text mode with no syntax highlighting */\n PLAINTEXT = 'plaintext'\n}","import { ContentFormat, ContentType, EditorLanguage, ITypeConverter } from './types';\n\nexport class TypeConverter implements ITypeConverter {\n private static contentTypeToContentFormatMap: { [key in ContentType]: ContentFormat } = {\n [ContentType.JSON]: ContentFormat.JSON,\n [ContentType.CSV]: ContentFormat.CSV,\n [ContentType.XML]: ContentFormat.XML,\n [ContentType.HL7V2]: ContentFormat.HL7\n };\n\n private static contentFormatToContentTypeMap: { [key in ContentFormat]: ContentType | null } = {\n [ContentFormat.JSON]: ContentType.JSON,\n [ContentFormat.CSV]: ContentType.CSV,\n [ContentFormat.XML]: ContentType.XML,\n [ContentFormat.HL7]: ContentType.HL7V2,\n [ContentFormat.UNKNOWN]: null\n };\n\n private static contentFormatToEditorLanguageMap: { [key in ContentFormat]: EditorLanguage } = {\n [ContentFormat.JSON]: EditorLanguage.JSON,\n [ContentFormat.XML]: EditorLanguage.XML,\n [ContentFormat.CSV]: EditorLanguage.PLAINTEXT,\n [ContentFormat.HL7]: EditorLanguage.PLAINTEXT,\n [ContentFormat.UNKNOWN]: EditorLanguage.PLAINTEXT\n };\n\n private static contentFormats: ContentFormat[] = [\n ContentFormat.JSON,\n ContentFormat.CSV,\n ContentFormat.XML,\n ContentFormat.HL7,\n ContentFormat.UNKNOWN\n ];\n\n private static contentTypes: ContentType[] = [\n ContentType.JSON,\n ContentType.CSV,\n ContentType.XML,\n ContentType.HL7V2\n ];\n\n private static editorLanguages: EditorLanguage[] = [\n EditorLanguage.JSON,\n EditorLanguage.XML,\n EditorLanguage.PLAINTEXT\n ];\n\n contentTypeToContentFormat(contentType: ContentType): ContentFormat {\n return TypeConverter.contentTypeToContentFormatMap[contentType];\n }\n\n contentTypeToEditorLanguage(contentType: ContentType): EditorLanguage {\n const format = this.contentTypeToContentFormat(contentType);\n return this.contentFormatToEditorLanguage(format);\n }\n\n contentFormatToContentType(format: ContentFormat): ContentType | null {\n return TypeConverter.contentFormatToContentTypeMap[format] || null;\n }\n\n contentFormatToEditorLanguage(format: ContentFormat): EditorLanguage {\n return TypeConverter.contentFormatToEditorLanguageMap[format];\n }\n\n stringToContentFormat(format: string): ContentFormat | null {\n const normalizedFormat = format.toLowerCase();\n return TypeConverter.contentFormats.find(value => value === normalizedFormat) || null;\n }\n\n stringToContentType(contentType: string): ContentType | null {\n const normalizedContentType = contentType.toLowerCase();\n return TypeConverter.contentTypes.find(value => normalizedContentType.startsWith(value)) || null;\n }\n\n stringToEditorLanguage(editorLanguage: string): EditorLanguage | null {\n const normalizedLanguage = editorLanguage.toLowerCase();\n return TypeConverter.editorLanguages.find(value => value === normalizedLanguage) || null;\n }\n\n}","import { TypeConverter } from './TypeConverter';\nimport { ContentFormat, ContentType, EditorLanguage, IFormatDetector, ITypeConverter } from './types';\n\nconst isPossiblyHL7 = (input: string): boolean =>\n typeof input === 'string' && input.trimStart().startsWith('MSH|');\n\nconst isValidJson = (input: string): boolean => {\n try {\n JSON.parse(input);\n return true;\n } catch (e) {\n return false;\n }\n};\n\nconst isJsonLikely = (input: string): boolean => {\n // Remove string values for JSON-specific heuristics (optimized regex)\n const inputWithoutStrings = input; //.replace(/\"[^\"]*\"/g, '\"\"');\n /*\n // Remove string values for JSON-specific heuristics (safe regex to prevent ReDoS)\n const inputWithoutStrings = input.replace(/\"(?:[^\"\\\\]|\\\\.)*\"/g, '\"\"');\n */\n\n const jsonStats = {\n curlyBraces: (inputWithoutStrings.match(/[{}]/g) || []).length,\n colons: (inputWithoutStrings.match(/:/g) || []).length,\n embeddedXml: /<[^>]+>/.test(input),\n keyValueStructure: /{[^}]*:[^}]*}/.test(input), // Key-value pattern\n };\n\n // Check for incomplete JSON patterns (like {\"key\": incomplete)\n const hasIncompleteJsonPattern = /{[^}]*\"[^\"]*\"\\s*:\\s*/.test(input);\n\n const isJsonLikely =\n (jsonStats.curlyBraces >= 2 || (jsonStats.curlyBraces >= 1 && hasIncompleteJsonPattern)) &&\n jsonStats.colons >= 1 &&\n (jsonStats.keyValueStructure || /{.*:.*}/.test(input) || hasIncompleteJsonPattern); // Strong JSON indicators\n\n return isJsonLikely;\n};\n\nconst isXmlLikely = (input: string): boolean => {\n const xmlStats = {\n openingTags: (input.match(/<[^/!?][^>]*?>/g) || []).length,\n closingTags: (input.match(/<\\/[^>]+>/g) || []).length,\n selfClosingTags: (input.match(/<[^>]+\\/>/g) || []).length,\n xmlNamespaces: (input.match(/xmlns(:[a-zA-Z0-9]+)?=/g) || []).length,\n };\n\n const hasXmlHeader = /^<\\?xml.*?\\?>/.test(input);\n const isXmlLikely =\n (hasXmlHeader || xmlStats.xmlNamespaces >= 1 || xmlStats.openingTags >= 1) &&\n (xmlStats.openingTags === xmlStats.closingTags || xmlStats.selfClosingTags >= 1);\n\n return isXmlLikely;\n};\n\nconst isCsvLikely = (input: string): boolean => {\n const lines = input.split(/\\r?\\n/);\n const headerRow = lines[0];\n const csvStats = {\n rowCount: lines.length,\n commaCounts: lines.map(line => (line.match(/,/g) || []).length),\n };\n\n const headerStats = {\n curlyBraces: (headerRow.match(/[{}]/g) || []).length,\n squareBrackets: (headerRow.match(/[\\[\\]]/g) || []).length,\n angularBrackets: (headerRow.match(/[<>]/g) || []).length,\n colons: (headerRow.match(/:/g) || []).length,\n };\n\n const isCsvLikely =\n (csvStats.rowCount > 1 || csvStats.commaCounts.some(count => count > 0)) &&\n headerStats.curlyBraces === 0 &&\n headerStats.squareBrackets === 0 &&\n headerStats.angularBrackets === 0 &&\n headerStats.colons === 0;\n\n return isCsvLikely;\n};\n\nexport class FormatDetector implements IFormatDetector {\n private static readonly typeConverter: ITypeConverter = new TypeConverter();\n\n detectContentType(input: string): ContentType | null {\n const format = this.detectFormat(input);\n return FormatDetector.typeConverter.contentFormatToContentType(format);\n }\n\n detectFormat(input: string): ContentFormat {\n try {\n const trimmedInput = input?.trim();\n if (!trimmedInput) return ContentFormat.UNKNOWN;\n if (isValidJson(input)) return ContentFormat.JSON;\n if (isPossiblyHL7(input)) return ContentFormat.HL7;\n if (isJsonLikely(input)) return ContentFormat.JSON;\n if (isXmlLikely(input)) return ContentFormat.XML;\n if (isCsvLikely(input)) return ContentFormat.CSV;\n return ContentFormat.UNKNOWN;\n } catch (e) {\n return ContentFormat.UNKNOWN;\n }\n }\n\n detectEditorLanguage(input: string): EditorLanguage {\n const format = this.detectFormat(input);\n switch (format) {\n case ContentFormat.JSON:\n return EditorLanguage.JSON;\n case ContentFormat.XML:\n return EditorLanguage.XML;\n default:\n return EditorLanguage.PLAINTEXT;\n }\n }\n}"]}
File without changes