function executeCode()

in src/webdemo-api.js [249:278]


function executeCode(
  url,
  code,
  compilerVersion,
  targetPlatform,
  args,
  hiddenDependencies,
  options,
) {
  const files = [buildFileObject(code, DEFAULT_FILE_NAME)].concat(
    hiddenDependencies.map((file, index) =>
      buildFileObject(file, `hiddenDependency${index}.kt`),
    ),
  );

  const body = {
    args,
    files,
    confType: targetPlatform.id,
    ...(options || {}),
  };

  return fetch(url, {
    method: 'POST',
    body: JSON.stringify(body),
    headers: {
      'Content-Type': 'application/json; charset=utf-8',
    },
  }).then((response) => response.json());
}