Trying to upgrade docx to use Vite
This commit is contained in:
@ -14,11 +14,14 @@ export abstract class XmlAttributeComponent<T extends object> extends BaseXmlCom
|
||||
}
|
||||
|
||||
public prepForXml(_: IContext): IXmlableObject {
|
||||
const attrs = {};
|
||||
// eslint-disable-next-line functional/prefer-readonly-type
|
||||
const attrs: { [key: string]: string } = {};
|
||||
Object.keys(this.root).forEach((key) => {
|
||||
const value = this.root[key];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const value = (this.root as any)[key];
|
||||
if (value !== undefined) {
|
||||
const newKey = (this.xmlKeys && this.xmlKeys[key]) || key;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const newKey = (this.xmlKeys && (this.xmlKeys as any)[key]) || key;
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
attrs[newKey] = value;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ export interface IXmlAttribute {
|
||||
readonly [key: string]: string | number | boolean;
|
||||
}
|
||||
export interface IXmlableObject extends Object {
|
||||
readonly _attr?: IXmlAttribute;
|
||||
// readonly _attr?: IXmlAttribute;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
readonly [key: string]: any;
|
||||
}
|
||||
|
||||
// Needed because of: https://github.com/s-panferov/awesome-typescript-loader/issues/432
|
||||
|
Reference in New Issue
Block a user