Update composer.js

Wrong compare to "undefined" and name.length of undefined.
should be:

    if (typeof global.admin == 'undefined') {

the same for all other checks