Skip to content

Commit

Permalink
refactor: use ModifyTypeOfProperty of @nidomiro/ts-type-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
nidomiro committed Nov 7, 2022
1 parent ab21100 commit fa8d16a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
75 changes: 68 additions & 7 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nidomiro/ts-type-utils": "^0.1.1",
"@ory/keto-client": "^0.10.0-alpha.0",
"@ory/keto-grpc-client": "^0.10.0-alpha.0",
"assert-never": "^1.2.1",
"defekt": "^9.3.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.0.0",
"tslib": "^2.3.0"
"tslib": "^2.4.1"
},
"devDependencies": {
"@nestjs/schematics": "^9.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/typescript/src/lib/relation-tuple-parser.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { defekt, error, Result, value } from 'defekt'
import { RelationTuple, SubjectSet } from './relation-tuple'
import { type ModifyTypeOfAttribute } from './util/type.util'
import { ModifyTypeOfProperty } from '@nidomiro/ts-type-utils'

export class RelationTupleSyntaxError extends defekt({ code: 'RelationTupleSyntaxError' }) {}

const forbiddenValueCharacters = [':', '#', '@', '(', ')']

type PartialRelationTuple = ModifyTypeOfAttribute<
type PartialRelationTuple = ModifyTypeOfProperty<
Partial<RelationTuple>,
{
subjectIdOrSet?: Partial<RelationTuple['subjectIdOrSet']>
}
>

type PartialRelationTupleWithSubjectSet = ModifyTypeOfAttribute<
type PartialRelationTupleWithSubjectSet = ModifyTypeOfProperty<
Partial<RelationTuple>,
{
subjectIdOrSet: Partial<SubjectSet>
Expand Down
1 change: 0 additions & 1 deletion packages/typescript/src/lib/util/type.util.ts

This file was deleted.

0 comments on commit fa8d16a

Please sign in to comment.