diff --git a/README.md b/README.md index c048ab2..e8bc615 100644 --- a/README.md +++ b/README.md @@ -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 + +© 2023 Mike Bland <> () + +## 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 @@ -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/ diff --git a/lib/index.js b/lib/index.js index 812dbc6..9a34a97 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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 = ' '