asv-hlps 1.4.64 → 1.4.65

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.
@@ -71,11 +71,12 @@ exports.isStaffSte = isStaffSte;
71
71
  const getFullname = (user) => {
72
72
  const gender = user.gender ? user.gender.abr.trim() : "";
73
73
  const titr = user.titr ? user.titr.shortname.trim() : "";
74
- const lastname = user.lastname ? user.lastname.trim() : "";
75
- const firstname = user.firstname ? user.firstname.trim() : "";
74
+ const lastname = user.lastname ? user.lastname.replace(/ +/g, " ").trim() : "";
75
+ const firstname = user.firstname ? user.firstname.replace(/ +/g, " ").trim() : "";
76
76
  const civil = titr ? titr : gender;
77
77
  // const fullname = Util.titleCase(civil)+' '+lastname.toUpperCase()+' '+Util.titleCase(firstname);
78
- return (0, utils_1.titleCase)(civil) + " " + lastname.toUpperCase() + " " + (0, utils_1.titleCase)(firstname);
78
+ // return titleCase(civil) + " " + lastname?.toUpperCase() + " " + titleCase(firstname);
79
+ return ((0, utils_1.titleCase)(civil) + " " + (lastname === null || lastname === void 0 ? void 0 : lastname.toUpperCase()) + " " + (0, utils_1.titleCase)(firstname)).replace(/ +/g, " ").trim();
79
80
  };
80
81
  exports.getFullname = getFullname;
81
82
  const entryDesignationUser = (user) => {
@@ -57,11 +57,12 @@ export const isStaffSte = (steNames, userSteName) => {
57
57
  export const getFullname = (user) => {
58
58
  const gender = user.gender ? user.gender.abr.trim() : "";
59
59
  const titr = user.titr ? user.titr.shortname.trim() : "";
60
- const lastname = user.lastname ? user.lastname.trim() : "";
61
- const firstname = user.firstname ? user.firstname.trim() : "";
60
+ const lastname = user.lastname ? user.lastname.replace(/ +/g, " ").trim() : "";
61
+ const firstname = user.firstname ? user.firstname.replace(/ +/g, " ").trim() : "";
62
62
  const civil = titr ? titr : gender;
63
63
  // const fullname = Util.titleCase(civil)+' '+lastname.toUpperCase()+' '+Util.titleCase(firstname);
64
- return titleCase(civil) + " " + lastname.toUpperCase() + " " + titleCase(firstname);
64
+ // return titleCase(civil) + " " + lastname?.toUpperCase() + " " + titleCase(firstname);
65
+ return (titleCase(civil) + " " + (lastname === null || lastname === void 0 ? void 0 : lastname.toUpperCase()) + " " + titleCase(firstname)).replace(/ +/g, " ").trim();
65
66
  };
66
67
  export const entryDesignationUser = (user) => {
67
68
  if (user.grp && user.ste) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.4.64",
3
+ "version": "1.4.65",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",