1 | 'use strict'
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | const multiword = obj =>
|
7 | Object.keys(obj).reduce((s, i) =>
|
8 | (s[i] = [ multiword_(i) ]
|
9 | .concat(obj[i].map(multiword_))
|
10 | .reduce((s, i) => (s.push.apply(s, i), s), []), s), obj)
|
11 |
|
12 | const multiword_ = str =>
|
13 | str.match(/[A-Z]/) ? [
|
14 | str,
|
15 | str.toLowerCase(),
|
16 | str.replace(/[A-Z]/g, $0 => '_' + $0.toLowerCase())
|
17 | ] : [str]
|
18 |
|
19 | module.exports = multiword({
|
20 | ok: ['true', 'assert'],
|
21 | notOk: ['false', 'assertNot'],
|
22 |
|
23 | error: ['ifError', 'ifErr'],
|
24 | throws: ['throw'],
|
25 | doesNotThrow: ['notThrow'],
|
26 |
|
27 |
|
28 | equal: [
|
29 | 'equals', 'isEqual', 'is', 'strictEqual', 'strictEquals', 'strictIs',
|
30 | 'isStrict', 'isStrictly', 'identical'
|
31 | ],
|
32 |
|
33 |
|
34 | not: [
|
35 | 'inequal', 'notEqual', 'notEquals', 'notStrictEqual', 'notStrictEquals',
|
36 | 'isNotEqual', 'isNot', 'doesNotEqual', 'isInequal'
|
37 | ],
|
38 |
|
39 |
|
40 | same: [
|
41 | 'equivalent', 'looseEqual', 'looseEquals', 'deepEqual',
|
42 | 'deepEquals', 'isLoose', 'looseIs', 'isEquivalent'
|
43 | ],
|
44 |
|
45 |
|
46 | notSame: [
|
47 | 'inequivalent', 'looseInequal', 'notDeep', 'deepInequal',
|
48 | 'notLoose', 'looseNot', 'notEquivalent', 'isNotDeepEqual',
|
49 | 'isNotDeeply', 'notDeepEqual', 'isInequivalent',
|
50 | 'isNotEquivalent'
|
51 | ],
|
52 |
|
53 |
|
54 | strictSame: [
|
55 | 'strictEquivalent', 'strictDeepEqual', 'sameStrict', 'deepIs',
|
56 | 'isDeeply', 'isDeep', 'strictDeepEquals'
|
57 | ],
|
58 |
|
59 |
|
60 | strictNotSame: [
|
61 | 'strictInequivalent', 'strictDeepInequal', 'notSameStrict', 'deepNot',
|
62 | 'notDeeply', 'strictDeepInequals', 'notStrictSame'
|
63 | ],
|
64 |
|
65 |
|
66 | match: [
|
67 | 'has', 'hasFields', 'matches', 'similar', 'like', 'isLike',
|
68 | 'includes', 'include', 'isSimilar', 'contains'
|
69 | ],
|
70 |
|
71 | notMatch: [
|
72 | 'dissimilar', 'unsimilar', 'notSimilar', 'unlike', 'isUnlike',
|
73 | 'notLike', 'isNotLike', 'doesNotHave', 'isNotSimilar', 'isDissimilar'
|
74 | ],
|
75 |
|
76 | type: [
|
77 | 'isa', 'isA'
|
78 | ]
|
79 | })
|