Skip to content
Snippets Groups Projects
Unverified Commit c2edb3b3 authored by Michael J. Giarlo's avatar Michael J. Giarlo Committed by GitHub
Browse files

Merge pull request #3449 from ProjectMirador/asArray

Consolidate implementations of asArray
parents 22b20184 e03053dd
No related branches found
No related tags found
No related merge requests found
...@@ -13,21 +13,12 @@ import { ...@@ -13,21 +13,12 @@ import {
} from '@material-ui/core'; } from '@material-ui/core';
import ArrowBackIcon from '@material-ui/icons/ArrowBackSharp'; import ArrowBackIcon from '@material-ui/icons/ArrowBackSharp';
import Skeleton from '@material-ui/lab/Skeleton'; import Skeleton from '@material-ui/lab/Skeleton';
import asArray from '../lib/asArray';
import { LabelValueMetadata } from './LabelValueMetadata'; import { LabelValueMetadata } from './LabelValueMetadata';
import CollapsibleSection from '../containers/CollapsibleSection'; import CollapsibleSection from '../containers/CollapsibleSection';
import ScrollIndicatedDialogContent from '../containers/ScrollIndicatedDialogContent'; import ScrollIndicatedDialogContent from '../containers/ScrollIndicatedDialogContent';
import ManifestInfo from '../containers/ManifestInfo'; import ManifestInfo from '../containers/ManifestInfo';
/**
*/
function asArray(value) {
if (!Array.isArray(value)) {
return [value];
}
return value;
}
/** /**
* a dialog providing the possibility to select the collection * a dialog providing the possibility to select the collection
*/ */
......
import { Utils } from 'manifesto.js'; import { Utils } from 'manifesto.js';
import MiradorManifest from './MiradorManifest'; import MiradorManifest from './MiradorManifest';
import MiradorCanvas from './MiradorCanvas'; import MiradorCanvas from './MiradorCanvas';
import asArray from './asArray';
/** */
function asArray(value) {
if (value === undefined) return [];
return Array.isArray(value) ? value : [value];
}
/** */ /** */
function isLevel0ImageProfile(service) { function isLevel0ImageProfile(service) {
......
/**
*/
export default function asArray(value) {
if (value === undefined) return [];
if (!Array.isArray(value)) {
return [value];
}
return value;
}
...@@ -3,6 +3,7 @@ import createCachedSelector from 're-reselect'; ...@@ -3,6 +3,7 @@ import createCachedSelector from 're-reselect';
import { PropertyValue } from 'manifesto.js/dist-esmodule/PropertyValue'; import { PropertyValue } from 'manifesto.js/dist-esmodule/PropertyValue';
import { Utils } from 'manifesto.js/dist-esmodule/Utils'; import { Utils } from 'manifesto.js/dist-esmodule/Utils';
import getThumbnail from '../../lib/ThumbnailFactory'; import getThumbnail from '../../lib/ThumbnailFactory';
import asArray from '../../lib/asArray';
import { getCompanionWindow } from './companionWindows'; import { getCompanionWindow } from './companionWindows';
import { getManifest } from './getters'; import { getManifest } from './getters';
import { getConfig } from './config'; import { getConfig } from './config';
...@@ -109,16 +110,6 @@ export const getManifestProvider = createSelector( ...@@ -109,16 +110,6 @@ export const getManifestProvider = createSelector(
&& PropertyValue.parse(provider[0].label, locale).getValue(), && PropertyValue.parse(provider[0].label, locale).getValue(),
); );
/**
*/
function asArray(value) {
if (!Array.isArray(value)) {
return [value];
}
return value;
}
/** /**
* Return the IIIF v3 homepage of a manifest or null * Return the IIIF v3 homepage of a manifest or null
* @param {object} state * @param {object} state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment