This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/helpers/as-hash.js.es6

9 lines
243 B
JavaScript

// Note: Later versions of ember include `hash`
export default function hashHelper(params) {
const hash = {};
Object.keys(params.hash).forEach(k => {
hash[k] = params.data.view.getStream(params.hash[k]).value();
});
return hash;
}