This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/remark-parse/lib/util/is-markdown-whitespace-character.js
2020-11-01 22:46:04 +00:00

28 lines
549 B
JavaScript

'use strict'
module.exports = whitespace
var tab = 9 // '\t'
var lineFeed = 10 // '\n'
var lineTabulation = 11 // '\v'
var formFeed = 12 // '\f'
var carriageReturn = 13 // '\r'
var space = 32 // ' '
function whitespace(char) {
/* istanbul ignore next - `number` handling for future */
var code = typeof char === 'number' ? char : char.charCodeAt(0)
switch (code) {
case tab:
case lineFeed:
case lineTabulation:
case formFeed:
case carriageReturn:
case space:
return true
default:
return false
}
}