Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

The clone function only iterated over string-keyed properties via for...in, missing symbol properties entirely.

Changes

  • Added Object.getOwnPropertySymbols() iteration to clone symbol-keyed properties
  • Added test case for nested symbol property cloning

Example

const sym = Symbol('test')
const obj = { a: 1, [sym]: { b: 2 } }
const cloned = clone(obj)

// Before: cloned[sym] was undefined
// After: cloned[sym] equals { b: 2 } (deep cloned)
Original prompt

clone util should clone symbol properties of object

if (isObject(value)) {
const result: Record<PropertyKey, unknown> = {}

for (const key in value) {
  result[key] = clone(value[key])
}

return result as any

}


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@coderabbitai
Copy link

coderabbitai bot commented Nov 27, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: unnoq <64189902+unnoq@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 27, 2025

Deploying orpc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9d0d396
Status: ✅  Deploy successful!
Preview URL: https://0648b284.orpc-1qh.pages.dev
Branch Preview URL: https://copilot-clone-symbol-propert.orpc-1qh.pages.dev

View logs

Copilot AI changed the title [WIP] Add clone utility to copy symbol properties fix: clone util should clone symbol properties of object Nov 27, 2025
Copilot AI requested a review from unnoq November 27, 2025 12:40
@unnoq unnoq marked this pull request as ready for review November 27, 2025 14:08
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 27, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 27, 2025
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 28, 2025

More templates

@orpc/ai-sdk

npm i https://pkg.pr.new/@orpc/ai-sdk@1258

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@1258

@orpc/client

npm i https://pkg.pr.new/@orpc/client@1258

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@1258

@orpc/experimental-durable-iterator

npm i https://pkg.pr.new/@orpc/experimental-durable-iterator@1258

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@1258

@orpc/interop

npm i https://pkg.pr.new/@orpc/interop@1258

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@1258

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@1258

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@1258

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@1258

@orpc/otel

npm i https://pkg.pr.new/@orpc/otel@1258

@orpc/experimental-pino

npm i https://pkg.pr.new/@orpc/experimental-pino@1258

@orpc/experimental-publisher

npm i https://pkg.pr.new/@orpc/experimental-publisher@1258

@orpc/experimental-publisher-durable-object

npm i https://pkg.pr.new/@orpc/experimental-publisher-durable-object@1258

@orpc/experimental-ratelimit

npm i https://pkg.pr.new/@orpc/experimental-ratelimit@1258

@orpc/react

npm i https://pkg.pr.new/@orpc/react@1258

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@1258

@orpc/experimental-react-swr

npm i https://pkg.pr.new/@orpc/experimental-react-swr@1258

@orpc/server

npm i https://pkg.pr.new/@orpc/server@1258

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@1258

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@1258

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@1258

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@1258

@orpc/standard-server-fastify

npm i https://pkg.pr.new/@orpc/standard-server-fastify@1258

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@1258

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@1258

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@1258

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@1258

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@1258

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@1258

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@1258

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@1258

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@1258

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@1258

commit: 9d0d396

@unnoq unnoq merged commit b4897a0 into main Nov 28, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants