asv-hlps 1.0.10 → 1.0.11
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/users/user.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const inGrp: (grps: string[], user: User) => boolean;
|
|
|
3
3
|
export declare const inSteGrp: (grps: string[], user: User) => boolean;
|
|
4
4
|
export declare const hasRole: (roles: string[], user: User) => boolean;
|
|
5
5
|
export declare const isBillPeriod: (user: User, period: string) => boolean;
|
|
6
|
-
export declare const isStaffSte: (user: User, steNames: string
|
|
6
|
+
export declare const isStaffSte: (user: User, steNames: string[]) => boolean;
|
|
7
7
|
export declare const getFullname: (user: User) => string;
|
|
8
8
|
export declare const entryDesignationUser: (user: User) => string;
|
|
9
9
|
export declare const secureUser: (user: any, username: string, heads: any) => void;
|
package/lib/cjs/users/user.js
CHANGED
|
@@ -27,9 +27,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.getUserCode = exports.secureUserPassword = exports.secureUser = exports.entryDesignationUser = exports.getFullname = exports.isStaffSte = exports.isBillPeriod = exports.hasRole = exports.inSteGrp = exports.inGrp = void 0;
|
|
30
|
-
const shared_1 = require("../utils/shared");
|
|
31
30
|
const bcrypt = __importStar(require("bcryptjs"));
|
|
32
31
|
const randomatic_1 = __importDefault(require("randomatic"));
|
|
32
|
+
const shared_1 = require("../utils/shared");
|
|
33
33
|
const inGrp = (grps, user) => {
|
|
34
34
|
return [...grps].includes(user.grp.code.toLowerCase()) ? true : false;
|
|
35
35
|
};
|
|
@@ -52,10 +52,11 @@ const isBillPeriod = (user, period) => {
|
|
|
52
52
|
return (user.periodBill.toLowerCase() === period) ? true : false;
|
|
53
53
|
};
|
|
54
54
|
exports.isBillPeriod = isBillPeriod;
|
|
55
|
+
// export const isStaffSte = (user: User, steNames: string|string[]) => {
|
|
55
56
|
const isStaffSte = (user, steNames) => {
|
|
56
|
-
if
|
|
57
|
-
|
|
58
|
-
}
|
|
57
|
+
/* if(!Array.isArray(steNames)) {
|
|
58
|
+
return (user.ste.name.toLowerCase() === steNames.toLowerCase());
|
|
59
|
+
} */
|
|
59
60
|
// return [...steNames].includes(user.ste.name.toLowerCase()) ? true : false;
|
|
60
61
|
return [...steNames].includes(user.ste.name.toLowerCase());
|
|
61
62
|
};
|
package/lib/esm/users/user.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const inGrp: (grps: string[], user: User) => boolean;
|
|
|
3
3
|
export declare const inSteGrp: (grps: string[], user: User) => boolean;
|
|
4
4
|
export declare const hasRole: (roles: string[], user: User) => boolean;
|
|
5
5
|
export declare const isBillPeriod: (user: User, period: string) => boolean;
|
|
6
|
-
export declare const isStaffSte: (user: User, steNames: string
|
|
6
|
+
export declare const isStaffSte: (user: User, steNames: string[]) => boolean;
|
|
7
7
|
export declare const getFullname: (user: User) => string;
|
|
8
8
|
export declare const entryDesignationUser: (user: User) => string;
|
|
9
9
|
export declare const secureUser: (user: any, username: string, heads: any) => void;
|
package/lib/esm/users/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { titleCase } from "../utils/shared";
|
|
2
1
|
import * as bcrypt from 'bcryptjs';
|
|
3
2
|
import randomatic from 'randomatic';
|
|
3
|
+
import { titleCase } from "../utils/shared";
|
|
4
4
|
export const inGrp = (grps, user) => {
|
|
5
5
|
return [...grps].includes(user.grp.code.toLowerCase()) ? true : false;
|
|
6
6
|
};
|
|
@@ -19,10 +19,11 @@ export const hasRole = (roles, user) => {
|
|
|
19
19
|
export const isBillPeriod = (user, period) => {
|
|
20
20
|
return (user.periodBill.toLowerCase() === period) ? true : false;
|
|
21
21
|
};
|
|
22
|
+
// export const isStaffSte = (user: User, steNames: string|string[]) => {
|
|
22
23
|
export const isStaffSte = (user, steNames) => {
|
|
23
|
-
if
|
|
24
|
-
|
|
25
|
-
}
|
|
24
|
+
/* if(!Array.isArray(steNames)) {
|
|
25
|
+
return (user.ste.name.toLowerCase() === steNames.toLowerCase());
|
|
26
|
+
} */
|
|
26
27
|
// return [...steNames].includes(user.ste.name.toLowerCase()) ? true : false;
|
|
27
28
|
return [...steNames].includes(user.ste.name.toLowerCase());
|
|
28
29
|
};
|