@riocrypto/common 1.0.1550 → 1.0.1551

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.
@@ -2,7 +2,7 @@ import { UBO } from "../types/UBO";
2
2
  import { CountryOfOrigin } from "../types/country-of-origin";
3
3
  import { OnboardingStatus } from "../types/onboarding-status";
4
4
  import { User } from "../types/user";
5
- export declare const getHighestOnboardingStatus: (user: User | UBO) => {
5
+ export declare const getHighestOnboardingStatus: (user: User | UBO, excludeUS?: boolean) => {
6
6
  status?: OnboardingStatus | undefined;
7
7
  country?: CountryOfOrigin | undefined;
8
8
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getHighestOnboardingStatus = void 0;
4
+ const country_of_origin_1 = require("../types/country-of-origin");
4
5
  const onboarding_status_1 = require("../types/onboarding-status");
5
6
  const onboardingStatusOrder = [
6
7
  onboarding_status_1.OnboardingStatus.None,
@@ -8,7 +9,7 @@ const onboardingStatusOrder = [
8
9
  onboarding_status_1.OnboardingStatus.Review,
9
10
  onboarding_status_1.OnboardingStatus.Approved,
10
11
  ];
11
- const getHighestOnboardingStatus = (user) => {
12
+ const getHighestOnboardingStatus = (user, excludeUS) => {
12
13
  var _a;
13
14
  let status = undefined;
14
15
  let statusCountry = undefined;
@@ -17,6 +18,9 @@ const getHighestOnboardingStatus = (user) => {
17
18
  if ((_a = user.onboarding[country]) === null || _a === void 0 ? void 0 : _a.status) {
18
19
  if (!status ||
19
20
  onboardingStatusOrder.indexOf(user.onboarding[country].status) > onboardingStatusOrder.indexOf(status)) {
21
+ if (excludeUS && country === country_of_origin_1.CountryOfOrigin.UnitedStates) {
22
+ continue;
23
+ }
20
24
  status = user.onboarding[country].status;
21
25
  statusCountry = country;
22
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1550",
3
+ "version": "1.0.1551",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",