Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 61181ad

Browse files
feat: operate $param[]
- checks object for $param[0] by index - main object fallback to fill undefiened index
1 parent 649c4f8 commit 61181ad

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/server.js‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,19 @@ class CoCreateLazyLoader {
171171
if (typeof method !== 'function')
172172
throw new Error(`Method ${data.method} is not a function.`);
173173

174-
let params = data.$params || [data[name]]
174+
let params = [], mainParam = false
175+
for (let i = 0; true; i++) {
176+
if (`$param[${i}]` in object) {
177+
params.push(data[`$param[${i}]`])
178+
delete data[`$param[${i}]`]
179+
} else if (!mainParam) {
180+
params.push([data[name]])
181+
mainParam = true
182+
} else {
183+
break;
184+
}
185+
}
186+
175187
data.postmark = await method.apply(instance, params);
176188
return data
177189
} catch (error) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /