Skip to content

Commit

Permalink
chore: remove packages: nuka-carousel, validator (#2077)
Browse files Browse the repository at this point in the history
chore: remove packages
- nuka-carousel
- validator
  • Loading branch information
thiskevinwang authored Jul 14, 2023
1 parent 2366fa1 commit aa780b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 76 deletions.
73 changes: 0 additions & 73 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
"next-query-params": "^4.1.0",
"next-sitemap": "^3.1.21",
"next-themes": "^0.2.1",
"nuka-carousel": "^4.8.4",
"p-map": "^4.0.0",
"probe-image-size": "^7.2.3",
"promise-polyfill": "^8.2.1",
Expand All @@ -200,7 +199,6 @@
"unist-util-visit": "^4.1.0",
"unist-util-visit-children": "^1.1.4",
"use-query-params": "^2.1.2",
"validator": "^13.7.0",
"zod": "^3.20.2"
},
"overrides": {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/learn-client/api/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
* SPDX-License-Identifier: MPL-2.0
*/

import isUuid from 'validator/lib/isUUID'
import { z } from 'zod'
import { identifier, slug } from 'lib/learn-client/types'

function formatSlug(slug: slug) {
return slug.replace('/', '|')
}

function isUuid(id: string) {
return z.string().uuid().safeParse(id).success
}

// if the identifier is a slug, we need to format for the request to replace slashes (/) with pipes (|)
export function formatIdentifier(idOrSlug: identifier): identifier {
let identifier = idOrSlug
Expand Down

1 comment on commit aa780b0

@vercel
Copy link

@vercel vercel bot commented on aa780b0 Jul 14, 2023

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.