Skip to content

Commit

Permalink
Nullable expressions: undefined -> null (#2)
Browse files Browse the repository at this point in the history
- Changes expressions to use the `null` data type instead of `undefined`.
- This change caused some issues with the type snapshot checks.  Refactored the test snapshots to use `jest-runner-tsd`.  These tests now can check on the actual result set data type, rather than having to use the `GetDataType` class to extract nullability.
- Refactors the result set types to reduce duplication, and better explain that the `GetDataType` helper is now only used in `FromItemQuery`, rather than for testing only.
- Modifies the `toSql` helper to accept `Tokenable` types.
  • Loading branch information
carterzenk authored Oct 14, 2023
1 parent f7ed6dd commit 707a866
Show file tree
Hide file tree
Showing 32 changed files with 2,957 additions and 1,878 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ This is a fork of [@ff00ff/mammoth](https://github.com/Ff00ff/mammoth). We made

This fork is based on the 1.x version rather than newer 2.x version. We made this decision because the 2.x version is still in alpha, and we ran into memory issues during TS compilation in the probject we were using it for. We start from [c7c525c978aa6326042b35ca95f93699a69370c5](https://github.com/Anrok/mammoth/commit/c7c525c978aa6326042b35ca95f93699a69370c5) because that is the last commit before the big 2.x refactor.

[List of changes](https://github.com/Anrok/mammoth/compare/main...c7c525c978aa6326042b35ca95f93699a69370c5)
### List of changes ([commits](https://github.com/Anrok/mammoth/compare/main...c7c525c978aa6326042b35ca95f93699a69370c5))
- Changes nullable expressions to use the `null` data type, rather than `undefined`.

---

Expand Down
3,436 changes: 2,241 additions & 1,195 deletions package-lock.json

Large diffs are not rendered by default.

54 changes: 35 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
".build"
],
"devDependencies": {
"@tsd/typescript": "^5.2.2",
"@types/jest": "^26.0.24",
"@types/node": "^16.4.10",
"dts-jest": "^23.3.0",
"jest": "^26.6.3",
"jest-runner-tsd": "^6.0.0",
"prettier": "^3.0.3",
"ts-jest": "^26.5.6",
"typescript": "^4.3.5"
Expand All @@ -35,23 +36,38 @@
"prepublishOnly": "npm run build && npm test"
},
"jest": {
"moduleFileExtensions": [
"ts",
"js"
],
"coveragePathIgnorePatterns": [
"__tests__",
"__checks__"
],
"testPathIgnorePatterns": [
"/\\.build/",
"/node_modules/",
"helpers"
],
"testRegex": "/__tests__|__checks__/.*\\.(test|check)\\.ts$",
"transform": {
"\\.check\\.ts$": "dts-jest/transform",
"\\.ts$": "ts-jest"
}
"projects": [
{
"displayName": "unit",
"moduleFileExtensions": [
"ts",
"js"
],
"coveragePathIgnorePatterns": [
"__tests__",
"__checks__"
],
"testPathIgnorePatterns": [
"/\\.build/",
"/node_modules/",
"helpers"
],
"testMatch": ["**/__tests__/*.test.ts"],
"transform": {
"\\.ts$": "ts-jest"
},
"reporters": [
"default"
]
},
{
"displayName": {
"color": "blue",
"name": "types"
},
"runner": "jest-runner-tsd",
"testMatch": ["**/__checks__/*.check.ts"]
}
]
}
}
3 changes: 0 additions & 3 deletions src/__checks__/__snapshots__/data-types.check.ts.snap

This file was deleted.

7 changes: 0 additions & 7 deletions src/__checks__/__snapshots__/delete.check.ts.snap

This file was deleted.

40 changes: 0 additions & 40 deletions src/__checks__/__snapshots__/insert.check.ts.snap

This file was deleted.

54 changes: 0 additions & 54 deletions src/__checks__/__snapshots__/select.check.ts.snap

This file was deleted.

5 changes: 0 additions & 5 deletions src/__checks__/__snapshots__/truncate.check.ts.snap

This file was deleted.

11 changes: 0 additions & 11 deletions src/__checks__/__snapshots__/update.check.ts.snap

This file was deleted.

Loading

0 comments on commit 707a866

Please sign in to comment.