Created
October 16, 2015 19:15
-
-
Save parshap/ed918fb4a80ae5d271a0 to your computer and use it in GitHub Desktop.
Browserify Buffer.isBuffer inlining with full path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ browserify --version | |
11.2.0 | |
$ echo "Buffer.isBuffer(null)" > buffer-test.js | |
$ browserify buffer-test.js | |
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
(function (Buffer){ | |
Buffer.isBuffer(null) | |
}).call(this,{"isBuffer":require("/home/parshap/projects/node-browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")}) | |
},{"/home/parshap/projects/node-browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":2}],2:[function(require,module,exports){ | |
/** | |
* Determine if an object is Buffer | |
* | |
* Author: Feross Aboukhadijeh <[email protected]> <http://feross.org> | |
* License: MIT | |
* | |
* `npm install is-buffer` | |
*/ | |
module.exports = function (obj) { | |
return !!(obj != null && | |
(obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor) | |
(obj.constructor && | |
typeof obj.constructor.isBuffer === 'function' && | |
obj.constructor.isBuffer(obj)) | |
)) | |
} | |
},{}]},{},[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment