isDraftable.js
This file
Path
__tests__/isDraftable.js
7 lines · 218 bytes · JavaScript
Last changed by
chore: fix build / test issueMichel Weststratebefore adoption8aac6ca
History of this fileTake it
fix: protect isDraftable against undefined constructor (#969)Brian Hungbefore adoptionced4563
line 1why, one step back1"use strict"chore: fix build / test issueMichel Weststratebefore adoption8aac6ca
line 2why, one step back2import {isDraftable} from "../src/immer"fix: protect isDraftable against undefined constructor (#969)Brian Hungbefore adoptionced4563
lines 3–4why, one step back34test("non-plain object with undefined constructor doesn't error", () => {chore: fix build / test issueMichel Weststratebefore adoption8aac6ca
lines 5–6why, one step back5 const obj = Object.create(Object.create(null))6 expect(isDraftable(obj)).toBe(false)fix: protect isDraftable against undefined constructor (#969)Brian Hungbefore adoptionced4563
line 7why, one step back7})