MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / getClassList

Function getClassList

core/src/utils/theme.ts:21–30  ·  view source on GitHub ↗
(classes: string | (string | null | undefined)[] | undefined)

Source from the content-addressed store, hash-verified

19};
20
21export const getClassList = (classes: string | (string | null | undefined)[] | undefined): string[] => {
22 if (classes !== undefined) {
23 const array = Array.isArray(classes) ? classes : classes.split(' ');
24 return array
25 .filter((c) => c != null)
26 .map((c) => (c as string).trim())
27 .filter((c) => c !== '');
28 }
29 return [];
30};
31
32export const getClassMap = (classes: string | string[] | undefined): CssClassMap => {
33 const map: CssClassMap = {};

Callers 2

theme.spec.tsFile · 0.90
getClassMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected