Skip to content

Commit

Permalink
Implement OpaqueUcrx.raw() properly
Browse files Browse the repository at this point in the history
  • Loading branch information
surol committed Jul 18, 2023
1 parent 3d1a725 commit a687c32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/rx/opaque.ucrx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ describe('OpaqueUcrx', () => {
});
});

describe('raw', () => {
it('returns 1', () => {
expect(new OpaqueUcrx().raw('test')).toBe(1);
});
});

describe('set', () => {
it('has no effect', () => {
class TestUcrx extends OpaqueUcrx {
Expand Down
10 changes: 5 additions & 5 deletions src/rx/opaque.ucrx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export class OpaqueUcrx extends VoidUcrx implements AllUcrx {
// Ignore metadata.
}

override raw(value: string): 1;
override raw(_value: string): 1 {
return 1;
}

override nls(): this {
return this;
}
Expand Down Expand Up @@ -46,14 +51,9 @@ export interface OpaqueUcrx extends AllUcrx {
big(value: bigint): 1;
ent(name: string): 1;
fmt(format: string, data: readonly UcToken[]): 1;
nls(): this;
nul(): 1;
num(value: number): 1;
raw(value: string): 1;
str(value: string): 1;
for(key: PropertyKey): this;
map(): 1;
and(): 1;
end(): void;
}

Expand Down

0 comments on commit a687c32

Please sign in to comment.