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';
|
import type Core from './Core';
|
||||||
|
|
||||||
|
export type App = Core;
|
||||||
|
|
||||||
export enum EntryType {
|
export enum EntryType {
|
||||||
CONFIG = 'config',
|
CONFIG = 'config',
|
||||||
VALUE = 'value',
|
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') }), {
|
recast.prettyPrint(recast.parse(code.replace(/\\/g, '/'), { parser: require('recast/parsers/typescript') }), {
|
||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
trailingComma: true,
|
trailingComma: true,
|
||||||
quote: 'single',
|
quote: 'single',
|
||||||
}).code;
|
}).code;
|
||||||
|
|
||||||
const makeCamelCase = function (name: string): string {
|
export const makeCamelCase = function (name: string): string {
|
||||||
if (typeof name !== 'string') {
|
if (typeof name !== 'string') {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user