Skip to content

Commit 22e6e2f

Browse files
committed
refactor: format, remove unnecessary exports, ignore unreachable code in coverage
1 parent 2a64114 commit 22e6e2f

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

src/c14n.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ const c14nIsVisibleCallback = addFunction(
6969
}
7070
return res;
7171
}
72-
73-
// No callback or nodeSet - include all nodes
72+
/* c8 ignore next 2, callback is not registered if neither is present */
7473
return 1;
7574
},
7675
'iiii',
@@ -221,6 +220,7 @@ function canonicalizeInternal(
221220
outputBufferPtr,
222221
);
223222

223+
/* c8 ignore next 3, defensive code */
224224
if (result < 0) {
225225
throw new XmlError('Failed to canonicalize XML document');
226226
}

src/libxml2.mts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ import { ContextStorage } from './utils.mjs';
1919
const libxml2 = await moduleLoader();
2020
libxml2._xmlInitParser();
2121

22-
// Export specific functions needed by other modules
23-
export const {
24-
getValue, UTF8ToString, lengthBytesUTF8, stringToUTF8, addFunction,
25-
} = libxml2;
22+
/**
23+
* Export runtime functions needed by other modules.
24+
* @internal
25+
*/
26+
export const { addFunction } = libxml2;
2627

2728
/**
2829
* The base class for exceptions in this library.

src/nodes.mts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ import {
4242
import type { XmlDocPtr, XmlNodePtr, XmlNsPtr } from './libxml2raw.mjs';
4343
import { XmlStringOutputBufferHandler } from './utils.mjs';
4444
import { NamespaceMap, XmlXPath } from './xpath.mjs';
45-
import {
46-
canonicalizeSubtree, SubtreeC14NOptions,
47-
} from './c14n.mjs';
45+
import { canonicalizeSubtree, SubtreeC14NOptions } from './c14n.mjs';
4846

4947
function compiledXPathEval(nodePtr: XmlNodePtr, xpath: XmlXPath) {
5048
const context = xmlXPathNewContext(XmlNodeStruct.doc(nodePtr));

src/utils.mts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import {
2-
XmlInputProvider, XmlOutputBufferHandler,
3-
} from './libxml2.mjs';
1+
import { XmlInputProvider, XmlOutputBufferHandler } from './libxml2.mjs';
42
import { Pointer } from './libxml2raw.mjs';
53

64
/**

0 commit comments

Comments
 (0)