Wondering what’s next for npm?Check out our public roadmap! »

is-open-comment

0.1.1 • Public • Published

is-open-comment v0.1.1

Returns true if a string opens a comment without closing it.

  • No runtime dependencies.
  • Comment syntax within a string literal causes a false positive.
const isOpenComment = require('is-open-comment')
 
isOpenComment('//')       // => true
isOpenComment('/*')       // => true
isOpenComment('/* // */') // => false
isOpenComment('/* \n')    // => true
isOpenComment('// \n')    // => false

Look at test.js for all supported edge cases.

Tests

# Install dev dependencies. 
npm i
 
# Run the tests once. 
./test.js -v
 
# Run the tests when a file changes. 
./test.js -w -v

Keywords

none

Install

npm i is-open-comment

DownloadsWeekly Downloads

2

Version

0.1.1

License

none

Last publish

Collaborators

  • avatar