Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "code-red", | ||
"description": "code-red", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"repository": "Rich-Harris/code-red", | ||
@@ -13,3 +13,2 @@ "exports": { | ||
"src", | ||
"dist", | ||
"types" | ||
@@ -37,3 +36,3 @@ ], | ||
}, | ||
"packageManager": "pnpm@7.28.0" | ||
} | ||
"packageManager": "pnpm@8.6.0" | ||
} |
@@ -1315,14 +1315,31 @@ // heavily based on https://github.com/davidbonnet/astring | ||
const args = node.arguments.map((arg) => handle(arg, state)); | ||
const args = node.arguments.map((arg) => { | ||
const chunks = []; | ||
while (state.comments.length) { | ||
const comment = state.comments.shift(); | ||
chunks.push(c(comment.type === 'Block' | ||
? `/*${comment.value}*/ ` | ||
: `//${comment.value}`)); | ||
} | ||
push_array(chunks, handle(arg, state)); | ||
return chunks; | ||
}); | ||
const multiple_lines = args.slice(0, -1).some(has_newline); // TODO or length exceeds 80 | ||
if (multiple_lines) { | ||
// need to handle args again. TODO find alternative approach? | ||
const args = node.arguments.map((arg) => | ||
handle(arg, { | ||
const args = node.arguments.map((arg) => { | ||
const chunks = []; | ||
while (state.comments.length) { | ||
const comment = state.comments.shift(); | ||
chunks.push(c(comment.type === 'Block' | ||
? `/*${comment.value}*/ ` | ||
: `//${comment.value}`)); | ||
} | ||
push_array(chunks, handle(arg, { | ||
...state, | ||
indent: `${state.indent}\t` | ||
}) | ||
); | ||
})); | ||
return chunks; | ||
}); | ||
@@ -1329,0 +1346,0 @@ chunks.push(c(`(\n${state.indent}\t`)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60181
15
1971