import { Module } from 'webpack' ; import { PACKAGE_NAMESPACE } from '../types' ; import type { ModuleWithMetaData } from '../types' ; export const moduleHasMetaData = ( module ) : module is ModuleWithMetaData => ( PACKAGE_NAMESPACE in module . buildInfo ) ; export function assertHasMetaData ( module ) { if ( ! moduleHasMetaData ( module ) ) { module . buildInfo [ PACKAGE_NAMESPACE ] = { } ; } }