# Features - Filters now control what types of modules they see. - Filters can be reinstantiated via `.new()` - Added the `Not` type in @revenge-mod/utils/types # Fixes - Pitfall with `lookupModules` and `withDependencies` without `uninitialize: true` fixed. - Filter type-metadata is now stored in a single object instead of multiple parameters. - Incorrect caching behavior for `lookupModules` where cache always reports not found if you finish the iterator. - Also attempt to report not found when using `lookupModule`.
27 lines
699 B
TypeScript
27 lines
699 B
TypeScript
import { lookupModule } from '@revenge-mod/modules/finders'
|
|
import {
|
|
withDependencies,
|
|
withProps,
|
|
} from '@revenge-mod/modules/finders/filters'
|
|
import { proxify } from '@revenge-mod/utils/proxy'
|
|
|
|
const { loose, relative } = withDependencies
|
|
|
|
export let nodeUtil: typeof import('node:util') = proxify(
|
|
() => {
|
|
const [module] = lookupModule(
|
|
withProps<typeof nodeUtil>('inspect').and(
|
|
withDependencies([
|
|
loose([relative(2, true), relative(4, true)]),
|
|
[],
|
|
[],
|
|
]),
|
|
),
|
|
)
|
|
|
|
if (module) return (nodeUtil = module)
|
|
},
|
|
{
|
|
hint: {},
|
|
},
|
|
)!
|