#1143·immer

CI Build 问题补丁 - 'patch' 可能是 'undefined'。

作者: nishant8BITS创建于 2024年9月9日更新于 2024年9月9日

import { DRAFT_STATE, DRAFTABLE, Objectish, Drafted, AnyObject, AnyMap, AnySet, ImmerState, ArchType, die, } from "../internal" export function shallowCopy(base: any, strict: StrictMode) { for (let i = 0; i < keys.length; i++) { const key: any = keys[i] const desc = descriptors[key]

  •   if (desc.writable === false) {
  •   if (desc?.writable === false) {
          desc.writable = true
          desc.configurable = true
      }
      // like object.assign, we will read any _own_, get/set accessors. This helps in dealing
      // with libraries that trap values, like mobx or vue
      // unlike object.assign, non-enumerables will be copied as well
  •   if (desc.get || desc.set) {
  •   if (desc?.get || desc?.set) {
          descriptors[key] = {
              configurable: true,
              writable: true, // could live with !!desc.set as well