Function tsHasDefaultExport

  • Checks if the provided TypeScript code has a default export.

    Parameters

    • code: string

      The TypeScript code to check.

    Returns boolean

    A boolean indicating whether the provided TypeScript code has a default export.

    Example

    const code = `export default function() {}`;
    tsHasDefaultExport(code);
    //=> true

Generated using TypeDoc