/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/taro-components/scripts/utils.ts
24 строки
595 B
liuzejia
lint: 修改node模块的引入
24 июн 2024, 16:25
24 июн 2024, 16:25
1965b18
Код
Авторство
О чём код?
import path from 'node:path' import { fs } from '@tarojs/helper' import { TYPES_DIR } from './constants' export function camelCaseEnhance (word = '', index: number) { word = word.toLowerCase() if (index !== 0) { word = `${word[0].toUpperCase()}${word.slice(1)}` } return word } export function getTypesList (type = ''): string[] { if (type) { return fs.readdirSync(path.join('node_modules', 'miniapp-types/dist/types', type)) } return fs.readdirSync(TYPES_DIR) } export function getTypeFilePath (name: string): string { return path.join(TYPES_DIR, `${name}.d.ts`) }