Commit adc50051 authored by Iain van der Bloat's avatar Iain van der Bloat Committed by Wouter van Oortmerssen

make flatbuffers.js into a UMD module (#4228)

parent 2aec8803
......@@ -3,18 +3,14 @@
/// @{
/// @cond FLATBUFFERS_INTERNAL
/**
* @fileoverview
*
* Need to suppress 'global this' error so the Node.js export line doesn't cause
* closure compile to error out.
* @suppress {globalThis}
*/
/**
* @const
* @namespace
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = { flatbuffers: factory() } :
typeof define === 'function' && define.amd ? define(factory) :
(global.flatbuffers = factory());
}(this, (function () { 'use strict';
/**
* @exports flatbuffers
*/
var flatbuffers = {};
/**
......@@ -1160,8 +1156,9 @@ flatbuffers.ByteBuffer.prototype.createLong = function(low, high) {
return flatbuffers.Long.create(low, high);
};
// Exports for Node.js and RequireJS
this.flatbuffers = flatbuffers;
return flatbuffers;
})));
/// @endcond
/// @}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment