asv-hlps 1.3.8 → 1.3.9

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/cjs/user.d.ts CHANGED
@@ -12,7 +12,7 @@ interface FullnameType {
12
12
  }
13
13
  export declare const inGrp: (grps: string[], user: User | UserNotarial) => boolean;
14
14
  export declare const inSteGrp: (grps: string[], user: User | UserNotarial) => boolean;
15
- export declare const hasRole: (roles: string[], role: UserRole) => boolean;
15
+ export declare const hasRole: (roles: string[], userRole: UserRole) => boolean;
16
16
  export declare const isBillPeriod: (user: User | UserNotarial, period: string) => boolean;
17
17
  export declare const isStaffSte: (steNames: string[], userSteName: string) => boolean;
18
18
  export declare const getFullname: <T extends FullnameType>(user: T) => string;
package/lib/cjs/user.js CHANGED
@@ -44,8 +44,8 @@ exports.inSteGrp = inSteGrp;
44
44
  /* export const hasRole = (roles: string[], user: User | UserNotarial) => {
45
45
  return [...roles].includes(user.role.code.toLowerCase()) ? true : false;
46
46
  }; */
47
- const hasRole = (roles, role) => {
48
- return [...roles].includes(role.code.toLowerCase()) ? true : false;
47
+ const hasRole = (roles, userRole) => {
48
+ return [...roles].includes(userRole.code.toLowerCase()) ? true : false;
49
49
  };
50
50
  exports.hasRole = hasRole;
51
51
  const isBillPeriod = (user, period) => {
package/lib/cjs/utils.js CHANGED
@@ -626,7 +626,7 @@ const dateFormatter = (date, format, separator = "-") => {
626
626
  case "dmyfr":
627
627
  return (0, dayjs_1.default)(date).locale("fr").format("dddd DD MMMM YYYY");
628
628
  default:
629
- return (0, dayjs_1.default)(date).format(`"YYYY${separator}MM${separator}DD"`);
629
+ return (0, dayjs_1.default)(date).format(`YYYY${separator}MM${separator}DD`);
630
630
  }
631
631
  };
632
632
  exports.dateFormatter = dateFormatter;
package/lib/esm/user.d.ts CHANGED
@@ -12,7 +12,7 @@ interface FullnameType {
12
12
  }
13
13
  export declare const inGrp: (grps: string[], user: User | UserNotarial) => boolean;
14
14
  export declare const inSteGrp: (grps: string[], user: User | UserNotarial) => boolean;
15
- export declare const hasRole: (roles: string[], role: UserRole) => boolean;
15
+ export declare const hasRole: (roles: string[], userRole: UserRole) => boolean;
16
16
  export declare const isBillPeriod: (user: User | UserNotarial, period: string) => boolean;
17
17
  export declare const isStaffSte: (steNames: string[], userSteName: string) => boolean;
18
18
  export declare const getFullname: <T extends FullnameType>(user: T) => string;
package/lib/esm/user.js CHANGED
@@ -13,8 +13,8 @@ export const inSteGrp = (grps, user) => {
13
13
  /* export const hasRole = (roles: string[], user: User | UserNotarial) => {
14
14
  return [...roles].includes(user.role.code.toLowerCase()) ? true : false;
15
15
  }; */
16
- export const hasRole = (roles, role) => {
17
- return [...roles].includes(role.code.toLowerCase()) ? true : false;
16
+ export const hasRole = (roles, userRole) => {
17
+ return [...roles].includes(userRole.code.toLowerCase()) ? true : false;
18
18
  };
19
19
  export const isBillPeriod = (user, period) => {
20
20
  return user.periodBill.toLowerCase() === period ? true : false;
package/lib/esm/utils.js CHANGED
@@ -544,6 +544,6 @@ export const dateFormatter = (date, format, separator = "-") => {
544
544
  case "dmyfr":
545
545
  return dayjs(date).locale("fr").format("dddd DD MMMM YYYY");
546
546
  default:
547
- return dayjs(date).format(`"YYYY${separator}MM${separator}DD"`);
547
+ return dayjs(date).format(`YYYY${separator}MM${separator}DD`);
548
548
  }
549
549
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",