Skip to content

Commit

Permalink
add missing src/properties-transformer.mjs from template
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Jun 20, 2024
1 parent 434f755 commit 562717f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/properties-transformer.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Creates a new transformer.
* On match the entry will be assigned new properties as given by propertyDefinitions.
* @param {Object} propertyDefinitions
* @param {Matcher} matcher
* @param {string} name
* @return {Transformer}
*/
export function createPropertiesTransformer(
match,
propertyDefinitions,
name = "property"
) {
return {
name,
match,
transform: async entry => Object.create(entry, propertyDefinitions)
};
}

0 comments on commit 562717f

Please sign in to comment.