mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-10 00:30:25 +08:00
chore(cli): 导入工具函数
This commit is contained in:
parent
b16c1fa5fc
commit
763038cc11
@ -1,5 +1,7 @@
|
||||
import type Core from './Core';
|
||||
|
||||
export type App = Core;
|
||||
|
||||
export enum EntryType {
|
||||
CONFIG = 'config',
|
||||
VALUE = 'value',
|
||||
|
@ -67,14 +67,14 @@ const generateContent = (
|
||||
`);
|
||||
};
|
||||
|
||||
const prettyCode = (code: string) =>
|
||||
export const prettyCode = (code: string) =>
|
||||
recast.prettyPrint(recast.parse(code.replace(/\\/g, '/'), { parser: require('recast/parsers/typescript') }), {
|
||||
tabWidth: 2,
|
||||
trailingComma: true,
|
||||
quote: 'single',
|
||||
}).code;
|
||||
|
||||
const makeCamelCase = function (name: string): string {
|
||||
export const makeCamelCase = function (name: string): string {
|
||||
if (typeof name !== 'string') {
|
||||
return '';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user