npm.io
0.0.6 • Published 9 years ago

reduce-string

Licence
ISC
Version
0.0.6
Deps
0
Vulns
0
Weekly
0
import test from 'ava';
import func from '../index';

test(t => {
    t.is(func('with spaces '), 'with spaces');
    t.is(func('no spaces'), 'no');
    t.is(func('中文'), '中');
    t.is(func('!@#$%^&*()_+'), '!@#$%^&*()_');
    t.is(func('what1'), 'what');
    t.is(func('what-'), 'what');
    t.is(func('what文'), 'what');
    t.is(func('what'), '');
    t.is(func('www.baidu.com google.cn'), 'www.baidu.com');
    t.is(func('www.baidu.com '), 'www.baidu.com');
    t.is(func('www.baidu.com'), '');
});