Skip to content

Commit

Permalink
Remove EMPTY_OBJECT
Browse files Browse the repository at this point in the history
Signed-off-by: William So <polyipseity@gmail.com>
  • Loading branch information
polyipseity committed Apr 28, 2023
1 parent 4cc81b4 commit d9e9ac4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions sources/utils/obsidian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import { DOMClasses, NOTICE_NO_TIMEOUT, SI_PREFIX_SCALE } from "sources/magic"
import { Directory, Encoding, Filesystem } from "@capacitor/filesystem"
import {
EMPTY_OBJECT,
Functions,
clear,
createChildElement,
Expand Down Expand Up @@ -279,7 +278,7 @@ export function awaitCSS(plugin: Plugin, element: HTMLElement): void {
export function cleanFrontmatterCache(
cache?: FrontMatterCache,
): Readonly<Record<string, unknown>> {
if (!cache) { return EMPTY_OBJECT }
if (!cache) { return deepFreeze({}) }
const ret = typedStructuredClone<Partial<typeof cache>>(cache)
delete ret.position
return deepFreeze(ret)
Expand Down
2 changes: 0 additions & 2 deletions sources/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import type { SvelteComponent } from "svelte"
import type { Writable } from "node:stream"

export type KeyModifier = "Alt" | "Ctrl" | "Meta" | "Shift"
export const EMPTY_OBJECT: Readonly<Record<keyof any, never>> =
deepFreeze({})

export class EventEmitterLite<A extends readonly unknown[]> {
protected static readonly emitLock = "emit"
Expand Down

0 comments on commit d9e9ac4

Please sign in to comment.