Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
1234567891011121314 |
- 'use strict';
-
- /**
- * Create a method that will retrieve the given field from an object where that field has a function value
- * @param {string} field The field to consider
- * @returns {function(object):function} A method that gets functions from the given field
- */
- function getFieldAsFn(field) {
- return function getFromValue(value) {
- return !!value && (typeof value === 'object') && (typeof value[field] === 'function') && value[field];
- };
- }
-
- module.exports = getFieldAsFn;
|