@@ -199,10 +199,10 @@ const noop = () => {};
199199 * @returns {API<RequestInternal, ResponseInternal> } webpack dev middleware
200200 */
201201function wdm ( compiler , options = { } , isPlugin = false ) {
202- // validate(/** @type {Schema } */ (schema), options, {
203- // name: "Dev Middleware",
204- // baseDataPath: "options",
205- // });
202+ validate ( /** @type {Schema } */ ( schema ) , options , {
203+ name : "Dev Middleware" ,
204+ baseDataPath : "options" ,
205+ } ) ;
206206
207207 const { mimeTypes } = options ;
208208
@@ -539,7 +539,7 @@ wdm.koaWrapper = koaWrapper;
539539 * @template {IncomingMessage} [RequestInternal=IncomingMessage]
540540 * @template {ServerResponse} [ResponseInternal=ServerResponse]
541541 * @param {Compiler | MultiCompiler } compiler compiler
542- * @param {Options<RequestInternal, ResponseInternal> & { debug?: boolean } = } options options
542+ * @param {Options<RequestInternal, ResponseInternal>= } options options
543543 * @param {boolean= } usePlugin true when need to use as a plugin, otherwise false
544544 * @returns {(ctx: EXPECTED_ANY, next: EXPECTED_FUNCTION) => Promise<void> | void } hono wrapper
545545 */
@@ -639,20 +639,12 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
639639 * @param {import("fs").ReadStream } stream readable stream
640640 */
641641 res . stream = ( stream ) => {
642- if ( options . writeToDisk === true && options . debug ) {
643- console . error ( stream ) ;
644- }
645-
646642 let isResolved = false ;
647643
648644 /**
649645 * @param {Error= } err err
650646 */
651647 const onEvent = ( err ) => {
652- if ( options . writeToDisk === true && options . debug ) {
653- console . error ( "onEvent" , err ) ;
654- }
655-
656648 if ( isResolved ) return ;
657649 isResolved = true ;
658650
@@ -669,10 +661,6 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
669661 body = stream ;
670662 isFinished = true ;
671663
672- if ( options . writeToDisk === true && options . debug ) {
673- console . error ( "resolve" , isFinished ) ;
674- }
675-
676664 resolve ( ) ;
677665 } ;
678666
@@ -729,10 +717,6 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
729717 } ,
730718 ) ;
731719 } catch ( err ) {
732- if ( options . writeToDisk === true && options . debug ) {
733- console . error ( "catch" , err ) ;
734- }
735-
736720 if ( options ?. forwardError ) {
737721 await next ( ) ;
738722
@@ -744,18 +728,10 @@ function honoWrapper(compiler, options = {}, usePlugin = false) {
744728 return context . json ( { message : /** @type {Error } */ ( err ) . message } ) ;
745729 }
746730
747- if ( options . writeToDisk === true && options . debug ) {
748- console . error ( "body" , body ) ;
749- }
750-
751731 if ( typeof body !== "undefined" ) {
752732 return context . body ( body , status ) ;
753733 }
754734
755- if ( options . writeToDisk === true && options . debug ) {
756- console . error ( "next" ) ;
757- }
758-
759735 await next ( ) ;
760736 }
761737
0 commit comments