Browse Source

[extract]: add jsdoc

mightyplow 7 years ago
parent
commit
fcf373338c
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/object/extract.js

+ 10 - 0
src/object/extract.js

@@ -1,3 +1,13 @@
+/**
+ * Creates a function which extracts some properties out of an object.
+ *
+ * @typedef {function} extractProps
+ *
+ * @memberOf object
+ * @param {string[]} props
+ * @return {function(obj: Object)}
+ */
+
 const extract = (...props) => (obj) => {
     return props.reduce((extracted, key) => {
         extracted[key] = obj[key];