2
2
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
3
3
*/
4
4
5
- import { get , has , isArray , isEmpty , isObject , isString , intersection , unset } from 'lodash' ;
5
+ import { get , has , isArray , isEmpty , isObject , isString , intersection } from 'lodash' ;
6
6
import Enum from 'enum' ;
7
7
import {
8
8
getColumn ,
@@ -19,6 +19,7 @@ import {getCornersColumns} from '../tables/TableInfoUtil.js';
19
19
import { MetaConst } from '../data/MetaConst.js' ;
20
20
import { CoordinateSys } from '../visualize/CoordSys.js' ;
21
21
import { makeAnyPt , makeWorldPt } from '../visualize/Point' ;
22
+ import { isDefined } from './WebUtil.js' ;
22
23
23
24
24
25
export const UCDCoord = new Enum ( [ 'eq' , 'ecliptic' , 'galactic' ] ) ;
@@ -1306,12 +1307,17 @@ export const getObsTitle= (tableOrId, rowIdx) => {
1306
1307
*/
1307
1308
export const getObsCoreAccessURL = ( tableOrId , rowIdx ) => getObsCoreCellValue ( tableOrId , rowIdx , 'access_url' ) ;
1308
1309
/**
1309
- * return dataproduct_type cell data
1310
+ * return dataproduct_type cell data.
1311
+ * and
1310
1312
* @param {TableModel|String } tableOrId - a table model or a table id
1311
1313
* @param rowIdx
1314
+ * @param alwaysLowerCaseString - if data is defined then always return data as a lowercase string
1312
1315
* @return {string }
1313
1316
*/
1314
- export const getObsCoreProdType = ( tableOrId , rowIdx ) => getObsCoreCellValue ( tableOrId , rowIdx , 'dataproduct_type' ) ;
1317
+ export function getObsCoreProdType ( tableOrId , rowIdx , alwaysLowerCaseString = true ) {
1318
+ const v = getObsCoreCellValue ( tableOrId , rowIdx , 'dataproduct_type' ) ;
1319
+ return ( isDefined ( v ) && alwaysLowerCaseString ) ? ( v + '' ) . toLowerCase ( ) : v ;
1320
+ }
1315
1321
1316
1322
1317
1323
export function getProdTypeGuess ( tableOrId , rowIdx ) {
0 commit comments