diff --git a/.nycrc b/.nycrc index 23a3fdfe39..d79a0ddd65 100644 --- a/.nycrc +++ b/.nycrc @@ -1,9 +1,9 @@ { "check-coverage": true, - "lines": 98.47, - "functions": 96.44, - "branches": 95.39, - "statements": 98.45, + "lines": 98.53, + "functions": 96.59, + "branches": 95.51, + "statements": 98.51, "include": [ "src/**/*.ts" ], diff --git a/src/file/custom-properties/custom-properties-attributes.ts b/src/file/custom-properties/custom-properties-attributes.ts index 087c9e98a1..2b91ce0ac0 100644 --- a/src/file/custom-properties/custom-properties-attributes.ts +++ b/src/file/custom-properties/custom-properties-attributes.ts @@ -1,11 +1,9 @@ import { XmlAttributeComponent } from "file/xml-components"; -export interface ICustomPropertiesAttributes { +export class CustomPropertiesAttributes extends XmlAttributeComponent<{ readonly xmlns: string; readonly vt: string; -} - -export class CustomPropertiesAttributes extends XmlAttributeComponent { +}> { protected readonly xmlKeys = { xmlns: "xmlns", vt: "xmlns:vt", diff --git a/src/file/custom-properties/custom-property-attributes.ts b/src/file/custom-properties/custom-property-attributes.ts index 9b2697fe94..e681eee135 100644 --- a/src/file/custom-properties/custom-property-attributes.ts +++ b/src/file/custom-properties/custom-property-attributes.ts @@ -1,12 +1,10 @@ import { XmlAttributeComponent } from "file/xml-components"; -export interface ICustomPropertyAttributes { +export class CustomPropertyAttributes extends XmlAttributeComponent<{ readonly fmtid: string; readonly pid: string; readonly name: string; -} - -export class CustomPropertyAttributes extends XmlAttributeComponent { +}> { protected readonly xmlKeys = { fmtid: "fmtid", pid: "pid", diff --git a/src/file/media/media.spec.ts b/src/file/media/media.spec.ts index d623e0e929..d3446ea0c1 100644 --- a/src/file/media/media.spec.ts +++ b/src/file/media/media.spec.ts @@ -77,19 +77,23 @@ describe("Media", () => { }); it("should return UInt8Array if atob is present", () => { - // tslint:disable-next-line - ((process as any).atob as any) = () => "atob result"; + global.atob = () => "atob result"; const image = new Media().addMedia(""); expect(image.stream).to.be.an.instanceof(Uint8Array); + + // tslint:disable-next-line: no-any + (global as any).atob = undefined; }); it("should use data as is if its not a string", () => { - // tslint:disable-next-line - ((process as any).atob as any) = () => "atob result"; + global.atob = () => "atob result"; - const image = new Media().addMedia(new Buffer("")); + const image = new Media().addMedia(Buffer.from("")); expect(image.stream).to.be.an.instanceof(Uint8Array); + + // tslint:disable-next-line: no-any + (global as any).atob = undefined; }); });