|
1 | 1 | { |
2 | 2 | "moduleReplacements": [ |
| 3 | + { |
| 4 | + "type": "simple", |
| 5 | + "moduleName": "arr-diff", |
| 6 | + "replacement": "Use a.filter((item) => !b.includes(item))", |
| 7 | + "category": "micro-utilities" |
| 8 | + }, |
| 9 | + { |
| 10 | + "type": "simple", |
| 11 | + "moduleName": "array-last", |
| 12 | + "replacement": "Use arr.at(-1) or arr[arr.length - 1]", |
| 13 | + "category": "micro-utilities" |
| 14 | + }, |
| 15 | + { |
| 16 | + "type": "simple", |
| 17 | + "moduleName": "array-union", |
| 18 | + "replacement": "Use [...new Set([...a, ...b])]", |
| 19 | + "category": "micro-utilities" |
| 20 | + }, |
| 21 | + { |
| 22 | + "type": "simple", |
| 23 | + "moduleName": "array-uniq", |
| 24 | + "replacement": "Use [...new Set(arr)]", |
| 25 | + "category": "micro-utilities" |
| 26 | + }, |
| 27 | + { |
| 28 | + "type": "simple", |
| 29 | + "moduleName": "array-unique", |
| 30 | + "replacement": "Use [...new Set(arr)]", |
| 31 | + "category": "micro-utilities" |
| 32 | + }, |
| 33 | + { |
| 34 | + "type": "simple", |
| 35 | + "moduleName": "arrify", |
| 36 | + "replacement": "Use (v == null ? [] : Array.isArray(v) ? v : [v])", |
| 37 | + "category": "micro-utilities" |
| 38 | + }, |
3 | 39 | { |
4 | 40 | "type": "simple", |
5 | 41 | "moduleName": "call-bind", |
|
24 | 60 | "replacement": "Use Object.defineProperty(target, Symbol.toStringTag, { value, configurable: true })", |
25 | 61 | "category": "micro-utilities" |
26 | 62 | }, |
| 63 | + { |
| 64 | + "type": "simple", |
| 65 | + "moduleName": "filter-obj", |
| 66 | + "replacement": "Use Object.fromEntries(Object.entries(obj).filter(fn))", |
| 67 | + "category": "micro-utilities" |
| 68 | + }, |
| 69 | + { |
| 70 | + "type": "simple", |
| 71 | + "moduleName": "has-flag", |
| 72 | + "replacement": "Use process.argv.includes('--flag')", |
| 73 | + "category": "micro-utilities" |
| 74 | + }, |
27 | 75 | { |
28 | 76 | "type": "simple", |
29 | 77 | "moduleName": "is-array-buffer", |
|
36 | 84 | "replacement": "Use Object.prototype.toString.call(v) === \"[object Boolean]\"", |
37 | 85 | "category": "micro-utilities" |
38 | 86 | }, |
| 87 | + { |
| 88 | + "type": "simple", |
| 89 | + "moduleName": "is-ci", |
| 90 | + "replacement": "Use Boolean(process.env.CI)", |
| 91 | + "category": "micro-utilities" |
| 92 | + }, |
39 | 93 | { |
40 | 94 | "type": "simple", |
41 | 95 | "moduleName": "is-date-object", |
|
48 | 102 | "replacement": "Use (n % 2) === 0", |
49 | 103 | "category": "micro-utilities" |
50 | 104 | }, |
| 105 | + { |
| 106 | + "type": "simple", |
| 107 | + "moduleName": "is-finite", |
| 108 | + "replacement": "Use Number.isFinite(v)", |
| 109 | + "category": "micro-utilities" |
| 110 | + }, |
51 | 111 | { |
52 | 112 | "type": "simple", |
53 | 113 | "moduleName": "is-negative", |
|
126 | 186 | "replacement": "Use process.platform === \"win32\"", |
127 | 187 | "category": "micro-utilities" |
128 | 188 | }, |
| 189 | + { |
| 190 | + "type": "simple", |
| 191 | + "moduleName": "kind-of", |
| 192 | + "replacement": "Use typeof v, or Object.prototype.toString.call(v) to get the internal [[Class]]", |
| 193 | + "category": "micro-utilities" |
| 194 | + }, |
| 195 | + { |
| 196 | + "type": "simple", |
| 197 | + "moduleName": "lower-case", |
| 198 | + "replacement": "Use str.toLocaleLowerCase() or str.toLowerCase()", |
| 199 | + "category": "micro-utilities" |
| 200 | + }, |
| 201 | + { |
| 202 | + "type": "simple", |
| 203 | + "moduleName": "repeat-string", |
| 204 | + "replacement": "Use str.repeat(n)", |
| 205 | + "category": "micro-utilities" |
| 206 | + }, |
| 207 | + { |
| 208 | + "type": "simple", |
| 209 | + "moduleName": "slash", |
| 210 | + "replacement": "Use path.startsWith('\\\\?\\') ? path : path.replace(/\\/g, '/')", |
| 211 | + "category": "micro-utilities" |
| 212 | + }, |
129 | 213 | { |
130 | 214 | "type": "simple", |
131 | 215 | "moduleName": "split-lines", |
132 | 216 | "replacement": "Use str.split(/\\r?\\n/)", |
133 | 217 | "category": "micro-utilities" |
| 218 | + }, |
| 219 | + { |
| 220 | + "type": "simple", |
| 221 | + "moduleName": "uniq", |
| 222 | + "replacement": "Use [...new Set(arr)]", |
| 223 | + "category": "micro-utilities" |
| 224 | + }, |
| 225 | + { |
| 226 | + "type": "simple", |
| 227 | + "moduleName": "upper-case", |
| 228 | + "replacement": "Use str.toLocaleUpperCase() or str.toUpperCase()", |
| 229 | + "category": "micro-utilities" |
134 | 230 | } |
135 | 231 | ] |
136 | 232 | } |
0 commit comments