Skip to content

Various improvements#12

Open
WasabiThumb wants to merge 9 commits intoisflavior:mainfrom
WasabiThumb:main
Open

Various improvements#12
WasabiThumb wants to merge 9 commits intoisflavior:mainfrom
WasabiThumb:main

Conversation

@WasabiThumb
Copy link

@WasabiThumb WasabiThumb commented Jun 14, 2024

  • Generated missing package-lock.json, this is valuable for deterministic installs
  • Normalized contract
    • Promise now always resolves with the output code, this is so that the typing doesn't need to have a special case. Side effects should be non-existent as dependents that are built with the assumption that the API will return a void promise should now quietly discard the output code.
      • Before
        await UglifyPHP.minify("in.php", { output: "out.php" }); // void
        await UglifyPHP.minify("in.php"); // string
      • After
        await UglifyPHP.minify("in.php", { output: "out.php" }); // string
        await UglifyPHP.minify("in.php"); // string
  • Added types for compatibility with TypeScript
  • Added documentation to types
  • Applied lints
    • var -> let, const
    • == -> === (for string to string comparison, should be identical)
  • Added method to API that accepts only source code; this means that using statSync to check if the input is a path is not required
  • Added filesOnly option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant