Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: flightcontrolhq/superjson
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.12.3
Choose a base ref
...
head repository: flightcontrolhq/superjson
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.12.4
Choose a head ref
  • 6 commits
  • 4 files changed
  • 5 contributors

Commits on Apr 27, 2023

  1. Copy the full SHA
    4db78f2 View commit details
  2. docs: add benjick as a contributor for doc (#235)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored Apr 27, 2023
    Copy the full SHA
    abc5a9c View commit details

Commits on May 18, 2023

  1. Copy the full SHA
    6826f23 View commit details
  2. docs: add tylercollier as a contributor for doc (#238)

    * docs: update README.md [skip ci]
    
    * docs: update .all-contributorsrc [skip ci]
    
    ---------
    
    Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
    allcontributors[bot] authored May 18, 2023
    Copy the full SHA
    ae7dbce View commit details

Commits on Jun 26, 2023

  1. Copy the full SHA
    f3363a1 View commit details
  2. v1.12.4

    Skn0tt committed Jun 26, 2023
    Copy the full SHA
    671866a View commit details
Showing with 25 additions and 8 deletions.
  1. +18 −0 .all-contributorsrc
  2. +5 −3 README.md
  3. +1 −1 package.json
  4. +1 −4 src/is.ts
18 changes: 18 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -250,6 +250,24 @@
"contributions": [
"code"
]
},
{
"login": "benjick",
"name": "Max Malm",
"avatar_url": "https://avatars.githubusercontent.com/u/430872?v=4",
"profile": "http://www.maxmalm.se",
"contributions": [
"doc"
]
},
{
"login": "tylercollier",
"name": "Tyler Collier",
"avatar_url": "https://avatars.githubusercontent.com/u/366538?v=4",
"profile": "https://github.com/tylercollier",
"contributions": [
"doc"
]
}
],
"badgeTemplate": "<a href=\"#contributors\"><img src=\"https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat-square\" alt=\"All Contributors\"/></a>",
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

<p align="center">
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors"><img src="https://img.shields.io/badge/all_contributors-26-orange.svg?style=flat-square" alt="All Contributors"/></a>
<a href="#contributors"><img src="https://img.shields.io/badge/all_contributors-28-orange.svg?style=flat-square" alt="All Contributors"/></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<a href="https://www.npmjs.com/package/superjson">
<img alt="npm" src="https://img.shields.io/npm/v/superjson" />
@@ -103,7 +103,7 @@ json = {
// note that `normal` is not included here; `meta` only has special cases
meta = {
values: {
timestamp: ['date'],
timestamp: ['Date'],
test: ['regexp'],
}
};
@@ -116,7 +116,7 @@ The `getServerSideProps`, `getInitialProps`, and `getStaticProps` data hooks pro

Thankfully, Superjson is a perfect tool to bypass that limitation!

### Next.js SWC Plugin (experimental, v12.2 or above)
### Next.js SWC Plugin (experimental, v13 or above)

Next.js SWC plugins are [experimental](https://nextjs.org/docs/advanced-features/compiler#swc-plugins-experimental), but promise a significant speedup.
To use the [SuperJSON SWC plugin](https://github.com/blitz-js/next-superjson-plugin), install it and add it to your `next.config.js`:
@@ -316,6 +316,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://narumincho.notion.site"><img src="https://avatars.githubusercontent.com/u/16481886?v=4?s=100" width="100px;" alt="narumincho"/><br /><sub><b>narumincho</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=narumincho" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mgreystone"><img src="https://avatars.githubusercontent.com/u/12430681?v=4?s=100" width="100px;" alt="Markus Greystone"/><br /><sub><b>Markus Greystone</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/issues?q=author%3Amgreystone" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://gw2treasures.com/"><img src="https://avatars.githubusercontent.com/u/2511547?v=4?s=100" width="100px;" alt="darthmaim"/><br /><sub><b>darthmaim</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=darthmaim" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.maxmalm.se"><img src="https://avatars.githubusercontent.com/u/430872?v=4?s=100" width="100px;" alt="Max Malm"/><br /><sub><b>Max Malm</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=benjick" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tylercollier"><img src="https://avatars.githubusercontent.com/u/366538?v=4?s=100" width="100px;" alt="Tyler Collier"/><br /><sub><b>Tyler Collier</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=tylercollier" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.12.3",
"version": "1.12.4",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
5 changes: 1 addition & 4 deletions src/is.ts
Original file line number Diff line number Diff line change
@@ -13,10 +13,7 @@ export const isPlainObject = (
if (payload === Object.prototype) return false;
if (Object.getPrototypeOf(payload) === null) return true;

return (
payload.constructor === Object &&
Object.getPrototypeOf(payload) === Object.prototype
);
return Object.getPrototypeOf(payload) === Object.prototype;
};

export const isEmptyObject = (payload: any): payload is {} =>