MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-workbench / getValues

Function getValues

src/services/models/flatFile.ts:449–454  ·  view source on GitHub ↗
(array: unknown, key: string)

Source from the content-addressed store, hash-verified

447
448// [{key: val0}, {key: val1}] => [val0, val1]
449function getValues(array: unknown, key: string) {
450 if (!array || !(Array.isArray(array) && array.length)) return [];
451 return array.map((elem) => {
452 return [elem[key] ? elem[key] : []];
453 });
454}

Callers 1

flattenFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected