@rethinkhealth/hl7v2-lint-required-message-header 0.2.28 → 0.2.30
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var hl7v2LintSegmentRequiredMessageHeader = lintRule(
|
|
|
16
16
|
return EXIT;
|
|
17
17
|
}
|
|
18
18
|
file.fail(
|
|
19
|
-
`Message header (MSH) segment is required as the first segment
|
|
19
|
+
`Message header (MSH) segment is required as the first segment \u2014 received '${node.value}' instead`,
|
|
20
20
|
{ ancestors: [node], place: node.position }
|
|
21
21
|
);
|
|
22
22
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Nodes } from \"@rethinkhealth/hl7v2-ast\";\nimport { lintRule } from \"unified-lint-rule\";\nimport { EXIT, 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<Nodes, 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 if (tree.type !== \"root\") {\n return;\n }\n\n // Get the first segment in the message even if it's in a nested group(s).\n // We must ensure that it is the first segment in the message.\n visitParents(tree, (node) => {\n if (node.type === \"segment-header\") {\n if (node.value === \"MSH\") {\n return EXIT;\n }\n file.fail(\n `Message header (MSH) segment is required as the first segment
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Nodes } from \"@rethinkhealth/hl7v2-ast\";\nimport { lintRule } from \"unified-lint-rule\";\nimport { EXIT, 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<Nodes, 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 if (tree.type !== \"root\") {\n return;\n }\n\n // Get the first segment in the message even if it's in a nested group(s).\n // We must ensure that it is the first segment in the message.\n visitParents(tree, (node) => {\n if (node.type === \"segment-header\") {\n if (node.value === \"MSH\") {\n return EXIT;\n }\n file.fail(\n `Message header (MSH) segment is required as the first segment — received '${node.value}' instead`,\n { ancestors: [node], place: node.position }\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,QAAI,KAAK,SAAS,QAAQ;AACxB;AAAA,IACF;AAIA,iBAAa,MAAM,CAAC,SAAS;AAC3B,UAAI,KAAK,SAAS,kBAAkB;AAClC,YAAI,KAAK,UAAU,OAAO;AACxB,iBAAO;AAAA,QACT;AACA,aAAK;AAAA,UACH,kFAA6E,KAAK,KAAK;AAAA,UACvF,EAAE,WAAW,CAAC,IAAI,GAAG,OAAO,KAAK,SAAS;AAAA,QAC5C;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;AACA,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.30",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Melek Somai",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vfile": "^6.0.3",
|
|
30
30
|
"vfile-reporter": "^8.1.1",
|
|
31
31
|
"vitest": "^4.0.6",
|
|
32
|
-
"@rethinkhealth/hl7v2-ast": "0.2.
|
|
33
|
-
"@rethinkhealth/hl7v2-builder": "0.2.
|
|
32
|
+
"@rethinkhealth/hl7v2-ast": "0.2.30",
|
|
33
|
+
"@rethinkhealth/hl7v2-builder": "0.2.30",
|
|
34
34
|
"@rethinkhealth/testing": "0.0.2",
|
|
35
35
|
"@rethinkhealth/tsconfig": "0.0.1"
|
|
36
36
|
},
|