the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence The _isBuffer check is for Safari 5-7 support, because it's missing Object.prototype.constructor. Remove this eventually
166084
function isBuffer(obj) {
	  return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
	}
808915
function (buffer) {
        var header = new Uint32Array(buffer, 0, 4);
        if (header[0] !== 0x46546C67) {
            this.trigger('error', 'Invalid glTF binary format: Invalid header');
            return;
        }
        if (header[0] < 2) {
            this.trigger('error', 'Only glTF2.0 is supported.');
            return;
        }

        var dataView = new DataView(buffer, 12);

        var json;
        var buffers = [];
        // Read chunks
        for (var i = 0; i < dataView.byteLength;) {
            var chunkLength = dataView.getUint32(i, true);
            i += 4;
            var chunkType = dataView.getUint32(i, true);
            i += 4;

            // json
            if (chunkType === 0x4E4F534A) {
                var arr = new Uint8Array(buffer, i + 12, chunkLength);
                // TODO, for the browser not support TextDecoder.
                var decoder = new TextDecoder();
                var str = decoder.decode(arr);
                try {
                    json = JSON.parse(str);
                }
                catch (e) {
                    this.trigger('error', 'JSON Parse error:' + e.toString());
                    return;
                }
            }
            else if (chunkType === 0x004E4942) {
                buffers.push(buffer.slice(i + 12, i + 12 + chunkLength));
            }

            i += chunkLength;
        }
        if (!json) {
            this.trigger('error', 'Invalid glTF binary format: Can\'t find JSON.');
            return;
        }

        return this.parse(json, buffers);
    }
798173
function buffer2ArrayBuffer(buffer) {
  var buf = new ArrayBuffer(buffer.length);
  var bufView = new Uint8Array(buf);
  for (var i = 0; i < buffer.length; i++) {
    bufView[i] = buffer[i];
  }
  return buf;
}
139481
function constructors(obj) {
		// supports: getter and normal function
		if (arguments.length === 0) obj = this;

		if (obj == null) return [];

		// convert to object from primitives
		if (typeof obj !== 'object' && typeof obj !== 'function')
			obj = Object(obj);

		if (obj === Array) return [Array, Function.prototype];
		if (obj === Error) return [Error, Function.prototype];
		if (obj === RegExp) return [RegExp, Function.prototype];
		if (obj === Object) return [Object, Function.prototype];
		if (obj === String) return [String, Function.prototype];
		if (obj === Number) return [Number, Function.prototype];
		if (obj === Boolean) return [Boolean, Function.prototype];
		if (obj === Function) return [Function, Function.prototype];
		if (obj.constructor === Array) return [Array, Object];
		if (obj.constructor === Error) return [Error, Object];
		if (obj.constructor === RegExp) return [RegExp, Object];
		if (obj.constructor === Object) return [Object];
		if (obj.constructor === String) return [String, Object];
		if (obj.constructor === Number) return [Number, Object];
		if (obj.constructor === Boolean) return [Boolean, Object];

		var classes = [];

		if (obj instanceof Function) {
			// for Class/constructor
			for (; obj; obj = (obj.super_ || obj['super'] || getProto(obj)))
				if (typeof obj === 'function')
					classes.push(obj);

			if (classes.length === 0 ||
					classes[classes.length - 1] !== Function.prototype)
				classes.push(Function.prototype);
		}
		else {
			var saveObj = obj;

			// for instance/object
			for (; obj; obj = getProto(obj)) {
				if (obj.hasOwnProperty) {
					if (obj.hasOwnProperty('constructor'))
						classes.push(obj.constructor);
				}
				else if (obj.constructor) {
					if (classes.length === 0 ||
							classes[classes.length - 1] !== obj.constructor)
						classes.push(obj.constructor);
				}
			}

			if (classes.length === 0 &&
					saveObj && typeof saveObj.constructor === 'function')
				classes = [saveObj.constructor];

			if (classes.length === 0 ||
					classes[classes.length - 1] !== Object)
				classes.push(Object);
		}

		return classes;
	}
815397
function (buf) {
    if (!(buf instanceof Buffer) || buf.length !== Id.SIZE)
        throw new Error('invalid buffer');
    this._buf = buf;
}
547192
function dataViewToArrayBuffer(str) {
    var bufView = new Uint8Array(dv.byteLength);
    for (var i = 0; i < bufView.length; i++) {
      bufView[i] = dv.getUint8(i);
    }
    return bufView.buffer;
  }
1051787
function TextBuffer( options = {} ) {
	this.ScreenBuffer = options.ScreenBuffer || ( options.dst && options.dst.constructor ) || termkit.ScreenBuffer ;

	// a screenBuffer
	this.dst = options.dst ;

	// virtually infinity by default
	this.width = options.width || Infinity ;
	this.height = options.height || Infinity ;

	this.x = options.x !== undefined ? options.x : 0 ;
	this.y = options.y !== undefined ? options.y : 0 ;
	this.cx = 0 ;
	this.cy = 0 ;

	this.emptyCellAttr = this.ScreenBuffer.prototype.DEFAULT_ATTR ;
	this.hidden = false ;

	this.tabWidth = options.tabWidth || 4 ;
	this.forceInBound = !! options.forceInBound ;
	this.wrap = !! options.wrap ;
	this.lineWrapping = options.lineWrapping || false ;

	this.buffer = [ [] ] ;

	this.stateMachine = options.stateMachine || null ;

	if ( options.hidden ) { this.setHidden( options.hidden ) ; }
}
1301811
function checkIfClassHasReactRender(currentClass) {
  try {
    var getRenderMethod = currentClass.body.body.filter(function (id) {
      return id.type === 'ClassMethod' && id.key.name === 'render';
    });
    return getRenderMethod[0].body.body.filter(function (child) {
      return child.type === 'ReturnStatement';
    }).map(function (stat) {
      return stat.argument.type;
    })[0] === 'JSXElement';
  } catch (e) {
    return false;
  }
}
558267
async function main({ isFragment, needsHelp, showVersion, useTabs }) {
  /* eslint-disable no-console */
  const stdin = await getStdin()

  if (showVersion) {
    return console.log(version)
  }

  if (needsHelp || !stdin) {
    return console.log(help)
  }

  const pug = html2pug(stdin, { isFragment, useTabs })
  return console.log(pug)

  /* eslint-enable no-console */
}
1182955
function( obj ) {
  // Not plain objects:
  // - Any object or value whose internal [[Class]] property is not "[object Object]"
  // - DOM nodes
  // - window
  if (typeof obj !== "object" || obj.nodeType || (obj !== null && obj === obj.window)) {
    return false;
  }

  if (obj.constructor && !Object.prototype.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
    return false;
  }

  // If the function hasn't returned already, we're confident that
  // |obj| is a plain object, created by {} or constructed with new Object
  return true;
}
724772
function isFunctionBasic(inputArg) {
            var isFn = toClass(inputArg) === classFunction,
                type;

            if (!isFn && inputArg !== null) {
                type = typeof inputArg;
                if ((type === 'function' || type === 'object') &&
                        ('constructor' in inputArg) &&
                        ('call' in inputArg) &&
                        ('apply' in inputArg) &&
                        ('length' in inputArg) &&
                        typeof inputArg.length === 'number') {

                    isFn = true;
                }
            }

            return isFn;
        }
712911
function toBuffer (typed) {
        var ab = typed.buffer;
        var buffer = new Buffer(ab.byteLength);
        var view = new Uint8Array(ab);
        for (var i = 0; i < buffer.length; ++i) {
            buffer[i] = view[i];
        }
        return buffer;
    }
1201006
function (/*HTMLElement*/ obj, /*String*/ type, /*Function*/ fn, /*Object*/ context) {
		var id = TL.Util.stamp(fn),
			key = '_tl_' + type + id;

		if (obj[key]) {
			return;
		}

		var handler = function (e) {
			return fn.call(context || obj, e || TL.DomEvent._getEvent());
		};

		if (TL.Browser.touch && (type === 'dblclick') && this.addDoubleTapListener) {
			this.addDoubleTapListener(obj, handler, id);
		} else if ('addEventListener' in obj) {
			if (type === 'mousewheel') {
				obj.addEventListener('DOMMouseScroll', handler, false);
				obj.addEventListener(type, handler, false);
			} else if ((type === 'mouseenter') || (type === 'mouseleave')) {
				var originalHandler = handler,
					newType = (type === 'mouseenter' ? 'mouseover' : 'mouseout');
				handler = function (e) {
					if (!TL.DomEvent._checkMouse(obj, e)) {
						return;
					}
					return originalHandler(e);
				};
				obj.addEventListener(newType, handler, false);
			} else {
				obj.addEventListener(type, handler, false);
			}
		} else if ('attachEvent' in obj) {
			obj.attachEvent("on" + type, handler);
		}

		obj[key] = handler;
	}
1011268
function proto() {
    var args = arguments // 

    if(args.length == 1) {
        var parent = {init: noop}
        var prototypeBuilder = args[0]

    } else { // length == 2
        var parent = args[0]
        var prototypeBuilder = args[1]
    }

    // special handling for Error objects
    var namePointer = {}    // name used only for Error Objects
    if([Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError].indexOf(parent) !== -1) {
        parent = normalizeErrorObject(parent, namePointer)
    }

    // set up the parent into the prototype chain if a parent is passed
    var parentIsFunction = typeof(parent) === "function"
    if(parentIsFunction) {
        prototypeBuilder[prototypeName] = parent[prototypeName]
    } else {
        prototypeBuilder[prototypeName] = parent
    }

    // the prototype that will be used to make instances
    var prototype = new prototypeBuilder(parent)
    namePointer.name = prototype.name

    // if there's no init, assume its inheriting a non-proto class, so default to applying the superclass's constructor.
    if(!prototype[init] && parentIsFunction) {
        prototype[init] = function() {
            parent.apply(this, arguments)
        }
    }

    // constructor for empty object which will be populated via the constructor
    var F = function() {}
        F[prototypeName] = prototype    // set the prototype for created instances

    var constructorName = prototype.name?prototype.name:''
    if(prototype[init] === undefined || prototype[init] === noop) {
        var ProtoObjectFactory = new Function('F',
            "return function " + constructorName + "(){" +
                "return new F()" +
            "}"
        )(F)
    } else {
        // dynamically creating this function cause there's no other way to dynamically name a function
        var ProtoObjectFactory = new Function('F','i','u','n', // shitty variables cause minifiers aren't gonna minify my function string here
            "return function " + constructorName + "(){ " +
                "var x=new F(),r=i.apply(x,arguments)\n" +    // populate object via the constructor
                "if(r===n)\n" +
                    "return x\n" +
                "else if(r===u)\n" +
                    "return n\n" +
                "else\n" +
                    "return r\n" +
            "}"
        )(F, prototype[init], proto[protoUndefined]) // note that n is undefined
    }

    prototype.constructor = ProtoObjectFactory;    // set the constructor property on the prototype

    // add all the prototype properties onto the static class as well (so you can access that class when you want to reference superclass properties)
    for(var n in prototype) {
        addProperty(ProtoObjectFactory, prototype, n)
    }

    // add properties from parent that don't exist in the static class object yet
    for(var n in parent) {
        if(ownProperty.call(parent, n) && ProtoObjectFactory[n] === undefined) {
            addProperty(ProtoObjectFactory, parent, n)
        }
    }

    ProtoObjectFactory.parent = parent;            // special parent property only available on the returned proto class
    ProtoObjectFactory[prototypeName] = prototype  // set the prototype on the object factory

    return ProtoObjectFactory;
}
351440
function (buffer) {
         JSZip.utils.checkSupport("blob");

         try {
            // Blob constructor
            return new Blob([buffer], { type: "application/zip" });
         }
         catch(e) {}

         try {
            // deprecated, browser only, old way
            var builder = new (window.BlobBuilder || window.WebKitBlobBuilder ||
                               window.MozBlobBuilder || window.MSBlobBuilder)();
            builder.append(buffer);
            return builder.getBlob('application/zip');
         }
         catch(e) {}

         // well, fuck ?!
         throw new Error("Bug : can't construct the Blob.");
      }
153696
function hasKey() {
    // lazy define for worst case fallback (not as accurate)
    hasKey = function(object, key) {
      var parent = object != null && (object.constructor || Object).prototype;
      return !!parent && key in Object(object) && !(key in parent && object[key] === parent[key]);
    };
    // for modern browsers
    if (isClassOf(hasOwnProperty, 'Function')) {
      hasKey = function(object, key) {
        return object != null && hasOwnProperty.call(object, key);
      };
    }
    // for Safari 2
    else if ({}.__proto__ == Object.prototype) {
      hasKey = function(object, key) {
        var result = false;
        if (object != null) {
          object = Object(object);
          object.__proto__ = [object.__proto__, object.__proto__ = null, result = key in object][0];
        }
        return result;
      };
    }
    return hasKey.apply(this, arguments);
  }
243578
function(a){
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
return!("object"!=typeof a||a.nodeType||null!==a&&a===a.window)&&!(a.constructor&&!Object.prototype.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf"))}