UNPKG

wunphile

Version:

Simple, imperative JavaScript-based static site generator

27 lines (23 loc) 603 B
import type { BehaviorModule } from '../../../index.mjs' import '../plain.js' type LocationType = 'known location' | 'unknown location' export default { behaviorModuleUrl: import.meta.url, behavior: () => { let msg: LocationType if (window.location.href.startsWith('/test')) { msg = 'known location' } else { msg = 'unknown location' } alert(msg) }, functions: { funcA: () => { alert('func a') }, funcB: () => { alert('func b') } }, } satisfies BehaviorModule