1
0
mirror of https://github.com/vercel/commerce.git synced 2025-07-22 20:26:49 +00:00
Files
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
commerce/lib/get-slug.ts
Luis Alvarez eddf338bfb Removed /utils
2020-10-27 05:53:30 -05:00

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