MCPcopy
hub / github.com/microsoft/SandDance / createUserSelection

Method createUserSelection

packages/sanddance/src/dataScope.ts:80–99  ·  view source on GitHub ↗
(search: Search, assign: boolean, rebase: boolean)

Source from the content-addressed store, hash-verified

78 }
79
80 public createUserSelection(search: Search, assign: boolean, rebase: boolean) {
81 const exec = new Exec(search, this.getColumns());
82 const s: UserSelection = {
83 search,
84 included: [],
85 excluded: [],
86 };
87 const data = rebase ? this.data : this.currentData();
88 data.forEach(datum => {
89 if (exec.run(datum)) {
90 if (assign) {
91 datum[FieldNames.Selected] = true;
92 }
93 s.included.push(datum);
94 } else {
95 s.excluded.push(datum);
96 }
97 });
98 return s;
99 }
100
101 public deselect() {
102 this.deactivate();

Callers 2

selectMethod · 0.95
filterMethod · 0.45

Calls 4

getColumnsMethod · 0.95
currentDataMethod · 0.95
runMethod · 0.95
forEachMethod · 0.45

Tested by

no test coverage detected