* Get dimension index in data store. Return -1 if not found. * Can be used to index value from getRawValue.
(dim: DimensionLoose)
| 395 | * Can be used to index value from getRawValue. |
| 396 | */ |
| 397 | getDimensionIndex(dim: DimensionLoose): DimensionIndex { |
| 398 | const dimIdx = this._recognizeDimIndex(dim); |
| 399 | if (dimIdx != null) { |
| 400 | return dimIdx; |
| 401 | } |
| 402 | |
| 403 | if (dim == null) { |
| 404 | return -1; |
| 405 | } |
| 406 | |
| 407 | const dimInfo = this._getDimInfo(dim as DimensionName); |
| 408 | return dimInfo |
| 409 | ? dimInfo.storeDimIndex |
| 410 | : this._dimOmitted |
| 411 | ? this._schema.getSourceDimensionIndex(dim as DimensionName) |
| 412 | : -1; |
| 413 | } |
| 414 | |
| 415 | /** |
| 416 | * The meanings of the input parameter `dim`: |
no test coverage detected