@stevenkellner/team-conduct-api 1.0.18 → 1.0.19

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.
@@ -7,6 +7,7 @@ export declare namespace FineAmount {
7
7
  amount: MoneyAmount;
8
8
  constructor(amount: MoneyAmount);
9
9
  formatted(configuration: Configuration): string;
10
+ multiplied(factor: number): Money;
10
11
  get flatten(): Money.Flatten;
11
12
  }
12
13
  namespace Money {
@@ -25,6 +26,7 @@ export declare namespace FineAmount {
25
26
  constructor(item: Item.Type, count: number);
26
27
  formatted(): string;
27
28
  formattedWithoutCount(): string;
29
+ multiplied(factor: number): Item;
28
30
  get flatten(): Item.Flatten;
29
31
  }
30
32
  namespace Item {
@@ -13,6 +13,9 @@ var FineAmount;
13
13
  formatted(configuration) {
14
14
  return this.amount.formatted(configuration.currency, configuration);
15
15
  }
16
+ multiplied(factor) {
17
+ return new Money(this.amount.multiplied(factor));
18
+ }
16
19
  get flatten() {
17
20
  return {
18
21
  type: 'money',
@@ -43,6 +46,9 @@ var FineAmount;
43
46
  formattedWithoutCount() {
44
47
  return Localization_1.Localization.shared.getN(key => key.fineAmount.item.type[`${this.item}WithoutCount`], this.count);
45
48
  }
49
+ multiplied(factor) {
50
+ return new Item(this.item, this.count * factor);
51
+ }
46
52
  get flatten() {
47
53
  return {
48
54
  type: 'item',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stevenkellner/team-conduct-api",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "Firebase API for Team Conduct",
5
5
  "license": "MIT",
6
6
  "author": "Steven Kellner",
@@ -19,6 +19,10 @@ export namespace FineAmount {
19
19
  return this.amount.formatted(configuration.currency, configuration);
20
20
  }
21
21
 
22
+ public multiplied(factor: number): Money {
23
+ return new Money(this.amount.multiplied(factor));
24
+ }
25
+
22
26
  public get flatten(): Money.Flatten {
23
27
  return {
24
28
  type: 'money',
@@ -59,6 +63,10 @@ export namespace FineAmount {
59
63
  return Localization.shared.getN(key => key.fineAmount.item.type[`${this.item}WithoutCount`], this.count);
60
64
  }
61
65
 
66
+ public multiplied(factor: number): Item {
67
+ return new Item(this.item, this.count * factor);
68
+ }
69
+
62
70
  public get flatten(): Item.Flatten {
63
71
  return {
64
72
  type: 'item',