- 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>
19 lines
480 B
TypeScript
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)
|
|
}
|