Closed exuanbo closed 6 months ago
Follow up on https://github.com/unadlib/mutative/issues/25
In real-world use, there won't be tons of symbol keys in an object, so any slowdown in performance shouldn't be a big deal.
Also, I think we might need some more test cases for this one.
Reference: how esbuild transforms spread syntax:
esbuild
var __defProp = Object.defineProperty; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; const state = { count: 1 }; const newState = __spreadValues({}, state);
https://hyrious.me/esbuild-repl/?version=0.19.10&t=const+state+%3D+%7B+count%3A+1+%7D%3B%0Aconst+newState+%3D+%7B+...state+%7D%3B&o=--target%3Des6
The CI failure comes from coveralls :thinking:
coveralls
Follow up on https://github.com/unadlib/mutative/issues/25
In real-world use, there won't be tons of symbol keys in an object, so any slowdown in performance shouldn't be a big deal.
Also, I think we might need some more test cases for this one.
Reference: how
esbuild
transforms spread syntax:https://hyrious.me/esbuild-repl/?version=0.19.10&t=const+state+%3D+%7B+count%3A+1+%7D%3B%0Aconst+newState+%3D+%7B+...state+%7D%3B&o=--target%3Des6