chore: add hypercube generic functions - part02 (#1715)

* chore: add hypercube generic functions - part02
This commit is contained in:
Donya MashaallahPoor
2025-05-06 13:07:19 +02:00
committed by GitHub
parent 6b84132273
commit 445d6949e7
25 changed files with 1662 additions and 249 deletions

View File

@@ -0,0 +1,12 @@
import { insertMainDimension } from './hypercube-utils';
export default function addMainDimension(self, dimension, index) {
const dimensions = self.getDimensions();
const idx = index ?? dimensions.length;
if (dimensions.length < self.maxDimensions()) {
return insertMainDimension(self, dimension, dimensions, idx);
}
return Promise.resolve();
}