Skip to content

Commit

Permalink
refactor(diff): update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Feb 24, 2020
1 parent 2641a40 commit 3fabbbb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
9 changes: 1 addition & 8 deletions packages/diff/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { IObjectOf } from "@thi.ng/api";
import type { IObjectOf } from "@thi.ng/api";

export type DiffKeyMap<T> = IObjectOf<T>;

export const enum DiffMode {
ONLY_DISTANCE,
ONLY_DISTANCE_LINEAR,
ONLY_DISTANCE_LINEAR_ONLY_CHANGES,
FULL
}

export interface ArrayDiff<T> {
distance: number;
adds?: DiffKeyMap<T>;
Expand Down
8 changes: 2 additions & 6 deletions packages/diff/src/array.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { equiv as _equiv } from "@thi.ng/equiv";
import {
ArrayDiff,
DiffKeyMap,
DiffMode,
EditLog
} from "./api";
import { DiffMode } from "./constants";
import type { ArrayDiff, DiffKeyMap, EditLog } from "./api";

let _cachedFP: Int32Array;
let _cachedPath: Int32Array;
Expand Down
6 changes: 6 additions & 0 deletions packages/diff/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const enum DiffMode {
ONLY_DISTANCE,
ONLY_DISTANCE_LINEAR,
ONLY_DISTANCE_LINEAR_ONLY_CHANGES,
FULL
}
3 changes: 2 additions & 1 deletion packages/diff/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./api";
export type * from "./api";
export * from "./array";
export * from "./constants";
export * from "./object";
5 changes: 3 additions & 2 deletions packages/diff/src/object.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IObjectOf, Predicate2 } from "@thi.ng/api";
import { equiv } from "@thi.ng/equiv";
import { DiffMode, ObjectDiff } from "./api";
import { DiffMode } from "./constants";
import type { IObjectOf, Predicate2 } from "@thi.ng/api";
import type { ObjectDiff } from "./api";

export const diffObject = <T>(
a: IObjectOf<T> | undefined | null,
Expand Down

0 comments on commit 3fabbbb

Please sign in to comment.