浏览代码

refactor sample data

AykutSarac 2 年之前
父节点
当前提交
e72ffd7c4c
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/constants/data.ts

+ 3 - 1
src/constants/data.ts

@@ -1,7 +1,7 @@
 export const baseURL = process.env.NEXT_PUBLIC_BASE_URL;
 
 // Example taken from https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json
-export const defaultJson = JSON.stringify({
+const sampleJson = Object.freeze({
   squadName: "Super hero squad",
   homeTown: "Metro City",
   formed: 2016,
@@ -38,3 +38,5 @@ export const defaultJson = JSON.stringify({
     },
   ],
 });
+
+export const defaultJson = JSON.stringify(sampleJson, null, 2);