1.3.4 • Published 7 years ago

merge-char v1.3.4

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago
  │         │                       
  │         │ │          │          
  │         │ │     │    │          
  │         └─┼─────┼─┐  │        │ 
  └──────────┼┴─┼───┼─┼──┼────┬───┴─
             │  │   └┬───┴────┼┐    
   ┌───────┬─┴─┴┴────┼────┐   ││    
           │         │         │    
                               │              

This is tiny, zero-dependency library for merging special characters, based on the official UTF8 tables. This library is mainly useful for overlapping some text on other text, while preserving as much visual information as possible.

const { mergeChar } = require('merge-char')

mergeChar('└', '┘') // results in ┴

mergeChar('a', 'b') // not mergable: will return null

Limitations

Currently the only characters that are supported are the full 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

isMergable(char)

Checks if given character is mergable with other characters, based on the merging tables.

mergeChars(...chars)

Merges the given characters, returning the merged character if one is found. In case of failure, null is returned.

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago