diff --git a/packages/vscale/__tests__/identity-scale.test.ts b/packages/vscale/__tests__/identity-scale.test.ts index 66d3c55..94f005d 100644 --- a/packages/vscale/__tests__/identity-scale.test.ts +++ b/packages/vscale/__tests__/identity-scale.test.ts @@ -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); }); diff --git a/packages/vscale/src/identity-scale.ts b/packages/vscale/src/identity-scale.ts index 9316cb2..d205889 100644 --- a/packages/vscale/src/identity-scale.ts +++ b/packages/vscale/src/identity-scale.ts @@ -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;