revenge-bundle-next/lib/externals/src/browserify.ts
PalmDevs b6d1cff9f5
feat(lib/modules)!: filter scopes + fixes and improvements
# 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`.
2025-10-28 01:01:17 +07:00

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: {},
},
)!