function createScript(script) {
  if (!script.scriptId) throw new Error('Must include a scriptId');

  // @ts-expect-error For testing purposes we assume the test set all valid properties.
  return {
    ...script,
    length: script.content?.length ?? script.length,
    name: script.name ?? script.url ?? '<no name>',
    scriptLanguage: 'JavaScript',
  };
}
@param {Partial<LH.Artifacts.Script>} script
@return {LH.Artifacts.Script} script