aboutsummaryrefslogtreecommitdiff
path: root/src/lib/locate.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/locate.ts')
-rw-r--r--src/lib/locate.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/locate.ts b/src/lib/locate.ts
index 733ba9f..46d4712 100644
--- a/src/lib/locate.ts
+++ b/src/lib/locate.ts
@@ -1,3 +1,4 @@
+import { flatten } from './data';
interface Izuku {
rowdata: unknown[][];
columns: string[];
@@ -110,3 +111,12 @@ export function getMultipleRowDetails(iz: Izuku, rows: Array<number>) {
});
return { rowd: extractedRows, rowh: iz.columns };
}
+
+/**
+ * rangeIndex returns the element at the specified index of the complete frame
+ * @param index: the index of the element to be returned
+ * @returns the element at the specified index of the complete frame
+ */
+export function rangeIndex(iz: Izuku, index: number): any {
+ return flatten(iz.rowdata)[index];
+}