aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2022-01-22 20:29:58 -0500
committerPriyansh <[email protected]>2022-01-22 20:29:58 -0500
commit703b4176d84b3f3deadf9c0b86649c29c8c333f9 (patch)
treec0a69a6dc9cbe285bd880c37b23b42b3e3657af3 /src/lib
parent9b744e4ce05b56a1aef94110c027d920a5e10005 (diff)
downloadizuku.js-703b4176d84b3f3deadf9c0b86649c29c8c333f9.tar.xz
izuku.js-703b4176d84b3f3deadf9c0b86649c29c8c333f9.zip
feat: rangeIndex function
Diffstat (limited to 'src/lib')
-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];
+}