@bgord/tools 1.2.18 → 1.2.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.
- package/dist/size.vo.d.ts +2 -0
- package/dist/size.vo.js +6 -0
- package/package.json +1 -1
- package/src/size.vo.ts +8 -0
package/dist/size.vo.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export declare class Size {
|
|
|
26
26
|
tokB(): number;
|
|
27
27
|
toMB(): number;
|
|
28
28
|
toGB(): number;
|
|
29
|
+
equals(another: Size): boolean;
|
|
30
|
+
isSmallerThan(another: Size): boolean;
|
|
29
31
|
isGreaterThan(another: Size): boolean;
|
|
30
32
|
format(unit: SizeUnitEnum): string;
|
|
31
33
|
static toBytes(config: SizeConfigType): SizeBytesType;
|
package/dist/size.vo.js
CHANGED
|
@@ -44,6 +44,12 @@ export class Size {
|
|
|
44
44
|
toGB() {
|
|
45
45
|
return Size.CONVERT_ROUND.round(this.bytes / Size.GB_MULTIPLIER);
|
|
46
46
|
}
|
|
47
|
+
equals(another) {
|
|
48
|
+
return this.bytes === another.toBytes();
|
|
49
|
+
}
|
|
50
|
+
isSmallerThan(another) {
|
|
51
|
+
return this.bytes < another.toBytes();
|
|
52
|
+
}
|
|
47
53
|
isGreaterThan(another) {
|
|
48
54
|
return this.bytes > another.toBytes();
|
|
49
55
|
}
|
package/package.json
CHANGED
package/src/size.vo.ts
CHANGED
|
@@ -59,6 +59,14 @@ export class Size {
|
|
|
59
59
|
return Size.CONVERT_ROUND.round(this.bytes / Size.GB_MULTIPLIER);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
equals(another: Size): boolean {
|
|
63
|
+
return this.bytes === another.toBytes();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
isSmallerThan(another: Size): boolean {
|
|
67
|
+
return this.bytes < another.toBytes();
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
isGreaterThan(another: Size): boolean {
|
|
63
71
|
return this.bytes > another.toBytes();
|
|
64
72
|
}
|