amis2/packages/office-viewer/__tests__/EmptyWord.ts
吴多益 0f97e378d9
chore: 换一下 office-viewer 包名 (#7321)
* chore: 换一下 office-viewer 包名

* 恢复误改的文件
2023-07-03 14:31:27 +08:00

17 lines
399 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 构建一个空 word主要是很多传参依赖
*/
import Word from '../src/Word';
import fs from 'fs';
import path from 'path';
import XMLPackageParser from '../src/package/XMLPackageParser';
export function createWord() {
const xmlContent = fs.readFileSync(
path.join(__dirname, './docx/empty.xml'),
'utf-8'
);
return new Word(xmlContent, {}, new XMLPackageParser());
}