0

Does anyone know what this exclamation mark syntax is?

https://github.com/GoogleChrome/chrome-launcher/blob/master/chrome-launcher.ts#L82

export async function launch(opts: Options = {}): Promise<LaunchedChrome> {
  opts.handleSIGINT = defaults(opts.handleSIGINT, true);

  const instance = new Launcher(opts);

  // Kill spawned Chrome process in case of ctrl-C.
  if (opts.handleSIGINT && instances.size === 0) {
    process.on(_SIGINT, sigintListener);
  }
  instances.add(instance);

  await instance.launch();

  const kill = async () => {
    instances.delete(instance);
    if (instances.size === 0) {
      process.removeListener(_SIGINT, sigintListener);
    }
    return instance.kill();
  };

  return {pid: instance.pid!, port: instance.port!, kill, chromeProcess: instance.chrome};   // here!
}

what does

pid: instance.pid!

mean?

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

0 Answers0