Skip to content

Commit

Permalink
Merge pull request #2231 from simlu/dev
Browse files Browse the repository at this point in the history
amend: minor
  • Loading branch information
simlu authored Feb 23, 2024
2 parents d2a9cf2 + 916a1d9 commit e3a2e52
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/module/dy/create-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ export default (kwargs) => {
};

const generateRewriter = (fn) => {
const logic = Object.fromEntries(
Object
.entries(attributes)
.filter(([k, v]) => typeof v?.[fn] === 'function')
.map(([k, v]) => [`{[*].${k},${k}}`, v])
);
const entries = Object
.entries(attributes)
.filter(([k, v]) => typeof v?.[fn] === 'function')
.map(([k, v]) => [`{[*].${k},${k}}`, v]);
if (entries.length === 0) {
return (e) => e;
}
const logic = Object.fromEntries(entries);
return (itemOrItems) => {
objectScan(Object.keys(logic), {
filterFn: ({
Expand Down

0 comments on commit e3a2e52

Please sign in to comment.