jupyter-ijavascript-utils 1.16.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/object.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyter-ijavascript-utils",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "Utilities for working with iJavaScript - a Jupyter Kernel",
5
5
  "homepage": "https://jupyter-ijavascript-utils.onrender.com/",
6
6
  "license": "MIT",
package/src/object.js CHANGED
@@ -206,10 +206,12 @@ module.exports.augment = function augment(objCollection, mappingFn, inPlace = fa
206
206
  */
207
207
  module.exports.mapByProperty = function mapByProperty(collection, propertyName) {
208
208
  if (!propertyName) throw new Error('object.mapByProperty: expects a propertyName');
209
+
210
+ const cleanedFunc = ObjectUtils.evaluateFunctionOrProperty(propertyName);
209
211
 
210
212
  return (collection || []).reduce(
211
213
  (result, entry) => {
212
- result.set(entry[propertyName], entry);
214
+ result.set(cleanedFunc(entry), entry);
213
215
  return result;
214
216
  }, new Map()
215
217
  );