@pax2pay/model-banking 0.1.240 → 0.1.241

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.
@@ -1,18 +1,21 @@
1
+ import { isly } from "isly"
2
+
1
3
  export interface Iban {
2
4
  type: "iban"
3
5
  iban: string
4
6
  holder: string
7
+ institution?: string
8
+ transactor?: string
5
9
  }
6
10
  export namespace Iban {
7
11
  export const currencies = ["EUR", "GBP", "SEK", "USD"] as const
8
12
  // maybe do the Iban checksum check below?
9
- export function is(value: Iban | any): value is Iban {
10
- return (
11
- value &&
12
- typeof value == "object" &&
13
- value.type == "iban" &&
14
- typeof value.iban == "string" &&
15
- typeof value.holder == "string"
16
- )
17
- }
13
+ export const type = isly.object<Iban>({
14
+ type: isly.string("iban"),
15
+ iban: isly.string(),
16
+ holder: isly.string(),
17
+ institution: isly.string().optional(),
18
+ transactor: isly.string().optional(),
19
+ })
20
+ export const is = type.is
18
21
  }
@@ -1,9 +1,13 @@
1
+ import { isly } from "isly";
1
2
  export interface Iban {
2
3
  type: "iban";
3
4
  iban: string;
4
5
  holder: string;
6
+ institution?: string;
7
+ transactor?: string;
5
8
  }
6
9
  export declare namespace Iban {
7
10
  const currencies: readonly ["EUR", "GBP", "SEK", "USD"];
8
- function is(value: Iban | any): value is Iban;
11
+ const type: isly.object.ExtendableType<Iban>;
12
+ const is: isly.Type.IsFunction<Iban>;
9
13
  }
@@ -1,13 +1,14 @@
1
+ import { isly } from "isly";
1
2
  export var Iban;
2
3
  (function (Iban) {
3
4
  Iban.currencies = ["EUR", "GBP", "SEK", "USD"];
4
- function is(value) {
5
- return (value &&
6
- typeof value == "object" &&
7
- value.type == "iban" &&
8
- typeof value.iban == "string" &&
9
- typeof value.holder == "string");
10
- }
11
- Iban.is = is;
5
+ Iban.type = isly.object({
6
+ type: isly.string("iban"),
7
+ iban: isly.string(),
8
+ holder: isly.string(),
9
+ institution: isly.string().optional(),
10
+ transactor: isly.string().optional(),
11
+ });
12
+ Iban.is = Iban.type.is;
12
13
  })(Iban || (Iban = {}));
13
14
  //# sourceMappingURL=Iban.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Iban.js","sourceRoot":"../","sources":["Rail/Address/Iban.ts"],"names":[],"mappings":"AAKA,MAAM,KAAW,IAAI,CAYpB;AAZD,WAAiB,IAAI;IACP,eAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IAE/D,SAAgB,EAAE,CAAC,KAAiB;QACnC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,KAAK,CAAC,IAAI,IAAI,MAAM;YACpB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,OAAO,KAAK,CAAC,MAAM,IAAI,QAAQ,CAC/B,CAAA;IACF,CAAC;IARe,OAAE,KAQjB,CAAA;AACF,CAAC,EAZgB,IAAI,KAAJ,IAAI,QAYpB"}
1
+ {"version":3,"file":"Iban.js","sourceRoot":"../","sources":["Rail/Address/Iban.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAS3B,MAAM,KAAW,IAAI,CAWpB;AAXD,WAAiB,IAAI;IACP,eAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IAElD,SAAI,GAAG,IAAI,CAAC,MAAM,CAAO;QACrC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACrC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACpC,CAAC,CAAA;IACW,OAAE,GAAG,KAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EAXgB,IAAI,KAAJ,IAAI,QAWpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.240",
3
+ "version": "0.1.241",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",