static translateKotlinToJs(
    code,
    compilerVersion,
    platform,
    args,
    hiddenDependencies,
  ) {
    const MINIMAL_VERSION_IR = '1.5.0';
    const MINIMAL_VERSION_WASM = '1.9.0';
    const MINIMAL_VERSION_SWIFT_EXPORT = '2.0.0';

    if (
      platform === TargetPlatforms.JS_IR &&
      compilerVersion < MINIMAL_VERSION_IR
    ) {
      return Promise.resolve({
        output: '',
        errors: [
          {
            severity: 'ERROR',
            message: `JS IR compiler backend accessible only since ${MINIMAL_VERSION_IR} version`,
          },
        ],
        jsCode: '',
      });
    }

    if (isWasmRelated(platform) && compilerVersion < MINIMAL_VERSION_WASM) {
      return Promise.resolve({
        output: '',
        errors: [
          {
            severity: 'ERROR',
            message: `Wasm compiler backend accessible only since ${MINIMAL_VERSION_WASM} version`,
          },
        ],
        jsCode: '',
      });
    }

    if (
      platform === TargetPlatforms.SWIFT_EXPORT &&
      compilerVersion < MINIMAL_VERSION_SWIFT_EXPORT
    ) {
      return Promise.resolve({
        output: '',
        errors: [
          {
            severity: 'ERROR',
            message: `Swift export accessible only since ${MINIMAL_VERSION_SWIFT_EXPORT} version`,
          },
        ],
        jsCode: '',
      });
    }

    return executeCode(
      API_URLS.COMPILE(platform, compilerVersion),
      code,
      compilerVersion,
      platform,
      args,
      hiddenDependencies,
    ).then(function (data) {
      let output = '';
      let errorsAndWarnings = flatten(Object.values(data.errors));
      return {
        output: output,
        errors: errorsAndWarnings,
        jsCode: data.jsCode,
        wasm: data.wasm,
      };
    });
  }
Request on translation Kotlin code to JS code

@param code            - string
@param compilerVersion - string kotlin compiler
@param platform        - TargetPlatform
@param args            - command line arguments
@param hiddenDependencies   - read only additional files
@returns {*|PromiseLike<T>|Promise<T>}