CARVIEW |
Select Language
HTTP/2 200
date: Wed, 23 Jul 2025 21:19:56 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/neo4j/neo4j-javascript-driver.git
etag: W/"3ddcc5b46ba5beefa97d8ea3f4ead489"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=6ijr3a7EteTZ9Bl5O%2Fi7uQuJ2IL5x67GyWrWh0ds4zQS0vvR6g%2FE41OEyDRmcy6ojJNsy80XPq6%2FqLkh72SdZdcs2jMgs9nH92n8yMr5K9UtDyJUMzTNA9BVk9HGc3xDoXZ2eRMmdD%2B4Cdn0dSG%2Bq46hEvfs46tCkHoXU4UG8herdWhJEsrjroct82m7XKh7%2F6rl7RaxCwp%2B34CnKCsa9d6mNnYwewRyToOPMIn1R1EivbiCBokQnGjwLqfFLAycGCLZ9dZ5hsBjSGL5PLDihQ%3D%3D--LEJMLNCY2z%2FGGxjk--GMpPGY3abJjz%2Fddp3zXdWw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.706080772.1753305596; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 21:19:56 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 23 Jul 2026 21:19:56 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A28C:271430:10D92A0:1415211:688151FC
Fix Record#get type checking (#1015) · neo4j/neo4j-javascript-driver@1fe1471 · GitHub
⚠️ This type definitions are not asserted in runtime. Thus mismatched type records coming from the database will not trigger type errors.
Copy file name to clipboardExpand all lines: packages/core/src/record.ts
Copy file name to clipboardExpand all lines: packages/core/test/record.test.ts
Copy file name to clipboardExpand all lines: packages/neo4j-driver-deno/lib/core/record.ts
Copy file name to clipboardExpand all lines: packages/neo4j-driver/test/types/record.test.ts
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 152
Commit 1fe1471
authored
Fix Record#get type checking (#1015)
This method was not correctly type checking the key argument. Keys are not in the Entries where being accepted without trigger typescript errors.
The error was being cause because the method was not relying in the keys set in the Entries, but the ones came from the constructor and from the field lookup.
The keys came from constructor and field lookup are not meant to be used in the client code, since they are internal.
This way, the error was solving by strict `get` method key type for consider only indexes (number) and Key originated from the Entries.
Example:
```typescript
interface Person {
age: Integer
name: string
}
const p: Record<Person> = // get record form somewhere
const age: Integer = p.get('age')
const name: string = p.get('name')
// @ts-expected-error This error was not being point out before
const nonExistingKey = p.get('non-existing-key')
```
1 parent 85c0939 commit 1fe1471Copy full SHA for 1fe1471
File tree
Expand file treeCollapse file tree
4 files changed
+57
-20
lines changedFilter options
- packages
- core
- src
- test
- neo4j-driver-deno/lib/core
- neo4j-driver/test/types
Expand file treeCollapse file tree
4 files changed
+57
-20
lines changedpackages/core/src/record.ts
Copy file name to clipboardExpand all lines: packages/core/src/record.ts+6-9Lines changed: 6 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| |||
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
190 |
| - | |
191 |
| - | |
192 |
| - | |
| 190 | + | |
| 191 | + | |
193 | 192 |
| |
194 | 193 |
| |
195 | 194 |
| |
196 | 195 |
| |
197 | 196 |
| |
198 | 197 |
| |
199 |
| - | |
200 |
| - | |
| 198 | + | |
| 199 | + | |
201 | 200 |
| |
202 | 201 |
| |
203 | 202 |
| |
204 | 203 |
| |
205 |
| - | |
206 |
| - | |
207 |
| - | |
| 204 | + | |
208 | 205 |
| |
209 | 206 |
| |
210 | 207 |
| |
|
packages/core/test/record.test.ts
Copy file name to clipboardExpand all lines: packages/core/test/record.test.ts+42-1Lines changed: 42 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
68 |
| - | |
| 68 | + | |
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| |||
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
198 | 239 |
|
packages/neo4j-driver-deno/lib/core/record.ts
Copy file name to clipboardExpand all lines: packages/neo4j-driver-deno/lib/core/record.ts+6-9Lines changed: 6 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| |||
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
190 |
| - | |
191 |
| - | |
192 |
| - | |
| 190 | + | |
| 191 | + | |
193 | 192 |
| |
194 | 193 |
| |
195 | 194 |
| |
196 | 195 |
| |
197 | 196 |
| |
198 | 197 |
| |
199 |
| - | |
200 |
| - | |
| 198 | + | |
| 199 | + | |
201 | 200 |
| |
202 | 201 |
| |
203 | 202 |
| |
204 | 203 |
| |
205 |
| - | |
206 |
| - | |
207 |
| - | |
| 204 | + | |
208 | 205 |
| |
209 | 206 |
| |
210 | 207 |
| |
|
packages/neo4j-driver/test/types/record.test.ts
Copy file name to clipboardExpand all lines: packages/neo4j-driver/test/types/record.test.ts+3-1Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
| 82 | + | |
| 83 | + | |
82 | 84 |
| |
83 | 85 |
| |
84 | 86 |
| |
85 | 87 |
| |
86 | 88 |
| |
87 |
| - | |
| 89 | + |
You can’t perform that action at this time.
0 commit comments