Skip to content

Commit

Permalink
lint TypeScript client
Browse files Browse the repository at this point in the history
  And add linting as a build step to avoid stumbling across this over and over again.
  • Loading branch information
KtorZ committed Jan 10, 2024
1 parent 8530d48 commit f73f2da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clients/TypeScript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author": "Rhys Bartels-Waller",
"license": "MPL-2.0",
"scripts": {
"build": "yarn workspaces run build",
"build": "yarn workspaces run build && yarn workspaces run lint --fix",
"cleanup": "yarn workspaces run cleanup && shx rm -rf docs/theme && shx rm -rf node_modules",
"generate-schema-types": "yarn workspace @cardano-ogmios/schema run generate-schema-types",
"lint": "yarn workspaces run lint",
Expand Down
4 changes: 2 additions & 2 deletions clients/TypeScript/packages/client/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export const safeJSON = {
return this.sanitize(this.$.parse(raw))
} catch (e) {
if (e.name === 'SyntaxError' && typeof e.message === 'string' && e.message.includes('forbidden constructor')) {
const escaped = raw.replace(/"constructor"/g, `"constr"`);
return this.sanitize(this.$.parse(escaped));
const escaped = raw.replace(/"constructor"/g, '"constr"')
return this.sanitize(this.$.parse(escaped))
}
throw e
}
Expand Down

0 comments on commit f73f2da

Please sign in to comment.