@openclaw/feishu 2026.6.8 → 2026.6.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/api.js +78 -23
  2. package/dist/{channel-DwygSth-.js → channel-C9mW5kaS.js} +2 -2
  3. package/dist/channel-plugin-api.js +1 -1
  4. package/dist/{channel.runtime-CrqKcXaU.js → channel.runtime-BgUhHAja.js} +3 -3
  5. package/dist/{drive-8o3Omlnd.js → drive-9UfpmY27.js} +15 -2
  6. package/dist/{monitor-_1eNsUVp.js → monitor-BayUOr_U.js} +1 -1
  7. package/dist/{monitor.account-BhoLA1Y0.js → monitor.account-DzZWj0ob.js} +92 -48
  8. package/dist/{send-B3kteMF8.js → send-BozRcrbz.js} +32 -24
  9. package/dist/setup-api.js +1 -1
  10. package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
  11. package/node_modules/@protobufjs/aspromise/README.md +13 -0
  12. package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
  13. package/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
  14. package/node_modules/@protobufjs/aspromise/package.json +21 -0
  15. package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
  16. package/node_modules/@protobufjs/base64/LICENSE +26 -0
  17. package/node_modules/@protobufjs/base64/README.md +19 -0
  18. package/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
  19. package/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
  20. package/node_modules/@protobufjs/base64/package.json +21 -0
  21. package/node_modules/@protobufjs/base64/tests/index.js +46 -0
  22. package/node_modules/@protobufjs/codegen/LICENSE +26 -0
  23. package/node_modules/@protobufjs/codegen/README.md +49 -0
  24. package/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
  25. package/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -113
  26. package/node_modules/@protobufjs/codegen/package.json +13 -0
  27. package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
  28. package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
  29. package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
  30. package/node_modules/@protobufjs/eventemitter/README.md +22 -0
  31. package/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
  32. package/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
  33. package/node_modules/@protobufjs/eventemitter/package.json +21 -0
  34. package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
  35. package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
  36. package/node_modules/@protobufjs/fetch/LICENSE +26 -0
  37. package/node_modules/@protobufjs/fetch/README.md +13 -0
  38. package/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
  39. package/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
  40. package/node_modules/@protobufjs/fetch/package.json +27 -0
  41. package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
  42. package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
  43. package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
  44. package/node_modules/@protobufjs/float/LICENSE +26 -0
  45. package/node_modules/@protobufjs/float/README.md +102 -0
  46. package/node_modules/@protobufjs/float/bench/index.js +87 -0
  47. package/node_modules/@protobufjs/float/bench/suite.js +46 -0
  48. package/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
  49. package/node_modules/@protobufjs/float/package.json +26 -0
  50. package/node_modules/@protobufjs/float/tests/index.js +100 -0
  51. package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
  52. package/node_modules/@protobufjs/inquire/LICENSE +26 -0
  53. package/node_modules/@protobufjs/inquire/README.md +13 -0
  54. package/node_modules/{protobufjs/src/util/inquire.d.ts → @protobufjs/inquire/index.d.ts} +10 -10
  55. package/node_modules/{protobufjs/src/util/inquire.js → @protobufjs/inquire/index.js} +38 -38
  56. package/node_modules/@protobufjs/inquire/package.json +21 -0
  57. package/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
  58. package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
  59. package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
  60. package/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
  61. package/node_modules/@protobufjs/inquire/tests/index.js +20 -0
  62. package/node_modules/@protobufjs/path/LICENSE +26 -0
  63. package/node_modules/@protobufjs/path/README.md +19 -0
  64. package/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
  65. package/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -72
  66. package/node_modules/@protobufjs/path/package.json +21 -0
  67. package/node_modules/@protobufjs/path/tests/index.js +60 -0
  68. package/node_modules/@protobufjs/pool/.npmignore +3 -0
  69. package/node_modules/@protobufjs/pool/LICENSE +26 -0
  70. package/node_modules/@protobufjs/pool/README.md +13 -0
  71. package/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
  72. package/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
  73. package/node_modules/@protobufjs/pool/package.json +21 -0
  74. package/node_modules/@protobufjs/pool/tests/index.js +33 -0
  75. package/node_modules/@protobufjs/utf8/LICENSE +26 -0
  76. package/node_modules/@protobufjs/utf8/README.md +20 -0
  77. package/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
  78. package/node_modules/{protobufjs/src/util/utf8.js → @protobufjs/utf8/index.js} +104 -130
  79. package/node_modules/@protobufjs/utf8/package.json +21 -0
  80. package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
  81. package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
  82. package/node_modules/@protobufjs/utf8/tests/index.js +74 -0
  83. package/node_modules/@types/node/LICENSE +21 -0
  84. package/node_modules/@types/node/README.md +15 -0
  85. package/node_modules/@types/node/assert/strict.d.ts +59 -0
  86. package/node_modules/@types/node/assert.d.ts +950 -0
  87. package/node_modules/@types/node/async_hooks.d.ts +711 -0
  88. package/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  89. package/node_modules/@types/node/buffer.d.ts +1765 -0
  90. package/node_modules/@types/node/child_process.d.ts +1366 -0
  91. package/node_modules/@types/node/cluster.d.ts +432 -0
  92. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  93. package/node_modules/@types/node/console.d.ts +93 -0
  94. package/node_modules/@types/node/constants.d.ts +14 -0
  95. package/node_modules/@types/node/crypto.d.ts +4058 -0
  96. package/node_modules/@types/node/dgram.d.ts +537 -0
  97. package/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
  98. package/node_modules/@types/node/dns/promises.d.ts +497 -0
  99. package/node_modules/@types/node/dns.d.ts +876 -0
  100. package/node_modules/@types/node/domain.d.ts +150 -0
  101. package/node_modules/@types/node/events.d.ts +1008 -0
  102. package/node_modules/@types/node/fs/promises.d.ts +1468 -0
  103. package/node_modules/@types/node/fs.d.ts +4780 -0
  104. package/node_modules/@types/node/globals.d.ts +150 -0
  105. package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  106. package/node_modules/@types/node/http.d.ts +2147 -0
  107. package/node_modules/@types/node/http2.d.ts +2485 -0
  108. package/node_modules/@types/node/https.d.ts +400 -0
  109. package/node_modules/@types/node/index.d.ts +117 -0
  110. package/node_modules/@types/node/inspector/promises.d.ts +35 -0
  111. package/node_modules/@types/node/inspector.d.ts +264 -0
  112. package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  113. package/node_modules/@types/node/module.d.ts +755 -0
  114. package/node_modules/@types/node/net.d.ts +970 -0
  115. package/node_modules/@types/node/os.d.ts +498 -0
  116. package/node_modules/@types/node/package.json +155 -0
  117. package/node_modules/@types/node/path/posix.d.ts +8 -0
  118. package/node_modules/@types/node/path/win32.d.ts +8 -0
  119. package/node_modules/@types/node/path.d.ts +178 -0
  120. package/node_modules/@types/node/perf_hooks.d.ts +612 -0
  121. package/node_modules/@types/node/process.d.ts +2204 -0
  122. package/node_modules/@types/node/punycode.d.ts +89 -0
  123. package/node_modules/@types/node/querystring.d.ts +139 -0
  124. package/node_modules/@types/node/quic.d.ts +897 -0
  125. package/node_modules/@types/node/readline/promises.d.ts +158 -0
  126. package/node_modules/@types/node/readline.d.ts +507 -0
  127. package/node_modules/@types/node/repl.d.ts +420 -0
  128. package/node_modules/@types/node/sea.d.ts +47 -0
  129. package/node_modules/@types/node/sqlite.d.ts +1068 -0
  130. package/node_modules/@types/node/stream/consumers.d.ts +114 -0
  131. package/node_modules/@types/node/stream/iter.d.ts +301 -0
  132. package/node_modules/@types/node/stream/promises.d.ts +211 -0
  133. package/node_modules/@types/node/stream/web.d.ts +300 -0
  134. package/node_modules/@types/node/stream.d.ts +1774 -0
  135. package/node_modules/@types/node/string_decoder.d.ts +27 -0
  136. package/node_modules/@types/node/test/reporters.d.ts +59 -0
  137. package/node_modules/@types/node/test.d.ts +2279 -0
  138. package/node_modules/@types/node/timers/promises.d.ts +93 -0
  139. package/node_modules/@types/node/timers.d.ts +149 -0
  140. package/node_modules/@types/node/tls.d.ts +1193 -0
  141. package/node_modules/@types/node/trace_events.d.ts +103 -0
  142. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  143. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  144. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  145. package/node_modules/@types/node/ts5.6/index.d.ts +119 -0
  146. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  147. package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  148. package/node_modules/@types/node/tty.d.ts +225 -0
  149. package/node_modules/@types/node/url.d.ts +556 -0
  150. package/node_modules/@types/node/util/types.d.ts +558 -0
  151. package/node_modules/@types/node/util.d.ts +1677 -0
  152. package/node_modules/@types/node/v8.d.ts +980 -0
  153. package/node_modules/@types/node/vm.d.ts +1136 -0
  154. package/node_modules/@types/node/wasi.d.ts +131 -0
  155. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  156. package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  157. package/node_modules/@types/node/web-globals/console.d.ts +9 -0
  158. package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  159. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  160. package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  161. package/node_modules/@types/node/web-globals/events.d.ts +106 -0
  162. package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  163. package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  164. package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  165. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  166. package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  167. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  168. package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  169. package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  170. package/node_modules/@types/node/web-globals/url.d.ts +24 -0
  171. package/node_modules/@types/node/worker_threads.d.ts +671 -0
  172. package/node_modules/@types/node/zlib/iter.d.ts +131 -0
  173. package/node_modules/@types/node/zlib.d.ts +589 -0
  174. package/node_modules/protobufjs/README.md +556 -263
  175. package/node_modules/protobufjs/dist/light/protobuf.js +1569 -1919
  176. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  177. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  178. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  179. package/node_modules/protobufjs/dist/minimal/protobuf.js +906 -1132
  180. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  181. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  182. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  183. package/node_modules/protobufjs/dist/protobuf.js +1576 -1993
  184. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  185. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  186. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  187. package/node_modules/protobufjs/ext/descriptor/README.md +70 -3
  188. package/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
  189. package/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
  190. package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
  191. package/node_modules/protobufjs/index.d.ts +720 -834
  192. package/node_modules/protobufjs/package.json +44 -20
  193. package/node_modules/protobufjs/src/converter.js +36 -60
  194. package/node_modules/protobufjs/src/decoder.js +53 -124
  195. package/node_modules/protobufjs/src/encoder.js +2 -10
  196. package/node_modules/protobufjs/src/enum.js +3 -8
  197. package/node_modules/protobufjs/src/field.js +11 -13
  198. package/node_modules/protobufjs/src/index-light.js +1 -1
  199. package/node_modules/protobufjs/src/mapfield.js +0 -1
  200. package/node_modules/protobufjs/src/message.js +11 -5
  201. package/node_modules/protobufjs/src/method.js +4 -5
  202. package/node_modules/protobufjs/src/namespace.js +3 -10
  203. package/node_modules/protobufjs/src/object.js +20 -20
  204. package/node_modules/protobufjs/src/oneof.js +0 -3
  205. package/node_modules/protobufjs/src/parse.js +16 -78
  206. package/node_modules/protobufjs/src/reader.js +31 -136
  207. package/node_modules/protobufjs/src/reader_buffer.js +3 -24
  208. package/node_modules/protobufjs/src/root.js +3 -7
  209. package/node_modules/protobufjs/src/roots.js +1 -1
  210. package/node_modules/protobufjs/src/service.js +6 -13
  211. package/node_modules/protobufjs/src/tokenize.js +1 -6
  212. package/node_modules/protobufjs/src/type.js +30 -44
  213. package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
  214. package/node_modules/protobufjs/src/util/minimal.js +12 -36
  215. package/node_modules/protobufjs/src/util.js +17 -6
  216. package/node_modules/protobufjs/src/verifier.js +6 -6
  217. package/node_modules/protobufjs/src/wrappers.js +1 -0
  218. package/node_modules/protobufjs/src/writer.js +16 -42
  219. package/node_modules/protobufjs/src/writer_buffer.js +1 -18
  220. package/node_modules/protobufjs/tsconfig.json +5 -3
  221. package/node_modules/undici-types/LICENSE +21 -0
  222. package/node_modules/undici-types/README.md +6 -0
  223. package/node_modules/undici-types/agent.d.ts +32 -0
  224. package/node_modules/undici-types/api.d.ts +43 -0
  225. package/node_modules/undici-types/balanced-pool.d.ts +30 -0
  226. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  227. package/node_modules/undici-types/cache.d.ts +36 -0
  228. package/node_modules/undici-types/client-stats.d.ts +15 -0
  229. package/node_modules/undici-types/client.d.ts +123 -0
  230. package/node_modules/undici-types/connector.d.ts +36 -0
  231. package/node_modules/undici-types/content-type.d.ts +21 -0
  232. package/node_modules/undici-types/cookies.d.ts +30 -0
  233. package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  234. package/node_modules/undici-types/dispatcher.d.ts +279 -0
  235. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  236. package/node_modules/undici-types/errors.d.ts +177 -0
  237. package/node_modules/undici-types/eventsource.d.ts +66 -0
  238. package/node_modules/undici-types/fetch.d.ts +211 -0
  239. package/node_modules/undici-types/formdata.d.ts +108 -0
  240. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  241. package/node_modules/undici-types/global-origin.d.ts +7 -0
  242. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  243. package/node_modules/undici-types/handlers.d.ts +15 -0
  244. package/node_modules/undici-types/header.d.ts +160 -0
  245. package/node_modules/undici-types/index.d.ts +91 -0
  246. package/node_modules/undici-types/interceptors.d.ts +80 -0
  247. package/node_modules/undici-types/mock-agent.d.ts +68 -0
  248. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  249. package/node_modules/undici-types/mock-client.d.ts +27 -0
  250. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  251. package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  252. package/node_modules/undici-types/mock-pool.d.ts +27 -0
  253. package/node_modules/undici-types/package.json +55 -0
  254. package/node_modules/undici-types/patch.d.ts +29 -0
  255. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  256. package/node_modules/undici-types/pool.d.ts +41 -0
  257. package/node_modules/undici-types/proxy-agent.d.ts +29 -0
  258. package/node_modules/undici-types/readable.d.ts +68 -0
  259. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  260. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  261. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  262. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  263. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  264. package/node_modules/undici-types/util.d.ts +18 -0
  265. package/node_modules/undici-types/utility.d.ts +7 -0
  266. package/node_modules/undici-types/webidl.d.ts +347 -0
  267. package/node_modules/undici-types/websocket.d.ts +188 -0
  268. package/npm-shrinkwrap.json +95 -6
  269. package/package.json +4 -4
  270. package/skills/feishu-wiki/SKILL.md +10 -1
  271. package/node_modules/protobufjs/ext/README.md +0 -81
  272. package/node_modules/protobufjs/ext/descriptor.d.ts +0 -86
  273. package/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -409
  274. package/node_modules/protobufjs/ext/descriptor.js +0 -1266
  275. package/node_modules/protobufjs/ext/textformat.d.ts +0 -19
  276. package/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -11
  277. package/node_modules/protobufjs/ext/textformat.js +0 -1235
  278. package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
  279. package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
  280. package/node_modules/protobufjs/src/typescript.js +0 -25
  281. /package/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
@@ -78,108 +78,28 @@ Reader.create = create();
78
78
 
79
79
  Reader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;
80
80
 
81
- /**
82
- * Returns raw bytes from the backing buffer without advancing the reader.
83
- * @param {number} start Start offset
84
- * @param {number} end End offset
85
- * @returns {Uint8Array} Raw bytes
86
- */
87
- Reader.prototype.raw = function read_raw(start, end) {
88
- if (Array.isArray(this.buf)) // plain array
89
- return this.buf.slice(start, end);
90
-
91
- if (start === end) // fix for IE 10/Win8 and others' subarray returning array of size 1
92
- return new this.buf.constructor(0);
93
- return this._slice.call(this.buf, start, end);
94
- };
95
-
96
81
  /**
97
82
  * Reads a varint as an unsigned 32 bit value.
98
83
  * @function
99
84
  * @returns {number} Value read
100
85
  */
101
- Reader.prototype.uint32 = function read_uint32() {
102
- var buf = this.buf,
103
- pos = this.pos,
104
- value = (buf[pos] & 127) >>> 0;
105
- if (buf[pos++] < 128) {
106
- this.pos = pos;
107
- return value;
108
- }
109
- value = (value | (buf[pos] & 127) << 7) >>> 0;
110
- if (buf[pos++] < 128) {
111
- this.pos = pos;
112
- return value;
113
- }
114
- value = (value | (buf[pos] & 127) << 14) >>> 0;
115
- if (buf[pos++] < 128) {
116
- this.pos = pos;
117
- return value;
118
- }
119
- value = (value | (buf[pos] & 127) << 21) >>> 0;
120
- if (buf[pos++] < 128) {
121
- this.pos = pos;
122
- return value;
123
- }
124
- value = (value | (buf[pos] & 15) << 28) >>> 0;
125
- if (buf[pos++] < 128) {
126
- this.pos = pos;
127
- return value;
128
- }
86
+ Reader.prototype.uint32 = (function read_uint32_setup() {
87
+ var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)
88
+ return function read_uint32() {
89
+ value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;
90
+ value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;
91
+ value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;
92
+ value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;
93
+ value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;
129
94
 
130
- for (var i = 0; i < 5; ++i) {
131
95
  /* istanbul ignore if */
132
- if (pos >= this.len) {
133
- this.pos = pos;
134
- throw indexOutOfRange(this);
96
+ if ((this.pos += 5) > this.len) {
97
+ this.pos = this.len;
98
+ throw indexOutOfRange(this, 10);
135
99
  }
136
- if (buf[pos++] < 128) {
137
- this.pos = pos;
138
- return value;
139
- }
140
- }
141
- /* istanbul ignore next */
142
- this.pos = pos;
143
- throw Error("invalid varint encoding");
144
- };
145
-
146
- /**
147
- * Reads a field tag.
148
- * @function
149
- * @returns {number} Tag read
150
- */
151
- Reader.prototype.tag = function read_tag() {
152
- var buf = this.buf,
153
- pos = this.pos,
154
- value = (buf[pos] & 127) >>> 0;
155
- if (buf[pos++] < 128) {
156
- this.pos = pos;
157
- return value;
158
- }
159
- value = (value | (buf[pos] & 127) << 7) >>> 0;
160
- if (buf[pos++] < 128) {
161
- this.pos = pos;
162
- return value;
163
- }
164
- value = (value | (buf[pos] & 127) << 14) >>> 0;
165
- if (buf[pos++] < 128) {
166
- this.pos = pos;
167
- return value;
168
- }
169
- value = (value | (buf[pos] & 127) << 21) >>> 0;
170
- if (buf[pos++] < 128) {
171
- this.pos = pos;
172
- return value;
173
- }
174
- value = (value | (buf[pos] & 15) << 28) >>> 0;
175
- if (buf[pos] < 128 && (buf[pos] & 112) === 0) {
176
- this.pos = pos + 1;
177
100
  return value;
178
- }
179
-
180
- this.pos = pos + 1;
181
- throw Error("invalid tag encoding");
182
- };
101
+ };
102
+ })();
183
103
 
184
104
  /**
185
105
  * Reads a varint as a signed 32 bit value.
@@ -281,20 +201,7 @@ function readLongVarint() {
281
201
  * @returns {boolean} Value read
282
202
  */
283
203
  Reader.prototype.bool = function read_bool() {
284
- var value = false,
285
- b;
286
- for (var i = 0; i < 10; ++i) {
287
- /* istanbul ignore if */
288
- if (this.pos >= this.len)
289
- throw indexOutOfRange(this);
290
- b = this.buf[this.pos++];
291
- if (b & 127)
292
- value = true;
293
- if (b < 128)
294
- return value;
295
- }
296
- /* istanbul ignore next */
297
- throw Error("invalid varint encoding");
204
+ return this.uint32() !== 0;
298
205
  };
299
206
 
300
207
  function readFixed32_end(buf, end) { // note that this uses `end`, not `pos`
@@ -402,8 +309,17 @@ Reader.prototype.bytes = function read_bytes() {
402
309
  if (end > this.len)
403
310
  throw indexOutOfRange(this, length);
404
311
 
405
- this.pos = end;
406
- return this.raw(start, end);
312
+ this.pos += length;
313
+ if (Array.isArray(this.buf)) // plain array
314
+ return this.buf.slice(start, end);
315
+
316
+ if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1
317
+ var nativeBuffer = util.Buffer;
318
+ return nativeBuffer
319
+ ? nativeBuffer.alloc(0)
320
+ : new this.buf.constructor(0);
321
+ }
322
+ return this._slice.call(this.buf, start, end);
407
323
  };
408
324
 
409
325
  /**
@@ -411,16 +327,8 @@ Reader.prototype.bytes = function read_bytes() {
411
327
  * @returns {string} Value read
412
328
  */
413
329
  Reader.prototype.string = function read_string() {
414
- var length = this.uint32(),
415
- start = this.pos,
416
- end = this.pos + length;
417
-
418
- /* istanbul ignore if */
419
- if (end > this.len)
420
- throw indexOutOfRange(this, length);
421
-
422
- this.pos = end;
423
- return utf8.read(this.buf, start, end);
330
+ var bytes = this.bytes();
331
+ return utf8.read(bytes, 0, bytes.length);
424
332
  };
425
333
 
426
334
  /**
@@ -454,15 +362,12 @@ Reader.recursionLimit = util.recursionLimit;
454
362
  * Skips the next element of the specified wire type.
455
363
  * @param {number} wireType Wire type received
456
364
  * @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted
457
- * @param {number} [fieldNumber] Field number for validating group end tags
458
365
  * @returns {Reader} `this`
459
366
  */
460
- Reader.prototype.skipType = function(wireType, depth, fieldNumber) {
367
+ Reader.prototype.skipType = function(wireType, depth) {
461
368
  if (depth === undefined) depth = 0;
462
369
  if (depth > Reader.recursionLimit)
463
- throw Error("max depth exceeded");
464
- if (fieldNumber === 0)
465
- throw Error("illegal tag: field number 0");
370
+ throw Error("maximum nesting depth exceeded");
466
371
  switch (wireType) {
467
372
  case 0:
468
373
  this.skip();
@@ -474,18 +379,8 @@ Reader.prototype.skipType = function(wireType, depth, fieldNumber) {
474
379
  this.skip(this.uint32());
475
380
  break;
476
381
  case 3:
477
- while (true) {
478
- var tag = this.tag();
479
- var nestedField = tag >>> 3;
480
- wireType = tag & 7;
481
- if (!nestedField)
482
- throw Error("illegal tag: field number 0");
483
- if (wireType === 4) {
484
- if (fieldNumber !== undefined && nestedField !== fieldNumber)
485
- throw Error("invalid end group tag");
486
- break;
487
- }
488
- this.skipType(wireType, depth + 1, nestedField);
382
+ while ((wireType = this.uint32() & 7) !== 4) {
383
+ this.skipType(wireType, depth + 1);
489
384
  }
490
385
  break;
491
386
  case 5:
@@ -30,36 +30,15 @@ BufferReader._configure = function () {
30
30
  BufferReader.prototype._slice = util.Buffer.prototype.slice;
31
31
  };
32
32
 
33
- /**
34
- * Returns raw bytes from the backing buffer without advancing the reader.
35
- * @name BufferReader#raw
36
- * @function
37
- * @param {number} start Start offset
38
- * @param {number} end End offset
39
- * @returns {Buffer} Raw bytes
40
- */
41
- BufferReader.prototype.raw = function read_raw_buffer(start, end) {
42
- if (start === end)
43
- return util.Buffer.alloc(0);
44
- return this._slice.call(this.buf, start, end);
45
- };
46
33
 
47
34
  /**
48
35
  * @override
49
36
  */
50
37
  BufferReader.prototype.string = function read_string_buffer() {
51
- var len = this.uint32(), // modifies pos
52
- start = this.pos,
53
- end = this.pos + len;
54
-
55
- /* istanbul ignore if */
56
- if (end > this.len)
57
- throw RangeError("index out of range: " + this.pos + " + " + len + " > " + this.len);
58
-
59
- this.pos = end;
38
+ var len = this.uint32(); // modifies pos
60
39
  return this.buf.utf8Slice
61
- ? this.buf.utf8Slice(start, end)
62
- : this.buf.toString("utf-8", start, end);
40
+ ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))
41
+ : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len));
63
42
  };
64
43
 
65
44
  /**
@@ -59,10 +59,7 @@ function Root(options) {
59
59
  * @returns {Root} Root namespace
60
60
  */
61
61
  Root.fromJSON = function fromJSON(json, root, depth) {
62
- if (depth === undefined)
63
- depth = 0;
64
- if (depth > util.recursionLimit)
65
- throw Error("max depth exceeded");
62
+ depth = util.checkDepth(depth);
66
63
  if (!root)
67
64
  root = new Root();
68
65
  if (json.options)
@@ -135,9 +132,8 @@ Root.prototype.load = function load(filename, options, callback) {
135
132
  var idx = filename.lastIndexOf("google/protobuf/");
136
133
  if (idx > -1) {
137
134
  var altname = filename.substring(idx);
138
- if (Object.prototype.hasOwnProperty.call(common, altname)) return altname;
135
+ if (altname in common) return altname;
139
136
  }
140
- if (Object.prototype.hasOwnProperty.call(common, filename)) return filename;
141
137
  return null;
142
138
  }
143
139
 
@@ -187,7 +183,7 @@ Root.prototype.load = function load(filename, options, callback) {
187
183
  self.files.push(filename);
188
184
 
189
185
  // Shortcut bundled definitions
190
- if (Object.prototype.hasOwnProperty.call(common, filename)) {
186
+ if (filename in common) {
191
187
  if (sync) {
192
188
  process(filename, common[filename], depth);
193
189
  } else {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- module.exports = {};
2
+ module.exports = Object.create(null);
3
3
 
4
4
  /**
5
5
  * Named roots.
@@ -9,8 +9,6 @@ var Method = require("./method"),
9
9
  util = require("./util"),
10
10
  rpc = require("./rpc");
11
11
 
12
- var reservedRe = util.patterns.reservedRe;
13
-
14
12
  /**
15
13
  * Constructs a new service instance.
16
14
  * @classdesc Reflected service.
@@ -41,9 +39,7 @@ function Service(name, options) {
41
39
  * Service descriptor.
42
40
  * @interface IService
43
41
  * @extends INamespace
44
- * @property {string} [edition] Edition
45
42
  * @property {Object.<string,IMethod>} methods Method descriptors
46
- * @property {string|null} [comment] Service comment
47
43
  */
48
44
 
49
45
  /**
@@ -55,10 +51,7 @@ function Service(name, options) {
55
51
  * @throws {TypeError} If arguments are invalid
56
52
  */
57
53
  Service.fromJSON = function fromJSON(name, json, depth) {
58
- if (depth === undefined)
59
- depth = 0;
60
- if (depth > util.recursionLimit)
61
- throw Error("max depth exceeded");
54
+ depth = util.checkDepth(depth);
62
55
  var service = new Service(name, json.options);
63
56
  /* istanbul ignore else */
64
57
  if (json.methods)
@@ -190,11 +183,11 @@ Service.prototype.create = function create(rpcImpl, requestDelimited, responseDe
190
183
  var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);
191
184
  for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {
192
185
  var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\w_]/g, "");
193
- rpcService[methodName] = util.codegen(["r","c"], reservedRe.test(methodName) ? methodName + "_" : methodName)("return this.rpcCall(m,q,s,r,c)")({
194
- m: method,
195
- q: method.resolvedRequestType.ctor,
196
- s: method.resolvedResponseType.ctor
197
- });
186
+ rpcService[methodName] = (function(method, requestType, responseType) {
187
+ return function rpcMethod(request, callback) {
188
+ return rpc.Service.prototype.rpcCall.call(this, method, requestType, responseType, request, callback);
189
+ };
190
+ })(method, method.resolvedRequestType.ctor, method.resolvedResponseType.ctor);
198
191
  }
199
192
  return rpcService;
200
193
  };
@@ -225,7 +225,6 @@ function tokenize(source, alternateCommentMode) {
225
225
  curr,
226
226
  start,
227
227
  isDoc,
228
- nextLineIsComment,
229
228
  isLeadingComment = offset === 0;
230
229
  do {
231
230
  if (offset === length)
@@ -279,11 +278,7 @@ function tokenize(source, alternateCommentMode) {
279
278
  // Trailing comment cannot not be multi-line
280
279
  break;
281
280
  }
282
- nextLineIsComment = isDoubleSlashCommentLine(offset);
283
- if (nextLineIsComment) {
284
- line++;
285
- }
286
- } while (nextLineIsComment);
281
+ } while (isDoubleSlashCommentLine(offset));
287
282
  } else {
288
283
  offset = Math.min(length, findEndOfLine(offset) + 1);
289
284
  }
@@ -171,15 +171,11 @@ Object.defineProperties(Type.prototype, {
171
171
  util.merge(ctor, Message, true);
172
172
 
173
173
  this._ctor = ctor;
174
- delete this.decode;
175
- delete this.fromObject;
176
174
 
177
175
  // Messages have non-enumerable default values on their prototype
178
176
  var i = 0;
179
- for (var field; i < /* initializes */ this.fieldsArray.length; ++i) {
180
- field = this._fieldsArray[i].resolve(); // ensures a proper value
181
- ctor.prototype[field.name] = field.defaultValue;
182
- }
177
+ for (; i < /* initializes */ this.fieldsArray.length; ++i)
178
+ this._fieldsArray[i].resolve(); // ensures a proper value
183
179
 
184
180
  // Messages have non-enumerable getters and setters for each virtual oneof field
185
181
  var ctorProperties = {};
@@ -226,13 +222,11 @@ function clearCache(type) {
226
222
  * Message type descriptor.
227
223
  * @interface IType
228
224
  * @extends INamespace
229
- * @property {string} [edition] Edition
230
225
  * @property {Object.<string,IOneOf>} [oneofs] Oneof descriptors
231
226
  * @property {Object.<string,IField>} fields Field descriptors
232
227
  * @property {number[][]} [extensions] Extension ranges
233
228
  * @property {Array.<number[]|string>} [reserved] Reserved ranges
234
229
  * @property {boolean} [group=false] Whether a legacy group or not
235
- * @property {string|null} [comment] Message type comment
236
230
  */
237
231
 
238
232
  /**
@@ -379,7 +373,7 @@ Type.prototype.add = function add(object) {
379
373
  throw Error("duplicate id " + object.id + " in " + this);
380
374
  if (this.isReservedId(object.id))
381
375
  throw Error("id " + object.id + " is reserved in " + this);
382
- if (this.isReservedName(object.name))
376
+ if (this.isReservedName(object.name) || object.name.charAt(0) === "$")
383
377
  throw Error("name '" + object.name + "' is reserved in " + this);
384
378
  if (object.name === "__proto__")
385
379
  return this;
@@ -392,6 +386,8 @@ Type.prototype.add = function add(object) {
392
386
  return clearCache(this);
393
387
  }
394
388
  if (object instanceof OneOf) {
389
+ if (object.name.charAt(0) === "$")
390
+ throw Error("name '" + object.name + "' is reserved in " + this);
395
391
  if (object.name === "__proto__")
396
392
  return this;
397
393
  if (!this.oneofs)
@@ -458,7 +454,7 @@ Type.prototype.isReservedName = function isReservedName(name) {
458
454
  /**
459
455
  * Creates a new message of this type using the specified properties.
460
456
  * @param {Object.<string,*>} [properties] Properties to set
461
- * @returns {ReflectedMessage} Message instance
457
+ * @returns {Message<{}>} Message instance
462
458
  */
463
459
  Type.prototype.create = function create(properties) {
464
460
  return new this.ctor(properties);
@@ -486,8 +482,7 @@ Type.prototype.setup = function setup() {
486
482
  this.decode = decoder(this)({
487
483
  Reader : Reader,
488
484
  types : types,
489
- util : util,
490
- C : this.ctor
485
+ util : util
491
486
  });
492
487
  this.verify = verifier(this)({
493
488
  types : types,
@@ -495,8 +490,7 @@ Type.prototype.setup = function setup() {
495
490
  });
496
491
  this.fromObject = converter.fromObject(this)({
497
492
  types : types,
498
- util : util,
499
- C : this.ctor
493
+ util : util
500
494
  });
501
495
  this.toObject = converter.toObject(this)({
502
496
  types : types,
@@ -506,13 +500,15 @@ Type.prototype.setup = function setup() {
506
500
  // Inject custom wrappers for common types
507
501
  var wrapper = wrappers[fullName];
508
502
  if (wrapper) {
509
- var wrapperThis = Object.create(this);
510
- // Reuse this type's runtime constructor in wrapper fromObject/toObject
511
- wrapperThis._ctor = this.ctor;
512
- wrapperThis.fromObject = this.fromObject;
513
- this.fromObject = wrapper.fromObject.bind(wrapperThis);
514
- wrapperThis.toObject = this.toObject;
515
- this.toObject = wrapper.toObject.bind(wrapperThis);
503
+ var originalThis = Object.create(this);
504
+ // if (wrapper.fromObject) {
505
+ originalThis.fromObject = this.fromObject;
506
+ this.fromObject = wrapper.fromObject.bind(originalThis);
507
+ // }
508
+ // if (wrapper.toObject) {
509
+ originalThis.toObject = this.toObject;
510
+ this.toObject = wrapper.toObject.bind(originalThis);
511
+ // }
516
512
  }
517
513
 
518
514
  return this;
@@ -542,18 +538,20 @@ Type.prototype.encodeDelimited = function encodeDelimited(message, writer) {
542
538
  * Decodes a message of this type.
543
539
  * @param {Reader|Uint8Array} reader Reader or buffer to decode from
544
540
  * @param {number} [length] Length of the message, if known beforehand
545
- * @returns {ReflectedMessage} Decoded message
541
+ * @param {number} [end] Expected group end tag, if decoding a group
542
+ * @param {number} [depth] Current nesting depth
543
+ * @returns {Message<{}>} Decoded message
546
544
  * @throws {Error} If the payload is not a reader or valid buffer
547
545
  * @throws {util.ProtocolError<{}>} If required fields are missing
548
546
  */
549
- Type.prototype.decode = function decode_setup(reader, length) { // eslint-disable-line no-unused-vars
550
- return this.setup().decode.apply(this, arguments); // overrides this method
547
+ Type.prototype.decode = function decode_setup(reader, length, end, depth) {
548
+ return this.setup().decode(reader, length, end, depth); // overrides this method
551
549
  };
552
550
 
553
551
  /**
554
552
  * Decodes a message of this type preceeded by its byte length as a varint.
555
553
  * @param {Reader|Uint8Array} reader Reader or buffer to decode from
556
- * @returns {ReflectedMessage} Decoded message
554
+ * @returns {Message<{}>} Decoded message
557
555
  * @throws {Error} If the payload is not a reader or valid buffer
558
556
  * @throws {util.ProtocolError} If required fields are missing
559
557
  */
@@ -566,19 +564,21 @@ Type.prototype.decodeDelimited = function decodeDelimited(reader) {
566
564
  /**
567
565
  * Verifies that field values are valid and that required fields are present.
568
566
  * @param {Object.<string,*>} message Plain object to verify
567
+ * @param {number} [depth] Current nesting depth
569
568
  * @returns {null|string} `null` if valid, otherwise the reason why it is not
570
569
  */
571
- Type.prototype.verify = function verify_setup(message) { // eslint-disable-line no-unused-vars
572
- return this.setup().verify.apply(this, arguments); // overrides this method
570
+ Type.prototype.verify = function verify_setup(message, depth) {
571
+ return this.setup().verify(message, depth); // overrides this method
573
572
  };
574
573
 
575
574
  /**
576
575
  * Creates a new message of this type from a plain object. Also converts values to their respective internal types.
577
576
  * @param {Object.<string,*>} object Plain object to convert
578
- * @returns {ReflectedMessage} Message instance
577
+ * @param {number} [depth] Current nesting depth
578
+ * @returns {Message<{}>} Message instance
579
579
  */
580
- Type.prototype.fromObject = function fromObject(object) { // eslint-disable-line no-unused-vars
581
- return this.setup().fromObject.apply(this, arguments);
580
+ Type.prototype.fromObject = function fromObject(object, depth) {
581
+ return this.setup().fromObject(object, depth);
582
582
  };
583
583
 
584
584
  /**
@@ -610,18 +610,6 @@ Type.prototype.toObject = function toObject(message, options) { // eslint-disabl
610
610
  return this.setup().toObject.apply(this, arguments);
611
611
  };
612
612
 
613
- /**
614
- * Gets the type url for this type.
615
- * @param {string} [prefix] Custom type url prefix, defaults to `"type.googleapis.com"`
616
- * @returns {string} The type url
617
- */
618
- Type.prototype.getTypeUrl = function getTypeUrl(prefix) {
619
- if (prefix === undefined)
620
- prefix = "type.googleapis.com";
621
- var fullName = this.fullName;
622
- return prefix + "/" + (fullName.charAt(0) === "." ? fullName.substring(1) : fullName);
623
- };
624
-
625
613
  /**
626
614
  * Decorator function as returned by {@link Type.d} (TypeScript).
627
615
  * @typedef TypeDecorator
@@ -629,7 +617,6 @@ Type.prototype.getTypeUrl = function getTypeUrl(prefix) {
629
617
  * @param {Constructor<T>} target Target constructor
630
618
  * @returns {undefined}
631
619
  * @template T extends Message<T>
632
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
633
620
  */
634
621
 
635
622
  /**
@@ -637,7 +624,6 @@ Type.prototype.getTypeUrl = function getTypeUrl(prefix) {
637
624
  * @param {string} [typeName] Type name, defaults to the constructor's name
638
625
  * @returns {TypeDecorator<T>} Decorator function
639
626
  * @template T extends Message<T>
640
- * @deprecated Legacy TypeScript decorator support. Will be removed in a future release.
641
627
  */
642
628
  Type.d = function decorateType(typeName) {
643
629
  return function typeDecorator(target) {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Constructor type.
3
+ * @interface Constructor
4
+ * @extends Function
5
+ * @template T
6
+ * @tstype new(...params: any[]): T; prototype: T;
7
+ */
8
+
9
+ /**
10
+ * Properties type.
11
+ * @typedef Properties
12
+ * @template T
13
+ * @type {Object.<string,*>}
14
+ * @tstype { [P in keyof T]?: T[P] }
15
+ */
@@ -2,25 +2,25 @@
2
2
  var util = exports;
3
3
 
4
4
  // used to return a Promise where callback is omitted
5
- util.asPromise = require("./aspromise");
5
+ util.asPromise = require("@protobufjs/aspromise");
6
6
 
7
7
  // converts to / from base64 encoded strings
8
- util.base64 = require("./base64");
8
+ util.base64 = require("@protobufjs/base64");
9
9
 
10
10
  // base class of rpc.Service
11
- util.EventEmitter = require("./eventemitter");
11
+ util.EventEmitter = require("@protobufjs/eventemitter");
12
12
 
13
13
  // float handling accross browsers
14
- util.float = require("./float");
14
+ util.float = require("@protobufjs/float");
15
15
 
16
16
  // requires modules optionally and hides the call from bundlers
17
- util.inquire = require("./inquire");
17
+ util.inquire = require("@protobufjs/inquire");
18
18
 
19
19
  // converts to / from utf8 encoded strings
20
- util.utf8 = require("./utf8");
20
+ util.utf8 = require("@protobufjs/utf8");
21
21
 
22
22
  // provides a node-like buffer pool in the browser
23
- util.pool = require("./pool");
23
+ util.pool = require("@protobufjs/pool");
24
24
 
25
25
  // utility to work with the low and high bits of a 64 bit value
26
26
  util.LongBits = require("./longbits");
@@ -119,7 +119,7 @@ util.isset =
119
119
  */
120
120
  util.isSet = function isSet(obj, prop) {
121
121
  var value = obj[prop];
122
- if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins
122
+ if (value != null && Object.hasOwnProperty.call(obj, prop)) // eslint-disable-line eqeqeq
123
123
  return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;
124
124
  return false;
125
125
  };
@@ -206,7 +206,7 @@ util.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore
206
206
  * @type {RegExp}
207
207
  * @const
208
208
  */
209
- util.key2Re = /^(?:true|false|0|1)$/;
209
+ util.key2Re = /^true|false|0|1$/;
210
210
 
211
211
  /**
212
212
  * Regular expression used to verify 32 bit (`int32` etc.) map keys.
@@ -220,7 +220,7 @@ util.key32Re = /^-?(?:0|[1-9][0-9]*)$/;
220
220
  * @type {RegExp}
221
221
  * @const
222
222
  */
223
- util.key64Re = /^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/; // eslint-disable-line no-control-regex
223
+ util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;
224
224
 
225
225
  /**
226
226
  * Converts a number or long to an 8 characters long hash string.
@@ -246,27 +246,6 @@ util.longFromHash = function longFromHash(hash, unsigned) {
246
246
  return bits.toNumber(Boolean(unsigned));
247
247
  };
248
248
 
249
- /**
250
- * Converts a 64 bit key to a long or number if it is an 8 characters long hash string.
251
- * @param {string} key Map key
252
- * @param {boolean} [unsigned=false] Whether unsigned or not
253
- * @returns {Long|number|string} Original value
254
- */
255
- util.longFromKey = function longFromKey(key, unsigned) {
256
- return util.key64Re.test(key) && !util.key32Re.test(key)
257
- ? util.longFromHash(key, unsigned)
258
- : key;
259
- };
260
-
261
- /**
262
- * Converts a boolean key to a boolean value.
263
- * @param {string} key Map key
264
- * @returns {boolean} Boolean value
265
- */
266
- util.boolFromKey = function boolFromKey(key) {
267
- return key === "true" || key === "1";
268
- };
269
-
270
249
  /**
271
250
  * Merges the properties of the source object into the destination object.
272
251
  * @memberof util
@@ -310,14 +289,11 @@ util.recursionLimit = 100; // protoc: CodedInputStream::default_recursion_limit_
310
289
  * @memberof util
311
290
  * @param {Object.<string,*>} obj Object
312
291
  * @param {string} key Property key
313
- * @param {boolean} [enumerable=true] Whether the property should be enumerable
314
292
  * @returns {undefined}
315
293
  */
316
- util.makeProp = function makeProp(obj, key, enumerable) {
317
- if (Object.prototype.hasOwnProperty.call(obj, key))
318
- return;
294
+ util.makeProp = function makeProp(obj, key) {
319
295
  Object.defineProperty(obj, key, {
320
- enumerable: enumerable === undefined ? true : enumerable,
296
+ enumerable: true,
321
297
  configurable: true,
322
298
  writable: true
323
299
  });