@cofondateurauchomage/libs 1.0.16 → 1.0.18

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/lib/const.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { TSkills } from "./db.model";
2
- export declare const SKILLS: TSkills;
1
+ import { TSkill } from "./db.model";
2
+ export declare const SKILLS: TSkill[];
package/lib/db.model.d.ts CHANGED
@@ -10,10 +10,10 @@ export interface IUser {
10
10
  city?: string;
11
11
  linkedin?: string;
12
12
  tel?: string;
13
- skills: TSkills[];
13
+ skills: TSkill[];
14
14
  motivations: string;
15
15
  partner: string;
16
16
  business: string;
17
17
  invest?: number;
18
18
  }
19
- export type TSkills = ("Business" | "Design" | "Marketing" | "Produit" | "Tech")[];
19
+ export type TSkill = "Business" | "Design" | "Marketing" | "Produit" | "Tech";
@@ -1,7 +1,7 @@
1
- import { TSkills } from "../db.model";
1
+ import { TSkill } from "../db.model";
2
2
  /**
3
- * Checks if at least one skill is checked
3
+ * Checks if at least one skill is checked and has the correct value
4
4
  * @param skills
5
5
  * @returns
6
6
  */
7
- export declare function checkSkills(skills: TSkills): boolean;
7
+ export declare function checkSkills(skills: TSkill[]): boolean;
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkSkills = void 0;
4
4
  const const_1 = require("../const");
5
5
  /**
6
- * Checks if at least one skill is checked
6
+ * Checks if at least one skill is checked and has the correct value
7
7
  * @param skills
8
8
  * @returns
9
9
  */
10
10
  function checkSkills(skills) {
11
- let check = true;
11
+ let valid = skills.length > 0 ? true : false;
12
12
  skills.forEach((skill) => {
13
13
  if (!const_1.SKILLS.includes(skill))
14
- check = false;
14
+ valid = false;
15
15
  });
16
- return check;
16
+ return valid;
17
17
  }
18
18
  exports.checkSkills = checkSkills;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofondateurauchomage/libs",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "",
5
5
  "main": "lib/index",
6
6
  "scripts": {