build(deps-dev): bump eslint from 8.57.1 to 9.13.0 (#2792)
* build(deps-dev): bump eslint from 8.57.1 to 9.13.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 9.13.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.57.1...v9.13.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Upgrade EsLint * Fix all new lint errors --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { BaseXmlComponent, IContext } from "./base";
|
||||
import { IXmlableObject, IXmlAttribute } from "./xmlable-object";
|
||||
import { IXmlAttribute, IXmlableObject } from "./xmlable-object";
|
||||
|
||||
type AttributeMap<T> = Record<keyof T, string>;
|
||||
|
||||
export type AttributeData = { readonly [key: string]: boolean | number | string };
|
||||
export type AttributeData = Record<string, boolean | number | string>;
|
||||
export type AttributePayload<T> = { readonly [P in keyof T]: { readonly key: string; readonly value: T[P] } };
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export abstract class XmlAttributeComponent<T extends { readonly [key: string]: any }> extends BaseXmlComponent {
|
||||
export abstract class XmlAttributeComponent<T extends Record<string, any>> extends BaseXmlComponent {
|
||||
protected readonly xmlKeys?: AttributeMap<T>;
|
||||
|
||||
public constructor(private readonly root: T) {
|
||||
@ -15,12 +15,9 @@ export abstract class XmlAttributeComponent<T extends { readonly [key: string]:
|
||||
}
|
||||
|
||||
public prepForXml(_: IContext): IXmlableObject {
|
||||
// eslint-disable-next-line functional/prefer-readonly-type
|
||||
const attrs: { [key: string]: string } = {};
|
||||
const attrs: Record<string, string> = {};
|
||||
Object.entries(this.root).forEach(([key, value]) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (value !== undefined) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const newKey = (this.xmlKeys && this.xmlKeys[key]) || key;
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
attrs[newKey] = value;
|
||||
|
Reference in New Issue
Block a user