@pdftron/pdfnet-node 10.6.0-1 → 10.6.0-3

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 (591) hide show
  1. package/package.json +29 -29
  2. package/readme.md +37 -37
  3. package/node_modules/underscore/LICENSE +0 -23
  4. package/node_modules/underscore/README.md +0 -28
  5. package/node_modules/underscore/amd/_apply.js +0 -7
  6. package/node_modules/underscore/amd/_applyProperty.js +0 -14
  7. package/node_modules/underscore/amd/_arrayAccessors.js +0 -11
  8. package/node_modules/underscore/amd/_arrayMutators.js +0 -15
  9. package/node_modules/underscore/amd/_baseCreate.js +0 -21
  10. package/node_modules/underscore/amd/_baseIteratee.js +0 -15
  11. package/node_modules/underscore/amd/_binarySearch.js +0 -17
  12. package/node_modules/underscore/amd/_bindCb.js +0 -14
  13. package/node_modules/underscore/amd/_bindCb4.js +0 -17
  14. package/node_modules/underscore/amd/_byValue.js +0 -11
  15. package/node_modules/underscore/amd/_cb.js +0 -12
  16. package/node_modules/underscore/amd/_chainResult.js +0 -10
  17. package/node_modules/underscore/amd/_collectNonEnumProps.js +0 -42
  18. package/node_modules/underscore/amd/_createAssigner.js +0 -24
  19. package/node_modules/underscore/amd/_createEscaper.js +0 -21
  20. package/node_modules/underscore/amd/_createIndexFinder.js +0 -30
  21. package/node_modules/underscore/amd/_createPredicateIndexFinder.js +0 -18
  22. package/node_modules/underscore/amd/_createReduce.js +0 -30
  23. package/node_modules/underscore/amd/_createSizePropertyCheck.js +0 -13
  24. package/node_modules/underscore/amd/_deepGet.js +0 -15
  25. package/node_modules/underscore/amd/_escapeMap.js +0 -15
  26. package/node_modules/underscore/amd/_executeBound.js +0 -16
  27. package/node_modules/underscore/amd/_extremum.js +0 -35
  28. package/node_modules/underscore/amd/_flatten.js +0 -32
  29. package/node_modules/underscore/amd/_forceNumericMinMax.js +0 -16
  30. package/node_modules/underscore/amd/_getByteLength.js +0 -8
  31. package/node_modules/underscore/amd/_getLength.js +0 -8
  32. package/node_modules/underscore/amd/_greater.js +0 -10
  33. package/node_modules/underscore/amd/_group.js +0 -18
  34. package/node_modules/underscore/amd/_has.js +0 -10
  35. package/node_modules/underscore/amd/_hasObjectTag.js +0 -7
  36. package/node_modules/underscore/amd/_isArrayLike.js +0 -11
  37. package/node_modules/underscore/amd/_isBufferLike.js +0 -9
  38. package/node_modules/underscore/amd/_keyInObj.js +0 -11
  39. package/node_modules/underscore/amd/_less.js +0 -10
  40. package/node_modules/underscore/amd/_lessEqual.js +0 -10
  41. package/node_modules/underscore/amd/_linearSearch.js +0 -31
  42. package/node_modules/underscore/amd/_mapReduce.js +0 -5
  43. package/node_modules/underscore/amd/_methodFingerprint.js +0 -44
  44. package/node_modules/underscore/amd/_optimizeCb.js +0 -27
  45. package/node_modules/underscore/amd/_push.js +0 -7
  46. package/node_modules/underscore/amd/_pusher.js +0 -13
  47. package/node_modules/underscore/amd/_sequence.js +0 -18
  48. package/node_modules/underscore/amd/_setup.js +0 -70
  49. package/node_modules/underscore/amd/_shallowProperty.js +0 -12
  50. package/node_modules/underscore/amd/_slice.js +0 -7
  51. package/node_modules/underscore/amd/_strictEqual.js +0 -9
  52. package/node_modules/underscore/amd/_stringTagBug.js +0 -16
  53. package/node_modules/underscore/amd/_tagTester.js +0 -13
  54. package/node_modules/underscore/amd/_toBufferView.js +0 -15
  55. package/node_modules/underscore/amd/_toPath.js +0 -11
  56. package/node_modules/underscore/amd/_unescapeMap.js +0 -8
  57. package/node_modules/underscore/amd/_unmethodize.js +0 -9
  58. package/node_modules/underscore/amd/_wrapArrayAccessor.js +0 -15
  59. package/node_modules/underscore/amd/_wrapArrayMutator.js +0 -28
  60. package/node_modules/underscore/amd/after.js +0 -14
  61. package/node_modules/underscore/amd/allKeys.js +0 -15
  62. package/node_modules/underscore/amd/before.js +0 -18
  63. package/node_modules/underscore/amd/bind.js +0 -15
  64. package/node_modules/underscore/amd/bindAll.js +0 -19
  65. package/node_modules/underscore/amd/chain.js +0 -12
  66. package/node_modules/underscore/amd/chunk.js +0 -17
  67. package/node_modules/underscore/amd/clone.js +0 -11
  68. package/node_modules/underscore/amd/compact.js +0 -10
  69. package/node_modules/underscore/amd/compose.js +0 -18
  70. package/node_modules/underscore/amd/concat.js +0 -7
  71. package/node_modules/underscore/amd/constant.js +0 -12
  72. package/node_modules/underscore/amd/contains.js +0 -12
  73. package/node_modules/underscore/amd/countBy.js +0 -12
  74. package/node_modules/underscore/amd/create.js +0 -14
  75. package/node_modules/underscore/amd/debounce.js +0 -43
  76. package/node_modules/underscore/amd/defaults.js +0 -8
  77. package/node_modules/underscore/amd/defer.js +0 -9
  78. package/node_modules/underscore/amd/delay.js +0 -13
  79. package/node_modules/underscore/amd/difference.js +0 -14
  80. package/node_modules/underscore/amd/each.js +0 -25
  81. package/node_modules/underscore/amd/escape.js +0 -8
  82. package/node_modules/underscore/amd/every.js +0 -17
  83. package/node_modules/underscore/amd/extend.js +0 -8
  84. package/node_modules/underscore/amd/extendOwn.js +0 -10
  85. package/node_modules/underscore/amd/filter.js +0 -15
  86. package/node_modules/underscore/amd/find.js +0 -12
  87. package/node_modules/underscore/amd/findIndex.js +0 -8
  88. package/node_modules/underscore/amd/findKey.js +0 -15
  89. package/node_modules/underscore/amd/findLastIndex.js +0 -8
  90. package/node_modules/underscore/amd/findWhere.js +0 -11
  91. package/node_modules/underscore/amd/first.js +0 -13
  92. package/node_modules/underscore/amd/flatten.js +0 -11
  93. package/node_modules/underscore/amd/functions.js +0 -14
  94. package/node_modules/underscore/amd/get.js +0 -14
  95. package/node_modules/underscore/amd/groupBy.js +0 -11
  96. package/node_modules/underscore/amd/has.js +0 -19
  97. package/node_modules/underscore/amd/identity.js +0 -10
  98. package/node_modules/underscore/amd/index-default.js +0 -12
  99. package/node_modules/underscore/amd/index.js +0 -154
  100. package/node_modules/underscore/amd/indexBy.js +0 -11
  101. package/node_modules/underscore/amd/indexOf.js +0 -11
  102. package/node_modules/underscore/amd/initial.js +0 -12
  103. package/node_modules/underscore/amd/intersection.js +0 -22
  104. package/node_modules/underscore/amd/invert.js +0 -15
  105. package/node_modules/underscore/amd/invoke.js +0 -28
  106. package/node_modules/underscore/amd/isArguments.js +0 -19
  107. package/node_modules/underscore/amd/isArray.js +0 -9
  108. package/node_modules/underscore/amd/isArrayBuffer.js +0 -7
  109. package/node_modules/underscore/amd/isBoolean.js +0 -10
  110. package/node_modules/underscore/amd/isDataView.js +0 -15
  111. package/node_modules/underscore/amd/isDate.js +0 -7
  112. package/node_modules/underscore/amd/isElement.js +0 -10
  113. package/node_modules/underscore/amd/isEmpty.js +0 -18
  114. package/node_modules/underscore/amd/isEqual.js +0 -133
  115. package/node_modules/underscore/amd/isError.js +0 -7
  116. package/node_modules/underscore/amd/isFinite.js +0 -10
  117. package/node_modules/underscore/amd/isFunction.js +0 -18
  118. package/node_modules/underscore/amd/isMap.js +0 -7
  119. package/node_modules/underscore/amd/isMatch.js +0 -17
  120. package/node_modules/underscore/amd/isNaN.js +0 -10
  121. package/node_modules/underscore/amd/isNull.js +0 -10
  122. package/node_modules/underscore/amd/isNumber.js +0 -7
  123. package/node_modules/underscore/amd/isObject.js +0 -11
  124. package/node_modules/underscore/amd/isRegExp.js +0 -7
  125. package/node_modules/underscore/amd/isSet.js +0 -7
  126. package/node_modules/underscore/amd/isString.js +0 -7
  127. package/node_modules/underscore/amd/isSymbol.js +0 -7
  128. package/node_modules/underscore/amd/isTypedArray.js +0 -16
  129. package/node_modules/underscore/amd/isUndefined.js +0 -10
  130. package/node_modules/underscore/amd/isWeakMap.js +0 -7
  131. package/node_modules/underscore/amd/isWeakSet.js +0 -7
  132. package/node_modules/underscore/amd/iteratee.js +0 -13
  133. package/node_modules/underscore/amd/join.js +0 -7
  134. package/node_modules/underscore/amd/keys.js +0 -17
  135. package/node_modules/underscore/amd/last.js +0 -13
  136. package/node_modules/underscore/amd/lastIndexOf.js +0 -9
  137. package/node_modules/underscore/amd/map.js +0 -18
  138. package/node_modules/underscore/amd/mapObject.js +0 -19
  139. package/node_modules/underscore/amd/matcher.js +0 -14
  140. package/node_modules/underscore/amd/max.js +0 -30
  141. package/node_modules/underscore/amd/memoize.js +0 -17
  142. package/node_modules/underscore/amd/min.js +0 -30
  143. package/node_modules/underscore/amd/mixin.js +0 -18
  144. package/node_modules/underscore/amd/negate.js +0 -12
  145. package/node_modules/underscore/amd/noop.js +0 -8
  146. package/node_modules/underscore/amd/now.js +0 -10
  147. package/node_modules/underscore/amd/object.js +0 -20
  148. package/node_modules/underscore/amd/omit.js +0 -20
  149. package/node_modules/underscore/amd/once.js +0 -9
  150. package/node_modules/underscore/amd/pairs.js +0 -17
  151. package/node_modules/underscore/amd/partial.js +0 -25
  152. package/node_modules/underscore/amd/partition.js +0 -11
  153. package/node_modules/underscore/amd/pick.js +0 -25
  154. package/node_modules/underscore/amd/pluck.js +0 -10
  155. package/node_modules/underscore/amd/pop.js +0 -7
  156. package/node_modules/underscore/amd/property.js +0 -14
  157. package/node_modules/underscore/amd/propertyOf.js +0 -13
  158. package/node_modules/underscore/amd/push.js +0 -7
  159. package/node_modules/underscore/amd/random.js +0 -14
  160. package/node_modules/underscore/amd/range.js +0 -27
  161. package/node_modules/underscore/amd/reduce.js +0 -9
  162. package/node_modules/underscore/amd/reduceRight.js +0 -8
  163. package/node_modules/underscore/amd/reject.js +0 -10
  164. package/node_modules/underscore/amd/rest.js +0 -12
  165. package/node_modules/underscore/amd/restArguments.js +0 -33
  166. package/node_modules/underscore/amd/result.js +0 -25
  167. package/node_modules/underscore/amd/reverse.js +0 -7
  168. package/node_modules/underscore/amd/sample.js +0 -27
  169. package/node_modules/underscore/amd/shift.js +0 -7
  170. package/node_modules/underscore/amd/shuffle.js +0 -10
  171. package/node_modules/underscore/amd/size.js +0 -11
  172. package/node_modules/underscore/amd/slice.js +0 -7
  173. package/node_modules/underscore/amd/some.js +0 -17
  174. package/node_modules/underscore/amd/sort.js +0 -7
  175. package/node_modules/underscore/amd/sortBy.js +0 -26
  176. package/node_modules/underscore/amd/sortedIndex.js +0 -18
  177. package/node_modules/underscore/amd/sortedLastIndex.js +0 -11
  178. package/node_modules/underscore/amd/splice.js +0 -7
  179. package/node_modules/underscore/amd/tap.js +0 -13
  180. package/node_modules/underscore/amd/template.js +0 -95
  181. package/node_modules/underscore/amd/templateSettings.js +0 -13
  182. package/node_modules/underscore/amd/throttle.js +0 -51
  183. package/node_modules/underscore/amd/times.js +0 -13
  184. package/node_modules/underscore/amd/toArray.js +0 -18
  185. package/node_modules/underscore/amd/toPath.js +0 -12
  186. package/node_modules/underscore/amd/toString.js +0 -11
  187. package/node_modules/underscore/amd/underscore-array-methods.js +0 -30
  188. package/node_modules/underscore/amd/underscore.js +0 -29
  189. package/node_modules/underscore/amd/unescape.js +0 -8
  190. package/node_modules/underscore/amd/union.js +0 -11
  191. package/node_modules/underscore/amd/uniq.js +0 -37
  192. package/node_modules/underscore/amd/uniqueId.js +0 -13
  193. package/node_modules/underscore/amd/unshift.js +0 -7
  194. package/node_modules/underscore/amd/unzip.js +0 -17
  195. package/node_modules/underscore/amd/value.js +0 -13
  196. package/node_modules/underscore/amd/values.js +0 -16
  197. package/node_modules/underscore/amd/where.js +0 -11
  198. package/node_modules/underscore/amd/without.js +0 -10
  199. package/node_modules/underscore/amd/wrap.js +0 -12
  200. package/node_modules/underscore/amd/zip.js +0 -9
  201. package/node_modules/underscore/cjs/_apply.js +0 -6
  202. package/node_modules/underscore/cjs/_applyProperty.js +0 -10
  203. package/node_modules/underscore/cjs/_arrayAccessors.js +0 -11
  204. package/node_modules/underscore/cjs/_arrayMutators.js +0 -19
  205. package/node_modules/underscore/cjs/_baseCreate.js +0 -20
  206. package/node_modules/underscore/cjs/_baseIteratee.js +0 -19
  207. package/node_modules/underscore/cjs/_binarySearch.js +0 -15
  208. package/node_modules/underscore/cjs/_bindCb.js +0 -10
  209. package/node_modules/underscore/cjs/_bindCb4.js +0 -13
  210. package/node_modules/underscore/cjs/_byValue.js +0 -7
  211. package/node_modules/underscore/cjs/_cb.js +0 -12
  212. package/node_modules/underscore/cjs/_chainResult.js +0 -8
  213. package/node_modules/underscore/cjs/_collectNonEnumProps.js +0 -42
  214. package/node_modules/underscore/cjs/_createAssigner.js +0 -20
  215. package/node_modules/underscore/cjs/_createEscaper.js +0 -19
  216. package/node_modules/underscore/cjs/_createIndexFinder.js +0 -30
  217. package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +0 -17
  218. package/node_modules/underscore/cjs/_createReduce.js +0 -30
  219. package/node_modules/underscore/cjs/_createSizePropertyCheck.js +0 -11
  220. package/node_modules/underscore/cjs/_deepGet.js +0 -11
  221. package/node_modules/underscore/cjs/_escapeMap.js +0 -11
  222. package/node_modules/underscore/cjs/_executeBound.js +0 -15
  223. package/node_modules/underscore/cjs/_extremum.js +0 -35
  224. package/node_modules/underscore/cjs/_flatten.js +0 -33
  225. package/node_modules/underscore/cjs/_forceNumericMinMax.js +0 -14
  226. package/node_modules/underscore/cjs/_getByteLength.js +0 -6
  227. package/node_modules/underscore/cjs/_getLength.js +0 -6
  228. package/node_modules/underscore/cjs/_greater.js +0 -6
  229. package/node_modules/underscore/cjs/_group.js +0 -17
  230. package/node_modules/underscore/cjs/_has.js +0 -8
  231. package/node_modules/underscore/cjs/_hasObjectTag.js +0 -5
  232. package/node_modules/underscore/cjs/_isArrayLike.js +0 -10
  233. package/node_modules/underscore/cjs/_isBufferLike.js +0 -8
  234. package/node_modules/underscore/cjs/_keyInObj.js +0 -7
  235. package/node_modules/underscore/cjs/_less.js +0 -6
  236. package/node_modules/underscore/cjs/_lessEqual.js +0 -6
  237. package/node_modules/underscore/cjs/_linearSearch.js +0 -30
  238. package/node_modules/underscore/cjs/_mapReduce.js +0 -1
  239. package/node_modules/underscore/cjs/_methodFingerprint.js +0 -44
  240. package/node_modules/underscore/cjs/_optimizeCb.js +0 -23
  241. package/node_modules/underscore/cjs/_push.js +0 -6
  242. package/node_modules/underscore/cjs/_pusher.js +0 -9
  243. package/node_modules/underscore/cjs/_sequence.js +0 -14
  244. package/node_modules/underscore/cjs/_setup.js +0 -66
  245. package/node_modules/underscore/cjs/_shallowProperty.js +0 -8
  246. package/node_modules/underscore/cjs/_slice.js +0 -6
  247. package/node_modules/underscore/cjs/_strictEqual.js +0 -5
  248. package/node_modules/underscore/cjs/_stringTagBug.js +0 -15
  249. package/node_modules/underscore/cjs/_tagTester.js +0 -11
  250. package/node_modules/underscore/cjs/_toBufferView.js +0 -13
  251. package/node_modules/underscore/cjs/_toPath.js +0 -10
  252. package/node_modules/underscore/cjs/_unescapeMap.js +0 -7
  253. package/node_modules/underscore/cjs/_unmethodize.js +0 -8
  254. package/node_modules/underscore/cjs/_wrapArrayAccessor.js +0 -14
  255. package/node_modules/underscore/cjs/_wrapArrayMutator.js +0 -29
  256. package/node_modules/underscore/cjs/after.js +0 -10
  257. package/node_modules/underscore/cjs/allKeys.js +0 -15
  258. package/node_modules/underscore/cjs/before.js +0 -14
  259. package/node_modules/underscore/cjs/bind.js +0 -15
  260. package/node_modules/underscore/cjs/bindAll.js +0 -19
  261. package/node_modules/underscore/cjs/chain.js +0 -10
  262. package/node_modules/underscore/cjs/chunk.js +0 -15
  263. package/node_modules/underscore/cjs/clone.js +0 -11
  264. package/node_modules/underscore/cjs/compact.js +0 -8
  265. package/node_modules/underscore/cjs/compose.js +0 -14
  266. package/node_modules/underscore/cjs/concat.js +0 -6
  267. package/node_modules/underscore/cjs/constant.js +0 -8
  268. package/node_modules/underscore/cjs/contains.js +0 -12
  269. package/node_modules/underscore/cjs/countBy.js +0 -11
  270. package/node_modules/underscore/cjs/create.js +0 -13
  271. package/node_modules/underscore/cjs/debounce.js +0 -42
  272. package/node_modules/underscore/cjs/defaults.js +0 -7
  273. package/node_modules/underscore/cjs/defer.js +0 -9
  274. package/node_modules/underscore/cjs/delay.js +0 -11
  275. package/node_modules/underscore/cjs/difference.js +0 -15
  276. package/node_modules/underscore/cjs/each.js +0 -25
  277. package/node_modules/underscore/cjs/escape.js +0 -7
  278. package/node_modules/underscore/cjs/every.js +0 -17
  279. package/node_modules/underscore/cjs/extend.js +0 -7
  280. package/node_modules/underscore/cjs/extendOwn.js +0 -9
  281. package/node_modules/underscore/cjs/filter.js +0 -14
  282. package/node_modules/underscore/cjs/find.js +0 -12
  283. package/node_modules/underscore/cjs/findIndex.js +0 -6
  284. package/node_modules/underscore/cjs/findKey.js +0 -14
  285. package/node_modules/underscore/cjs/findLastIndex.js +0 -6
  286. package/node_modules/underscore/cjs/findWhere.js +0 -10
  287. package/node_modules/underscore/cjs/first.js +0 -11
  288. package/node_modules/underscore/cjs/flatten.js +0 -9
  289. package/node_modules/underscore/cjs/functions.js +0 -12
  290. package/node_modules/underscore/cjs/get.js +0 -14
  291. package/node_modules/underscore/cjs/groupBy.js +0 -10
  292. package/node_modules/underscore/cjs/has.js +0 -18
  293. package/node_modules/underscore/cjs/identity.js +0 -6
  294. package/node_modules/underscore/cjs/index-default.js +0 -11
  295. package/node_modules/underscore/cjs/index.js +0 -277
  296. package/node_modules/underscore/cjs/indexBy.js +0 -9
  297. package/node_modules/underscore/cjs/indexOf.js +0 -11
  298. package/node_modules/underscore/cjs/initial.js +0 -10
  299. package/node_modules/underscore/cjs/intersection.js +0 -21
  300. package/node_modules/underscore/cjs/invert.js +0 -13
  301. package/node_modules/underscore/cjs/invoke.js +0 -30
  302. package/node_modules/underscore/cjs/isArguments.js +0 -18
  303. package/node_modules/underscore/cjs/isArray.js +0 -8
  304. package/node_modules/underscore/cjs/isArrayBuffer.js +0 -5
  305. package/node_modules/underscore/cjs/isBoolean.js +0 -8
  306. package/node_modules/underscore/cjs/isDataView.js +0 -16
  307. package/node_modules/underscore/cjs/isDate.js +0 -5
  308. package/node_modules/underscore/cjs/isElement.js +0 -6
  309. package/node_modules/underscore/cjs/isEmpty.js +0 -20
  310. package/node_modules/underscore/cjs/isEqual.js +0 -140
  311. package/node_modules/underscore/cjs/isError.js +0 -5
  312. package/node_modules/underscore/cjs/isFinite.js +0 -9
  313. package/node_modules/underscore/cjs/isFunction.js +0 -17
  314. package/node_modules/underscore/cjs/isMap.js +0 -7
  315. package/node_modules/underscore/cjs/isMatch.js +0 -15
  316. package/node_modules/underscore/cjs/isNaN.js +0 -9
  317. package/node_modules/underscore/cjs/isNull.js +0 -6
  318. package/node_modules/underscore/cjs/isNumber.js +0 -5
  319. package/node_modules/underscore/cjs/isObject.js +0 -7
  320. package/node_modules/underscore/cjs/isRegExp.js +0 -5
  321. package/node_modules/underscore/cjs/isSet.js +0 -7
  322. package/node_modules/underscore/cjs/isString.js +0 -5
  323. package/node_modules/underscore/cjs/isSymbol.js +0 -5
  324. package/node_modules/underscore/cjs/isTypedArray.js +0 -17
  325. package/node_modules/underscore/cjs/isUndefined.js +0 -6
  326. package/node_modules/underscore/cjs/isWeakMap.js +0 -7
  327. package/node_modules/underscore/cjs/isWeakSet.js +0 -5
  328. package/node_modules/underscore/cjs/iteratee.js +0 -12
  329. package/node_modules/underscore/cjs/join.js +0 -6
  330. package/node_modules/underscore/cjs/keys.js +0 -18
  331. package/node_modules/underscore/cjs/last.js +0 -11
  332. package/node_modules/underscore/cjs/lastIndexOf.js +0 -8
  333. package/node_modules/underscore/cjs/map.js +0 -18
  334. package/node_modules/underscore/cjs/mapObject.js +0 -18
  335. package/node_modules/underscore/cjs/matcher.js +0 -13
  336. package/node_modules/underscore/cjs/max.js +0 -31
  337. package/node_modules/underscore/cjs/memoize.js +0 -15
  338. package/node_modules/underscore/cjs/min.js +0 -31
  339. package/node_modules/underscore/cjs/mixin.js +0 -20
  340. package/node_modules/underscore/cjs/negate.js +0 -8
  341. package/node_modules/underscore/cjs/noop.js +0 -4
  342. package/node_modules/underscore/cjs/now.js +0 -6
  343. package/node_modules/underscore/cjs/object.js +0 -18
  344. package/node_modules/underscore/cjs/omit.js +0 -24
  345. package/node_modules/underscore/cjs/once.js +0 -8
  346. package/node_modules/underscore/cjs/pairs.js +0 -15
  347. package/node_modules/underscore/cjs/partial.js +0 -25
  348. package/node_modules/underscore/cjs/partition.js +0 -9
  349. package/node_modules/underscore/cjs/pick.js +0 -28
  350. package/node_modules/underscore/cjs/pluck.js +0 -9
  351. package/node_modules/underscore/cjs/pop.js +0 -6
  352. package/node_modules/underscore/cjs/property.js +0 -13
  353. package/node_modules/underscore/cjs/propertyOf.js +0 -12
  354. package/node_modules/underscore/cjs/push.js +0 -6
  355. package/node_modules/underscore/cjs/random.js +0 -10
  356. package/node_modules/underscore/cjs/range.js +0 -23
  357. package/node_modules/underscore/cjs/reduce.js +0 -7
  358. package/node_modules/underscore/cjs/reduceRight.js +0 -6
  359. package/node_modules/underscore/cjs/reject.js +0 -10
  360. package/node_modules/underscore/cjs/rest.js +0 -10
  361. package/node_modules/underscore/cjs/restArguments.js +0 -29
  362. package/node_modules/underscore/cjs/result.js +0 -24
  363. package/node_modules/underscore/cjs/reverse.js +0 -6
  364. package/node_modules/underscore/cjs/sample.js +0 -29
  365. package/node_modules/underscore/cjs/shift.js +0 -6
  366. package/node_modules/underscore/cjs/shuffle.js +0 -8
  367. package/node_modules/underscore/cjs/size.js +0 -10
  368. package/node_modules/underscore/cjs/slice.js +0 -6
  369. package/node_modules/underscore/cjs/some.js +0 -17
  370. package/node_modules/underscore/cjs/sort.js +0 -6
  371. package/node_modules/underscore/cjs/sortBy.js +0 -26
  372. package/node_modules/underscore/cjs/sortedIndex.js +0 -17
  373. package/node_modules/underscore/cjs/sortedLastIndex.js +0 -11
  374. package/node_modules/underscore/cjs/splice.js +0 -6
  375. package/node_modules/underscore/cjs/tap.js +0 -9
  376. package/node_modules/underscore/cjs/template.js +0 -95
  377. package/node_modules/underscore/cjs/templateSettings.js +0 -11
  378. package/node_modules/underscore/cjs/throttle.js +0 -49
  379. package/node_modules/underscore/cjs/times.js +0 -11
  380. package/node_modules/underscore/cjs/toArray.js +0 -22
  381. package/node_modules/underscore/cjs/toPath.js +0 -11
  382. package/node_modules/underscore/cjs/toString.js +0 -9
  383. package/node_modules/underscore/cjs/underscore-array-methods.js +0 -31
  384. package/node_modules/underscore/cjs/underscore.js +0 -27
  385. package/node_modules/underscore/cjs/unescape.js +0 -7
  386. package/node_modules/underscore/cjs/union.js +0 -11
  387. package/node_modules/underscore/cjs/uniq.js +0 -38
  388. package/node_modules/underscore/cjs/uniqueId.js +0 -9
  389. package/node_modules/underscore/cjs/unshift.js +0 -6
  390. package/node_modules/underscore/cjs/unzip.js +0 -17
  391. package/node_modules/underscore/cjs/value.js +0 -9
  392. package/node_modules/underscore/cjs/values.js +0 -14
  393. package/node_modules/underscore/cjs/where.js +0 -10
  394. package/node_modules/underscore/cjs/without.js +0 -9
  395. package/node_modules/underscore/cjs/wrap.js +0 -10
  396. package/node_modules/underscore/cjs/zip.js +0 -8
  397. package/node_modules/underscore/modules/.eslintrc +0 -12
  398. package/node_modules/underscore/modules/_baseCreate.js +0 -18
  399. package/node_modules/underscore/modules/_baseIteratee.js +0 -17
  400. package/node_modules/underscore/modules/_cb.js +0 -10
  401. package/node_modules/underscore/modules/_chainResult.js +0 -6
  402. package/node_modules/underscore/modules/_collectNonEnumProps.js +0 -40
  403. package/node_modules/underscore/modules/_createAssigner.js +0 -18
  404. package/node_modules/underscore/modules/_createEscaper.js +0 -17
  405. package/node_modules/underscore/modules/_createIndexFinder.js +0 -28
  406. package/node_modules/underscore/modules/_createPredicateIndexFinder.js +0 -15
  407. package/node_modules/underscore/modules/_createReduce.js +0 -28
  408. package/node_modules/underscore/modules/_createSizePropertyCheck.js +0 -9
  409. package/node_modules/underscore/modules/_deepGet.js +0 -9
  410. package/node_modules/underscore/modules/_escapeMap.js +0 -9
  411. package/node_modules/underscore/modules/_executeBound.js +0 -13
  412. package/node_modules/underscore/modules/_flatten.js +0 -31
  413. package/node_modules/underscore/modules/_getByteLength.js +0 -4
  414. package/node_modules/underscore/modules/_getLength.js +0 -4
  415. package/node_modules/underscore/modules/_group.js +0 -15
  416. package/node_modules/underscore/modules/_has.js +0 -6
  417. package/node_modules/underscore/modules/_hasObjectTag.js +0 -3
  418. package/node_modules/underscore/modules/_isArrayLike.js +0 -8
  419. package/node_modules/underscore/modules/_isBufferLike.js +0 -6
  420. package/node_modules/underscore/modules/_keyInObj.js +0 -5
  421. package/node_modules/underscore/modules/_methodFingerprint.js +0 -37
  422. package/node_modules/underscore/modules/_optimizeCb.js +0 -21
  423. package/node_modules/underscore/modules/_setup.js +0 -43
  424. package/node_modules/underscore/modules/_shallowProperty.js +0 -6
  425. package/node_modules/underscore/modules/_stringTagBug.js +0 -10
  426. package/node_modules/underscore/modules/_tagTester.js +0 -9
  427. package/node_modules/underscore/modules/_toBufferView.js +0 -11
  428. package/node_modules/underscore/modules/_toPath.js +0 -8
  429. package/node_modules/underscore/modules/_unescapeMap.js +0 -5
  430. package/node_modules/underscore/modules/after.js +0 -8
  431. package/node_modules/underscore/modules/allKeys.js +0 -13
  432. package/node_modules/underscore/modules/before.js +0 -12
  433. package/node_modules/underscore/modules/bind.js +0 -13
  434. package/node_modules/underscore/modules/bindAll.js +0 -17
  435. package/node_modules/underscore/modules/chain.js +0 -8
  436. package/node_modules/underscore/modules/chunk.js +0 -13
  437. package/node_modules/underscore/modules/clone.js +0 -9
  438. package/node_modules/underscore/modules/compact.js +0 -6
  439. package/node_modules/underscore/modules/compose.js +0 -12
  440. package/node_modules/underscore/modules/constant.js +0 -6
  441. package/node_modules/underscore/modules/contains.js +0 -10
  442. package/node_modules/underscore/modules/countBy.js +0 -9
  443. package/node_modules/underscore/modules/create.js +0 -11
  444. package/node_modules/underscore/modules/debounce.js +0 -40
  445. package/node_modules/underscore/modules/defaults.js +0 -5
  446. package/node_modules/underscore/modules/defer.js +0 -7
  447. package/node_modules/underscore/modules/delay.js +0 -9
  448. package/node_modules/underscore/modules/difference.js +0 -13
  449. package/node_modules/underscore/modules/each.js +0 -23
  450. package/node_modules/underscore/modules/escape.js +0 -5
  451. package/node_modules/underscore/modules/every.js +0 -15
  452. package/node_modules/underscore/modules/extend.js +0 -5
  453. package/node_modules/underscore/modules/extendOwn.js +0 -7
  454. package/node_modules/underscore/modules/filter.js +0 -12
  455. package/node_modules/underscore/modules/find.js +0 -10
  456. package/node_modules/underscore/modules/findIndex.js +0 -4
  457. package/node_modules/underscore/modules/findKey.js +0 -12
  458. package/node_modules/underscore/modules/findLastIndex.js +0 -4
  459. package/node_modules/underscore/modules/findWhere.js +0 -8
  460. package/node_modules/underscore/modules/first.js +0 -9
  461. package/node_modules/underscore/modules/flatten.js +0 -7
  462. package/node_modules/underscore/modules/functions.js +0 -10
  463. package/node_modules/underscore/modules/get.js +0 -12
  464. package/node_modules/underscore/modules/groupBy.js +0 -8
  465. package/node_modules/underscore/modules/has.js +0 -16
  466. package/node_modules/underscore/modules/identity.js +0 -4
  467. package/node_modules/underscore/modules/index-all.js +0 -18
  468. package/node_modules/underscore/modules/index-default.js +0 -27
  469. package/node_modules/underscore/modules/index.js +0 -200
  470. package/node_modules/underscore/modules/indexBy.js +0 -7
  471. package/node_modules/underscore/modules/indexOf.js +0 -9
  472. package/node_modules/underscore/modules/initial.js +0 -8
  473. package/node_modules/underscore/modules/intersection.js +0 -19
  474. package/node_modules/underscore/modules/invert.js +0 -11
  475. package/node_modules/underscore/modules/invoke.js +0 -28
  476. package/node_modules/underscore/modules/isArguments.js +0 -16
  477. package/node_modules/underscore/modules/isArray.js +0 -6
  478. package/node_modules/underscore/modules/isArrayBuffer.js +0 -3
  479. package/node_modules/underscore/modules/isBoolean.js +0 -6
  480. package/node_modules/underscore/modules/isDataView.js +0 -14
  481. package/node_modules/underscore/modules/isDate.js +0 -3
  482. package/node_modules/underscore/modules/isElement.js +0 -4
  483. package/node_modules/underscore/modules/isEmpty.js +0 -18
  484. package/node_modules/underscore/modules/isEqual.js +0 -138
  485. package/node_modules/underscore/modules/isError.js +0 -3
  486. package/node_modules/underscore/modules/isFinite.js +0 -7
  487. package/node_modules/underscore/modules/isFunction.js +0 -15
  488. package/node_modules/underscore/modules/isMap.js +0 -5
  489. package/node_modules/underscore/modules/isMatch.js +0 -13
  490. package/node_modules/underscore/modules/isNaN.js +0 -7
  491. package/node_modules/underscore/modules/isNull.js +0 -4
  492. package/node_modules/underscore/modules/isNumber.js +0 -3
  493. package/node_modules/underscore/modules/isObject.js +0 -5
  494. package/node_modules/underscore/modules/isRegExp.js +0 -3
  495. package/node_modules/underscore/modules/isSet.js +0 -5
  496. package/node_modules/underscore/modules/isString.js +0 -3
  497. package/node_modules/underscore/modules/isSymbol.js +0 -3
  498. package/node_modules/underscore/modules/isTypedArray.js +0 -15
  499. package/node_modules/underscore/modules/isUndefined.js +0 -4
  500. package/node_modules/underscore/modules/isWeakMap.js +0 -5
  501. package/node_modules/underscore/modules/isWeakSet.js +0 -3
  502. package/node_modules/underscore/modules/iteratee.js +0 -10
  503. package/node_modules/underscore/modules/keys.js +0 -16
  504. package/node_modules/underscore/modules/last.js +0 -9
  505. package/node_modules/underscore/modules/lastIndexOf.js +0 -6
  506. package/node_modules/underscore/modules/map.js +0 -16
  507. package/node_modules/underscore/modules/mapObject.js +0 -16
  508. package/node_modules/underscore/modules/matcher.js +0 -11
  509. package/node_modules/underscore/modules/max.js +0 -29
  510. package/node_modules/underscore/modules/memoize.js +0 -13
  511. package/node_modules/underscore/modules/min.js +0 -29
  512. package/node_modules/underscore/modules/mixin.js +0 -18
  513. package/node_modules/underscore/modules/negate.js +0 -6
  514. package/node_modules/underscore/modules/noop.js +0 -2
  515. package/node_modules/underscore/modules/now.js +0 -4
  516. package/node_modules/underscore/modules/object.js +0 -16
  517. package/node_modules/underscore/modules/omit.js +0 -22
  518. package/node_modules/underscore/modules/once.js +0 -6
  519. package/node_modules/underscore/modules/pairs.js +0 -13
  520. package/node_modules/underscore/modules/partial.js +0 -24
  521. package/node_modules/underscore/modules/partition.js +0 -7
  522. package/node_modules/underscore/modules/pick.js +0 -26
  523. package/node_modules/underscore/modules/pluck.js +0 -7
  524. package/node_modules/underscore/modules/property.js +0 -11
  525. package/node_modules/underscore/modules/propertyOf.js +0 -10
  526. package/node_modules/underscore/modules/random.js +0 -8
  527. package/node_modules/underscore/modules/range.js +0 -21
  528. package/node_modules/underscore/modules/reduce.js +0 -5
  529. package/node_modules/underscore/modules/reduceRight.js +0 -4
  530. package/node_modules/underscore/modules/reject.js +0 -8
  531. package/node_modules/underscore/modules/rest.js +0 -8
  532. package/node_modules/underscore/modules/restArguments.js +0 -27
  533. package/node_modules/underscore/modules/result.js +0 -22
  534. package/node_modules/underscore/modules/sample.js +0 -27
  535. package/node_modules/underscore/modules/shuffle.js +0 -6
  536. package/node_modules/underscore/modules/size.js +0 -8
  537. package/node_modules/underscore/modules/some.js +0 -15
  538. package/node_modules/underscore/modules/sortBy.js +0 -24
  539. package/node_modules/underscore/modules/sortedIndex.js +0 -15
  540. package/node_modules/underscore/modules/tap.js +0 -7
  541. package/node_modules/underscore/modules/template.js +0 -93
  542. package/node_modules/underscore/modules/templateSettings.js +0 -9
  543. package/node_modules/underscore/modules/throttle.js +0 -47
  544. package/node_modules/underscore/modules/times.js +0 -9
  545. package/node_modules/underscore/modules/toArray.js +0 -20
  546. package/node_modules/underscore/modules/toPath.js +0 -9
  547. package/node_modules/underscore/modules/underscore-array-methods.js +0 -31
  548. package/node_modules/underscore/modules/underscore.js +0 -25
  549. package/node_modules/underscore/modules/unescape.js +0 -5
  550. package/node_modules/underscore/modules/union.js +0 -9
  551. package/node_modules/underscore/modules/uniq.js +0 -36
  552. package/node_modules/underscore/modules/uniqueId.js +0 -7
  553. package/node_modules/underscore/modules/unzip.js +0 -15
  554. package/node_modules/underscore/modules/values.js +0 -12
  555. package/node_modules/underscore/modules/where.js +0 -8
  556. package/node_modules/underscore/modules/without.js +0 -7
  557. package/node_modules/underscore/modules/wrap.js +0 -8
  558. package/node_modules/underscore/modules/zip.js +0 -6
  559. package/node_modules/underscore/package.json +0 -108
  560. package/node_modules/underscore/underscore-esm-min.js +0 -5
  561. package/node_modules/underscore/underscore-esm-min.js.map +0 -1
  562. package/node_modules/underscore/underscore-esm.js +0 -2026
  563. package/node_modules/underscore/underscore-esm.js.map +0 -1
  564. package/node_modules/underscore/underscore-min.js +0 -6
  565. package/node_modules/underscore/underscore.js +0 -2034
  566. package/node_modules/underscore/underscore.js.map +0 -1
  567. package/node_modules/xhr2/CONTRIBUTING.md +0 -33
  568. package/node_modules/xhr2/Cakefile +0 -131
  569. package/node_modules/xhr2/LICENSE.txt +0 -19
  570. package/node_modules/xhr2/lib/browser.js +0 -1
  571. package/node_modules/xhr2/lib/xhr2.js +0 -1244
  572. package/node_modules/xhr2/package.json +0 -93
  573. package/node_modules/xhr2/src/001-xml_http_request.coffee +0 -782
  574. package/node_modules/xhr2/src/errors.coffee +0 -31
  575. package/node_modules/xhr2/src/progress_event.coffee +0 -39
  576. package/node_modules/xhr2/test/fixtures/hello.json +0 -1
  577. package/node_modules/xhr2/test/fixtures/hello.txt +0 -1
  578. package/node_modules/xhr2/test/fixtures/xhr2.png +0 -0
  579. package/node_modules/xhr2/test/html/browser_test.html +0 -30
  580. package/node_modules/xhr2/test/src/event_target_test.coffee +0 -85
  581. package/node_modules/xhr2/test/src/events_test.coffee +0 -204
  582. package/node_modules/xhr2/test/src/headers_test.coffee +0 -165
  583. package/node_modules/xhr2/test/src/helpers/browser_mocha_setup.coffee +0 -1
  584. package/node_modules/xhr2/test/src/helpers/setup.coffee +0 -38
  585. package/node_modules/xhr2/test/src/helpers/xhr_server.coffee +0 -156
  586. package/node_modules/xhr2/test/src/nodejs_set_test.coffee +0 -162
  587. package/node_modules/xhr2/test/src/redirect_test.coffee +0 -57
  588. package/node_modules/xhr2/test/src/response_type_test.coffee +0 -88
  589. package/node_modules/xhr2/test/src/send_test.coffee +0 -89
  590. package/node_modules/xhr2/test/src/status_test.coffee +0 -47
  591. package/node_modules/xhr2/test/src/xhr_test.coffee +0 -102
@@ -1,782 +0,0 @@
1
- # This file's name is set up in such a way that it will always show up second
2
- # in the list of files given to coffee --join, so it can use the
3
- # XMLHttpRequestEventTarget definition and so that the other files can assume
4
- # that XMLHttpRequest was already defined.
5
-
6
- http = require 'http'
7
- https = require 'https'
8
- os = require 'os'
9
- url = require 'url'
10
-
11
- # The ECMAScript HTTP API.
12
- #
13
- # @see http://www.w3.org/TR/XMLHttpRequest/#introduction
14
- class XMLHttpRequest extends XMLHttpRequestEventTarget
15
- # Creates a new request.
16
- #
17
- # @param {Object} options one or more of the options below
18
- # @option options {Boolean} anon if true, the request's anonymous flag
19
- # will be set
20
- # @see http://www.w3.org/TR/XMLHttpRequest/#constructors
21
- # @see http://www.w3.org/TR/XMLHttpRequest/#anonymous-flag
22
- constructor: (options) ->
23
- super()
24
- @onreadystatechange = null
25
-
26
- @_anonymous = options and options.anon
27
-
28
- @readyState = XMLHttpRequest.UNSENT
29
- @response = null
30
- @responseText = ''
31
- @responseType = ''
32
- @responseURL = ''
33
- @status = 0
34
- @statusText = ''
35
- @timeout = 0
36
- @upload = new XMLHttpRequestUpload @
37
-
38
- @_method = null # String
39
- @_url = null # Return value of url.parse()
40
- @_sync = false
41
- @_headers = null # Object<String, String>
42
- @_loweredHeaders = null # Object<lowercase String, String>
43
- @_mimeOverride = null
44
- @_request = null # http.ClientRequest
45
- @_response = null # http.ClientResponse
46
- @_responseParts = null # Array<Buffer, String>
47
- @_responseHeaders = null # Object<lowercase String, String>
48
- @_aborting = null
49
- @_error = null
50
- @_loadedBytes = 0
51
- @_totalBytes = 0
52
- @_lengthComputable = false
53
-
54
- # @property {function(ProgressEvent)} DOM level 0-style handler for the
55
- # 'readystatechange' event
56
- onreadystatechange: null
57
-
58
- # @property {Number} the current state of the XHR object
59
- # @see http://www.w3.org/TR/XMLHttpRequest/#states
60
- readyState: null
61
-
62
- # @property {String, ArrayBuffer, Buffer, Object} processed XHR response
63
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-response-attribute
64
- response: null
65
-
66
- # @property {String} response string, if responseType is '' or 'text'
67
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute
68
- responseText: null
69
-
70
- # @property {String} sets the parsing method for the XHR response
71
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute
72
- responseType: null
73
-
74
- # @property {Number} the HTTP
75
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute
76
- status: null
77
-
78
- # @property {Number} milliseconds to wait for the request to complete
79
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute
80
- timeout: null
81
-
82
- # @property {XMLHttpRequestUpload} the associated upload information
83
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-upload-attribute
84
- upload: null
85
-
86
- # Sets the XHR's method, URL, synchronous flag, and authentication params.
87
- #
88
- # @param {String} method the HTTP method to be used
89
- # @param {String} url the URL that the request will be made to
90
- # @param {?Boolean} async if false, the XHR should be processed
91
- # synchronously; true by default
92
- # @param {?String} user the user credential to be used in HTTP basic
93
- # authentication
94
- # @param {?String} password the password credential to be used in HTTP basic
95
- # authentication
96
- # @return {undefined} undefined
97
- # @throw {SecurityError} method is not one of the allowed methods
98
- # @throw {SyntaxError} urlString is not a valid URL
99
- # @throw {Error} the URL contains an unsupported protocol; the supported
100
- # protocols are file, http and https
101
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-open()-method
102
- open: (method, url, async, user, password) ->
103
- method = method.toUpperCase()
104
- if method of @_restrictedMethods
105
- throw new SecurityError "HTTP method #{method} is not allowed in XHR"
106
-
107
- xhrUrl = @_parseUrl url
108
- async = true if async is undefined
109
-
110
- switch @readyState
111
- when XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE
112
- # Nothing to do here.
113
- null
114
- when XMLHttpRequest.HEADERS_RECEIVED, XMLHttpRequest.LOADING
115
- # TODO(pwnall): terminate abort(), terminate send()
116
- null
117
-
118
- @_method = method
119
- @_url = xhrUrl
120
- @_sync = !async
121
- @_headers = {}
122
- @_loweredHeaders = {}
123
- @_mimeOverride = null
124
- @_setReadyState XMLHttpRequest.OPENED
125
- @_request = null
126
- @_response = null
127
- @status = 0
128
- @statusText = ''
129
- @_responseParts = []
130
- @_responseHeaders = null
131
- @_loadedBytes = 0
132
- @_totalBytes = 0
133
- @_lengthComputable = false
134
- undefined
135
-
136
- # Appends a header to the list of author request headers.
137
- #
138
- # @param {String} name the HTTP header name
139
- # @param {String} value the HTTP header value
140
- # @return {undefined} undefined
141
- # @throw {InvalidStateError} readyState is not OPENED
142
- # @throw {SyntaxError} name is not a valid HTTP header name or value is not
143
- # a valid HTTP header value
144
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method
145
- setRequestHeader: (name, value) ->
146
- unless @readyState is XMLHttpRequest.OPENED
147
- throw new InvalidStateError "XHR readyState must be OPENED"
148
-
149
- loweredName = name.toLowerCase()
150
- if @_restrictedHeaders[loweredName] or /^sec\-/.test(loweredName) or
151
- /^proxy-/.test(loweredName)
152
- console.warn "Refused to set unsafe header \"#{name}\""
153
- return undefined
154
-
155
- value = value.toString()
156
- if loweredName of @_loweredHeaders
157
- # Combine value with the existing header value.
158
- name = @_loweredHeaders[loweredName]
159
- @_headers[name] = @_headers[name] + ', ' + value
160
- else
161
- # New header.
162
- @_loweredHeaders[loweredName] = name
163
- @_headers[name] = value
164
-
165
- undefined
166
-
167
- # Initiates the request.
168
- #
169
- # @param {?String, ?ArrayBufferView} data the data to be sent; ignored for
170
- # GET and HEAD requests
171
- # @return {undefined} undefined
172
- # @throw {InvalidStateError} readyState is not OPENED
173
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-send()-method
174
- send: (data) ->
175
- unless @readyState is XMLHttpRequest.OPENED
176
- throw new InvalidStateError "XHR readyState must be OPENED"
177
-
178
- if @_request
179
- throw new InvalidStateError "send() already called"
180
-
181
- switch @_url.protocol
182
- when 'file:'
183
- @_sendFile data
184
- when 'http:', 'https:'
185
- @_sendHttp data
186
- else
187
- throw new NetworkError "Unsupported protocol #{@_url.protocol}"
188
-
189
- undefined
190
-
191
- # Cancels the network activity performed by this request.
192
- #
193
- # @return {undefined} undefined
194
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method
195
- abort: ->
196
- return unless @_request
197
-
198
- @_request.abort()
199
- @_setError()
200
- @_dispatchProgress 'abort'
201
- @_dispatchProgress 'loadend'
202
- undefined
203
-
204
- # Returns a header value in the HTTP response for this XHR.
205
- #
206
- # @param {String} name case-insensitive HTTP header name
207
- # @return {?String} value the value of the header whose name matches the
208
- # given name, or null if there is no such header
209
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
210
- getResponseHeader: (name) ->
211
- return null unless @_responseHeaders
212
-
213
- loweredName = name.toLowerCase()
214
- if loweredName of @_responseHeaders
215
- @_responseHeaders[loweredName]
216
- else
217
- null
218
-
219
- # Returns all the HTTP headers in this XHR's response.
220
- #
221
- # @return {String} header lines separated by CR LF, where each header line
222
- # has the name and value separated by a ": " (colon, space); the empty
223
- # string is returned if the headers are not available
224
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method
225
- getAllResponseHeaders: ->
226
- return '' unless @_responseHeaders
227
-
228
- lines = ("#{name}: #{value}" for name, value of @_responseHeaders)
229
- lines.join "\r\n"
230
-
231
- # Overrides the Content-Type
232
- #
233
- # @return {undefined} undefined
234
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-overridemimetype()-method
235
- overrideMimeType: (newMimeType) ->
236
- if @readyState is XMLHttpRequest.LOADING or
237
- @readyState is XMLHttpRequest.DONE
238
- throw new InvalidStateError(
239
- "overrideMimeType() not allowed in LOADING or DONE")
240
-
241
- @_mimeOverride = newMimeType.toLowerCase()
242
- undefined
243
-
244
- # Network configuration not exposed in the XHR API.
245
- #
246
- # Although the XMLHttpRequest specification calls itself "ECMAScript HTTP",
247
- # it assumes that requests are always performed in the context of a browser
248
- # application, where some network parameters are set by the browser user and
249
- # should not be modified by Web applications. This API provides access to
250
- # these network parameters.
251
- #
252
- # NOTE: this is not in the XMLHttpRequest API, and will not work in
253
- # browsers. It is a stable node-xhr2 API.
254
- #
255
- # @param {Object} options one or more of the options below
256
- # @option options {?http.Agent} httpAgent the value for the nodejsHttpAgent
257
- # property (the agent used for HTTP requests)
258
- # @option options {?https.Agent} httpsAgent the value for the
259
- # nodejsHttpsAgent property (the agent used for HTTPS requests)
260
- # @return {undefined} undefined
261
- nodejsSet: (options) ->
262
- if 'httpAgent' of options
263
- @nodejsHttpAgent = options.httpAgent
264
- if 'httpsAgent' of options
265
- @nodejsHttpsAgent = options.httpsAgent
266
- if 'baseUrl' of options
267
- baseUrl = options.baseUrl
268
- unless baseUrl is null
269
- parsedUrl = url.parse baseUrl, false, true
270
- unless parsedUrl.protocol
271
- throw new SyntaxError("baseUrl must be an absolute URL")
272
- @nodejsBaseUrl = baseUrl
273
-
274
- undefined
275
-
276
- # Default settings for the network configuration not exposed in the XHR API.
277
- #
278
- # NOTE: this is not in the XMLHttpRequest API, and will not work in
279
- # browsers. It is a stable node-xhr2 API.
280
- #
281
- # @param {Object} options one or more of the options below
282
- # @option options {?http.Agent} httpAgent the default value for the
283
- # nodejsHttpAgent property (the agent used for HTTP requests)
284
- # @option options {https.Agent} httpsAgent the default value for the
285
- # nodejsHttpsAgent property (the agent used for HTTPS requests)
286
- # @return {undefined} undefined
287
- # @see XMLHttpRequest.nodejsSet
288
- @nodejsSet: (options) ->
289
- # "this" will be set to XMLHttpRequest.prototype, so the instance nodejsSet
290
- # operates on default property values.
291
- XMLHttpRequest::nodejsSet options
292
-
293
- undefined
294
-
295
- # readyState value before XMLHttpRequest#open() is called
296
- UNSENT: 0
297
- # readyState value before XMLHttpRequest#open() is called
298
- @UNSENT: 0
299
-
300
- # readyState value after XMLHttpRequest#open() is called, and before
301
- # XMLHttpRequest#send() is called; XMLHttpRequest#setRequestHeader() can be
302
- # called in this state
303
- OPENED: 1
304
- # readyState value after XMLHttpRequest#open() is called, and before
305
- # XMLHttpRequest#send() is called; XMLHttpRequest#setRequestHeader() can be
306
- # called in this state
307
- @OPENED: 1
308
-
309
- # readyState value after redirects have been followed and the HTTP headers of
310
- # the final response have been received
311
- HEADERS_RECEIVED: 2
312
- # readyState value after redirects have been followed and the HTTP headers of
313
- # the final response have been received
314
- @HEADERS_RECEIVED: 2
315
-
316
- # readyState value when the response entity body is being received
317
- LOADING: 3
318
- # readyState value when the response entity body is being received
319
- @LOADING: 3
320
-
321
- # readyState value after the request has been completely processed
322
- DONE: 4
323
- # readyState value after the request has been completely processed
324
- @DONE: 4
325
-
326
- # @property {http.Agent} the agent option passed to HTTP requests
327
- #
328
- # NOTE: this is not in the XMLHttpRequest API, and will not work in browsers.
329
- # It is a stable node-xhr2 API that is useful for testing & going through
330
- # web-proxies.
331
- nodejsHttpAgent: http.globalAgent
332
-
333
- # @property {https.Agent} the agent option passed to HTTPS requests
334
- #
335
- # NOTE: this is not in the XMLHttpRequest API, and will not work in browsers.
336
- # It is a stable node-xhr2 API that is useful for testing & going through
337
- # web-proxies.
338
- nodejsHttpsAgent: https.globalAgent
339
-
340
- # @property {String} the base URL that relative URLs get resolved to
341
- #
342
- # NOTE: this is not in the XMLHttpRequest API, and will not work in browsers.
343
- # Its browser equivalent is the base URL of the document associated with the
344
- # Window object. It is a stable node-xhr2 API provided for libraries such as
345
- # Angular Universal.
346
- nodejsBaseUrl: null
347
-
348
- # HTTP methods that are disallowed in the XHR spec.
349
- #
350
- # @private
351
- # @see Step 6 in http://www.w3.org/TR/XMLHttpRequest/#the-open()-method
352
- _restrictedMethods:
353
- CONNECT: true
354
- TRACE: true
355
- TRACK: true
356
-
357
- # HTTP request headers that are disallowed in the XHR spec.
358
- #
359
- # @private
360
- # @see Step 5 in
361
- # http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method
362
- _restrictedHeaders:
363
- 'accept-charset': true
364
- 'accept-encoding': true
365
- 'access-control-request-headers': true
366
- 'access-control-request-method': true
367
- connection: true
368
- 'content-length': true
369
- cookie: true
370
- cookie2: true
371
- date: true
372
- dnt: true
373
- expect: true
374
- host: true
375
- 'keep-alive': true
376
- origin: true
377
- referer: true
378
- te: true
379
- trailer: true
380
- 'transfer-encoding': true
381
- upgrade: true
382
- 'user-agent': true
383
- via: true
384
-
385
- # HTTP response headers that should not be exposed according to the XHR spec.
386
- #
387
- # @private
388
- # @see Step 3 in
389
- # http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
390
- _privateHeaders:
391
- 'set-cookie': true
392
- 'set-cookie2': true
393
-
394
- # The value of the User-Agent header.
395
- _userAgent: "Mozilla/5.0 (#{os.type()} #{os.arch()}) " +
396
- "node.js/#{process.versions.node} v8/#{process.versions.v8}"
397
-
398
- # Sets the readyState property and fires the readystatechange event.
399
- #
400
- # @private
401
- # @param {Number} newReadyState the new value of readyState
402
- # @return {undefined} undefined
403
- _setReadyState: (newReadyState) ->
404
- @readyState = newReadyState
405
- event = new ProgressEvent 'readystatechange'
406
- @dispatchEvent event
407
- undefined
408
-
409
- # XMLHttpRequest#send() implementation for the file: protocol.
410
- #
411
- # @private
412
- _sendFile: ->
413
- unless @_url.method is 'GET'
414
- throw new NetworkError 'The file protocol only supports GET'
415
-
416
- throw new Error "Protocol file: not implemented"
417
-
418
- # XMLHttpRequest#send() implementation for the http: and https: protocols.
419
- #
420
- # @private
421
- # This method sets the instance variables and calls _sendHxxpRequest(), which
422
- # is responsible for building a node.js request and firing it off. The code
423
- # in _sendHxxpRequest() is separated off so it can be reused when handling
424
- # redirects.
425
- #
426
- # @see http://www.w3.org/TR/XMLHttpRequest/#infrastructure-for-the-send()-method
427
- _sendHttp: (data) ->
428
- if @_sync
429
- throw new Error "Synchronous XHR processing not implemented"
430
-
431
- if data? and (@_method is 'GET' or @_method is 'HEAD')
432
- console.warn "Discarding entity body for #{@_method} requests"
433
- data = null
434
- else
435
- # Send Content-Length: 0
436
- data or= ''
437
-
438
- # NOTE: this is called before finalizeHeaders so that the uploader can
439
- # figure out Content-Length and Content-Type.
440
- @upload._setData data
441
- @_finalizeHeaders()
442
-
443
- @_sendHxxpRequest()
444
- undefined
445
-
446
- # Sets up and fires off a HTTP/HTTPS request using the node.js API.
447
- #
448
- # @private
449
- # This method contains the bulk of the XMLHttpRequest#send() implementation,
450
- # and is also used to issue new HTTP requests when handling HTTP redirects.
451
- #
452
- # @see http://www.w3.org/TR/XMLHttpRequest/#infrastructure-for-the-send()-method
453
- _sendHxxpRequest: ->
454
- if @_url.protocol is 'http:'
455
- hxxp = http
456
- agent = @nodejsHttpAgent
457
- else
458
- hxxp = https
459
- agent = @nodejsHttpsAgent
460
-
461
- request = hxxp.request
462
- hostname: @_url.hostname, port: @_url.port, path: @_url.path,
463
- auth: @_url.auth, method: @_method, headers: @_headers, agent: agent
464
- @_request = request
465
- if @timeout
466
- request.setTimeout @timeout, => @_onHttpTimeout request
467
- request.on 'response', (response) => @_onHttpResponse request, response
468
- request.on 'error', (error) => @_onHttpRequestError request, error
469
- @upload._startUpload request
470
- if @_request is request # An http error might have already fired.
471
- @_dispatchProgress 'loadstart'
472
-
473
- undefined
474
-
475
- # Fills in the restricted HTTP headers with default values.
476
- #
477
- # This is called right before the HTTP request is sent off.
478
- #
479
- # @private
480
- # @return {undefined} undefined
481
- _finalizeHeaders: ->
482
- @_headers['Connection'] = 'keep-alive'
483
- @_headers['Host'] = @_url.host
484
- if @_anonymous
485
- @_headers['Referer'] = 'about:blank'
486
- @_headers['User-Agent'] = @_userAgent
487
- @upload._finalizeHeaders @_headers, @_loweredHeaders
488
- undefined
489
-
490
-
491
- # Called when the headers of an HTTP response have been received.
492
- #
493
- # @private
494
- # @param {http.ClientRequest} request the node.js ClientRequest instance that
495
- # produced this response
496
- # @param {http.ClientResponse} response the node.js ClientResponse instance
497
- # passed to
498
- _onHttpResponse: (request, response) ->
499
- return unless @_request is request
500
-
501
- # Transparent redirection handling.
502
- switch response.statusCode
503
- when 301, 302, 303, 307, 308
504
- @_url = @_parseUrl response.headers['location']
505
- @_method = 'GET'
506
- if 'content-type' of @_loweredHeaders
507
- delete @_headers[@_loweredHeaders['content-type']]
508
- delete @_loweredHeaders['content-type']
509
- # XMLHttpRequestUpload#_finalizeHeaders() sets Content-Type directly.
510
- if 'Content-Type' of @_headers
511
- delete @_headers['Content-Type']
512
- # Restricted headers can't be set by the user, no need to check
513
- # loweredHeaders.
514
- delete @_headers['Content-Length']
515
-
516
- @upload._reset()
517
- @_finalizeHeaders()
518
- @_sendHxxpRequest()
519
- return
520
-
521
- @_response = response
522
- @_response.on 'data', (data) => @_onHttpResponseData response, data
523
- @_response.on 'end', => @_onHttpResponseEnd response
524
- @_response.on 'close', => @_onHttpResponseClose response
525
-
526
- @responseURL = @_url.href.split('#')[0]
527
- @status = @_response.statusCode
528
- @statusText = http.STATUS_CODES[@status]
529
- @_parseResponseHeaders response
530
-
531
- if lengthString = @_responseHeaders['content-length']
532
- @_totalBytes = parseInt(lengthString)
533
- @_lengthComputable = true
534
- else
535
- @_lengthComputable = false
536
-
537
- @_setReadyState XMLHttpRequest.HEADERS_RECEIVED
538
-
539
- # Called when some data has been received on a HTTP connection.
540
- #
541
- # @private
542
- # @param {http.ClientResponse} response the node.js ClientResponse instance
543
- # that fired this event
544
- # @param {String, Buffer} data the data that has been received
545
- _onHttpResponseData: (response, data) ->
546
- return unless @_response is response
547
-
548
- @_responseParts.push data
549
- @_loadedBytes += data.length
550
-
551
- if @readyState isnt XMLHttpRequest.LOADING
552
- @_setReadyState XMLHttpRequest.LOADING
553
- @_dispatchProgress 'progress'
554
-
555
- # Called when the HTTP request finished processing.
556
- #
557
- # @private
558
- # @param {http.ClientResponse} response the node.js ClientResponse instance
559
- # that fired this event
560
- _onHttpResponseEnd: (response) ->
561
- return unless @_response is response
562
-
563
- @_parseResponse()
564
-
565
- @_request = null
566
- @_response = null
567
- @_setReadyState XMLHttpRequest.DONE
568
- @_dispatchProgress 'load'
569
- @_dispatchProgress 'loadend'
570
-
571
- # Called when the underlying HTTP connection was closed prematurely.
572
- #
573
- # If this method is called, it will be called after or instead of
574
- # onHttpResponseEnd.
575
- #
576
- # @private
577
- # @param {http.ClientResponse} response the node.js ClientResponse instance
578
- # that fired this event
579
- _onHttpResponseClose: (response) ->
580
- return unless @_response is response
581
-
582
- request = @_request
583
- @_setError()
584
- request.abort()
585
- @_setReadyState XMLHttpRequest.DONE
586
- @_dispatchProgress 'error'
587
- @_dispatchProgress 'loadend'
588
-
589
- # Called when the timeout set on the HTTP socket expires.
590
- #
591
- # @private
592
- # @param {http.ClientRequest} request the node.js ClientRequest instance that
593
- # fired this event
594
- _onHttpTimeout: (request) ->
595
- return unless @_request is request
596
-
597
- @_setError()
598
- request.abort()
599
- @_setReadyState XMLHttpRequest.DONE
600
- @_dispatchProgress 'timeout'
601
- @_dispatchProgress 'loadend'
602
-
603
- # Called when something wrong happens on the HTTP socket
604
- #
605
- # @private
606
- # @param {http.ClientRequest} request the node.js ClientRequest instance that
607
- # fired this event
608
- # @param {Error} error emitted exception
609
- _onHttpRequestError: (request, error) ->
610
- return unless @_request is request
611
-
612
- @_setError()
613
- request.abort()
614
- @_setReadyState XMLHttpRequest.DONE
615
- @_dispatchProgress 'error'
616
- @_dispatchProgress 'loadend'
617
-
618
- # Fires an XHR progress event.
619
- #
620
- # @private
621
- # @param {String} eventType one of the XHR progress event types, such as
622
- # 'load' and 'progress'
623
- _dispatchProgress: (eventType) ->
624
- event = new ProgressEvent eventType
625
- event.lengthComputable = @_lengthComputable
626
- event.loaded = @_loadedBytes
627
- event.total = @_totalBytes
628
- @dispatchEvent event
629
- undefined
630
-
631
- # Sets up the XHR to reflect the fact that an error has occurred.
632
- #
633
- # The possible errors are a network error, a timeout, or an abort.
634
- #
635
- # @private
636
- _setError: ->
637
- @_request = null
638
- @_response = null
639
- @_responseHeaders = null
640
- @_responseParts = null
641
- undefined
642
-
643
- # Parses a request URL string.
644
- #
645
- # @private
646
- # This method is a thin wrapper around url.parse() that normalizes HTTP
647
- # user/password credentials. It is used to parse the URL string passed to
648
- # XMLHttpRequest#open() and the URLs in the Location headers of HTTP redirect
649
- # responses.
650
- #
651
- # @param {String} urlString the URL to be parsed
652
- # @return {Object} parsed URL
653
- _parseUrl: (urlString) ->
654
- if @nodejsBaseUrl is null
655
- absoluteUrlString = urlString
656
- else
657
- absoluteUrlString = url.resolve @nodejsBaseUrl, urlString
658
-
659
- xhrUrl = url.parse absoluteUrlString, false, true
660
- xhrUrl.hash = null
661
- if xhrUrl.auth and (user? or password?)
662
- index = xhrUrl.auth.indexOf ':'
663
- if index is -1
664
- user = xhrUrl.auth unless user
665
- else
666
- user = xhrUrl.substring(0, index) unless user
667
- password = xhrUrl.substring(index + 1) unless password
668
- if user or password
669
- xhrUrl.auth = "#{user}:#{password}"
670
- xhrUrl
671
-
672
- # Reads the headers from a node.js ClientResponse instance.
673
- #
674
- # @private
675
- # @param {http.ClientResponse} response the response whose headers will be
676
- # imported into this XMLHttpRequest's state
677
- # @return {undefined} undefined
678
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
679
- # @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method
680
- _parseResponseHeaders: (response) ->
681
- @_responseHeaders = {}
682
- for name, value of response.headers
683
- loweredName = name.toLowerCase()
684
- continue if @_privateHeaders[loweredName]
685
- if @_mimeOverride isnt null and loweredName is 'content-type'
686
- value = @_mimeOverride
687
- @_responseHeaders[loweredName] = value
688
-
689
- if @_mimeOverride isnt null and !('content-type' of @_responseHeaders)
690
- @_responseHeaders['content-type'] = @_mimeOverride
691
- undefined
692
-
693
- # Sets the response and responseText properties when an XHR completes.
694
- #
695
- # @private
696
- # @return {undefined} undefined
697
- _parseResponse: ->
698
- if Buffer.concat
699
- buffer = Buffer.concat @_responseParts
700
- else
701
- # node 0.6
702
- buffer = @_concatBuffers @_responseParts
703
- @_responseParts = null
704
-
705
- switch @responseType
706
- when 'text'
707
- @_parseTextResponse buffer
708
- when 'json'
709
- @responseText = null
710
- try
711
- @response = JSON.parse buffer.toString('utf-8')
712
- catch jsonError
713
- @response = null
714
- when 'buffer'
715
- @responseText = null
716
- @response = buffer
717
- when 'arraybuffer'
718
- @responseText = null
719
- arrayBuffer = new ArrayBuffer buffer.length
720
- view = new Uint8Array arrayBuffer
721
- view[i] = buffer[i] for i in [0...buffer.length]
722
- @response = arrayBuffer
723
- else
724
- # TODO(pwnall): content-base detection
725
- @_parseTextResponse buffer
726
- undefined
727
-
728
- # Sets response and responseText for a 'text' response type.
729
- #
730
- # @private
731
- # @param {Buffer} buffer the node.js Buffer containing the binary response
732
- # @return {undefined} undefined
733
- _parseTextResponse: (buffer) ->
734
- try
735
- @responseText = buffer.toString @_parseResponseEncoding()
736
- catch e
737
- # Unknown encoding.
738
- @responseText = buffer.toString 'binary'
739
-
740
- @response = @responseText
741
- undefined
742
-
743
- # Figures out the string encoding of the XHR's response.
744
- #
745
- # This is called to determine the encoding when responseText is set.
746
- #
747
- # @private
748
- # @return {String} a string encoding, e.g. 'utf-8'
749
- _parseResponseEncoding: ->
750
- encoding = null
751
- if contentType = @_responseHeaders['content-type']
752
- if match = /\;\s*charset\=(.*)$/.exec contentType
753
- return match[1]
754
- 'utf-8'
755
-
756
- # Buffer.concat implementation for node 0.6.
757
- #
758
- # @private
759
- # @param {Array<Buffer>} buffers the buffers whose contents will be merged
760
- # @return {Buffer} same as Buffer.concat(buffers) in node 0.8 and above
761
- _concatBuffers: (buffers) ->
762
- if buffers.length is 0
763
- return Buffer.alloc 0
764
- if buffers.length is 1
765
- return buffers[0]
766
-
767
- length = 0
768
- length += buffer.length for buffer in buffers
769
- target = Buffer.alloc length
770
- length = 0
771
- for buffer in buffers
772
- buffer.copy target, length
773
- length += buffer.length
774
- target
775
-
776
- # XMLHttpRequest is the result of require('node-xhr2').
777
- module.exports = XMLHttpRequest
778
-
779
- # Make node-xhr2 work as a drop-in replacement for libraries that promote the
780
- # following usage pattern:
781
- # var XMLHttpRequest = require('xhr-library-name').XMLHttpRequest
782
- XMLHttpRequest.XMLHttpRequest = XMLHttpRequest