mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 00:02:02 +00:00
make flatbuffers.js into a UMD module (#4228)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
2aec880347
commit
adc50051e0
@@ -3,18 +3,14 @@
|
|||||||
/// @{
|
/// @{
|
||||||
/// @cond FLATBUFFERS_INTERNAL
|
/// @cond FLATBUFFERS_INTERNAL
|
||||||
|
|
||||||
|
(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';
|
||||||
/**
|
/**
|
||||||
* @fileoverview
|
* @exports flatbuffers
|
||||||
*
|
*/
|
||||||
* Need to suppress 'global this' error so the Node.js export line doesn't cause
|
|
||||||
* closure compile to error out.
|
|
||||||
* @suppress {globalThis}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @const
|
|
||||||
* @namespace
|
|
||||||
*/
|
|
||||||
var flatbuffers = {};
|
var flatbuffers = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1160,8 +1156,9 @@ flatbuffers.ByteBuffer.prototype.createLong = function(low, high) {
|
|||||||
return flatbuffers.Long.create(low, high);
|
return flatbuffers.Long.create(low, high);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Exports for Node.js and RequireJS
|
return flatbuffers;
|
||||||
this.flatbuffers = flatbuffers;
|
|
||||||
|
})));
|
||||||
|
|
||||||
/// @endcond
|
/// @endcond
|
||||||
/// @}
|
/// @}
|
||||||
|
|||||||
Reference in New Issue
Block a user