mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
update definition, add tests
This commit is contained in:
+1
-1
@@ -77,7 +77,7 @@ declare namespace WebpackManifestPlugin {
|
||||
/**
|
||||
* Sort files before they are passed to generate.
|
||||
*/
|
||||
sort?: (file: FileDescriptor) => number;
|
||||
sort?: (a: FileDescriptor, b: FileDescriptor) => number;
|
||||
|
||||
/**
|
||||
* Create the manifest. It can return anything as long as it's serialisable by JSON.stringify.
|
||||
|
||||
@@ -14,14 +14,12 @@ const options: WebpackManifestPlugin.Options = {
|
||||
map: (file) => {
|
||||
if (file.name) {
|
||||
file.name = path.join(path.dirname(file.path), file.name);
|
||||
return file;
|
||||
}
|
||||
},
|
||||
reduce: (manifest, { name, path }) => {
|
||||
if (name) {
|
||||
return { ...manifest, [name]: path };
|
||||
}
|
||||
return file;
|
||||
},
|
||||
sort: (a, b) => a.path.localeCompare(b.path),
|
||||
generate: (seed, files) => files.reduce((manifest, {name, path}) => name ? {...manifest, [name]: path} : manifest, seed),
|
||||
serialize: (manifest) => JSON.stringify(manifest, null, 2)
|
||||
};
|
||||
|
||||
const c: Configuration = {
|
||||
|
||||
Reference in New Issue
Block a user