itube-specs 0.0.694 → 0.0.696

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.694",
4
+ "version": "0.0.696",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "./types/index.d.ts",
7
7
  "scripts": {
@@ -1,11 +1,8 @@
1
1
  import type { IRawModelCard, IModelCard, IModelParameter } from '../../../types';
2
2
  import { ThumbSize } from '../../enums/thumb-size';
3
3
 
4
- const PIERCING_NAME = 'tattoos_presence';
5
- const TATTOOS_NAME = 'piercings_presence';
6
- const parameters = ['height_cm', 'weight_kg', PIERCING_NAME, TATTOOS_NAME];
7
- const iconOnlyParameters = [PIERCING_NAME, TATTOOS_NAME];
8
- const age = (card: IRawModelCard) => card.parameters.find(item => item.name === 'age')?.values[0].title
4
+ const parameterNames = ['height_cm', 'weight_kg'];
5
+ const age = (card: IRawModelCard) => card.parameters.find(item => item.name === 'age')?.values[0].title;
9
6
 
10
7
  export const cleanModelCard = (card: IRawModelCard): IModelCard => ({
11
8
  title: card.title || '',
@@ -16,24 +13,15 @@ export const cleanModelCard = (card: IRawModelCard): IModelCard => ({
16
13
  country: {
17
14
  title: card.parameters?.find(item => item.name === 'birthplace_country')?.values[0].title || '',
18
15
  name: card.parameters?.find(item => item.name === 'birthplace_country')?.values[0].name || '',
19
- } ,
16
+ },
20
17
  parameters: [
21
18
  ...(age(card) ? [{
22
19
  title: 'age',
23
20
  value: age(card),
24
21
  }] : []),
25
- ...card.parameters.filter(item => parameters.includes(item.name) && item.values?.length).map((item: IModelParameter) => {
26
- if (iconOnlyParameters.includes(item.name)) {
27
- return {
28
- icon: item.name.split('_')[0],
29
- title: item.name,
30
- value: item.values?.[0]?.name,
31
- }
32
- }
33
- return {
34
- title: item.name,
35
- value: item.values?.[0]?.title,
36
- }
37
- }),
22
+ ...card.parameters.filter(item => parameterNames.includes(item.name) && item.values?.length).map((item: IModelParameter) => ({
23
+ title: item.name,
24
+ value: item.values?.[0]?.title,
25
+ })),
38
26
  ],
39
27
  });
@@ -1,4 +1,5 @@
1
1
  import type { IRawPlaylistsUser, IPlaylistCard } from '../../../types';
2
+ import { ThumbSize } from '../../enums/thumb-size';
2
3
 
3
4
  export const cleanUserPlaylistCard = (card: IRawPlaylistsUser): IPlaylistCard => ({
4
5
  created: card.created || 0,
@@ -6,7 +7,11 @@ export const cleanUserPlaylistCard = (card: IRawPlaylistsUser): IPlaylistCard =>
6
7
  name: card.name || '',
7
8
  username: card.username || '',
8
9
  playlistType: card.playlistType || '',
9
- thumbUrls: card.thumbs?.slice(0, 4) || [''],
10
+ thumbUrls: card.thumbs?.slice(0, 4).map(url => ({
11
+ webp: {
12
+ [ThumbSize.Small]: url,
13
+ },
14
+ })) || [],
10
15
  videosCount: card.videoCount || 0,
11
16
  firstVideoId: card.firstVideoID || '',
12
17
  })
@@ -10,7 +10,6 @@ export interface IModelCard {
10
10
  title: string
11
11
  };
12
12
  parameters: {
13
- icon?: string
14
13
  title?: string
15
14
  value?: string
16
15
  }[];