code: function formatJSAssignment(
    objectName: string,
    path: Array<string | number>,
    value: mixed,
  ): string {
    const assignmentPath = path
      .map(p => (typeof p === 'string' ? `.${p}` : `[${p}]`))
      .join('');
    const jsValue = value === undefined ? 'undefined' : JSON.stringify(value);
    // $FlowFixMe(>=0.95.0) JSON.stringify can return undefined
    return `${objectName}${assignmentPath} = ${jsValue};`;
  }
docs: Print a path/value pair as a JS assignment expression.