MCPcopy Create free account
hub / github.com/apache/fory / buildAddressBook

Function buildAddressBook

integration_tests/idl_tests/javascript/roundtrip.ts:260–284  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258}
259
260function buildAddressBook(): AddressBook {
261 const person: Person = {
262 name: "Alice",
263 id: 123,
264 email: "alice@example.com",
265 tags: ["friend", "colleague"],
266 scores: new Map([
267 ["math", 100],
268 ["science", 98],
269 ]),
270 salary: 120000.5,
271 phones: [
272 buildPhoneNumber("555-0100", Person.PhoneType.MOBILE),
273 buildPhoneNumber("555-0111", Person.PhoneType.WORK),
274 ],
275 pet: {
276 case: AnimalCase.CAT,
277 value: buildCat(),
278 },
279 };
280 return {
281 people: [person],
282 peopleByName: new Map([[person.name, person]]),
283 };
284}
285
286function buildAutoIdEnvelope(): Envelope {
287 const payload: Envelope.Payload = { value: 42 };

Callers 1

runStandardRoundTripFunction · 0.70

Calls 2

buildPhoneNumberFunction · 0.70
buildCatFunction · 0.70

Tested by

no test coverage detected