forked from opentiny/tiny-vue
fix: Deserialization problem (#836)
* fix: Deserialization problem * fix: type error
This commit is contained in:
parent
7cd5270d46
commit
64183e2c25
|
@ -444,16 +444,16 @@ const createModuleMapping = (componentName, isMobile = false) => {
|
|||
})
|
||||
|
||||
const moduleJson = quickSort({ sortData: moduleMap, returnType: 'object' })
|
||||
|
||||
fs.writeJsonSync(
|
||||
fs.writeFileSync(
|
||||
pathJoinFromCLI('../../packages/modules.json'),
|
||||
prettierFormat({
|
||||
str: JSON.stringify(moduleJson),
|
||||
str: typeof moduleJson === 'string' ? moduleJson : JSON.stringify(moduleJson),
|
||||
options: {
|
||||
parser: 'json',
|
||||
printWidth: 10
|
||||
}
|
||||
})
|
||||
}),
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ const kebabCase = ({ str, splitChar = '-' }: { str: string; splitChar?: string }
|
|||
* @param {String} str 格式字符
|
||||
* @param {Object} options 格式字符
|
||||
*/
|
||||
const prettierFormat = ({ str, options = {} }: { str: string; options?: object }) => {
|
||||
const prettierFormat = ({ str, options = {} }: { str: string; options?: object }):string => {
|
||||
return prettier.format(
|
||||
str,
|
||||
Object.assign(
|
||||
|
@ -143,10 +143,10 @@ const prettierFormat = ({ str, options = {} }: { str: string; options?: object }
|
|||
bracketSpacing: true,
|
||||
quoteProps: 'preserve',
|
||||
parser: 'typescript'
|
||||
},
|
||||
} as any,
|
||||
options
|
||||
)
|
||||
)
|
||||
) as unknown as string
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue