Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

static-module.js 960B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. module.exports = static_module_target;
  3. // - The default wrapper supports AMD, CommonJS and the global scope (as window.root), in this order.
  4. // - You can specify a custom wrapper with the --wrap argument.
  5. // - CommonJS modules depend on the minimal build for reduced package size with browserify.
  6. // - AMD and global scope depend on the full library for now.
  7. var util = require("../util");
  8. var protobuf = require("../..");
  9. static_module_target.description = "Static code without reflection as a module";
  10. function static_module_target(root, options, callback) {
  11. require("./static")(root, options, function(err, output) {
  12. if (err) {
  13. callback(err);
  14. return;
  15. }
  16. try {
  17. output = util.wrap(output, protobuf.util.merge({ dependency: "protobufjs/minimal" }, options));
  18. } catch (e) {
  19. callback(e);
  20. return;
  21. }
  22. callback(null, output);
  23. });
  24. }