MCPcopy
hub / github.com/prettier/prettier / test

Function test

tests/format/flow/flow-repo/spread/test5.js:14–25  ·  view source on GitHub ↗

* Tests overriding a property via a spread, where the value is a tvar. the * type of the prop from the object that is being overridden (`x.kind` in the * case below) should //not// feed back into the tvar (`value`), since the * result is a new object.

(
  x: {kind: ?string},
  kinds: {[key: string]: string}
)

Source from the content-addressed store, hash-verified

12 * result is a new object.
13 */
14function test(
15 x: {kind: ?string},
16 kinds: {[key: string]: string}
17): Array<{kind: ?string}> {
18 return map(kinds, (value) => {
19 (value: string); // OK
20 return {
21 ...x,
22 kind: value,
23 };
24 });
25}

Callers

nothing calls this directly

Calls 1

mapFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…