Skip to content

Commit

Permalink
docs: remove inconsistent spacing, improve code example
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshx committed Jul 27, 2024
1 parent 26fcdc9 commit ced4060
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ export const notionError = createHumanLogs(
},
}
),
explanation(
"unsupported_blocktype",
"unsupported block type `{blockType}` is is included in this page",
{
params: {
blockType: "",
},
}
),
solution(
"add_missing_param",
"add the missing {paramType} on your Notion page",
Expand All @@ -70,6 +61,13 @@ export const notionError = createHumanLogs(
paramName: "",
},
}
),
solution(
"add_skip_missing_fields",
"if you want to skip posts that have missing fields, add `skipMissingFields`: true to your `fetchPosts` call like this: `notionSource.fetchPosts({ skipMissingFields: true })`",
{
params: {},
}
),
solution("open_issue", "open an issue for this on GitHub", {
params: {},
Expand All @@ -94,10 +92,11 @@ const errorLog = notionError([
"fetching_posts_failed",
"missing_params",
"add_missing_param",
"provide_fallback",
"add_skip_missing_fields",
], {
// 👇 these are inferred like magic!
paramName: 'image',
// 👇 these are inferred like magic!
paramName: 'image',
paramType: 'Image',
postId: 'abcd-123',
});
Expand All @@ -107,7 +106,8 @@ console.log(errorLog.toString())
🛠️ Solutions:
1) add the missing Image on your Notion page
2) if you want to skip posts that have missing fields, add `skipMissingFields`: true to your `fetchPosts` call like this: `notionSource.fetchPosts({ skipMissingFields: true })`"
2) add a fallback to your parameter definition like this: url(`image`, { fallback: `https://useflytrap.com` })
3) if you want to skip posts that have missing fields, add `skipMissingFields`: true to your `fetchPosts` call like this: `notionSource.fetchPosts({ skipMissingFields: true })`"
*/
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dev": "vitest dev",
"build": "unbuild",
"test": "vitest run",
"lint": "eslint",
"lint": "eslint --fix",
"release": "np",
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
Expand Down

0 comments on commit ced4060

Please sign in to comment.