Package Exports
- rotate-char
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 (rotate-char) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
├ ┬ ┤ ┴ ├
This is tiny, zero-dependency library for rotating special characters, based on the official UTF8 tables.
const { rotateChar } = require('rotate-char')
rotateChar('└', -Math.PI/2) // results in ┘
rotateChar('⚠', Math.PI) // not rotatable: will return the original character
Limitations
Currently the only characters that are supported are a subset of the UTF8 box drawing characters. Feel free to open a pull request if you'd like to see some other characters supported.
API
canRotate(char)
Checks if given character can be rotated using this library.
rotateChar(char, rad)
Finds the character that comes nearest to the rotation of the original character given in radians. If no matching rotation is found, the original character is returned.