Fix the type of excerpt function #111
Loading…
Reference in a new issue
No description provided.
Delete branch "sunnyone/fix-excerpt-type"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The "excerpt" option does not expect a function that returns a string but expects a function that mutates a file object itself. https://github.com/jonschlinkert/gray-matter#optionsexcerpt
I hit this just now too working on a next.js project using this.
That being said, I'm really not sure the point of
O, and that seems to trip things up more than it helps. Locally, I tried:And this seems to make everything happy. With the semi-recursive
Otype, the TS compiler seems to trip up. With the change, I can do:And TS is happy.
Happy to submit an updated PR if folks like that.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.