Skip to content

Commit 4fc4a70

Browse files
handle additional permutations
"
1 parent a9ffaa9 commit 4fc4a70

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

transforms/angle-brackets/transform.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,15 @@ function transformToAngleBracket(env, fileInfo, config) {
266266
let _qpParam;
267267

268268
if (hasQueryParamHelper) {
269-
_modelsParam = b.attr('@model', transformModelParams(models[0]));
270-
_qpParam = b.attr('@query', b.mustache(b.path('hash'), [], models[1].hash));
269+
if (models.length < 3) {
270+
_modelsParam = b.attr('@model', transformModelParams(models[0]));
271+
} else {
272+
_modelsParam = b.attr(
273+
'@models',
274+
b.mustache(b.path('array'), models.slice().splice(0, 2))
275+
);
276+
}
277+
_qpParam = b.attr('@query', b.mustache(b.path('hash'), [], models[models.length - 1].hash));
271278
} else {
272279
_modelsParam = b.attr('@models', b.mustache(b.path('array'), models));
273280
}

0 commit comments

Comments
 (0)