diff --git a/examples/typescript-node-es6/src/index.ts b/examples/typescript-node-es6/src/index.ts index bb3792485..7b28a0c28 100644 --- a/examples/typescript-node-es6/src/index.ts +++ b/examples/typescript-node-es6/src/index.ts @@ -7,6 +7,8 @@ const source = ` const doc = new DOMParser().parseFromString(source, 'text/xml') +if (!doc) throw 'expected Document but was null' + const serialized = new XMLSerializer().serializeToString(doc) if (source !== serialized) {