Skip to content

Commit

Permalink
fix(vscale): identity-scale rang() return the same value as domain()
Browse files Browse the repository at this point in the history
  • Loading branch information
xile611 committed Aug 29, 2023
1 parent fee28aa commit 9762932
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/vscale/__tests__/identity-scale.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { IdentityScale } from '../src/identity-scale';
test('IdentityScale of any values', () => {
const scale = new IdentityScale();

expect(scale.domain()).toBeUndefined();
expect(scale.range()).toBeUndefined();
expect(scale.scale('x')).toBe('x');
expect(scale.scale(12)).toBe(12);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/vscale/src/identity-scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class IdentityScale implements IBaseScale {
range(_: any[]): this;
range(_?: any[]): this | any {
if (!_) {
return undefined;
return this._domain ? this._domain.slice() : undefined;
}

return this;
Expand Down

0 comments on commit 9762932

Please sign in to comment.