MCPcopy Index your code
hub / github.com/buildbot/buildbot / getPropertyValueArrayOrEmpty

Function getPropertyValueArrayOrEmpty

www/data-module/src/util/Properties.ts:10–24  ·  view source on GitHub ↗
(props: {[key: string]: any}, key: string)

Source from the content-addressed store, hash-verified

8import {emailInString} from "../data/DataUtils";
9
10export function getPropertyValueArrayOrEmpty(props: {[key: string]: any}, key: string) {
11 if (!(key in props)) {
12 return [];
13 }
14 const prop = props[key];
15 // each property is an array of two elements: property value and source
16 if (!Array.isArray(prop) || prop.length !== 2) {
17 return [];
18 }
19 const value = prop[0];
20 if (!Array.isArray(value)) {
21 return [];
22 }
23 return value;
24}
25
26export function getPropertyValueOrDefault(props: {[key: string]: any}, key: string, def: any) {
27 if (!(key in props)) {

Callers 2

tableElementFunction · 0.85
BuildsTable.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected