| 15 | const styles = Object.create(null); |
| 16 | |
| 17 | const assertValidLevel = level => { |
| 18 | if (!Number.isSafeInteger(level) || level < 0 || level > 3) { |
| 19 | throw new Error('The `level` should be an integer from 0 to 3'); |
| 20 | } |
| 21 | }; |
| 22 | |
| 23 | // The level is stored under a symbol so the hot path can read it as a plain property, while `level` itself is an accessor that rejects values the rest of the code could not handle. |
| 24 | const levelDescriptor = { |
no outgoing calls
no test coverage detected