pakastin / frzr

Turboboosted 2 KB view library for browser & node.js
https://frzr.js.org
ISC License
265 stars 21 forks source link

{ isDefined } from utils #19

Closed jwarnox closed 8 years ago

jwarnox commented 8 years ago

Is this a bug or am I missing something, line: https://github.com/pakastin/frzr/blob/master/src/utils.js#L9

When I ran this in the console I got true? which is wrong as x is an undefined var

var x;
function isDefined (check) {
  return typeof check !== 'undefined' || check !== null;
};
isDefined(x);
> true

but using a logical AND (&&) it works!

var x;
function isDefined (check) {
  return typeof check !== 'undefined' && check !== null;
};
isDefined(x);
> false
isDefined();
> false
pakastin commented 8 years ago

oh, thanks! I fixed it to translate.js (the only place it's used), and removed the helper – it wasn't even exported from index.js..

https://github.com/pakastin/frzr/commit/d8209661954b674aa67403ccaf3ffa49c07a76be

jwarnox commented 8 years ago

Cool - https://github.com/pakastin/frzr/blob/master/src/translate.js#L3 is redundant now but rollup is smart enough not to try and import it

pakastin commented 8 years ago

Oh yeah, I'll remove that also. Thank you so much for reporting the issue! 👍

jwarnox commented 8 years ago

Your welcome and looking forward to Part 2 in your blog series on FRZR !

pakastin commented 8 years ago

I'm working on it.. Still haven't figured out precisely what FRZR really is and where it should go - easier to use or more towards minimalism and thinner DOM wrap.

Tough questions, and it feels like as I'm writing the post, I'm somehow locking the specs, if you know what I mean. Another thing is that English is not my mother tongue and I constantly feel that I'm writing bad English, repeating words etc.. Never written a blog before, but I'm learning.

Thank you for the support! ;)