MCPcopy Index your code
hub / github.com/adobe/react-spectrum / shouldMerge

Function shouldMerge

packages/dev/parcel-packager-docs/DocsPackager.js:246–263  ·  view source on GitHub ↗
(t, k, keyStack)

Source from the content-addressed store, hash-verified

244});
245
246function 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
265async function parse(asset) {
266 let buffer = await asset.getBuffer();

Callers 1

fnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected