Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(README): fix code sample and describe forPrimitives #49

Merged
merged 2 commits into from
Oct 18, 2024

Conversation

forivall
Copy link
Contributor

@forivall forivall commented Oct 18, 2024

While resolving a different issue, I didn't immediately understand the forPrimitives option, and it wasn't documented anywhere, so I figured it out by looking at the one place where it's used, and looking up the documentation for squire and noticed a glaring issue on the README - in the readme, createFilter is used, but no such function exists, and createFactory is the correct function.

Other notes

I also would love to have custom operators to have better typing, like the following snippet:

type JSONSchemaQuery<T> = BuildMongoQuery<T, { toplevel: { $jsonSchema: import('json-schema').JSONSchema4 }}>
type JSONSchemaFilter = <
  T = Record<string, unknown>,
  Q extends JSONSchemaQuery<T> = JSONSchemaQuery<T>
>(query: Q) => ThingFilter<T>
const customGuard = createFactory({
  $jsonSchema,
}, {
  jsonSchema
}) as JSONSchemaFilter;

@stalniy stalniy merged commit b636ba6 into stalniy:master Oct 18, 2024
0 of 3 checks passed
@stalniy
Copy link
Owner

stalniy commented Oct 18, 2024

thank you for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants