How to use the value-or-function.call function in value-or-function

To help you get started, we’ve selected a few value-or-function examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gulpjs / resolve-options / index.js View on Github external
return constants[key];
    }

    var definition = config[key];
    // Ignore options that are not defined
    if (!definition) {
      return;
    }

    var option = options[key];

    if (option != null) {
      if (typeof option === 'function') {
        return;
      }
      option = normalize.call(resolver, definition.type, option);
      if (option != null) {
        constants[key] = option;
        return option;
      }
    }

    var fallback = definition.default;
    if (option == null && typeof fallback !== 'function') {
      constants[key] = fallback;
      return fallback;
    }
  }

value-or-function

Normalize a value or function, applying extra args to the function

MIT
Latest version published 3 years ago

Package Health Score

66 / 100
Full package analysis