Skip to content

Commit

Permalink
refactor: remove qs dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
BJvdA committed Nov 24, 2021
1 parent a40d5ce commit cd1c2e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"dependencies": {
"fast-deep-equal": "^3.1.3",
"intersection-observer": "^0.12.0",
"qs": "^6.10.1",
"storyblok-rich-text-react-renderer": "^2.1.1"
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions src/next/previewHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import qs from 'qs';

interface NextPreviewHandlersProps {
/**
Expand Down Expand Up @@ -40,7 +39,9 @@ export const nextPreviewHandlers = ({
}

const restParams =
rest && Object.keys(rest).length ? `?${qs.stringify(rest)}` : '';
rest && Object.keys(rest).length
? `?${new URLSearchParams(rest as Record<string, string>).toString()}`
: '';

if (disableStoryCheck) {
res.setPreviewData({});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getPlainText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
NODE_BR,
} from 'storyblok-rich-text-react-renderer';

import { Richtext } from '../story';
import type { Richtext } from '../story';

const renderNode = (node: any, addNewlines: boolean) => {
if (node.type === 'text') {
Expand Down
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9121,13 +9121,6 @@ qrcode-terminal@^0.12.0:
resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819"
integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==

qs@^6.10.1:
version "6.10.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a"
integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==
dependencies:
side-channel "^1.0.4"

qs@~6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
Expand Down

1 comment on commit cd1c2e9

@vercel
Copy link

@vercel vercel bot commented on cd1c2e9 Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.