@rethinkhealth/hl7v2-lint-required-message-header 0.2.15 → 0.2.17
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/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
package/dist/index.d.ts
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Node, Root, Segment } from
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Node, Root, Segment } from \"@rethinkhealth/hl7v2-ast\";\nimport { lintRule } from \"unified-lint-rule\";\nimport { SKIP, visitParents } from \"unist-util-visit-parents\";\n\n/**\n * hl7v2-lint rule to warn when message header segment (MSH) is missing.\n *\n * This rule is useful for ensuring that all messages start with a message\n * header segment.\n */\nconst hl7v2LintSegmentRequiredMessageHeader = lintRule<Node, undefined>(\n {\n origin: \"hl7v2-lint:segment-required-message-header\",\n url: \"https://github.com/rethinkhealth/hl7v2/tree/main/packages/hl7v2-lint-segment-required-message-header#readme\",\n },\n (tree, file) => {\n visitParents(tree, (node, parents) => {\n if (node.type === \"root\") {\n const firstSegment = (node as Root).children[0];\n if (firstSegment?.type === \"segment\") {\n const header = (firstSegment as Segment).children?.[0]?.children?.[0]\n ?.children?.[0]?.children?.[0]?.value;\n if (header !== \"MSH\") {\n file.message(\n `Message header (MSH) segment is required. Received ${header} instead.`,\n {\n ancestors: [...parents, node, firstSegment],\n place: firstSegment.position,\n }\n );\n }\n }\n } else {\n return SKIP;\n }\n });\n }\n);\n\nexport default hl7v2LintSegmentRequiredMessageHeader;\n"],"mappings":";AACA,SAAS,gBAAgB;AACzB,SAAS,MAAM,oBAAoB;AAQnC,IAAM,wCAAwC;AAAA,EAC5C;AAAA,IACE,QAAQ;AAAA,IACR,KAAK;AAAA,EACP;AAAA,EACA,CAAC,MAAM,SAAS;AACd,iBAAa,MAAM,CAAC,MAAM,YAAY;AACpC,UAAI,KAAK,SAAS,QAAQ;AACxB,cAAM,eAAgB,KAAc,SAAS,CAAC;AAC9C,YAAI,cAAc,SAAS,WAAW;AACpC,gBAAM,SAAU,aAAyB,WAAW,CAAC,GAAG,WAAW,CAAC,GAChE,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG;AAClC,cAAI,WAAW,OAAO;AACpB,iBAAK;AAAA,cACH,sDAAsD,MAAM;AAAA,cAC5D;AAAA,gBACE,WAAW,CAAC,GAAG,SAAS,MAAM,YAAY;AAAA,gBAC1C,OAAO,aAAa;AAAA,cACtB;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF,OAAO;AACL,eAAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEA,IAAO,cAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rethinkhealth/hl7v2-lint-required-message-header",
|
|
3
3
|
"description": "hl7v2-lint rule to warn when message header segment is missing",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.17",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Melek Somai",
|
|
@@ -21,19 +21,18 @@
|
|
|
21
21
|
"unist-util-visit-parents": "6.0.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/node": "24.
|
|
24
|
+
"@types/node": "24.5.2",
|
|
25
25
|
"@types/unist": "^3.0.3",
|
|
26
|
-
"@vitest/coverage-c8": "^0.33.0",
|
|
27
26
|
"@vitest/coverage-v8": "^3.2.4",
|
|
28
27
|
"tsup": "8.5.0",
|
|
29
28
|
"typescript": "^5.8.3",
|
|
30
29
|
"vfile-reporter": "^8.1.1",
|
|
31
30
|
"vitest": "^3.2.4",
|
|
32
|
-
"@rethinkhealth/hl7v2-ast": "0.2.15",
|
|
33
|
-
"@rethinkhealth/hl7v2-parser": "0.2.15",
|
|
34
31
|
"@rethinkhealth/testing": "0.0.1",
|
|
35
|
-
"@rethinkhealth/hl7v2-
|
|
36
|
-
"@rethinkhealth/
|
|
32
|
+
"@rethinkhealth/hl7v2-ast": "0.2.17",
|
|
33
|
+
"@rethinkhealth/hl7v2-jsonify": "0.2.17",
|
|
34
|
+
"@rethinkhealth/tsconfig": "0.0.1",
|
|
35
|
+
"@rethinkhealth/hl7v2-parser": "0.2.17"
|
|
37
36
|
},
|
|
38
37
|
"repository": "rethinkhealth/hl7v2.git",
|
|
39
38
|
"homepage": "https://www.rethinkhealth.io/hl7v2/docs",
|