mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
assets
components
config
docs
lib
click-outside
hooks
colors.ts
defaults.ts
get-slug.ts
logger.ts
range-map.ts
search.tsx
to-pixels.ts
usage-warns.ts
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
README.md
global.d.ts
license.md
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
6 lines
186 B
TypeScript
6 lines
186 B
TypeScript
// Remove trailing and leading slash, usually included in nodes
|
|
// returned by the BigCommerce API
|
|
const getSlug = (path: string) => path.replace(/^\/|\/$/g, '')
|
|
|
|
export default getSlug
|