UNPKG

oops

Version:

Functional <3 to rescue from OOPs

14 lines (10 loc) 344 B
"use strict"; var curry = require("functional/curry") var hasnt = curry(function hasnt(name, dictionary) { /** High order function that returns predicate function which will return `true` if given `hash` has a field with that `name` and `false` if doesn't. **/ return !dictionary || !(name in dictionary) }) module.exports = hasnt