@clipboard-health/util-ts 0.11.3 → 0.11.4
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/CHANGELOG.md +2 -0
- package/package.json +1 -1
- package/src/lib/money.d.ts +4 -3
- package/src/lib/money.d.ts.map +1 -1
- package/src/lib/money.js +5 -6
- package/src/lib/money.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.11.4](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.3...util-ts-0.11.4) (2023-11-06)
|
|
6
|
+
|
|
5
7
|
## [0.11.3](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.2...util-ts-0.11.3) (2023-11-06)
|
|
6
8
|
|
|
7
9
|
## [0.11.2](https://github.com/ClipboardHealth/cbh-core/compare/util-ts-0.11.1...util-ts-0.11.2) (2023-11-06)
|
package/package.json
CHANGED
package/src/lib/money.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
export declare const CURRENCY_CODES: {
|
|
2
|
+
readonly usd: "USD";
|
|
3
|
+
};
|
|
4
|
+
export type CurrencyCode = (typeof CURRENCY_CODES)[keyof typeof CURRENCY_CODES];
|
|
4
5
|
export interface Money {
|
|
5
6
|
amountInMinorUnits: number;
|
|
6
7
|
currencyCode: CurrencyCode;
|
package/src/lib/money.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/money.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/money.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;CAEjB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF,MAAM,WAAW,KAAK;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAUtD"}
|
package/src/lib/money.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMoney = exports.
|
|
3
|
+
exports.isMoney = exports.CURRENCY_CODES = void 0;
|
|
4
4
|
const defined_utils_1 = require("./defined-utils");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})(CurrencyCode || (exports.CurrencyCode = CurrencyCode = {}));
|
|
5
|
+
exports.CURRENCY_CODES = {
|
|
6
|
+
usd: "USD",
|
|
7
|
+
};
|
|
9
8
|
/**
|
|
10
9
|
* Money type guard.
|
|
11
10
|
*/
|
|
@@ -15,7 +14,7 @@ function isMoney(value) {
|
|
|
15
14
|
}
|
|
16
15
|
const money = value;
|
|
17
16
|
return (typeof money.amountInMinorUnits === "number" &&
|
|
18
|
-
Object.values(
|
|
17
|
+
Object.values(exports.CURRENCY_CODES).includes(money.currencyCode));
|
|
19
18
|
}
|
|
20
19
|
exports.isMoney = isMoney;
|
|
21
20
|
//# sourceMappingURL=money.js.map
|
package/src/lib/money.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/money.ts"],"names":[],"mappings":";;;AAAA,mDAAoD;
|
|
1
|
+
{"version":3,"file":"money.js","sourceRoot":"","sources":["../../../../../packages/util-ts/src/lib/money.ts"],"names":[],"mappings":";;;AAAA,mDAAoD;AAEvC,QAAA,cAAc,GAAG;IAC5B,GAAG,EAAE,KAAK;CACF,CAAC;AAQX;;GAEG;AACH,SAAgB,OAAO,CAAC,KAAc;IACpC,IAAI,IAAA,iCAAiB,EAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACzD,OAAO,KAAK,CAAC;KACd;IAED,MAAM,KAAK,GAAG,KAAc,CAAC;IAC7B,OAAO,CACL,OAAO,KAAK,CAAC,kBAAkB,KAAK,QAAQ;QAC5C,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAC3D,CAAC;AACJ,CAAC;AAVD,0BAUC"}
|