Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dolanmiu committed Dec 22, 2023
1 parent 452e154 commit 09b56f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/file/fonts/font-wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { IViewWrapper } from "@file/document-wrapper";
import { Relationships } from "@file/relationships";
import { XmlComponent } from "@file/xml-components";
import { createFontTable } from ".";

import { IFontOptions } from "./font";
import { createFontTable } from "./font-table";

export class FontWrapper implements IViewWrapper {
private readonly fontTable: XmlComponent;
private readonly relationships: Relationships;

public constructor(public options: readonly IFontOptions[]) {
public constructor(public readonly options: readonly IFontOptions[]) {
this.fontTable = createFontTable(options);
this.relationships = new Relationships();

Expand Down
2 changes: 2 additions & 0 deletions src/file/fonts/obfuscate-ttf-to-odttf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ export const obfuscate = (buf: Buffer, fontFilename: string): Buffer => {

const hexStrings = guid.replace(/(..)/g, "$1 ").trim().split(" ");
const hexNumbers = hexStrings.map((hexString) => parseInt(hexString, 16));
// eslint-disable-next-line functional/immutable-data
hexNumbers.reverse();

const bytesToObfuscate = buf.slice(obfuscatedStartOffset, obfuscatedEndOffset);
// eslint-disable-next-line no-bitwise
const obfuscatedBytes = bytesToObfuscate.map((byte, i) => byte ^ hexNumbers[i % hexNumbers.length]);

const out = Buffer.concat([buf.slice(0, obfuscatedStartOffset), obfuscatedBytes, buf.slice(obfuscatedEndOffset)]);
Expand Down

0 comments on commit 09b56f9

Please sign in to comment.