mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-06 04:21:55 +00:00
fix typings issues
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -35,3 +35,4 @@ yarn-error.log*
|
||||
|
||||
/public/posts
|
||||
.idea/
|
||||
tsconfig.tsbuildinfo
|
||||
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -8628,9 +8628,9 @@
|
||||
"integrity": "sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ=="
|
||||
},
|
||||
"ts-util-helpers": {
|
||||
"version": "1.1.0-alpha.1",
|
||||
"resolved": "https://registry.npmjs.org/ts-util-helpers/-/ts-util-helpers-1.1.0-alpha.1.tgz",
|
||||
"integrity": "sha512-VhthBMnmA67jAnRCtlsBloTv/ovTBxToOc0a2BdSc+EfyvvGaa/RJpqOyNTyzklU2ltPduO+XZU2TNg20Ops/g==",
|
||||
"version": "1.1.0-alpha.2",
|
||||
"resolved": "https://registry.npmjs.org/ts-util-helpers/-/ts-util-helpers-1.1.0-alpha.2.tgz",
|
||||
"integrity": "sha512-/6mKvEmzuDXfHK50ghJyPm4D3BWu/RJK06xF89dfVnWDTbLHtJcnXuIblJFSwbyoi4iUPESXtqX4ze523IKu2w==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.14.6"
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
"retext-english": "^4.1.0",
|
||||
"sass": "^1.44.0",
|
||||
"slash": "^4.0.0",
|
||||
"ts-util-helpers": "^1.1.0-alpha.1",
|
||||
"ts-util-helpers": "^1.1.0-alpha.2",
|
||||
"typescript": "^4.4.4",
|
||||
"unified": "^10.1.0",
|
||||
"unist-util-flat-filter": "^2.0.0"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import fs from "fs";
|
||||
import { join } from "path";
|
||||
import matter from "gray-matter";
|
||||
import { countContent } from "../utils/count-words";
|
||||
import {PostInfo} from "uu-types";
|
||||
import { countContent } from "utils/count-words";
|
||||
import { PostInfo } from "uu-types";
|
||||
import { dataDirectory, getDatas } from "./get-datas";
|
||||
import {
|
||||
pickDeep,
|
||||
@@ -20,7 +20,7 @@ export function getPostSlugs() {
|
||||
return fs.readdirSync(postsDirectory);
|
||||
}
|
||||
|
||||
type KeysToPick = DeepPartial<DeepReplaceKeys<PostInfo, true | false>>;
|
||||
type KeysToPick = DeepPartial<DeepReplaceKeys<PostInfo>>;
|
||||
|
||||
export function getPostBySlug<ToPick extends KeysToPick>(
|
||||
slug: string,
|
||||
@@ -44,7 +44,7 @@ export function getPostBySlug<ToPick extends KeysToPick>(
|
||||
};
|
||||
|
||||
// Ensure only the minimal needed data is exposed
|
||||
const items = pickDeep(data, fields);
|
||||
const items = pickDeep(data, fields as DeepReplaceKeys<typeof data>);
|
||||
|
||||
if (fields.slug) {
|
||||
items.slug = realSlug;
|
||||
@@ -95,7 +95,7 @@ export const getAllPostsForListView = () => {
|
||||
authors: {
|
||||
firstName: true,
|
||||
lastName: true,
|
||||
id: true
|
||||
id: true,
|
||||
},
|
||||
excerpt: true,
|
||||
} as const,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user