diff --git a/package.json b/package.json index 09207cb..db3d2c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ini-decode", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "dist/index.js", "types": "typing/index.d.ts", diff --git a/src/index.ts b/src/index.ts index e53debe..80e0754 100644 --- a/src/index.ts +++ b/src/index.ts @@ -82,12 +82,13 @@ function parseDetail(data: any, parent: any, key: any): string { /** * 解码ini文件 * @param content 数据内容 + * @param interfaceName 自定义接口名称 */ -export function decode(content: string | Buffer) { +export function decode(content: string | Buffer, interfaceName?: string) { const base = parseBase(content) const dts = parseDetail(base, null, null) return { json: base, - dts: dts, + dts: `interface ${interfaceName||'ini'} ${dts}`, } } \ No newline at end of file