domoritz commented on a change in pull request #10151: URL: https://github.com/apache/arrow/pull/10151#discussion_r619719176
########## File path: js/src/util/args.ts ########## @@ -21,11 +21,26 @@ import { Column } from '../column'; import { Vector } from '../vector'; import { DataType } from '../type'; import { Chunked } from '../vector/chunked'; +import { BigIntArray, TypedArray } from '../interfaces'; +import { FloatVector, IntVector } from '../vector/index'; type RecordBatchCtor = typeof import('../recordbatch').RecordBatch; const isArray = Array.isArray; +/** @ignore */ +export function isTypedArray(arr: any): arr is TypedArray | BigIntArray { + return ArrayBuffer.isView(arr) && 'BYTES_PER_ELEMENT' in arr; Review comment: I think this should be enough. Otherwise, we can use something like https://underscorejs.org/docs/modules/isTypedArray.html. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org