core: decorator: check with startWith

This commit is contained in:
undefined committed 2024-03-10 22:46:42 +08:00
1 parent 2338255f5c
commit c0e8d8bf90
1 file changed
+1 -1
+1 -1
View File
@@ -44,7 +44,7 @@ function _descriptor(v: ParamOption<any>) {
const originalMethod = obj.value;
const val = originalMethod.toString();
const firstArg = val.split(')')[0]?.split(',')[0]?.split('(')[1]?.trim() || '';
const domainIdStyle = firstArg.toLowerCase().includes('domainid');
const domainIdStyle = firstArg.toLowerCase().startsWith('domainid');
target.__param[target.constructor.name][funcName] = [];
obj.value = function validate(this: Handler, rawArgs: any, ...extra: any[]) {
if (typeof rawArgs !== 'object' || extra.length) return originalMethod.call(this, rawArgs, ...extra);