JSPM

is-backslash

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q36370F
  • License MIT

Checks given value is backslash - support char code number, hex, unicode or string value to be given.

Package Exports

  • is-backslash

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-backslash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-backslash npmjs.com The MIT License

Checks given value is backslash - support char code number, hex, unicode or string value to be given.

code climate standard code style travis build status coverage status dependency status

Install

npm i is-backslash --save

Usage

For more use-cases see the tests

const isBackslash = require('is-backslash')

.isBackslash

Check value is strictly backslash or backslash-like.

  • [val] {String|Number} value to check
  • [opts] {Object} only opts.strict option, default false
  • returns {Boolean}

Example

const isBackslash = require('is-backslash')

// returns true (default mode, opts.strict !== true)
console.log(isBackslash(92, {strict: 123})) // => true
console.log(isBackslash(92))                // => true
console.log(isBackslash('92'))              // => true
console.log(isBackslash('\\'))              // => true
console.log(isBackslash('\u005C'))          // => true
console.log(isBackslash('\u005c'))          // => true
console.log(isBackslash('\x5c'))            // => true
console.log(isBackslash('\'))           // => true

// strict mode - need explicitly define `opts.strict: true`
console.log(isBackslash(92, {strict: true}))        // => false
console.log(isBackslash('92', {strict: true}))      // => false
console.log(isBackslash('\\', {strict: true}))      // => true
console.log(isBackslash('\u005C', {strict: true}))  // => true
console.log(isBackslash('\u005c', {strict: true}))  // => true
console.log(isBackslash('\x5c', {strict: true}))    // => true

console.log(isBackslash('\', {strict: 123}))    // => true
console.log(isBackslash('\', {strict: true}))   // => false

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github