MCPcopy
hub / github.com/apify/crawlee / optionalSpread

Function optionalSpread

packages/utils/src/internals/open_graph_parser.ts:20–21  ·  view source on GitHub ↗
(key: string, item: any)

Source from the content-addressed store, hash-verified

18 * @returns Either an empty object or an object with the content provided.
19 */
20const optionalSpread = (key: string, item: any) =>
21 item !== undefined && !!Object.values(item)?.length ? { [key]: item } : {};
22
23const OPEN_GRAPH_PROPERTIES: OpenGraphProperty[] = [
24 {

Callers 2

parseOpenGraphPropertyFunction · 0.85
parseOpenGraphFunction · 0.85

Calls 1

valuesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…