You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui/packages/consul-ui/app/helpers/flatten-property.js

9 lines
278 B

import { helper } from '@ember/component/helper';
export default helper(function flattenProperty([obj, prop], hash) {
const pages = hash.pages || [];
pages.push(...obj.pages);
obj.children.forEach(child => flattenProperty([child], { pages: pages }));
return pages;
});