medialize/ally.js

View on GitHub
build/metalsmith/helpers/contains.js

Summary

Maintainability
A
0 mins
Test Coverage

module.exports = function(key, haystack, context) {
  const contained = (haystack || '').indexOf(key) > -1;
  if (contained) {
    return context.fn(this);
  } else {
    return context.inverse(this);
  }
};