Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc-cloned / node_modules / protobufjs / cli / pbjs / targets / amd.js
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/amd.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/amd.js
new file mode 100644 (file)
index 0000000..7d0f538
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures as AMD module";\r
+\r
+var ProtoBuf = require("../../../index.js"),\r
+    util = require("../util.js"),\r
+    js = require("./js.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures as an AMD module\r
+ * @exports pbjs/targets/amd\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var amd = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        "define([", JSON.stringify(options.dependency || "protobuf"), "]", options.min ? "," : ", ",\r
+        "function(ProtoBuf)", options.min ? "{" : " {\n    ",\r
+        "return ProtoBuf",\r
+        util.indent(js.build(builder, options), options.min ? "" : "    "), options.min ? "" : "\n",\r
+        "});"\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+amd.description = description;\r