Comments (3)
Can also Confirm this issue, errors are also the same.
using [email protected] , [email protected] (which depends on this)
from shapeshift.
The SchemaOf
issue is easily fixable by adding extends NonNullable
in SchemaOf
but I tried to fix other type issues related to {}
and I wasn't able to do it. The issue is coming from https://github.com/sapphiredev/shapeshift/blob/main/src/lib/util-types.ts#L10
before 4.8, it was {} & object
but after 4.8, it's now object
. The only solution that worked for me was removing extends NonNullableObject
from https://github.com/sapphiredev/shapeshift/blob/main/src/validators/ObjectValidator.ts#L15 but that's not a solution as it'll now accept any values.
For now you can add skipLibCheck
in your tsconfig or use typescript < 4.8
from shapeshift.
The
SchemaOf
issue is easily fixable by addingextends NonNullable
inSchemaOf
but I tried to fix other type issues related to{}
and I wasn't able to do it. The issue is coming from https://github.com/sapphiredev/shapeshift/blob/main/src/lib/util-types.ts#L10 before 4.8, it was{} & object
but after 4.8, it's nowobject
. The only solution that worked for me was removingextends NonNullableObject
from https://github.com/sapphiredev/shapeshift/blob/main/src/validators/ObjectValidator.ts#L15 but that's not a solution as it'll now accept any values.For now you can add
skipLibCheck
in your tsconfig or usetypescript < 4.8
I have been using skipLibCheck because of this, but its not the best thing to do.
About object
, maybe a solution to this would be using Record<PropertyKey, unknown>
which can be used to represent any object but might need some changes in other parts of the code.
from shapeshift.
Related Issues (20)
- bug: Object validators considers keys that have a default return value as required
- bug: shapeshift 3.5.0 imports fast-deep-equal wrong breaking it HOT 2
- bug: Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import HOT 4
- request: Narrowing types from schema HOT 4
- request: `setValidationEnabled` should [un]wrap the validator into an `PartialValidator<T>`
- bug: Type 'T' does not satisfy the constraint 'object' HOT 1
- bug: Type 'T' does not satisfy the constraint 'object' HOT 3
- request: add `s.string.phone` to regex validate a phone number HOT 1
- request: Add label support to validators, constraints, etc HOT 1
- request: cloudflare worker support HOT 5
- question: Multiple errors causing my discord bot to crash HOT 2
- bug: UnionValidator#setValidationEnabled does not make its members respect that HOT 2
- request: cloudflare worker support HOT 5
- request: refactor code in order to rely less on type casting HOT 1
- Implement something like zod's nativeEnum HOT 1
- request: Implement something like zod's nativeEnum
- bug: `BaseValidator` return type is invalid
- bug: Reshape is in the docs, but is nowhere in the code HOT 2
- bug: BaseError is not correctly exported HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shapeshift.