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

Function createSample

benchmarks/javascript/benchmark.js:337–362  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335}
336
337function createSample() {
338 return {
339 int_value: 123,
340 long_value: 1230000,
341 float_value: 12.345,
342 double_value: 1.234567,
343 short_value: 12345,
344 char_value: "!".charCodeAt(0),
345 boolean_value: true,
346 int_value_boxed: 321,
347 long_value_boxed: 3210000,
348 float_value_boxed: 54.321,
349 double_value_boxed: 7.654321,
350 short_value_boxed: 32100,
351 char_value_boxed: "$".charCodeAt(0),
352 boolean_value_boxed: false,
353 int_array: [-1234, -123, -12, -1, 0, 1, 12, 123, 1234],
354 long_array: [-123400, -12300, -1200, -100, 0, 100, 1200, 12300, 123400],
355 float_array: [-12.34, -12.3, -12.0, -1.0, 0.0, 1.0, 12.0, 12.3, 12.34],
356 double_array: [-1.234, -1.23, -12.0, -1.0, 0.0, 1.0, 12.0, 1.23, 1.234],
357 short_array: [-1234, -123, -12, -1, 0, 1, 12, 123, 1234],
358 char_array: Array.from("asdfASDF", (char) => char.charCodeAt(0)),
359 boolean_array: [true, false, false, true],
360 string: "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
361 };
362}
363
364function createMediaContent() {
365 return {

Callers

nothing calls this directly

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected