You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way of doing a validation without needing the fs library? Given the README example it seems like it would be possible. var results = validator.validate(xml, schematron);
both the xml and schematron variables are strings after toString().
The text was updated successfully, but these errors were encountered:
My PR #2 resolves this issue by only loading readFile from fs if necessary. If you never use any file paths it will never import the library. It still has a guaranteed runtime dependency to the xpath library, though.
It is unclear from your comment if you're sending objects with a toString() method to validate() or you're sending strings (perhaps from earlier call to toString()) as parameters? The function call expects the parameters to already be strings and detects if it's a filepath/URL or serialized XML by checking if the first non-whitespace character is <.
After my PR is applied fs is imported when it detects a filepath, node-fetch is imported when it detects an URL and no fetch() is available in the global scope, and otherwise no library for loading external data is imported.
Is there a way of doing a validation without needing the
fs
library? Given the README example it seems like it would be possible.var results = validator.validate(xml, schematron);
both the
xml
andschematron
variables are strings aftertoString()
.The text was updated successfully, but these errors were encountered: