| 244 | }); |
| 245 | |
| 246 | function shouldMerge(t, k, keyStack) { |
| 247 | if (t && (t.type === 'alias' || t.type === 'interface')) { |
| 248 | // Return merged interface if the parent is a component or an interface we're extending. |
| 249 | if (t.type === 'interface' && (!k || k === 'props' || k === 'extends' || k === 'keyof')) { |
| 250 | return true; |
| 251 | } |
| 252 | |
| 253 | // If the key is "base", then it came from a generic type application, so we need to |
| 254 | // check one level above. If that was a component or extended interface, return the |
| 255 | // merged interface. |
| 256 | let lastKey = keyStack[keyStack.length - 1]; |
| 257 | if (k === 'base' && (lastKey === 'props' || lastKey === 'extends')) { |
| 258 | return true; |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | return false; |
| 263 | } |
| 264 | |
| 265 | async function parse(asset) { |
| 266 | let buffer = await asset.getBuffer(); |