@bondsports/types 2.2.187 → 2.2.188
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,14 @@
|
|
1
|
-
import { CartItem } from '../../../cart/entities/cart-item.entity';
|
2
1
|
import { InvoiceDiscountOnEnum } from '../../../payment/types/enums/discount.enums';
|
3
2
|
export declare const discountOnMapper: {
|
4
3
|
[key: string]: InvoiceDiscountOnEnum;
|
5
4
|
};
|
5
|
+
type HasIdOrUnique = {
|
6
|
+
id?: number | string;
|
7
|
+
unique?: string;
|
8
|
+
};
|
6
9
|
/**
|
7
10
|
* Generates a unique key for a given cart item.
|
8
11
|
*
|
9
12
|
*/
|
10
|
-
export declare const getUniqueKey: (
|
13
|
+
export declare const getUniqueKey: (entity: HasIdOrUnique) => string;
|
14
|
+
export {};
|
@@ -10,9 +10,9 @@ exports.discountOnMapper = {
|
|
10
10
|
* Generates a unique key for a given cart item.
|
11
11
|
*
|
12
12
|
*/
|
13
|
-
const getUniqueKey = (
|
13
|
+
const getUniqueKey = (entity) => {
|
14
14
|
var _a, _b;
|
15
|
-
return (_b = (_a =
|
15
|
+
return (_b = (_a = entity.id) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : entity.unique;
|
16
16
|
};
|
17
17
|
exports.getUniqueKey = getUniqueKey;
|
18
18
|
//# sourceMappingURL=invoice.consts.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invoice.consts.js","sourceRoot":"","sources":["../../../../../src/types/invoice/types/consts/invoice.consts.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"invoice.consts.js","sourceRoot":"","sources":["../../../../../src/types/invoice/types/consts/invoice.consts.ts"],"names":[],"mappings":";;;AAAA,gFAAoG;AAEvF,QAAA,gBAAgB,GAA6C;IACzE,CAAC,+BAAc,CAAC,IAAI,CAAC,EAAE,sCAAqB,CAAC,SAAS;IACtD,CAAC,+BAAc,CAAC,GAAG,CAAC,EAAE,sCAAqB,CAAC,OAAO;CACnD,CAAC;AAOF;;;GAGG;AACI,MAAM,YAAY,GAAsC,CAAC,MAAqB,EAAU,EAAE;;IAChG,OAAO,MAAA,MAAA,MAAM,CAAC,EAAE,0CAAE,QAAQ,EAAE,mCAAI,MAAM,CAAC,MAAM,CAAC;AAC/C,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB"}
|