itube-specs 0.0.274 → 0.0.276

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "itube-specs",
3
3
  "type": "module",
4
- "version": "0.0.274",
4
+ "version": "0.0.276",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -4,6 +4,7 @@ export const convertString = () => {
4
4
  const toSlug = (input: string): string => {
5
5
  return input
6
6
  .toLowerCase()
7
+ .replace(/_/g, '~')
7
8
  .replace(/-/g, '\u0000')
8
9
  .replace(/\s+/g, '-')
9
10
  .replace(/\u0000/g, '_');
@@ -11,9 +12,10 @@ export const convertString = () => {
11
12
 
12
13
  const fromSlug = (slug: string): string => {
13
14
  return slug
14
- .replace(/_/g, '\u0000')
15
- .replace(/-/g, ' ')
16
- .replace(/\u0000/g, '-');
15
+ .replace(/_/g, '\u0000') // временно убираем "_" (разделители)
16
+ .replace(/-/g, ' ') // "-" → пробел
17
+ .replace(/\u0000/g, '-') // возвращаем старые "-"
18
+ .replace(/~/g, '_'); // в конце восстанавливаем "_"
17
19
  };
18
20
 
19
21
  const toSnakeCase = (slug: string): string => {