@@ -3,7 +3,6 @@ import * as Zod from 'zod'
33import * as Process from 'node:process'
44import * as TLDTS from 'tldts'
55import PackageJson from '@npmcli/package-json'
6- import { LoadDomainsFromCache } from './cache.js'
76import { FetchAdShieldDomains } from './references/index.js'
87import { CustomDefinedMatches } from './references/custom-defined.js'
98import { ConvertWildcardSuffixToRegexPattern } from './utils/wildcard-suffix-converter.js'
@@ -12,7 +11,6 @@ import { SafeInitCwd } from './utils/safe-init-cwd.js'
1211
1312export type BuildOptions = {
1413 Minify : boolean
15- UseCache : boolean
1614 BuildType : 'production' | 'development' ,
1715 SubscriptionUrl : string ,
1816 Version ?: string
@@ -21,18 +19,13 @@ export type BuildOptions = {
2119export async function Build ( OptionsParam ?: BuildOptions ) : Promise < void > {
2220 const Options = await Zod . strictObject ( {
2321 Minify : Zod . boolean ( ) ,
24- UseCache : Zod . boolean ( ) ,
2522 BuildType : Zod . enum ( [ 'production' , 'development' ] ) ,
2623 SubscriptionUrl : Zod . string ( ) . transform ( Value => new URL ( Value ) ) . default ( new URL ( 'https://cdn.jsdelivr.net/npm/@filteringdev/tinyshield@latest/dist/tinyShield.user.js' ) ) ,
2724 Version : Zod . string ( ) . optional ( )
2825 } ) . parseAsync ( OptionsParam )
2926
3027 let MatchingDomains : Set < string > = new Set < string > ( )
31- if ( Options . UseCache ) {
32- MatchingDomains = await LoadDomainsFromCache ( )
33- } else {
34- MatchingDomains = await FetchAdShieldDomains ( )
35- }
28+ MatchingDomains = await FetchAdShieldDomains ( )
3629 CustomDefinedMatches . forEach ( Domain => MatchingDomains . add ( Domain ) )
3730
3831 MatchingDomains = new Set < string > ( [ ...MatchingDomains ] . map ( Domain => TLDTS . parse ( Domain ) . domain ?? Domain ) . filter ( ( D ) : D is string => D !== null ) )
0 commit comments