Jelajahi Sumber

[extract]: add jsdoc

mightyplow 7 tahun lalu
induk
melakukan
fcf373338c
1 mengubah file dengan 10 tambahan dan 0 penghapusan
  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];