Skip to content

Commit

Permalink
Merge f63c05e into 7e60a31
Browse files Browse the repository at this point in the history
  • Loading branch information
mbland committed Dec 30, 2023
2 parents 7e60a31 + f63c05e commit 70de0a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ as robust as the [Node.js][] version in this package. It also wasn't natively
portable to Windows. So I decided to dig in and make it so, using it as a
Node.js, JSDoc, and [npm packaging][] exercise as well.

## Copyright

&copy; 2023 Mike Bland &lt;<mbland@acm.org>&gt; (<https://mike-bland.com/>)

## License

Licensed under the [Mozilla Public License, v. 2.0][mpl-20], included in this
repository as [LICENSE.txt](./LICENSE.txt). See the [MPL 2.0 FAQ][mpl-faq] for a
higher level explanation.

[JSDoc]: https://jsdoc.app/
[cli]: https://github.com/jsdoc/jsdoc
[coveralls-jsdw]: https://coveralls.io/github/mbland/jsdoc-cli-wrapper?branch=main
Expand All @@ -226,3 +236,5 @@ Node.js, JSDoc, and [npm packaging][] exercise as well.
[Bash]: https://www.gnu.org/software/bash/
[Node.js]: https://nodejs.org/
[npm packaging]: https://docs.npmjs.com/packages-and-modules
[mpl-20]: https://mozilla.org/MPL/2.0/
[mpl-faq]: https://www.mozilla.org/MPL/2.0/FAQ/
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export function stripJsonComments(jsonStr) {
inString = curChar !== '"' || escaped
escaped = curChar === '\\' && !escaped
} else if (inComment) {
if ((inComment === 'line' && curChar === '\n') ||
(inComment === 'block' && prevChar === '*' && curChar === '/')) {
if ((curChar === '\n' && inComment === 'line') ||
(curChar === '/' && inComment === 'block' && prevChar === '*')) {
inComment = null
}
if (isNotWhitespace) curChar = ' '
Expand Down

0 comments on commit 70de0a6

Please sign in to comment.