import { helper } from '@ember/component/helper';
const describe = (entries: string): string => (entries.length > 0 ? entries : '(none)');
export function showAll(positional: unknown[], named: Record<string, unknown>) {
// pretty print each item with its index, like `0: { neat: true }` or
const positionalEntries = positional
.reduce<string[]>((items, arg, index) => items.concat(`${index}: ${JSON.stringify(arg)}`), [])
// pretty print each item with its name, like `cool: beans` or
const namedEntries = Object.keys(named)
(items, key) => items.concat(`${key}: ${JSON.stringify(named[key], undefined, 2)}`),
return `positional: ${describe(positionalEntries)}\nnamed: ${describe(namedEntries)}`;
export default helper(showAll);