|
| 1 | +import {expectType} from 'tsd'; |
| 2 | +import type {SplitWords} from '../source/split-words'; |
| 3 | + |
| 4 | +expectType<SplitWords<''>>([]); |
| 5 | +expectType<SplitWords<'a'>>(['a']); |
| 6 | +expectType<SplitWords<'B'>>(['B']); |
| 7 | +expectType<SplitWords<'aa'>>(['aa']); |
| 8 | +expectType<SplitWords<'aB'>>(['a', 'B']); |
| 9 | +expectType<SplitWords<'Ba'>>(['Ba']); |
| 10 | +expectType<SplitWords<'BB'>>(['BB']); |
| 11 | +expectType<SplitWords<'aaa'>>(['aaa']); |
| 12 | +expectType<SplitWords<'aaB'>>(['aa', 'B']); |
| 13 | +expectType<SplitWords<'aBa'>>(['a', 'Ba']); |
| 14 | +expectType<SplitWords<'aBB'>>(['a', 'BB']); |
| 15 | +expectType<SplitWords<'Baa'>>(['Baa']); |
| 16 | +expectType<SplitWords<'BaB'>>(['Ba', 'B']); |
| 17 | +expectType<SplitWords<'BBa'>>(['B', 'Ba']); |
| 18 | +expectType<SplitWords<'BBB'>>(['BBB']); |
| 19 | +expectType<SplitWords<'aaaa'>>(['aaaa']); |
| 20 | +expectType<SplitWords<'aaaB'>>(['aaa', 'B']); |
| 21 | +expectType<SplitWords<'aaBa'>>(['aa', 'Ba']); |
| 22 | +expectType<SplitWords<'aaBB'>>(['aa', 'BB']); |
| 23 | +expectType<SplitWords<'aBaa'>>(['a', 'Baa']); |
| 24 | +expectType<SplitWords<'aBaB'>>(['a', 'Ba', 'B']); |
| 25 | +expectType<SplitWords<'aBBa'>>(['a', 'B', 'Ba']); |
| 26 | +expectType<SplitWords<'aBBB'>>(['a', 'BBB']); |
| 27 | +expectType<SplitWords<'Baaa'>>(['Baaa']); |
| 28 | +expectType<SplitWords<'BaaB'>>(['Baa', 'B']); |
| 29 | +expectType<SplitWords<'BaBa'>>(['Ba', 'Ba']); |
| 30 | +expectType<SplitWords<'BaBB'>>(['Ba', 'BB']); |
| 31 | +expectType<SplitWords<'BBaa'>>(['B', 'Baa']); |
| 32 | +expectType<SplitWords<'BBaB'>>(['B', 'Ba', 'B']); |
| 33 | +expectType<SplitWords<'BBBa'>>(['BB', 'Ba']); |
| 34 | +expectType<SplitWords<'BBBB'>>(['BBBB']); |
| 35 | +expectType<SplitWords<'aaaaa'>>(['aaaaa']); |
| 36 | +expectType<SplitWords<'aaaaB'>>(['aaaa', 'B']); |
| 37 | +expectType<SplitWords<'aaaBa'>>(['aaa', 'Ba']); |
| 38 | +expectType<SplitWords<'aaaBB'>>(['aaa', 'BB']); |
| 39 | +expectType<SplitWords<'aaBaa'>>(['aa', 'Baa']); |
| 40 | +expectType<SplitWords<'aaBaB'>>(['aa', 'Ba', 'B']); |
| 41 | +expectType<SplitWords<'aaBBa'>>(['aa', 'B', 'Ba']); |
| 42 | +expectType<SplitWords<'aaBBB'>>(['aa', 'BBB']); |
| 43 | +expectType<SplitWords<'aBaaa'>>(['a', 'Baaa']); |
| 44 | +expectType<SplitWords<'aBaaB'>>(['a', 'Baa', 'B']); |
| 45 | +expectType<SplitWords<'aBaBa'>>(['a', 'Ba', 'Ba']); |
| 46 | +expectType<SplitWords<'aBaBB'>>(['a', 'Ba', 'BB']); |
| 47 | +expectType<SplitWords<'aBBaa'>>(['a', 'B', 'Baa']); |
| 48 | +expectType<SplitWords<'aBBaB'>>(['a', 'B', 'Ba', 'B']); |
| 49 | +expectType<SplitWords<'aBBBa'>>(['a', 'BB', 'Ba']); |
| 50 | +expectType<SplitWords<'aBBBB'>>(['a', 'BBBB']); |
| 51 | +expectType<SplitWords<'Baaaa'>>(['Baaaa']); |
| 52 | +expectType<SplitWords<'BaaaB'>>(['Baaa', 'B']); |
| 53 | +expectType<SplitWords<'BaaBa'>>(['Baa', 'Ba']); |
| 54 | +expectType<SplitWords<'BaaBB'>>(['Baa', 'BB']); |
| 55 | +expectType<SplitWords<'BaBaa'>>(['Ba', 'Baa']); |
| 56 | +expectType<SplitWords<'BaBaB'>>(['Ba', 'Ba', 'B']); |
| 57 | +expectType<SplitWords<'BaBBa'>>(['Ba', 'B', 'Ba']); |
| 58 | +expectType<SplitWords<'BaBBB'>>(['Ba', 'BBB']); |
| 59 | +expectType<SplitWords<'BBaaa'>>(['B', 'Baaa']); |
| 60 | +expectType<SplitWords<'BBaaB'>>(['B', 'Baa', 'B']); |
| 61 | +expectType<SplitWords<'BBaBa'>>(['B', 'Ba', 'Ba']); |
| 62 | +expectType<SplitWords<'BBaBB'>>(['B', 'Ba', 'BB']); |
| 63 | +expectType<SplitWords<'BBBaa'>>(['BB', 'Baa']); |
| 64 | +expectType<SplitWords<'BBBaB'>>(['BB', 'Ba', 'B']); |
| 65 | +expectType<SplitWords<'BBBBa'>>(['BBB', 'Ba']); |
| 66 | +expectType<SplitWords<'BBBBB'>>(['BBBBB']); |
| 67 | + |
| 68 | +expectType<SplitWords<'hello world'>>(['hello', 'world']); |
| 69 | +expectType<SplitWords<'Hello-world'>>(['Hello', 'world']); |
| 70 | +expectType<SplitWords<'hello_world'>>(['hello', 'world']); |
| 71 | +expectType<SplitWords<'hello world'>>(['hello', 'world']); |
| 72 | +expectType<SplitWords<'Hello--world'>>(['Hello', 'world']); |
| 73 | +expectType<SplitWords<'hello__world'>>(['hello', 'world']); |
| 74 | +expectType<SplitWords<' hello world'>>(['hello', 'world']); |
| 75 | +expectType<SplitWords<'---Hello--world'>>(['Hello', 'world']); |
| 76 | +expectType<SplitWords<'___hello__world'>>(['hello', 'world']); |
| 77 | +expectType<SplitWords<'hello world '>>(['hello', 'world']); |
| 78 | +expectType<SplitWords<'Hello--world--'>>(['Hello', 'world']); |
| 79 | +expectType<SplitWords<'hello__world___'>>(['hello', 'world']); |
| 80 | +expectType<SplitWords<'___ hello -__ _world'>>(['hello', 'world']); |
| 81 | +expectType<SplitWords<'__HelloWorld-HELLOWorld helloWORLD'>>(['Hello', 'World', 'HELLO', 'World', 'hello', 'WORLD']); |
| 82 | + |
| 83 | +expectType<SplitWords<'item0'>>(['item', '0']); |
| 84 | +expectType<SplitWords<'item01'>>(['item', '01']); |
| 85 | +expectType<SplitWords<'item10'>>(['item', '10']); |
| 86 | +expectType<SplitWords<'item010'>>(['item', '010']); |
| 87 | +expectType<SplitWords<'0item0'>>(['0', 'item', '0']); |
| 88 | +expectType<SplitWords<'01item01'>>(['01', 'item', '01']); |
| 89 | +expectType<SplitWords<'10item10'>>(['10', 'item', '10']); |
| 90 | +expectType<SplitWords<'010item010'>>(['010', 'item', '010']); |
| 91 | +expectType<SplitWords<'item0_item_1 item -2'>>(['item', '0', 'item', '1', 'item', '2']); |
0 commit comments