MCPcopy Index your code
hub / github.com/tinyplex/tinybase / getValuesSubset

Function getValuesSubset

src/persisters/common/database/tabular.ts:116–137  ·  view source on GitHub ↗
(
    values: Values | {[valueId: Id]: ValueOrUndefined},
    valueIds: Id[],
    partial?: boolean,
  )

Source from the content-addressed store, hash-verified

114 );
115
116 const getValuesSubset = (
117 values: Values | {[valueId: Id]: ValueOrUndefined},
118 valueIds: Id[],
119 partial?: boolean,
120 ) =>
121 objNew(
122 partial == true
123 ? arrayFilter(
124 objToArray(values, (value, valueId): [Id, ValueOrUndefined] => [
125 valueId,
126 value,
127 ]),
128 ([valueId]) => arrayHas(valueIds, valueId),
129 )
130 : arrayFilter(
131 arrayMap(valueIds, (valueId): [Id, ValueOrUndefined] => [
132 valueId,
133 values[valueId],
134 ]),
135 ([, value]) => !isUndefined(value),
136 ),
137 );
138
139 const saveValues = async (
140 values: Values | {[valueId: Id]: ValueOrUndefined},

Callers 1

saveValuesFunction · 0.85

Calls 6

objNewFunction · 0.90
arrayFilterFunction · 0.90
objToArrayFunction · 0.90
arrayHasFunction · 0.90
arrayMapFunction · 0.90
isUndefinedFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…