Skip to content

Commit bee92e3

Browse files
committed
lint
1 parent 852800d commit bee92e3

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/nestedArray/types.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { DtypeString } from '../types'
2-
import { ValueError } from '../errors'
1+
import { DtypeString } from '../types';
2+
import { ValueError } from '../errors';
33

4-
export type NestedArrayData = TypedArray | NDNestedArrayData
4+
export type NestedArrayData = TypedArray | NDNestedArrayData;
55
export type NDNestedArrayData =
66
| TypedArray[]
77
| TypedArray[][]
88
| TypedArray[][][]
99
| TypedArray[][][][]
1010
| TypedArray[][][][][]
11-
| TypedArray[][][][][][]
11+
| TypedArray[][][][][][];
1212

1313
export type TypedArray =
1414
| Uint8Array
@@ -18,7 +18,7 @@ export type TypedArray =
1818
| Uint32Array
1919
| Int32Array
2020
| Float32Array
21-
| Float64Array
21+
| Float64Array;
2222

2323
// ArrayLike<any> & {
2424
// BYTES_PER_ELEMENT: number;
@@ -29,13 +29,13 @@ export type TypedArray =
2929
// constructor: TypedArrayConstructor<TypedArray>;
3030
// };
3131
export type TypedArrayConstructor<TypedArray> = {
32-
new (): TypedArray
32+
new (): TypedArray;
3333
// tslint:disable-next-line: unified-signatures
34-
new (size: number): TypedArray
34+
new (size: number): TypedArray;
3535
// tslint:disable-next-line: unified-signatures
36-
new (buffer: ArrayBuffer): TypedArray
37-
BYTES_PER_ELEMENT: number
38-
}
36+
new (buffer: ArrayBuffer): TypedArray;
37+
BYTES_PER_ELEMENT: number;
38+
};
3939

4040
export const DTYPE_TYPEDARRAY_MAPPING: { [A in DtypeString]: TypedArrayConstructor<TypedArray> } = {
4141
'<b': Int8Array,
@@ -49,19 +49,19 @@ export const DTYPE_TYPEDARRAY_MAPPING: { [A in DtypeString]: TypedArrayConstruct
4949

5050
'<f4': Float32Array,
5151
'<f8': Float64Array
52-
}
52+
};
5353

5454
export function getTypedArrayDtypeString(t: TypedArray): DtypeString {
5555
// Favour the types below instead of small and big B
56-
if (t instanceof Uint8Array) return '<u1'
57-
if (t instanceof Int8Array) return '<i1'
58-
if (t instanceof Uint16Array) return '<u2'
59-
if (t instanceof Int16Array) return '<i2'
60-
if (t instanceof Uint32Array) return '<u4'
61-
if (t instanceof Int32Array) return '<i4'
56+
if (t instanceof Uint8Array) return '<u1';
57+
if (t instanceof Int8Array) return '<i1';
58+
if (t instanceof Uint16Array) return '<u2';
59+
if (t instanceof Int16Array) return '<i2';
60+
if (t instanceof Uint32Array) return '<u4';
61+
if (t instanceof Int32Array) return '<i4';
6262

63-
if (t instanceof Float32Array) return '<f4'
64-
if (t instanceof Float64Array) return '<f8'
63+
if (t instanceof Float32Array) return '<f4';
64+
if (t instanceof Float64Array) return '<f8';
6565

66-
throw new ValueError('Mapping for TypedArray to Dtypestring not known')
66+
throw new ValueError('Mapping for TypedArray to Dtypestring not known');
6767
}

test/nestedArray/ops.creation.test.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { createNestedArray, rangeTypedArray } from '../../src/nestedArray'
2-
import { NestedArrayData, TypedArray, TypedArrayConstructor } from '../../src/nestedArray/types'
1+
import { createNestedArray, rangeTypedArray } from '../../src/nestedArray';
2+
import { NestedArrayData, TypedArray, TypedArrayConstructor } from '../../src/nestedArray/types';
33

44
describe('NestedArray creation', () => {
55
interface TestCase {
6-
name: string
7-
shape: number[]
8-
constr: TypedArrayConstructor<TypedArray>
9-
expected: NestedArrayData
6+
name: string;
7+
shape: number[];
8+
constr: TypedArrayConstructor<TypedArray>;
9+
expected: NestedArrayData;
1010
}
1111

1212
const testCases: TestCase[] = [
@@ -171,12 +171,12 @@ describe('NestedArray creation', () => {
171171
]
172172
]
173173
}
174-
]
174+
];
175175

176176
test.each(testCases)(`%p`, (t: TestCase) => {
177-
const data = rangeTypedArray(t.shape, t.constr)
178-
const nestedArray = createNestedArray(data.buffer, t.constr, t.shape)
177+
const data = rangeTypedArray(t.shape, t.constr);
178+
const nestedArray = createNestedArray(data.buffer, t.constr, t.shape);
179179

180-
expect(nestedArray).toEqual(t.expected)
181-
})
182-
})
180+
expect(nestedArray).toEqual(t.expected);
181+
});
182+
});

0 commit comments

Comments
 (0)