Initial commit

This commit is contained in:
Ammaar Reshi
2025-01-04 14:06:53 +00:00
parent 7082408604
commit d6025af146
23760 changed files with 3299690 additions and 0 deletions

43
node_modules/regexparam/dist/index.js generated vendored Normal file
View File

@ -0,0 +1,43 @@
/**
* @param {string|RegExp} input The route pattern
* @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.
*/
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?
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;
});
}
exports.inject = inject;
exports.parse = parse;

1
node_modules/regexparam/dist/index.min.js generated vendored Normal file
View File

@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.regexparam={})}(this,(function(e){var n=/(\/|^)([:*][^/]*?)(\?)?(?=[/.]|$)/g;e.inject=function(e,t){return e.replace(n,(e,n,i,r)=>(e=t["*"==i?i:i.substring(1)])?"/"+e:r||"*"==i?"":"/"+i)},e.parse=function(e,n){if(e instanceof RegExp)return{keys:!1,pattern:e};var t,i,r,f,s=[],p="",o=e.split("/");for(o[0]||o.shift();r=o.shift();)"*"===(t=r[0])?(s.push(t),p+="?"===r[1]?"(?:/(.*))?":"/(.*)"):":"===t?(i=r.indexOf("?",1),f=r.indexOf(".",1),s.push(r.substring(1,~i?i:~f?f:r.length)),p+=~i&&!~f?"(?:/([^/]+?))?":"/([^/]+?)",~f&&(p+=(~i?"?":"")+"\\"+r.substring(f))):p+="/"+r;return{keys:s,pattern:new RegExp("^"+p+(n?"(?=$|/)":"/?$"),"i")}}}));

40
node_modules/regexparam/dist/index.mjs generated vendored Normal file
View File

@ -0,0 +1,40 @@
/**
* @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;
});
}