@uniformdev/canvas-next-rsc-client 19.179.2-alpha.22 → 19.181.1-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -25,9 +25,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
 
28
- // ../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js
28
+ // ../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js
29
29
  var require_rfdc = __commonJS({
30
- "../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js"(exports, module) {
30
+ "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports, module) {
31
31
  "use strict";
32
32
  module.exports = rfdc4;
33
33
  function copyBuffer(cur) {
@@ -39,17 +39,27 @@ var require_rfdc = __commonJS({
39
39
  function rfdc4(opts) {
40
40
  opts = opts || {};
41
41
  if (opts.circles) return rfdcCircles(opts);
42
+ const constructorHandlers = /* @__PURE__ */ new Map();
43
+ constructorHandlers.set(Date, (o) => new Date(o));
44
+ constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
45
+ constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
46
+ if (opts.constructorHandlers) {
47
+ for (const handler2 of opts.constructorHandlers) {
48
+ constructorHandlers.set(handler2[0], handler2[1]);
49
+ }
50
+ }
51
+ let handler = null;
42
52
  return opts.proto ? cloneProto : clone2;
43
53
  function cloneArray(a, fn) {
44
- var keys = Object.keys(a);
45
- var a2 = new Array(keys.length);
46
- for (var i = 0; i < keys.length; i++) {
47
- var k = keys[i];
48
- var cur = a[k];
54
+ const keys = Object.keys(a);
55
+ const a2 = new Array(keys.length);
56
+ for (let i = 0; i < keys.length; i++) {
57
+ const k = keys[i];
58
+ const cur = a[k];
49
59
  if (typeof cur !== "object" || cur === null) {
50
60
  a2[k] = cur;
51
- } else if (cur instanceof Date) {
52
- a2[k] = new Date(cur);
61
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
62
+ a2[k] = handler(cur, fn);
53
63
  } else if (ArrayBuffer.isView(cur)) {
54
64
  a2[k] = copyBuffer(cur);
55
65
  } else {
@@ -60,22 +70,18 @@ var require_rfdc = __commonJS({
60
70
  }
61
71
  function clone2(o) {
62
72
  if (typeof o !== "object" || o === null) return o;
63
- if (o instanceof Date) return new Date(o);
64
73
  if (Array.isArray(o)) return cloneArray(o, clone2);
65
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone2));
66
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone2));
67
- var o2 = {};
68
- for (var k in o) {
74
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
75
+ return handler(o, clone2);
76
+ }
77
+ const o2 = {};
78
+ for (const k in o) {
69
79
  if (Object.hasOwnProperty.call(o, k) === false) continue;
70
- var cur = o[k];
80
+ const cur = o[k];
71
81
  if (typeof cur !== "object" || cur === null) {
72
82
  o2[k] = cur;
73
- } else if (cur instanceof Date) {
74
- o2[k] = new Date(cur);
75
- } else if (cur instanceof Map) {
76
- o2[k] = new Map(cloneArray(Array.from(cur), clone2));
77
- } else if (cur instanceof Set) {
78
- o2[k] = new Set(cloneArray(Array.from(cur), clone2));
83
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
84
+ o2[k] = handler(cur, clone2);
79
85
  } else if (ArrayBuffer.isView(cur)) {
80
86
  o2[k] = copyBuffer(cur);
81
87
  } else {
@@ -86,21 +92,17 @@ var require_rfdc = __commonJS({
86
92
  }
87
93
  function cloneProto(o) {
88
94
  if (typeof o !== "object" || o === null) return o;
89
- if (o instanceof Date) return new Date(o);
90
95
  if (Array.isArray(o)) return cloneArray(o, cloneProto);
91
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto));
92
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto));
93
- var o2 = {};
94
- for (var k in o) {
95
- var cur = o[k];
96
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
97
+ return handler(o, cloneProto);
98
+ }
99
+ const o2 = {};
100
+ for (const k in o) {
101
+ const cur = o[k];
96
102
  if (typeof cur !== "object" || cur === null) {
97
103
  o2[k] = cur;
98
- } else if (cur instanceof Date) {
99
- o2[k] = new Date(cur);
100
- } else if (cur instanceof Map) {
101
- o2[k] = new Map(cloneArray(Array.from(cur), cloneProto));
102
- } else if (cur instanceof Set) {
103
- o2[k] = new Set(cloneArray(Array.from(cur), cloneProto));
104
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
105
+ o2[k] = handler(cur, cloneProto);
104
106
  } else if (ArrayBuffer.isView(cur)) {
105
107
  o2[k] = copyBuffer(cur);
106
108
  } else {
@@ -111,23 +113,33 @@ var require_rfdc = __commonJS({
111
113
  }
112
114
  }
113
115
  function rfdcCircles(opts) {
114
- var refs = [];
115
- var refsNew = [];
116
+ const refs = [];
117
+ const refsNew = [];
118
+ const constructorHandlers = /* @__PURE__ */ new Map();
119
+ constructorHandlers.set(Date, (o) => new Date(o));
120
+ constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
121
+ constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
122
+ if (opts.constructorHandlers) {
123
+ for (const handler2 of opts.constructorHandlers) {
124
+ constructorHandlers.set(handler2[0], handler2[1]);
125
+ }
126
+ }
127
+ let handler = null;
116
128
  return opts.proto ? cloneProto : clone2;
117
129
  function cloneArray(a, fn) {
118
- var keys = Object.keys(a);
119
- var a2 = new Array(keys.length);
120
- for (var i = 0; i < keys.length; i++) {
121
- var k = keys[i];
122
- var cur = a[k];
130
+ const keys = Object.keys(a);
131
+ const a2 = new Array(keys.length);
132
+ for (let i = 0; i < keys.length; i++) {
133
+ const k = keys[i];
134
+ const cur = a[k];
123
135
  if (typeof cur !== "object" || cur === null) {
124
136
  a2[k] = cur;
125
- } else if (cur instanceof Date) {
126
- a2[k] = new Date(cur);
137
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
138
+ a2[k] = handler(cur, fn);
127
139
  } else if (ArrayBuffer.isView(cur)) {
128
140
  a2[k] = copyBuffer(cur);
129
141
  } else {
130
- var index = refs.indexOf(cur);
142
+ const index = refs.indexOf(cur);
131
143
  if (index !== -1) {
132
144
  a2[k] = refsNew[index];
133
145
  } else {
@@ -139,28 +151,24 @@ var require_rfdc = __commonJS({
139
151
  }
140
152
  function clone2(o) {
141
153
  if (typeof o !== "object" || o === null) return o;
142
- if (o instanceof Date) return new Date(o);
143
154
  if (Array.isArray(o)) return cloneArray(o, clone2);
144
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone2));
145
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone2));
146
- var o2 = {};
155
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
156
+ return handler(o, clone2);
157
+ }
158
+ const o2 = {};
147
159
  refs.push(o);
148
160
  refsNew.push(o2);
149
- for (var k in o) {
161
+ for (const k in o) {
150
162
  if (Object.hasOwnProperty.call(o, k) === false) continue;
151
- var cur = o[k];
163
+ const cur = o[k];
152
164
  if (typeof cur !== "object" || cur === null) {
153
165
  o2[k] = cur;
154
- } else if (cur instanceof Date) {
155
- o2[k] = new Date(cur);
156
- } else if (cur instanceof Map) {
157
- o2[k] = new Map(cloneArray(Array.from(cur), clone2));
158
- } else if (cur instanceof Set) {
159
- o2[k] = new Set(cloneArray(Array.from(cur), clone2));
166
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
167
+ o2[k] = handler(cur, clone2);
160
168
  } else if (ArrayBuffer.isView(cur)) {
161
169
  o2[k] = copyBuffer(cur);
162
170
  } else {
163
- var i = refs.indexOf(cur);
171
+ const i = refs.indexOf(cur);
164
172
  if (i !== -1) {
165
173
  o2[k] = refsNew[i];
166
174
  } else {
@@ -174,27 +182,23 @@ var require_rfdc = __commonJS({
174
182
  }
175
183
  function cloneProto(o) {
176
184
  if (typeof o !== "object" || o === null) return o;
177
- if (o instanceof Date) return new Date(o);
178
185
  if (Array.isArray(o)) return cloneArray(o, cloneProto);
179
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto));
180
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto));
181
- var o2 = {};
186
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
187
+ return handler(o, cloneProto);
188
+ }
189
+ const o2 = {};
182
190
  refs.push(o);
183
191
  refsNew.push(o2);
184
- for (var k in o) {
185
- var cur = o[k];
192
+ for (const k in o) {
193
+ const cur = o[k];
186
194
  if (typeof cur !== "object" || cur === null) {
187
195
  o2[k] = cur;
188
- } else if (cur instanceof Date) {
189
- o2[k] = new Date(cur);
190
- } else if (cur instanceof Map) {
191
- o2[k] = new Map(cloneArray(Array.from(cur), cloneProto));
192
- } else if (cur instanceof Set) {
193
- o2[k] = new Set(cloneArray(Array.from(cur), cloneProto));
196
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
197
+ o2[k] = handler(cur, cloneProto);
194
198
  } else if (ArrayBuffer.isView(cur)) {
195
199
  o2[k] = copyBuffer(cur);
196
200
  } else {
197
- var i = refs.indexOf(cur);
201
+ const i = refs.indexOf(cur);
198
202
  if (i !== -1) {
199
203
  o2[k] = refsNew[i];
200
204
  } else {
package/dist/index.js CHANGED
@@ -31,9 +31,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  ));
32
32
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
33
 
34
- // ../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js
34
+ // ../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js
35
35
  var require_rfdc = __commonJS({
36
- "../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js"(exports2, module2) {
36
+ "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports2, module2) {
37
37
  "use strict";
38
38
  module2.exports = rfdc4;
39
39
  function copyBuffer(cur) {
@@ -45,17 +45,27 @@ var require_rfdc = __commonJS({
45
45
  function rfdc4(opts) {
46
46
  opts = opts || {};
47
47
  if (opts.circles) return rfdcCircles(opts);
48
+ const constructorHandlers = /* @__PURE__ */ new Map();
49
+ constructorHandlers.set(Date, (o) => new Date(o));
50
+ constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
51
+ constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
52
+ if (opts.constructorHandlers) {
53
+ for (const handler2 of opts.constructorHandlers) {
54
+ constructorHandlers.set(handler2[0], handler2[1]);
55
+ }
56
+ }
57
+ let handler = null;
48
58
  return opts.proto ? cloneProto : clone2;
49
59
  function cloneArray(a, fn) {
50
- var keys = Object.keys(a);
51
- var a2 = new Array(keys.length);
52
- for (var i = 0; i < keys.length; i++) {
53
- var k = keys[i];
54
- var cur = a[k];
60
+ const keys = Object.keys(a);
61
+ const a2 = new Array(keys.length);
62
+ for (let i = 0; i < keys.length; i++) {
63
+ const k = keys[i];
64
+ const cur = a[k];
55
65
  if (typeof cur !== "object" || cur === null) {
56
66
  a2[k] = cur;
57
- } else if (cur instanceof Date) {
58
- a2[k] = new Date(cur);
67
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
68
+ a2[k] = handler(cur, fn);
59
69
  } else if (ArrayBuffer.isView(cur)) {
60
70
  a2[k] = copyBuffer(cur);
61
71
  } else {
@@ -66,22 +76,18 @@ var require_rfdc = __commonJS({
66
76
  }
67
77
  function clone2(o) {
68
78
  if (typeof o !== "object" || o === null) return o;
69
- if (o instanceof Date) return new Date(o);
70
79
  if (Array.isArray(o)) return cloneArray(o, clone2);
71
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone2));
72
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone2));
73
- var o2 = {};
74
- for (var k in o) {
80
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
81
+ return handler(o, clone2);
82
+ }
83
+ const o2 = {};
84
+ for (const k in o) {
75
85
  if (Object.hasOwnProperty.call(o, k) === false) continue;
76
- var cur = o[k];
86
+ const cur = o[k];
77
87
  if (typeof cur !== "object" || cur === null) {
78
88
  o2[k] = cur;
79
- } else if (cur instanceof Date) {
80
- o2[k] = new Date(cur);
81
- } else if (cur instanceof Map) {
82
- o2[k] = new Map(cloneArray(Array.from(cur), clone2));
83
- } else if (cur instanceof Set) {
84
- o2[k] = new Set(cloneArray(Array.from(cur), clone2));
89
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
90
+ o2[k] = handler(cur, clone2);
85
91
  } else if (ArrayBuffer.isView(cur)) {
86
92
  o2[k] = copyBuffer(cur);
87
93
  } else {
@@ -92,21 +98,17 @@ var require_rfdc = __commonJS({
92
98
  }
93
99
  function cloneProto(o) {
94
100
  if (typeof o !== "object" || o === null) return o;
95
- if (o instanceof Date) return new Date(o);
96
101
  if (Array.isArray(o)) return cloneArray(o, cloneProto);
97
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto));
98
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto));
99
- var o2 = {};
100
- for (var k in o) {
101
- var cur = o[k];
102
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
103
+ return handler(o, cloneProto);
104
+ }
105
+ const o2 = {};
106
+ for (const k in o) {
107
+ const cur = o[k];
102
108
  if (typeof cur !== "object" || cur === null) {
103
109
  o2[k] = cur;
104
- } else if (cur instanceof Date) {
105
- o2[k] = new Date(cur);
106
- } else if (cur instanceof Map) {
107
- o2[k] = new Map(cloneArray(Array.from(cur), cloneProto));
108
- } else if (cur instanceof Set) {
109
- o2[k] = new Set(cloneArray(Array.from(cur), cloneProto));
110
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
111
+ o2[k] = handler(cur, cloneProto);
110
112
  } else if (ArrayBuffer.isView(cur)) {
111
113
  o2[k] = copyBuffer(cur);
112
114
  } else {
@@ -117,23 +119,33 @@ var require_rfdc = __commonJS({
117
119
  }
118
120
  }
119
121
  function rfdcCircles(opts) {
120
- var refs = [];
121
- var refsNew = [];
122
+ const refs = [];
123
+ const refsNew = [];
124
+ const constructorHandlers = /* @__PURE__ */ new Map();
125
+ constructorHandlers.set(Date, (o) => new Date(o));
126
+ constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
127
+ constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
128
+ if (opts.constructorHandlers) {
129
+ for (const handler2 of opts.constructorHandlers) {
130
+ constructorHandlers.set(handler2[0], handler2[1]);
131
+ }
132
+ }
133
+ let handler = null;
122
134
  return opts.proto ? cloneProto : clone2;
123
135
  function cloneArray(a, fn) {
124
- var keys = Object.keys(a);
125
- var a2 = new Array(keys.length);
126
- for (var i = 0; i < keys.length; i++) {
127
- var k = keys[i];
128
- var cur = a[k];
136
+ const keys = Object.keys(a);
137
+ const a2 = new Array(keys.length);
138
+ for (let i = 0; i < keys.length; i++) {
139
+ const k = keys[i];
140
+ const cur = a[k];
129
141
  if (typeof cur !== "object" || cur === null) {
130
142
  a2[k] = cur;
131
- } else if (cur instanceof Date) {
132
- a2[k] = new Date(cur);
143
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
144
+ a2[k] = handler(cur, fn);
133
145
  } else if (ArrayBuffer.isView(cur)) {
134
146
  a2[k] = copyBuffer(cur);
135
147
  } else {
136
- var index = refs.indexOf(cur);
148
+ const index = refs.indexOf(cur);
137
149
  if (index !== -1) {
138
150
  a2[k] = refsNew[index];
139
151
  } else {
@@ -145,28 +157,24 @@ var require_rfdc = __commonJS({
145
157
  }
146
158
  function clone2(o) {
147
159
  if (typeof o !== "object" || o === null) return o;
148
- if (o instanceof Date) return new Date(o);
149
160
  if (Array.isArray(o)) return cloneArray(o, clone2);
150
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone2));
151
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone2));
152
- var o2 = {};
161
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
162
+ return handler(o, clone2);
163
+ }
164
+ const o2 = {};
153
165
  refs.push(o);
154
166
  refsNew.push(o2);
155
- for (var k in o) {
167
+ for (const k in o) {
156
168
  if (Object.hasOwnProperty.call(o, k) === false) continue;
157
- var cur = o[k];
169
+ const cur = o[k];
158
170
  if (typeof cur !== "object" || cur === null) {
159
171
  o2[k] = cur;
160
- } else if (cur instanceof Date) {
161
- o2[k] = new Date(cur);
162
- } else if (cur instanceof Map) {
163
- o2[k] = new Map(cloneArray(Array.from(cur), clone2));
164
- } else if (cur instanceof Set) {
165
- o2[k] = new Set(cloneArray(Array.from(cur), clone2));
172
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
173
+ o2[k] = handler(cur, clone2);
166
174
  } else if (ArrayBuffer.isView(cur)) {
167
175
  o2[k] = copyBuffer(cur);
168
176
  } else {
169
- var i = refs.indexOf(cur);
177
+ const i = refs.indexOf(cur);
170
178
  if (i !== -1) {
171
179
  o2[k] = refsNew[i];
172
180
  } else {
@@ -180,27 +188,23 @@ var require_rfdc = __commonJS({
180
188
  }
181
189
  function cloneProto(o) {
182
190
  if (typeof o !== "object" || o === null) return o;
183
- if (o instanceof Date) return new Date(o);
184
191
  if (Array.isArray(o)) return cloneArray(o, cloneProto);
185
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto));
186
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto));
187
- var o2 = {};
192
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
193
+ return handler(o, cloneProto);
194
+ }
195
+ const o2 = {};
188
196
  refs.push(o);
189
197
  refsNew.push(o2);
190
- for (var k in o) {
191
- var cur = o[k];
198
+ for (const k in o) {
199
+ const cur = o[k];
192
200
  if (typeof cur !== "object" || cur === null) {
193
201
  o2[k] = cur;
194
- } else if (cur instanceof Date) {
195
- o2[k] = new Date(cur);
196
- } else if (cur instanceof Map) {
197
- o2[k] = new Map(cloneArray(Array.from(cur), cloneProto));
198
- } else if (cur instanceof Set) {
199
- o2[k] = new Set(cloneArray(Array.from(cur), cloneProto));
202
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
203
+ o2[k] = handler(cur, cloneProto);
200
204
  } else if (ArrayBuffer.isView(cur)) {
201
205
  o2[k] = copyBuffer(cur);
202
206
  } else {
203
- var i = refs.indexOf(cur);
207
+ const i = refs.indexOf(cur);
204
208
  if (i !== -1) {
205
209
  o2[k] = refsNew[i];
206
210
  } else {
package/dist/index.mjs CHANGED
@@ -25,9 +25,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
 
28
- // ../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js
28
+ // ../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js
29
29
  var require_rfdc = __commonJS({
30
- "../../node_modules/.pnpm/rfdc@1.3.1/node_modules/rfdc/index.js"(exports, module) {
30
+ "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports, module) {
31
31
  "use strict";
32
32
  module.exports = rfdc4;
33
33
  function copyBuffer(cur) {
@@ -39,17 +39,27 @@ var require_rfdc = __commonJS({
39
39
  function rfdc4(opts) {
40
40
  opts = opts || {};
41
41
  if (opts.circles) return rfdcCircles(opts);
42
+ const constructorHandlers = /* @__PURE__ */ new Map();
43
+ constructorHandlers.set(Date, (o) => new Date(o));
44
+ constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
45
+ constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
46
+ if (opts.constructorHandlers) {
47
+ for (const handler2 of opts.constructorHandlers) {
48
+ constructorHandlers.set(handler2[0], handler2[1]);
49
+ }
50
+ }
51
+ let handler = null;
42
52
  return opts.proto ? cloneProto : clone2;
43
53
  function cloneArray(a, fn) {
44
- var keys = Object.keys(a);
45
- var a2 = new Array(keys.length);
46
- for (var i = 0; i < keys.length; i++) {
47
- var k = keys[i];
48
- var cur = a[k];
54
+ const keys = Object.keys(a);
55
+ const a2 = new Array(keys.length);
56
+ for (let i = 0; i < keys.length; i++) {
57
+ const k = keys[i];
58
+ const cur = a[k];
49
59
  if (typeof cur !== "object" || cur === null) {
50
60
  a2[k] = cur;
51
- } else if (cur instanceof Date) {
52
- a2[k] = new Date(cur);
61
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
62
+ a2[k] = handler(cur, fn);
53
63
  } else if (ArrayBuffer.isView(cur)) {
54
64
  a2[k] = copyBuffer(cur);
55
65
  } else {
@@ -60,22 +70,18 @@ var require_rfdc = __commonJS({
60
70
  }
61
71
  function clone2(o) {
62
72
  if (typeof o !== "object" || o === null) return o;
63
- if (o instanceof Date) return new Date(o);
64
73
  if (Array.isArray(o)) return cloneArray(o, clone2);
65
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone2));
66
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone2));
67
- var o2 = {};
68
- for (var k in o) {
74
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
75
+ return handler(o, clone2);
76
+ }
77
+ const o2 = {};
78
+ for (const k in o) {
69
79
  if (Object.hasOwnProperty.call(o, k) === false) continue;
70
- var cur = o[k];
80
+ const cur = o[k];
71
81
  if (typeof cur !== "object" || cur === null) {
72
82
  o2[k] = cur;
73
- } else if (cur instanceof Date) {
74
- o2[k] = new Date(cur);
75
- } else if (cur instanceof Map) {
76
- o2[k] = new Map(cloneArray(Array.from(cur), clone2));
77
- } else if (cur instanceof Set) {
78
- o2[k] = new Set(cloneArray(Array.from(cur), clone2));
83
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
84
+ o2[k] = handler(cur, clone2);
79
85
  } else if (ArrayBuffer.isView(cur)) {
80
86
  o2[k] = copyBuffer(cur);
81
87
  } else {
@@ -86,21 +92,17 @@ var require_rfdc = __commonJS({
86
92
  }
87
93
  function cloneProto(o) {
88
94
  if (typeof o !== "object" || o === null) return o;
89
- if (o instanceof Date) return new Date(o);
90
95
  if (Array.isArray(o)) return cloneArray(o, cloneProto);
91
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto));
92
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto));
93
- var o2 = {};
94
- for (var k in o) {
95
- var cur = o[k];
96
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
97
+ return handler(o, cloneProto);
98
+ }
99
+ const o2 = {};
100
+ for (const k in o) {
101
+ const cur = o[k];
96
102
  if (typeof cur !== "object" || cur === null) {
97
103
  o2[k] = cur;
98
- } else if (cur instanceof Date) {
99
- o2[k] = new Date(cur);
100
- } else if (cur instanceof Map) {
101
- o2[k] = new Map(cloneArray(Array.from(cur), cloneProto));
102
- } else if (cur instanceof Set) {
103
- o2[k] = new Set(cloneArray(Array.from(cur), cloneProto));
104
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
105
+ o2[k] = handler(cur, cloneProto);
104
106
  } else if (ArrayBuffer.isView(cur)) {
105
107
  o2[k] = copyBuffer(cur);
106
108
  } else {
@@ -111,23 +113,33 @@ var require_rfdc = __commonJS({
111
113
  }
112
114
  }
113
115
  function rfdcCircles(opts) {
114
- var refs = [];
115
- var refsNew = [];
116
+ const refs = [];
117
+ const refsNew = [];
118
+ const constructorHandlers = /* @__PURE__ */ new Map();
119
+ constructorHandlers.set(Date, (o) => new Date(o));
120
+ constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
121
+ constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
122
+ if (opts.constructorHandlers) {
123
+ for (const handler2 of opts.constructorHandlers) {
124
+ constructorHandlers.set(handler2[0], handler2[1]);
125
+ }
126
+ }
127
+ let handler = null;
116
128
  return opts.proto ? cloneProto : clone2;
117
129
  function cloneArray(a, fn) {
118
- var keys = Object.keys(a);
119
- var a2 = new Array(keys.length);
120
- for (var i = 0; i < keys.length; i++) {
121
- var k = keys[i];
122
- var cur = a[k];
130
+ const keys = Object.keys(a);
131
+ const a2 = new Array(keys.length);
132
+ for (let i = 0; i < keys.length; i++) {
133
+ const k = keys[i];
134
+ const cur = a[k];
123
135
  if (typeof cur !== "object" || cur === null) {
124
136
  a2[k] = cur;
125
- } else if (cur instanceof Date) {
126
- a2[k] = new Date(cur);
137
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
138
+ a2[k] = handler(cur, fn);
127
139
  } else if (ArrayBuffer.isView(cur)) {
128
140
  a2[k] = copyBuffer(cur);
129
141
  } else {
130
- var index = refs.indexOf(cur);
142
+ const index = refs.indexOf(cur);
131
143
  if (index !== -1) {
132
144
  a2[k] = refsNew[index];
133
145
  } else {
@@ -139,28 +151,24 @@ var require_rfdc = __commonJS({
139
151
  }
140
152
  function clone2(o) {
141
153
  if (typeof o !== "object" || o === null) return o;
142
- if (o instanceof Date) return new Date(o);
143
154
  if (Array.isArray(o)) return cloneArray(o, clone2);
144
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone2));
145
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone2));
146
- var o2 = {};
155
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
156
+ return handler(o, clone2);
157
+ }
158
+ const o2 = {};
147
159
  refs.push(o);
148
160
  refsNew.push(o2);
149
- for (var k in o) {
161
+ for (const k in o) {
150
162
  if (Object.hasOwnProperty.call(o, k) === false) continue;
151
- var cur = o[k];
163
+ const cur = o[k];
152
164
  if (typeof cur !== "object" || cur === null) {
153
165
  o2[k] = cur;
154
- } else if (cur instanceof Date) {
155
- o2[k] = new Date(cur);
156
- } else if (cur instanceof Map) {
157
- o2[k] = new Map(cloneArray(Array.from(cur), clone2));
158
- } else if (cur instanceof Set) {
159
- o2[k] = new Set(cloneArray(Array.from(cur), clone2));
166
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
167
+ o2[k] = handler(cur, clone2);
160
168
  } else if (ArrayBuffer.isView(cur)) {
161
169
  o2[k] = copyBuffer(cur);
162
170
  } else {
163
- var i = refs.indexOf(cur);
171
+ const i = refs.indexOf(cur);
164
172
  if (i !== -1) {
165
173
  o2[k] = refsNew[i];
166
174
  } else {
@@ -174,27 +182,23 @@ var require_rfdc = __commonJS({
174
182
  }
175
183
  function cloneProto(o) {
176
184
  if (typeof o !== "object" || o === null) return o;
177
- if (o instanceof Date) return new Date(o);
178
185
  if (Array.isArray(o)) return cloneArray(o, cloneProto);
179
- if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto));
180
- if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto));
181
- var o2 = {};
186
+ if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
187
+ return handler(o, cloneProto);
188
+ }
189
+ const o2 = {};
182
190
  refs.push(o);
183
191
  refsNew.push(o2);
184
- for (var k in o) {
185
- var cur = o[k];
192
+ for (const k in o) {
193
+ const cur = o[k];
186
194
  if (typeof cur !== "object" || cur === null) {
187
195
  o2[k] = cur;
188
- } else if (cur instanceof Date) {
189
- o2[k] = new Date(cur);
190
- } else if (cur instanceof Map) {
191
- o2[k] = new Map(cloneArray(Array.from(cur), cloneProto));
192
- } else if (cur instanceof Set) {
193
- o2[k] = new Set(cloneArray(Array.from(cur), cloneProto));
196
+ } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
197
+ o2[k] = handler(cur, cloneProto);
194
198
  } else if (ArrayBuffer.isView(cur)) {
195
199
  o2[k] = copyBuffer(cur);
196
200
  } else {
197
- var i = refs.indexOf(cur);
201
+ const i = refs.indexOf(cur);
198
202
  if (i !== -1) {
199
203
  o2[k] = refsNew[i];
200
204
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-client",
3
- "version": "19.179.2-alpha.22+79878be48f",
3
+ "version": "19.181.1-alpha.4+63886f3999",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -32,9 +32,9 @@
32
32
  "react-dom": "18.3.1"
33
33
  },
34
34
  "dependencies": {
35
- "@uniformdev/canvas": "19.179.2-alpha.22+79878be48f",
36
- "@uniformdev/canvas-next-rsc-shared": "^19.179.2-alpha.22+79878be48f",
37
- "@uniformdev/canvas-react": "^19.179.2-alpha.22+79878be48f"
35
+ "@uniformdev/canvas": "19.181.1-alpha.4+63886f3999",
36
+ "@uniformdev/canvas-next-rsc-shared": "^19.181.1-alpha.4+63886f3999",
37
+ "@uniformdev/canvas-react": "^19.181.1-alpha.4+63886f3999"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=16.14.0"
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "79878be48f2d4b1c6158026aa632e71c91473ac6"
50
+ "gitHead": "63886f3999fa693ef6b012fdcaefc930e238fc4d"
51
51
  }