Commit 1237854b authored by Florent Chehab's avatar Florent Chehab
Browse files

Merge branch 'cleaning' into 'master'

Cleaning

Closes #48 and #47

See merge request !48
parents 909dae0d 827fa5b8
/**
* Function that converts an array of instances of a model to a map.
*
* @export
* @param {Array} arr
* @param {string} [attrToUseAsKey="id"]
* @returns {Map}
*/
export default function arrayOfInstancesToMap(arr, attrToUseAsKey = "id") {
let out = new Map;
arr.forEach(instance => out.set(instance[attrToUseAsKey], instance));
return out;
}
......@@ -7,7 +7,7 @@ const config = {
"./src/index",
],
vendor: [
"babel-polyfill",
"@babel/polyfill",
]
},
output: {
......@@ -21,7 +21,6 @@ const config = {
exclude: /node_modules/,
loader: "babel-loader",
options: {
presets: ["es2015", "react", "stage-0"],
compact: true
},
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment