are-feross-and-mafintosh-stuck-in-an-elevator icon indicating copy to clipboard operation
are-feross-and-mafintosh-stuck-in-an-elevator copied to clipboard

Version 2.0 will always return `false`; even if Feross and Mafintosh are indeed stuck in an elevator/lift

Open gausby opened this issue 9 years ago • 8 comments

I have only tested this with simulation. My model of reality could very well differ from the real reality.

gausby avatar Aug 05 '15 11:08 gausby

I think we'll need the NSA in on this.

fnky avatar Aug 05 '15 12:08 fnky

What if only one of @feross or @mafintosh get stuck in an elevator? I feel the implementation behavior here is undefined.

stuartpb avatar Aug 05 '15 16:08 stuartpb

@stuartpb We'll need to make two new modules and refactor this module like this:

module.exports = function () {
  return require('is-feross-stuck-in-an-elevator')() && require('is-mafintosh-stuck-in-an-elevator')()
}

feross avatar Aug 05 '15 16:08 feross

What if the elevator gets stuck in @feross and/or @mafintosh? Need more clarification

fnky avatar Aug 05 '15 17:08 fnky

@feross i don't know, maybe we can abstract it out:

return require('is-entity-stuck-in-entity')(people['feross'], transports['elevator']) && require('is-entity-stuck-in-entity')(people['mafintosh'], transports['elevator'])

though maybe it really could be even more general:

require('is-entity-condition-qualifier-entity')(f, 'stuck', 'in', m) 

jbenet avatar Aug 05 '15 21:08 jbenet

@jbenet I like the second approach as it is more generic. Would it return a Boolean?

fnky avatar Aug 05 '15 21:08 fnky

@fnky not flexible enough. maybe a function() { return Boolean(true) }

jbenet avatar Aug 05 '15 21:08 jbenet

@jbenet I meant you should be able to set the conditions for when an entity is stuck or not.

fnky avatar Aug 05 '15 23:08 fnky