itube-specs 0.0.325 → 0.0.326

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.325",
4
+ "version": "0.0.326",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
package/runtime/index.ts CHANGED
@@ -39,6 +39,8 @@ export * from './utils/converters/convert-model-card-to-chips';
39
39
  export * from './utils/converters/group-categories-by-first-letter';
40
40
  export * from './utils/converters/group-objects-by-first-letter';
41
41
  export * from './utils/converters/convert-snake-keys-to-camel';
42
+ export * from './utils/converters/convert-query-categories';
43
+ export * from './utils/converters/convert-string-array-to-chips';
42
44
  export * from './utils/server/abort-controller';
43
45
  export * from './utils/server/api-helper';
44
46
  export * from './utils/server/parse-api-error';
@@ -0,0 +1,8 @@
1
+ import type { RouteLocationNormalizedLoaded } from 'vue-router';
2
+ /**
3
+ * конвертирует список категорий из фильтра страниц с видео роликами из query в одну строку, все слова с заглавной буквы
4
+ */
5
+ export function convertQueryCategories(route: RouteLocationNormalizedLoaded) {
6
+ const MAX_CATEGORIES = 3;
7
+ return String(route.query[ 'categories' ])?.split(',').map(item => item.split('_')[ 1 ]).map(item => item?.charAt(0).toUpperCase() + item?.slice(1)).slice(0, MAX_CATEGORIES).join(', ');
8
+ }
@@ -0,0 +1,10 @@
1
+ import type { IChipsItem } from '../../../types';
2
+
3
+ export function convertStringArrayToChips(array: string[], prefix: string, resetPath: string): IChipsItem[] {
4
+ return array.map((item) => ({
5
+ title: item,
6
+ value: item,
7
+ prefix: prefix,
8
+ resetPath: resetPath,
9
+ }));
10
+ }
@@ -1,7 +0,0 @@
1
- /**
2
- * конвертирует список категорий из фильтра страниц с видео роликами из query в одну строку, все слова с заглавной буквы
3
- */
4
- export function useConvertQueryCategories() {
5
- const MAX_CATEGORIES = 3;
6
- return String(useRoute().query[ 'categories' ])?.split(',').map(item => item.split('_')[ 1 ]).map(item => item?.charAt(0).toUpperCase() + item?.slice(1)).slice(0, MAX_CATEGORIES).join(', ');
7
- }
@@ -1,14 +0,0 @@
1
- import type { IChipsItem } from '../types';
2
-
3
- export function useConvertStringArrayToChips(array: string[], prefix: string, resetPath: string) {
4
- const alphabetItems = computed<IChipsItem[]>(() => {
5
- return array.map((item) => ({
6
- title: item,
7
- value: item,
8
- prefix: prefix,
9
- resetPath: resetPath,
10
- }));
11
- });
12
-
13
- return { alphabetItems };
14
- }