Skip to content

Commit

Permalink
Merge branch 'release/v0.20.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed May 10, 2024
2 parents e25378f + 8cc705f commit 72a4d2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zeed",
"type": "module",
"version": "0.20.6",
"version": "0.20.7",
"description": "🌱 Simple foundation library",
"author": {
"name": "Dirk Holtwick",
Expand Down
21 changes: 11 additions & 10 deletions src/common/data/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,24 @@ export function objectPlain(obj: any, opt?: {
if (keepAsIs(obj))
return obj

if (isSymbol(obj))
return String(obj)

if (isPrimitive(obj))
return obj

if (cycle.includes(obj))
return circleValue // '*** CYCLE ***'

cycle.push(obj)
if (!isPrimitive(obj)) {
if (cycle.includes(obj))
return circleValue // '*** CYCLE ***'
cycle.push(obj)
}

if (transformer) {
const result = transformer(obj)
if (result !== undefined)
return result
}

if (isSymbol(obj))
return String(obj)

if (isPrimitive(obj))
return obj

if (obj instanceof Date) {
return {
__class: 'Date',
Expand Down

0 comments on commit 72a4d2b

Please sign in to comment.