Make WordPress Core

Changeset 62604


Ignore:
Timestamp:
06/30/2026 09:19:46 PM (14 hours ago)
Author:
jorbin
Message:

Build/Test: Fix typescript error in Gutenberg Copy.

Backporting [62600] leads to the following error: Parameter 'dep' implicitly has an 'any' type. so this gives an explicit type and also does explicit type checking.

This isn't an issue in trunk due to [62428] removing this code and re-introducing client side media so this commit is only happening in the 7.0 branch.

Developed in: https://github.com/WordPress/wordpress-develop/pull/12370
Discussed in slack thread: https://wordpress.slack.com/archives/C02RQBWTW/p1782850291418919

Follow up-to [62600].

Props jorbin, joedolson.
See: #65452.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/7.0/tools/gutenberg/copy.js

    r62600 r62604  
    500500                assetData.module_dependencies =
    501501                    assetData.module_dependencies.filter(
     502                        /**
     503                         * @param {string|{ id: string }} dep
     504                         * @return {boolean}
     505                         */
    502506                        ( dep ) =>
    503                             ! ( dep.id || dep ).startsWith(
     507                            ! ( typeof dep === 'string' ? dep : dep.id ).startsWith(
    504508                                '@wordpress/vips'
    505509                            )
Note: See TracChangeset for help on using the changeset viewer.