@riocrypto/common 1.0.1092 → 1.0.1093

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.
@@ -0,0 +1,2 @@
1
+ import { User } from "../types/user";
2
+ export declare const getUerName: (user: User) => string;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUerName = void 0;
4
+ const user_type_1 = require("../types/user-type");
5
+ const getUerName = (user) => {
6
+ if (user.type === user_type_1.UserType.Business) {
7
+ return user.companyName;
8
+ }
9
+ else {
10
+ let name = user.firstName;
11
+ if (user.middleName) {
12
+ name += user.middleName;
13
+ }
14
+ name += user.lastName;
15
+ if (user.secondLastName) {
16
+ name += user.secondLastName;
17
+ }
18
+ return name;
19
+ }
20
+ };
21
+ exports.getUerName = getUerName;
package/build/index.d.ts CHANGED
@@ -199,6 +199,7 @@ export * from "./helpers/format-transaction-hash";
199
199
  export * from "./helpers/round-to-decimals";
200
200
  export * from "./helpers/number-with-commas";
201
201
  export * from "./helpers/alpha-2-to-alpha-3";
202
+ export * from "./helpers/get-user-name";
202
203
  export * from "./clients/rio-client";
203
204
  export * from "./clients/rio-admin-client";
204
205
  export * from "./constants/mexico-fiscal-regimens";
package/build/index.js CHANGED
@@ -215,6 +215,7 @@ __exportStar(require("./helpers/format-transaction-hash"), exports);
215
215
  __exportStar(require("./helpers/round-to-decimals"), exports);
216
216
  __exportStar(require("./helpers/number-with-commas"), exports);
217
217
  __exportStar(require("./helpers/alpha-2-to-alpha-3"), exports);
218
+ __exportStar(require("./helpers/get-user-name"), exports);
218
219
  __exportStar(require("./clients/rio-client"), exports);
219
220
  __exportStar(require("./clients/rio-admin-client"), exports);
220
221
  __exportStar(require("./constants/mexico-fiscal-regimens"), exports);
@@ -6,7 +6,9 @@ import { UserAttribute } from "./user-attribute";
6
6
  import { UserType } from "./user-type";
7
7
  interface IndividualUser {
8
8
  firstName: string;
9
+ middleName?: string;
9
10
  lastName: string;
11
+ secondLastName?: string;
10
12
  birthday: Date;
11
13
  }
12
14
  interface BusinessUser {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1092",
3
+ "version": "1.0.1093",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",