mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
license-checker-webpack-plugin: Fix outputWriter type (#38579)
The function is passed an object containing a dependencies array, not the array itself.
This commit is contained in:
parent
62db23a607
commit
d84efa6950
@ -19,6 +19,12 @@ declare namespace LicenseCheckerWebpackPlugin {
|
||||
licenseText: string;
|
||||
}
|
||||
|
||||
interface OutputWriterArgs {
|
||||
dependencies: Dependency[];
|
||||
}
|
||||
|
||||
type OutputWriter = (args: OutputWriterArgs) => string;
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* Regular expression that matches the file paths of dependencies to check.
|
||||
@ -59,7 +65,7 @@ declare namespace LicenseCheckerWebpackPlugin {
|
||||
* Path to a `.ejs` template, or function that will generate the contents
|
||||
* of the third-party notices file.
|
||||
*/
|
||||
outputWriter: string | ((dependencies: Dependency[]) => string);
|
||||
outputWriter: string | OutputWriter;
|
||||
|
||||
/**
|
||||
* Name of the third-party notices file with all licensing information.
|
||||
|
||||
@ -18,7 +18,8 @@ new LicenseCheckerWebpackPlugin({
|
||||
// $ExpectType LicenseCheckerWebpackPlugin
|
||||
new LicenseCheckerWebpackPlugin({
|
||||
filter: /.*/,
|
||||
outputWriter: (dependencies) => {
|
||||
outputWriter: ({ dependencies }) => {
|
||||
dependencies; // $ExpectType Dependency[]
|
||||
return dependencies.map(d => `${d.name} ${d.licenseName}`).join('\n');
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user