Skip to content

Commit f85f616

Browse files
fix: export missing DiffResult type
1 parent b468b43 commit f85f616

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/lovely-onions-share.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opentf/obj-diff": minor
3+
---
4+
5+
Exported the missing DiffResult type.

apps/demo/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import prettier from "prettier/standalone";
1111
import * as babelPlugin from "prettier/parser-babel";
1212
import * as estreeParser from "prettier/plugins/estree";
1313

14-
async function format(code) {
14+
async function format(code: string) {
1515
const formatted = await prettier.format(`const a = ${code}`, {
1616
parser: "babel",
1717
plugins: [babelPlugin, estreeParser],
@@ -29,7 +29,7 @@ function App() {
2929
const [obj2Val, setObj2Val] = useState(`{
3030
a: 2, c: 5
3131
}`);
32-
const [raw, setRaw] = useState([]);
32+
const [raw, setRaw] = useState<Array<DiffResult>([]);
3333

3434
useEffect(() => {
3535
async function runFormat() {

packages/obj-diff/src/diff.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ADDED, CHANGED, DELETED } from "./constants";
22

3-
type DiffResult = {
3+
export type DiffResult = {
44
t: 0 | 1 | 2;
55
p: Array<string | number>;
66
v?: unknown;

0 commit comments

Comments
 (0)