BLUE
PHP 7.4.33
Path:
/var/www/gtechmarathon2026.bitkit.dk/httpdocs/node_modules/regexparam/dist
Run
Logout
Edit File
Size: 1.17 KB
Close
/var/www/gtechmarathon2026.bitkit.dk/httpdocs/node_modules/regexparam/dist/index.mjs
Text
Base64
/** * @param {string|RegExp} input The route pattern * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input. */ export function parse(input, loose) { if (input instanceof RegExp) return { keys:false, pattern:input }; var c, o, tmp, ext, keys=[], pattern='', arr = input.split('/'); arr[0] || arr.shift(); while (tmp = arr.shift()) { c = tmp[0]; if (c === '*') { keys.push(c); pattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)'; } else if (c === ':') { o = tmp.indexOf('?', 1); ext = tmp.indexOf('.', 1); keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) ); pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); } else { pattern += '/' + tmp; } } return { keys: keys, pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') }; } var RGX = /(\/|^)([:*][^/]*?)(\?)?(?=[/.]|$)/g; // error if key missing? export function inject(route, values) { return route.replace(RGX, (x, lead, key, optional) => { x = values[key=='*' ? key : key.substring(1)]; return x ? '/'+x : (optional || key=='*') ? '' : '/' + key; }); }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.js
1.21 KB
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.min.js
783 B
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.mjs
1.17 KB
lrw-r--r--
2025-07-10 12:54:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).