bitovi / bitovi/documentjs

Does not handle the Unicode byte order mark (BOM)

Open
#215 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
598
Forks
371
PR merge metrics
No merged PRs in 30d

Description

DocumentJS fails to take into account the presence of a Unicode byte order mark (BOM) in a `documentjs.json` configuration file, resulting in an immediate crash and a stack trace resembling the following:

``` cmd
C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:126
throw e;
^
SyntaxError: Unexpected token 
at Object.parse (native)
at readFile.then.documentConfig.sites.project.sites.docs.glob.ignore (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\lib\configured\generate_project.js:87:25)
at _fulfilled (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:749:13)
at C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:557:44
at flush (C:\Users\{..}\AppData\Roaming\npm\node_modules\documentjs\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:419:13)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at lib/configured/generate_project.js around line 87, where the documentjs.json configuration is parsed, and reproduce the crash with a configuration file containing a Unicode BOM. Done means DocumentJS accepts that file without the reported SyntaxError or immediate crash; add or run a focused regression check if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.