data icon indicating copy to clipboard operation
data copied to clipboard

Support nested nullable objects

Open kettanaito opened this issue 3 years ago • 3 comments

  • Originated from #202

This has to be supported:

const db = factory({
  user: {
    id: primaryKey(String),
    permissions: nullable(() => ({
      id: String,
    })),
  },
})

But it's not. Recursive nullable objects as well. No primary key needed. An API without a getter function would be preferable: nullable({ ... }).

kettanaito avatar Apr 08 '22 19:04 kettanaito

@kettanaito I'll give this a crack 😉

aloysb avatar May 21 '22 23:05 aloysb

See PR #219 👍 😃

aloysb avatar May 22 '22 03:05 aloysb

Hi guys,

I opened a new PR for solving this issue with an api that doesn't use a nullable getter as @kettanaito asked Can someone please take a look at it here ?

@kettanaito @abitbetterthanyesterday please let me know if this solution is acceptable and if so I will add some notes about it in the documentation

Thanks

yishayweb avatar Jan 02 '23 20:01 yishayweb