(defaultValues)
| 24 | import quoteString from './utils/quoteString'; |
| 25 | |
| 26 | function throwOnInvalidDefaultValues(defaultValues) { |
| 27 | if (isRecord(defaultValues)) { |
| 28 | throw new Error( |
| 29 | 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.' |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | if (isImmutable(defaultValues)) { |
| 34 | throw new Error( |
| 35 | 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.' |
| 36 | ); |
| 37 | } |
| 38 | |
| 39 | if (defaultValues === null || typeof defaultValues !== 'object') { |
| 40 | throw new Error( |
| 41 | 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.' |
| 42 | ); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | export class Record { |
| 47 | constructor(defaultValues, name) { |
no test coverage detected