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
According to the API, the charset parameter should be optional, when calling the extractCommentsFromFile function.
But, feeding an "us-ascii" / "utf-8" file to this function, without passing "{charset:'utf-8'}" as a parameter, returns an "ERR_UNKNOWN_ENCODING TypeError".
So:
commentList = commentExtractor.extractCommentsFromFile('/path/to/file.js',{charset:'utf-8'}); - works
but
commentList = commentExtractor.extractCommentsFromFile('/path/to/file.js'); throws:
UnhandledPromiseRejectionWarning: TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: null
at stringSlice (buffer.js:630:9)
at Buffer.toString (buffer.js:666:10)
[...]
The text was updated successfully, but these errors were encountered:
According to the API, the charset parameter should be optional, when calling the extractCommentsFromFile function.
But, feeding an "us-ascii" / "utf-8" file to this function, without passing "{charset:'utf-8'}" as a parameter, returns an "ERR_UNKNOWN_ENCODING TypeError".
So:
commentList = commentExtractor.extractCommentsFromFile('/path/to/file.js',{charset:'utf-8'}); - works
but
commentList = commentExtractor.extractCommentsFromFile('/path/to/file.js'); throws:
UnhandledPromiseRejectionWarning: TypeError [ERR_UNKNOWN_ENCODING]: Unknown encoding: null
at stringSlice (buffer.js:630:9)
at Buffer.toString (buffer.js:666:10)
[...]
The text was updated successfully, but these errors were encountered: