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

🐛fix: improve inferred Schema Type #12007

Merged
merged 23 commits into from Jul 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bb2ef25
🏷️types: fix types
iammola Jun 28, 2022
2e51745
🏷️types: improve inferred types for arrays
iammola Jun 28, 2022
73706cb
✅test: add tests
iammola Jun 28, 2022
6277c4f
🏷️types: correct friendId type
iammola Jun 28, 2022
687d4db
🐛fix: handle deeper schema arrays
iammola Jun 28, 2022
e3679a8
🐛fix: corrrectly filter `default: undefined` aray
iammola Jun 28, 2022
79c9ce4
🐛fix: resolves type of nested paths that isn't a schema
iammola Jun 29, 2022
7d280a2
🚨lint: fix indentation
iammola Jun 29, 2022
2f1d2d9
🐛fix: use correct type in test schema
iammola Jun 29, 2022
5ce27ac
✅test: remove mixed schema type test
iammola Jun 29, 2022
d31aa08
🏷️types: allow `Mixed`, `{}` and `ObjectConstructor` resolve to `unkn…
iammola Jun 29, 2022
4123249
🏷️types: use `unknown` as expected mixed schema type
iammola Jun 29, 2022
d12af93
🐛fix: reviewed changes
iammola Jun 30, 2022
4037696
Restore schema.test.ts
iammola Jun 30, 2022
3def8c3
Revert "Restore schema.test.ts"
iammola Jun 30, 2022
27614de
🚨lint: fix warnings
iammola Jun 30, 2022
1abdb34
Fix TS errors And refactor inferschematype.d.ts file
mohammad0-0ahmad Jun 30, 2022
1c82c05
Coverage for array path implicit type.
mohammad0-0ahmad Jun 30, 2022
c64f97b
Merge pull request #1 from mohammad0-0ahmad-forks/_12007
iammola Jun 30, 2022
814a0db
🐛 fix: make paths with default specified required
iammola Jul 1, 2022
dc5e52a
🐛 fix: limit allowed types to be required with default
iammola Jul 1, 2022
8aa7f53
✅ test: add test for schema paths with default
iammola Jul 1, 2022
ca6f97b
🚨 lint: fix errors
iammola Jul 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions test/types/schema.test.ts
Expand Up @@ -377,9 +377,9 @@ export function autoTypedSchema() {
mixed1?: any;
mixed2?: any;
mixed3?: any;
objectId1?: Schema.Types.ObjectId;
objectId2?: Schema.Types.ObjectId;
objectId3?: Schema.Types.ObjectId;
objectId1?: Types.ObjectId;
iammola marked this conversation as resolved.
Show resolved Hide resolved
objectId2?: Types.ObjectId;
iammola marked this conversation as resolved.
Show resolved Hide resolved
objectId3?: Types.ObjectId;
customSchema?: Int8;
map1?: Map<string, string>;
map2?: Map<string, number>;
Expand All @@ -388,9 +388,9 @@ export function autoTypedSchema() {
array3?: any[];
array4?: any[];
array5?: any[];
decimal1?: Schema.Types.Decimal128;
decimal2?: Schema.Types.Decimal128;
decimal3?: Schema.Types.Decimal128;
decimal1?: Types.Decimal128;
iammola marked this conversation as resolved.
Show resolved Hide resolved
decimal2?: Types.Decimal128;
decimal3?: Types.Decimal128;
};

const TestSchema = new Schema({
Expand Down