sindresorhus / electron-store

Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc
MIT License
4.61k stars 150 forks source link

Warning about not allowing union types #232

Closed mtdvlpr closed 2 years ago

mtdvlpr commented 2 years ago

Warning: strict mode: use allowUnionTypes to allow union type keyword at "#/properties/***/properties/***" (strictTypes)

Hi, I'm getting above warning, because I set one of my properties to be either string or number. This warning can be traced back to the ajv package you use to validate the JSON schema. I would like the warning to be solved. Or is it against your wishes to allow the electron store to handle union types?

sindresorhus commented 2 years ago

Did you read https://ajv.js.org/strict-mode.html#union-types?

It seems it's preferable to use anyOf.

mtdvlpr commented 2 years ago

I have not, thanks!