Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 8x 61x 61x 53x 51x 14x 13x 58x 8x | const { isDynamicKey, getStaticKey } = require('../utils/ast'); function listDynamicKeys(references, allKeys) { const dynamicKeys = []; for (const ref of references) { if (ref.parentPath.isSpreadElement()) return allKeys; if (ref.parentPath.isMemberExpression()) { if (isDynamicKey(ref.parentPath)) return allKeys; dynamicKeys.push(getStaticKey(ref.parentPath)); } } return dynamicKeys; } module.exports = listDynamicKeys; |