Skip to content

Commit

Permalink
Merge pull request #24 from duncanhealy/fix/types
Browse files Browse the repository at this point in the history
fix tsc output for types
  • Loading branch information
kiwicopple authored Nov 15, 2020
2 parents 18859b3 + ec576fd commit bad9993
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
},
"devDependencies": {
"@types/jest": "^26.0.13",
"@types/node": "^14.14.7",
"@types/node-fetch": "^2.5.7",
"jest": "^26.4.1",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const DEFAULT_OPTIONS = {
url: GOTRUE_URL,
autoRefreshToken: true,
persistSession: true,
localStorage: global.localStorage,
localStorage: globalThis.localStorage,
detectSessionInUrl: true,
headers: DEFAULT_HEADERS,
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class LocalStorage implements Storage {
[name: string]: any
length!: number
constructor(localStorage: Storage) {
this.localStorage = localStorage || global.localStorage
this.localStorage = localStorage || globalThis.localStorage
}
clear(): void {
return this.localStorage.clear()
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/client.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Object {
"created_at": Any<String>,
"email": "fake@email.com",
"id": Any<String>,
"last_sign_in_at": Any<String>,
"role": "",
"updated_at": Any<String>,
"user_metadata": Object {
Expand All @@ -45,6 +46,7 @@ Object {
"created_at": Any<String>,
"email": "fake@email.com",
"id": Any<String>,
"last_sign_in_at": Any<String>,
"role": "",
"updated_at": Any<String>,
"user_metadata": Object {
Expand Down
2 changes: 2 additions & 0 deletions test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ test('Update user', async () => {
id: expect.any(String),
aud: expect.any(String),
updated_at: expect.any(String),
last_sign_in_at: expect.any(String),
confirmed_at: expect.any(String),
created_at: expect.any(String),
user_metadata: {
Expand All @@ -95,6 +96,7 @@ test('Get user after updating', async () => {
id: expect.any(String),
aud: expect.any(String),
updated_at: expect.any(String),
last_sign_in_at: expect.any(String),
confirmed_at: expect.any(String),
created_at: expect.any(String),
user_metadata: {
Expand Down

0 comments on commit bad9993

Please sign in to comment.