Skip to content

Commit

Permalink
Fix some dates remaining as strings + a missing field
Browse files Browse the repository at this point in the history
  • Loading branch information
TTTaevas committed Nov 25, 2023
1 parent 6d5abd7 commit 8ed659b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function correctType(x: any): any {

if (typeof x === "boolean") {
return x
} else if (/^[+-[0-9][0-9]+-[0-9]{2}-[0-9]{2}($|[ T])/.test(x)) {
} else if (/^[+-[0-9][0-9]+-[0-9]{2}-[0-9]{2}($|[ T].*)/.test(x)) {
if (/[0-9]{2}:[0-9]{2}:[0-9]{2}$/.test(x)) x += "Z"
if (/[0-9]{2}:[0-9]{2}:[0-9]{2}\+[0-9]{2}:[0-9]{2}$/.test(x)) x = x.substring(0, x.indexOf("+")) + "Z"
return new Date(x)
Expand Down
2 changes: 1 addition & 1 deletion lib/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export interface UserExtended extends UserWithCountryCoverGroupsStatisticsSuppor
* Expected from api.getResourceOwner()
*/
export interface UserExtendedWithStatisticsrulesets extends UserExtended, UserWithCountryCoverGroupsStatisticsrulesets {

is_restricted: boolean
}

/**
Expand Down

0 comments on commit 8ed659b

Please sign in to comment.