@storybook/router
Advanced tools
Comparing version 5.1.0-alpha.1 to 5.1.0-alpha.2
@@ -7,6 +7,9 @@ import { toId } from '../utils'; | ||
['handles simple cases', 'kind', 'story', 'kind--story'], | ||
['handles basic substitution', 'a b$c?d😀e', '1-2:3', 'a-b-c-d-e--1-2-3'], | ||
['handles basic substitution', 'a b$c?d😀e', '1-2:3', 'a-b-c-d😀e--1-2-3'], | ||
['handles runs of non-url chars', 'a?&*b', 'story', 'a-b--story'], | ||
['removes non-url chars from start and end', '?ab-', 'story', 'ab--story'], | ||
['downcases', 'KIND', 'STORY', 'kind--story'], | ||
['non-latin', 'Кнопки', 'нормальный', 'кнопки--нормальный'], | ||
['korean', 'kind', '바보 (babo)', 'kind--바보-babo'], | ||
['all punctuation', 'kind', 'unicorns,’–—―′¿`"<>()!.!!!{}[]%^&$*#&', 'kind--unicorns'], | ||
].forEach(([name, kind, story, output]) => { | ||
@@ -13,0 +16,0 @@ it(name, () => { |
@@ -10,6 +10,7 @@ "use strict"; | ||
var splitPath = /\/([^/]+)\/([^/]+)?/; | ||
// Remove punctuation https://gist.github.com/davidjrice/9d2af51100e41c6c4b4a | ||
exports.sanitize = function (string) { | ||
return string | ||
.toLowerCase() | ||
.replace(/[^a-z0-9-]/g, '-') | ||
.replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '-') | ||
.replace(/-+/g, '-') | ||
@@ -16,0 +17,0 @@ .replace(/^-+/, '') |
{ | ||
"name": "@storybook/router", | ||
"version": "5.1.0-alpha.1", | ||
"version": "5.1.0-alpha.2", | ||
"description": "Core Storybook Router", | ||
@@ -24,3 +24,4 @@ "keywords": [ | ||
"@reach/router": "^1.2.1", | ||
"@storybook/theming": "5.1.0-alpha.1", | ||
"@storybook/theming": "5.1.0-alpha.2", | ||
"core-js": "^2.6.5", | ||
"global": "^4.3.2", | ||
@@ -37,3 +38,3 @@ "memoizerific": "^1.11.3", | ||
}, | ||
"gitHead": "ed9b342742fadd5005f84bec846c0537bc13b4d5" | ||
"gitHead": "394cc916377ea71bfce7f3d9fc1e4c9f154f02bd" | ||
} |
@@ -7,6 +7,9 @@ import { toId } from '../utils'; | ||
['handles simple cases', 'kind', 'story', 'kind--story'], | ||
['handles basic substitution', 'a b$c?d😀e', '1-2:3', 'a-b-c-d-e--1-2-3'], | ||
['handles basic substitution', 'a b$c?d😀e', '1-2:3', 'a-b-c-d😀e--1-2-3'], | ||
['handles runs of non-url chars', 'a?&*b', 'story', 'a-b--story'], | ||
['removes non-url chars from start and end', '?ab-', 'story', 'ab--story'], | ||
['downcases', 'KIND', 'STORY', 'kind--story'], | ||
['non-latin', 'Кнопки', 'нормальный', 'кнопки--нормальный'], | ||
['korean', 'kind', '바보 (babo)', 'kind--바보-babo'], | ||
['all punctuation', 'kind', 'unicorns,’–—―′¿`"<>()!.!!!{}[]%^&$*#&', 'kind--unicorns'], | ||
].forEach(([name, kind, story, output]) => { | ||
@@ -13,0 +16,0 @@ it(name, () => { |
@@ -12,6 +12,7 @@ import qs from 'qs'; | ||
// Remove punctuation https://gist.github.com/davidjrice/9d2af51100e41c6c4b4a | ||
export const sanitize = (string: string) => { | ||
return string | ||
.toLowerCase() | ||
.replace(/[^a-z0-9-]/g, '-') | ||
.replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '-') | ||
.replace(/-+/g, '-') | ||
@@ -18,0 +19,0 @@ .replace(/^-+/, '') |
24276
612
8
+ Addedcore-js@^2.6.5
+ Added@babel/traverse@7.25.1(transitive)
+ Added@storybook/client-logger@5.1.0-alpha.2(transitive)
+ Added@storybook/theming@5.1.0-alpha.2(transitive)
- Removed@babel/traverse@7.25.0(transitive)
- Removed@storybook/client-logger@5.1.0-alpha.1(transitive)
- Removed@storybook/theming@5.1.0-alpha.1(transitive)