|
1 | | -import { Record } from "immutable"; |
| 1 | +import { Record as ImmutableRecord } from "immutable"; |
2 | 2 | import { AuditableDefaultValues } from "../constants/auditable-default-values"; |
3 | 3 | import type { Auditable } from "../interfaces/auditable"; |
4 | 4 | import type { Constructor } from "../types/constructor"; |
@@ -38,15 +38,15 @@ const RecordUtils = { |
38 | 38 | * If `maybeRecord` is already an instance of `T`, it returns that value. |
39 | 39 | * |
40 | 40 | * @param maybeRecord Object or Record to be coalesced into a Record. |
41 | | - * @param record Type of the Record to be instantiated |
| 41 | + * @param Record Type of the Record to be instantiated |
42 | 42 | */ |
43 | 43 | ensureRecord<TValue, TRecord extends TValue>( |
44 | 44 | maybeRecord: TValue, |
45 | | - record: Constructor<TRecord> |
| 45 | + Record: Constructor<TRecord> |
46 | 46 | ): TRecord { |
47 | | - return RecordUtils.isRecord(maybeRecord, record) |
| 47 | + return RecordUtils.isRecord(maybeRecord, Record) |
48 | 48 | ? maybeRecord |
49 | | - : new record(maybeRecord); |
| 49 | + : new Record(maybeRecord); |
50 | 50 | }, |
51 | 51 |
|
52 | 52 | /** |
@@ -77,7 +77,10 @@ const RecordUtils = { |
77 | 77 | maybeRecord: TValue, |
78 | 78 | record: Constructor<TRecord> |
79 | 79 | ): maybeRecord is TRecord { |
80 | | - return Record.isRecord(maybeRecord) && maybeRecord instanceof record; |
| 80 | + return ( |
| 81 | + ImmutableRecord.isRecord(maybeRecord) && |
| 82 | + maybeRecord instanceof record |
| 83 | + ); |
81 | 84 | }, |
82 | 85 | }; |
83 | 86 |
|
|
0 commit comments