pad-mid
v0.2.2
Published
Pads each middle character of a string
Downloads
1
Readme
pad-mid
Pads each middle character of a string
Installation
npm install pad-mid
Example:
import {padMid} from 'pad-mid';
expect(padMid('foobar')).toEqual('f o o b a r');
expect(padMid('foobar', 2)).toEqual('f o o b a r');
expect(padMid('foobar', 2, '*')).toEqual('f**o**o**b**a**r');
expect(padMid('foobar', 2, '**')).toEqual('f****o****o****b****a****r');
// prettier-ignore
expect(padMid(`i
love
you`, 1, '*')).toEqual(`i
l*o*v*e
y*o*u`);
License
MIT