/
githubmirror
/
styled-components
Обзор
Документация
Войти
/
githubmirror
/
styled-components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/benchmarks/src/impl.js
29 строк
803 B
Evan Jacobs
chore(bench): sandbox, headless benches, native-showcase, ios-benchmark
11 май 2026, 10:37
11 май 2026, 10:37
062ec8b
Код
Авторство
О чём код?
import packageJson from '../package.json'; const context = require.context('./implementations/', true, /index\.js$/); const { dependencies } = packageJson; const dependencyMap = { emotion: '@emotion/styled', tailwind: 'tailwindcss', 'styled-components-native': 'styled-components', 'styled-components-native-v6': 'styled-components-v6', }; const toImplementations = context => context.keys().map(path => { const components = context(path).default; const name = path.split('/')[1]; const version = dependencies[dependencyMap[name] || name] || ''; return { components, name, version }; }); const toObject = impls => impls.reduce((acc, impl) => { acc[impl.name] = impl; return acc; }, {}); const map = toObject(toImplementations(context)); export default map;