Files
adam-acs/app/utils/glob_match.ts
T
Kevin L'HereecandCopilot d1c65dbf1e chore: initial commit — AdonisJS v7 TR-069 ACS
- Docker infrastructure (Dockerfile, docker-compose.yml, genieacs-sim)
- AdonisJS v7 app with Inertia.js + Vue 3
- MongoDB integration
- CWMP/TR-069 state machine engine
- Configuration engine with compliance tracking
- Branding: ADAM ACS (favicon, navbar, locales)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-29 16:46:37 +02:00

19 lines
480 B
TypeScript

/**
* Simple glob matching for Configuration criteria.
* Supports:
* - `*` matches any sequence of characters (including empty)
* - `?` matches exactly one character
* Matching is case-sensitive.
*/
export function matchGlob(pattern: string, value: string): boolean {
const regex = new RegExp(
'^' +
pattern
.replace(/[.+^${}()|[\]\\]/g, '\\$&')
.replace(/\*/g, '.*')
.replace(/\?/g, '.') +
'$'
)
return regex.test(value)
}