melonjs 15.0.0 → 15.1.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 (285) hide show
  1. package/README.md +4 -4
  2. package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +1 -1
  3. package/dist/melonjs.mjs/_virtual/arraymultimap.js +1 -1
  4. package/dist/melonjs.mjs/_virtual/earcut.js +1 -1
  5. package/dist/melonjs.mjs/_virtual/howler.js +1 -1
  6. package/dist/melonjs.mjs/_virtual/index.js +7 -3
  7. package/dist/melonjs.mjs/_virtual/index2.js +1 -1
  8. package/dist/melonjs.mjs/_virtual/multimap.js +1 -1
  9. package/dist/melonjs.mjs/_virtual/setmultimap.js +1 -1
  10. package/dist/melonjs.mjs/application/application.js +27 -17
  11. package/dist/melonjs.mjs/application/header.js +6 -5
  12. package/dist/melonjs.mjs/application/resize.js +20 -20
  13. package/dist/melonjs.mjs/application/settings.js +1 -1
  14. package/dist/melonjs.mjs/audio/audio.js +17 -17
  15. package/dist/melonjs.mjs/camera/camera2d.js +10 -10
  16. package/dist/melonjs.mjs/const.js +1 -1
  17. package/dist/melonjs.mjs/entity/entity.js +4 -4
  18. package/dist/melonjs.mjs/geometries/ellipse.js +6 -6
  19. package/dist/melonjs.mjs/geometries/line.js +9 -9
  20. package/dist/melonjs.mjs/geometries/path2d.js +53 -53
  21. package/dist/melonjs.mjs/geometries/point.js +2 -2
  22. package/dist/melonjs.mjs/geometries/poly.js +29 -29
  23. package/dist/melonjs.mjs/geometries/rectangle.js +8 -8
  24. package/dist/melonjs.mjs/geometries/roundrect.js +6 -6
  25. package/dist/melonjs.mjs/index.js +5 -5
  26. package/dist/melonjs.mjs/input/gamepad.js +30 -30
  27. package/dist/melonjs.mjs/input/input.js +2 -2
  28. package/dist/melonjs.mjs/input/keyboard.js +15 -15
  29. package/dist/melonjs.mjs/input/pointer.js +2 -2
  30. package/dist/melonjs.mjs/input/pointerevent.js +58 -58
  31. package/dist/melonjs.mjs/lang/console.js +3 -3
  32. package/dist/melonjs.mjs/lang/deprecated.js +2 -2
  33. package/dist/melonjs.mjs/level/level.js +9 -9
  34. package/dist/melonjs.mjs/level/tiled/TMXGroup.js +3 -3
  35. package/dist/melonjs.mjs/level/tiled/TMXLayer.js +31 -31
  36. package/dist/melonjs.mjs/level/tiled/TMXObject.js +8 -8
  37. package/dist/melonjs.mjs/level/tiled/TMXTile.js +8 -8
  38. package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +19 -19
  39. package/dist/melonjs.mjs/level/tiled/TMXTileset.js +15 -15
  40. package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +3 -3
  41. package/dist/melonjs.mjs/level/tiled/TMXUtils.js +46 -41
  42. package/dist/melonjs.mjs/level/tiled/constants.js +1 -1
  43. package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +30 -30
  44. package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +21 -21
  45. package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +10 -10
  46. package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +2 -2
  47. package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +6 -6
  48. package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +1 -1
  49. package/dist/melonjs.mjs/loader/cache.js +1 -1
  50. package/dist/melonjs.mjs/loader/loader.js +7 -7
  51. package/dist/melonjs.mjs/loader/loadingscreen.js +2 -2
  52. package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
  53. package/dist/melonjs.mjs/loader/parser.js +13 -13
  54. package/dist/melonjs.mjs/loader/settings.js +3 -3
  55. package/dist/melonjs.mjs/math/color.js +21 -21
  56. package/dist/melonjs.mjs/math/math.js +2 -2
  57. package/dist/melonjs.mjs/math/matrix2.js +22 -22
  58. package/dist/melonjs.mjs/math/matrix3.js +52 -52
  59. package/dist/melonjs.mjs/math/observable_vector2.js +12 -12
  60. package/dist/melonjs.mjs/math/observable_vector3.js +22 -22
  61. package/dist/melonjs.mjs/math/vector2.js +11 -11
  62. package/dist/melonjs.mjs/math/vector3.js +21 -21
  63. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +45 -0
  64. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +130 -0
  65. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +1 -1
  66. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +1 -1
  67. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +1 -1
  68. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +1 -1
  69. package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +1 -1
  70. package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +2 -2
  71. package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +1 -1
  72. package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +1 -1
  73. package/dist/melonjs.mjs/particles/emitter.js +5 -5
  74. package/dist/melonjs.mjs/particles/particle.js +8 -8
  75. package/dist/melonjs.mjs/particles/settings.js +3 -3
  76. package/dist/melonjs.mjs/physics/body.js +17 -17
  77. package/dist/melonjs.mjs/physics/bounds.js +12 -12
  78. package/dist/melonjs.mjs/physics/collision.js +3 -3
  79. package/dist/melonjs.mjs/physics/detector.js +14 -14
  80. package/dist/melonjs.mjs/physics/quadtree.js +19 -19
  81. package/dist/melonjs.mjs/physics/response.js +1 -1
  82. package/dist/melonjs.mjs/physics/sat.js +60 -60
  83. package/dist/melonjs.mjs/physics/world.js +4 -4
  84. package/dist/melonjs.mjs/plugin/plugin.js +11 -11
  85. package/dist/melonjs.mjs/renderable/collectable.js +2 -2
  86. package/dist/melonjs.mjs/renderable/colorlayer.js +1 -1
  87. package/dist/melonjs.mjs/renderable/container.js +107 -63
  88. package/dist/melonjs.mjs/renderable/dragndrop.js +5 -5
  89. package/dist/melonjs.mjs/renderable/imagelayer.js +7 -6
  90. package/dist/melonjs.mjs/renderable/light2d.js +6 -6
  91. package/dist/melonjs.mjs/renderable/nineslicesprite.js +12 -12
  92. package/dist/melonjs.mjs/renderable/renderable.js +11 -11
  93. package/dist/melonjs.mjs/renderable/sprite.js +25 -25
  94. package/dist/melonjs.mjs/renderable/trigger.js +11 -9
  95. package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +97 -27
  96. package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +25 -25
  97. package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +83 -63
  98. package/dist/melonjs.mjs/state/stage.js +7 -7
  99. package/dist/melonjs.mjs/state/state.js +15 -15
  100. package/dist/melonjs.mjs/system/device.js +2 -2
  101. package/dist/melonjs.mjs/system/dom.js +1 -1
  102. package/dist/melonjs.mjs/system/event.js +2 -2
  103. package/dist/melonjs.mjs/system/platform.js +1 -1
  104. package/dist/melonjs.mjs/system/pooling.js +9 -9
  105. package/dist/melonjs.mjs/system/save.js +6 -6
  106. package/dist/melonjs.mjs/system/timer.js +16 -12
  107. package/dist/melonjs.mjs/text/bitmaptext.js +20 -20
  108. package/dist/melonjs.mjs/text/bitmaptextdata.js +22 -22
  109. package/dist/melonjs.mjs/text/glyph.js +3 -3
  110. package/dist/melonjs.mjs/text/text.js +10 -9
  111. package/dist/melonjs.mjs/text/textmetrics.js +15 -15
  112. package/dist/melonjs.mjs/text/textstyle.js +1 -1
  113. package/dist/melonjs.mjs/tweens/easing.js +4 -4
  114. package/dist/melonjs.mjs/tweens/interpolation.js +8 -8
  115. package/dist/melonjs.mjs/tweens/tween.js +11 -11
  116. package/dist/melonjs.mjs/utils/agent.js +6 -6
  117. package/dist/melonjs.mjs/utils/array.js +4 -4
  118. package/dist/melonjs.mjs/utils/file.js +1 -1
  119. package/dist/melonjs.mjs/utils/function.js +5 -5
  120. package/dist/melonjs.mjs/utils/string.js +3 -3
  121. package/dist/melonjs.mjs/utils/utils.js +16 -16
  122. package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +35 -109
  123. package/dist/melonjs.mjs/video/renderer.js +74 -7
  124. package/dist/melonjs.mjs/video/texture/atlas.js +37 -37
  125. package/dist/melonjs.mjs/video/texture/cache.js +9 -10
  126. package/dist/melonjs.mjs/video/texture/canvas_texture.js +63 -3
  127. package/dist/melonjs.mjs/video/utils/autodetect.js +1 -1
  128. package/dist/melonjs.mjs/video/video.js +2 -2
  129. package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +3 -3
  130. package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +5 -5
  131. package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +5 -5
  132. package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +18 -15
  133. package/dist/melonjs.mjs/video/webgl/glshader.js +7 -7
  134. package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
  135. package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +1 -1
  136. package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
  137. package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +1 -1
  138. package/dist/melonjs.mjs/video/webgl/utils/attributes.js +2 -2
  139. package/dist/melonjs.mjs/video/webgl/utils/precision.js +1 -1
  140. package/dist/melonjs.mjs/video/webgl/utils/program.js +7 -7
  141. package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
  142. package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +4 -4
  143. package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +55 -38
  144. package/dist/melonjs.module.js +1777 -1813
  145. package/dist/types/application/application.d.ts +11 -8
  146. package/dist/types/audio/audio.d.ts +3 -3
  147. package/dist/types/index.d.ts +4 -3
  148. package/dist/types/input/input.d.ts +1 -1
  149. package/dist/types/input/keyboard.d.ts +1 -1
  150. package/dist/types/input/pointerevent.d.ts +6 -6
  151. package/dist/types/level/level.d.ts +2 -2
  152. package/dist/types/level/tiled/TMXLayer.d.ts +4 -4
  153. package/dist/types/level/tiled/TMXTileMap.d.ts +2 -2
  154. package/dist/types/level/tiled/TMXUtils.d.ts +5 -4
  155. package/dist/types/loader/loader.d.ts +2 -2
  156. package/dist/types/loader/settings.d.ts +2 -2
  157. package/dist/types/particles/emitter.d.ts +1 -1
  158. package/dist/types/physics/collision.d.ts +1 -1
  159. package/dist/types/physics/detector.d.ts +1 -1
  160. package/dist/types/plugin/plugin.d.ts +2 -2
  161. package/dist/types/renderable/container.d.ts +21 -17
  162. package/dist/types/renderable/sprite.d.ts +11 -11
  163. package/dist/types/renderable/trigger.d.ts +1 -1
  164. package/dist/types/renderable/ui/uibaseelement.d.ts +28 -6
  165. package/dist/types/renderable/ui/uispriteelement.d.ts +12 -14
  166. package/dist/types/renderable/ui/uitextbutton.d.ts +52 -11
  167. package/dist/types/state/stage.d.ts +1 -1
  168. package/dist/types/system/device.d.ts +1 -1
  169. package/dist/types/system/pooling.d.ts +3 -3
  170. package/dist/types/system/timer.d.ts +5 -5
  171. package/dist/types/text/bitmaptext.d.ts +1 -1
  172. package/dist/types/text/text.d.ts +1 -1
  173. package/dist/types/utils/array.d.ts +2 -2
  174. package/dist/types/video/canvas/canvas_renderer.d.ts +8 -76
  175. package/dist/types/video/renderer.d.ts +48 -0
  176. package/dist/types/video/texture/atlas.d.ts +3 -3
  177. package/dist/types/video/texture/canvas_texture.d.ts +40 -0
  178. package/dist/types/video/webgl/glshader.d.ts +1 -1
  179. package/dist/types/video/webgl/webgl_renderer.d.ts +13 -9
  180. package/package.json +14 -14
  181. package/src/application/application.js +26 -16
  182. package/src/application/header.js +5 -4
  183. package/src/application/resize.js +19 -19
  184. package/src/audio/audio.js +16 -16
  185. package/src/camera/camera2d.js +9 -9
  186. package/src/entity/entity.js +3 -3
  187. package/src/geometries/ellipse.js +5 -5
  188. package/src/geometries/line.js +8 -8
  189. package/src/geometries/path2d.js +52 -52
  190. package/src/geometries/point.js +1 -1
  191. package/src/geometries/poly.js +28 -28
  192. package/src/geometries/rectangle.js +7 -7
  193. package/src/geometries/roundrect.js +5 -5
  194. package/src/index.js +3 -2
  195. package/src/input/gamepad.js +29 -29
  196. package/src/input/input.js +1 -1
  197. package/src/input/keyboard.js +14 -14
  198. package/src/input/pointer.js +1 -1
  199. package/src/input/pointerevent.js +52 -52
  200. package/src/lang/console.js +2 -2
  201. package/src/lang/deprecated.js +1 -1
  202. package/src/level/level.js +8 -8
  203. package/src/level/tiled/TMXGroup.js +2 -2
  204. package/src/level/tiled/TMXLayer.js +30 -30
  205. package/src/level/tiled/TMXObject.js +7 -7
  206. package/src/level/tiled/TMXTile.js +7 -7
  207. package/src/level/tiled/TMXTileMap.js +18 -18
  208. package/src/level/tiled/TMXTileset.js +14 -14
  209. package/src/level/tiled/TMXTilesetGroup.js +2 -2
  210. package/src/level/tiled/TMXUtils.js +45 -40
  211. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +29 -29
  212. package/src/level/tiled/renderer/TMXIsometricRenderer.js +20 -20
  213. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +9 -9
  214. package/src/level/tiled/renderer/TMXRenderer.js +1 -1
  215. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +5 -5
  216. package/src/loader/loader.js +6 -6
  217. package/src/loader/loadingscreen.js +1 -1
  218. package/src/loader/parser.js +12 -12
  219. package/src/loader/settings.js +2 -2
  220. package/src/math/color.js +20 -20
  221. package/src/math/math.js +1 -1
  222. package/src/math/matrix2.js +21 -21
  223. package/src/math/matrix3.js +51 -51
  224. package/src/math/observable_vector2.js +11 -11
  225. package/src/math/observable_vector3.js +21 -21
  226. package/src/math/vector2.js +10 -10
  227. package/src/math/vector3.js +20 -20
  228. package/src/particles/emitter.js +4 -4
  229. package/src/particles/particle.js +7 -7
  230. package/src/particles/settings.js +2 -2
  231. package/src/physics/body.js +16 -16
  232. package/src/physics/bounds.js +11 -11
  233. package/src/physics/collision.js +2 -2
  234. package/src/physics/detector.js +13 -13
  235. package/src/physics/quadtree.js +18 -18
  236. package/src/physics/sat.js +59 -59
  237. package/src/physics/world.js +3 -3
  238. package/src/plugin/plugin.js +8 -8
  239. package/src/renderable/collectable.js +1 -1
  240. package/src/renderable/container.js +106 -62
  241. package/src/renderable/dragndrop.js +4 -4
  242. package/src/renderable/imagelayer.js +6 -5
  243. package/src/renderable/light2d.js +5 -5
  244. package/src/renderable/nineslicesprite.js +11 -11
  245. package/src/renderable/renderable.js +10 -10
  246. package/src/renderable/sprite.js +24 -24
  247. package/src/renderable/trigger.js +10 -8
  248. package/src/renderable/ui/uibaseelement.js +96 -26
  249. package/src/renderable/ui/uispriteelement.js +24 -24
  250. package/src/renderable/ui/uitextbutton.js +85 -65
  251. package/src/state/stage.js +6 -6
  252. package/src/state/state.js +14 -14
  253. package/src/system/device.js +1 -1
  254. package/src/system/event.js +1 -1
  255. package/src/system/pooling.js +8 -8
  256. package/src/system/save.js +5 -5
  257. package/src/system/timer.js +15 -11
  258. package/src/text/bitmaptext.js +19 -19
  259. package/src/text/bitmaptextdata.js +21 -21
  260. package/src/text/glyph.js +2 -2
  261. package/src/text/text.js +9 -8
  262. package/src/text/textmetrics.js +14 -14
  263. package/src/tweens/easing.js +3 -3
  264. package/src/tweens/interpolation.js +7 -7
  265. package/src/tweens/tween.js +10 -10
  266. package/src/utils/agent.js +5 -5
  267. package/src/utils/array.js +3 -3
  268. package/src/utils/function.js +4 -4
  269. package/src/utils/string.js +2 -2
  270. package/src/utils/utils.js +15 -15
  271. package/src/video/canvas/canvas_renderer.js +34 -108
  272. package/src/video/renderer.js +72 -5
  273. package/src/video/texture/atlas.js +36 -36
  274. package/src/video/texture/cache.js +6 -6
  275. package/src/video/texture/canvas_texture.js +62 -2
  276. package/src/video/video.js +1 -1
  277. package/src/video/webgl/buffer/vertex.js +2 -2
  278. package/src/video/webgl/compositors/compositor.js +4 -4
  279. package/src/video/webgl/compositors/primitive_compositor.js +4 -4
  280. package/src/video/webgl/compositors/quad_compositor.js +17 -14
  281. package/src/video/webgl/glshader.js +6 -6
  282. package/src/video/webgl/utils/attributes.js +1 -1
  283. package/src/video/webgl/utils/program.js +6 -6
  284. package/src/video/webgl/utils/uniforms.js +3 -3
  285. package/src/video/webgl/webgl_renderer.js +54 -37
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -15,7 +15,7 @@ const capChars = ["M", "N", "B", "D", "C", "E", "F", "K", "A", "G", "H", "I", "J
15
15
  * @ignore
16
16
  */
17
17
  function getValueFromPair(string, pattern) {
18
- var value = string.match(pattern);
18
+ let value = string.match(pattern);
19
19
  if (!value) {
20
20
  throw new Error("Could not find pattern " + pattern + " in string: " + string);
21
21
  }
@@ -32,8 +32,8 @@ function getValueFromPair(string, pattern) {
32
32
  * @returns {Glyph}
33
33
  */
34
34
  function getFirstGlyph(glyphs) {
35
- var keys = Object.keys(glyphs);
36
- for (var i = 0; i < keys.length; i++) {
35
+ let keys = Object.keys(glyphs);
36
+ for (let i = 0; i < keys.length; i++) {
37
37
  if (keys[i] > 32) {
38
38
  return glyphs[keys[i]];
39
39
  }
@@ -49,8 +49,8 @@ function getFirstGlyph(glyphs) {
49
49
  * @param {object} glyphs - the map of glyphs, each key is a char code
50
50
  */
51
51
  function createSpaceGlyph(glyphs) {
52
- var spaceCharCode = " ".charCodeAt(0);
53
- var glyph = glyphs[spaceCharCode];
52
+ let spaceCharCode = " ".charCodeAt(0);
53
+ let glyph = glyphs[spaceCharCode];
54
54
  if (!glyph) {
55
55
  glyph = new Glyph();
56
56
  glyph.id = spaceCharCode;
@@ -109,12 +109,12 @@ function createSpaceGlyph(glyphs) {
109
109
  if (!fontData) {
110
110
  throw new Error("File containing font data was empty, cannot load the bitmap font.");
111
111
  }
112
- var lines = fontData.split(/\r\n|\n/);
113
- var padding = fontData.match(/padding\=\d+,\d+,\d+,\d+/g);
112
+ let lines = fontData.split(/\r\n|\n/);
113
+ let padding = fontData.match(/padding\=\d+,\d+,\d+,\d+/g);
114
114
  if (!padding) {
115
115
  throw new Error("Padding not found in first line");
116
116
  }
117
- var paddingValues = padding[0].split("=")[1].split(",");
117
+ let paddingValues = padding[0].split("=")[1].split(",");
118
118
  this.padTop = parseFloat(paddingValues[0]);
119
119
  this.padLeft = parseFloat(paddingValues[1]);
120
120
  this.padBottom = parseFloat(paddingValues[2]);
@@ -122,24 +122,24 @@ function createSpaceGlyph(glyphs) {
122
122
 
123
123
  this.lineHeight = parseFloat(getValueFromPair(lines[1], /lineHeight\=\d+/g));
124
124
 
125
- var baseLine = parseFloat(getValueFromPair(lines[1], /base\=\d+/g));
125
+ let baseLine = parseFloat(getValueFromPair(lines[1], /base\=\d+/g));
126
126
 
127
- var padY = this.padTop + this.padBottom;
127
+ let padY = this.padTop + this.padBottom;
128
128
 
129
- var glyph = null;
129
+ let glyph = null;
130
130
 
131
- var i;
131
+ let i;
132
132
 
133
133
  for (i = 4; i < lines.length; i++) {
134
- var line = lines[i];
135
- var characterValues = line.split(/=|\s+/);
134
+ let line = lines[i];
135
+ let characterValues = line.split(/=|\s+/);
136
136
  if (!line || /^kernings/.test(line)) {
137
137
  continue;
138
138
  }
139
139
  if (/^kerning\s/.test(line)) {
140
- var first = parseFloat(characterValues[2]);
141
- var second = parseFloat(characterValues[4]);
142
- var amount = parseFloat(characterValues[6]);
140
+ let first = parseFloat(characterValues[2]);
141
+ let second = parseFloat(characterValues[4]);
142
+ let amount = parseFloat(characterValues[6]);
143
143
 
144
144
  glyph = this.glyphs[first];
145
145
  if (glyph !== null && typeof glyph !== "undefined") {
@@ -148,7 +148,7 @@ function createSpaceGlyph(glyphs) {
148
148
  } else {
149
149
  glyph = new Glyph();
150
150
 
151
- var ch = parseFloat(characterValues[2]);
151
+ let ch = parseFloat(characterValues[2]);
152
152
  glyph.id = ch;
153
153
  glyph.x = parseFloat(characterValues[4]);
154
154
  glyph.y = parseFloat(characterValues[6]);
@@ -170,16 +170,16 @@ function createSpaceGlyph(glyphs) {
170
170
 
171
171
  createSpaceGlyph(this.glyphs);
172
172
 
173
- var capGlyph = null;
173
+ let capGlyph = null;
174
174
  for (i = 0; i < capChars.length; i++) {
175
- var capChar = capChars[i];
175
+ let capChar = capChars[i];
176
176
  capGlyph = this.glyphs[capChar.charCodeAt(0)];
177
177
  if (capGlyph) {
178
178
  break;
179
179
  }
180
180
  }
181
181
  if (!capGlyph) {
182
- for (var charCode in this.glyphs) {
182
+ for (let charCode in this.glyphs) {
183
183
  if (this.glyphs.hasOwnProperty(charCode)) {
184
184
  glyph = this.glyphs[charCode];
185
185
  if (glyph.height === 0 || glyph.width === 0) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -38,7 +38,7 @@ const PAGE_SIZE = 1 << LOG2_PAGE_SIZE;
38
38
  */
39
39
  getKerning(ch) {
40
40
  if (this.kerning) {
41
- var page = this.kerning[ch >>> LOG2_PAGE_SIZE];
41
+ let page = this.kerning[ch >>> LOG2_PAGE_SIZE];
42
42
  if (page) {
43
43
  return page[ch & PAGE_SIZE - 1] || 0;
44
44
  }
@@ -53,7 +53,7 @@ const PAGE_SIZE = 1 << LOG2_PAGE_SIZE;
53
53
  if (!this.kerning) {
54
54
  this.kerning = {};
55
55
  }
56
- var page = this.kerning[ch >>> LOG2_PAGE_SIZE];
56
+ let page = this.kerning[ch >>> LOG2_PAGE_SIZE];
57
57
  if (typeof page === "undefined") {
58
58
  this.kerning[ch >>> LOG2_PAGE_SIZE] = {};
59
59
  page = this.kerning[ch >>> LOG2_PAGE_SIZE];
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -47,7 +47,7 @@ const toPX = [12, 24, 0.75, 1];
47
47
  * @param {number} [settings.wordWrapWidth] - the maximum length in CSS pixel for a single segment of text
48
48
  * @param {(string|string[])} [settings.text=""] - a string, or an array of strings
49
49
  * @example
50
- * var font = new me.Text(0, 0, {font: "Arial", size: 8, fillStyle: this.color});
50
+ * let font = new me.Text(0, 0, {font: "Arial", size: 8, fillStyle: this.color});
51
51
  */
52
52
  constructor(x, y, settings) {
53
53
  // call the parent constructor
@@ -176,7 +176,8 @@ const toPX = [12, 24, 0.75, 1];
176
176
  }
177
177
 
178
178
  // the canvas Texture used to render this text
179
- this.canvasTexture = pool.pull("CanvasTexture", 2, 2, { offscreenCanvas: true });
179
+ // XXX: offscreenCanvas is currently disabled for text rendering due to issue in WebGL mode
180
+ this.canvasTexture = pool.pull("CanvasTexture", 2, 2, { offscreenCanvas: false });
180
181
 
181
182
  // instance to text metrics functions
182
183
  this.metrics = new TextMetrics(this);
@@ -216,7 +217,7 @@ const toPX = [12, 24, 0.75, 1];
216
217
  */
217
218
  setFont(font, size = 10) {
218
219
  // font name and type
219
- var font_names = font.split(",").map((value) => {
220
+ let font_names = font.split(",").map((value) => {
220
221
  value = value.trim();
221
222
  return (
222
223
  !/(^".*"$)|(^'.*'$)/.test(value)
@@ -229,7 +230,7 @@ const toPX = [12, 24, 0.75, 1];
229
230
  size += "px";
230
231
  } else /* string */ {
231
232
  // extract the units and convert if necessary
232
- var CSSval = size.match(/([-+]?[\d.]*)(.*)/);
233
+ let CSSval = size.match(/([-+]?[\d.]*)(.*)/);
233
234
  this.fontSize = parseFloat(CSSval[1]);
234
235
  if (CSSval[2]) {
235
236
  this.fontSize *= toPX[runits.indexOf(CSSval[2])];
@@ -252,7 +253,7 @@ const toPX = [12, 24, 0.75, 1];
252
253
  * @returns {Text} this object for chaining
253
254
  */
254
255
  setText(value = "") {
255
- var bounds = this.getBounds();
256
+ let bounds = this.getBounds();
256
257
 
257
258
  // set the next text
258
259
  if (this._text.toString() !== value.toString()) {
@@ -272,7 +273,7 @@ const toPX = [12, 24, 0.75, 1];
272
273
  bounds.addBounds(this.metrics.measureText(this._text, this.canvasTexture.context), true);
273
274
 
274
275
  // update the offScreenCanvas texture if required
275
- var width = Math.ceil(this.metrics.width),
276
+ let width = Math.ceil(this.metrics.width),
276
277
  height = Math.ceil(this.metrics.height);
277
278
 
278
279
  if (typeof renderer.gl !== "undefined") {
@@ -380,8 +381,8 @@ const toPX = [12, 24, 0.75, 1];
380
381
  _drawFont(context, text, x, y) {
381
382
  setContextStyle(context, this);
382
383
 
383
- for (var i = 0; i < text.length; i++) {
384
- var string = text[i].trimEnd();
384
+ for (let i = 0; i < text.length; i++) {
385
+ let string = text[i].trimEnd();
385
386
  // draw the string
386
387
  if (this.fillStyle.alpha > 0) {
387
388
  context.fillText(string, x, y);
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -57,14 +57,14 @@ import setContextStyle from './textstyle.js';
57
57
  if (this.ancestor instanceof Text) {
58
58
  return context.measureText(text).width;
59
59
  } else { // it's a BitmapText
60
- var characters = text.split("");
61
- var width = 0;
62
- var lastGlyph = null;
63
- for (var i = 0; i < characters.length; i++) {
64
- var ch = characters[i].charCodeAt(0);
65
- var glyph = this.ancestor.fontData.glyphs[ch];
60
+ let characters = text.split("");
61
+ let width = 0;
62
+ let lastGlyph = null;
63
+ for (let i = 0; i < characters.length; i++) {
64
+ let ch = characters[i].charCodeAt(0);
65
+ let glyph = this.ancestor.fontData.glyphs[ch];
66
66
  if (typeof glyph !== "undefined") {
67
- var kerning = (lastGlyph && lastGlyph.kerning) ? lastGlyph.getKerning(ch) : 0;
67
+ let kerning = (lastGlyph && lastGlyph.kerning) ? lastGlyph.getKerning(ch) : 0;
68
68
  width += (glyph.xadvance + kerning) * this.ancestor.fontScale.x;
69
69
  lastGlyph = glyph;
70
70
  }
@@ -80,7 +80,7 @@ import setContextStyle from './textstyle.js';
80
80
  * @returns {TextMetrics} this
81
81
  */
82
82
  measureText(text, context) {
83
- var strings;
83
+ let strings;
84
84
 
85
85
  if (!Array.isArray(text)) {
86
86
  strings = ("" + text).split("\n");
@@ -99,7 +99,7 @@ import setContextStyle from './textstyle.js';
99
99
  // compute the bounding box size
100
100
  this.width = this.height = 0;
101
101
 
102
- for (var i = 0; i < strings.length; i++) {
102
+ for (let i = 0; i < strings.length; i++) {
103
103
  this.width = Math.max(this.lineWidth(strings[i].trimEnd(), context), this.width);
104
104
  this.height += this.lineHeight();
105
105
  }
@@ -130,9 +130,9 @@ import setContextStyle from './textstyle.js';
130
130
  * @returns {string[]} an array of string representing wrapped text
131
131
  */
132
132
  wordWrap(text, width, context) {
133
- var words;
134
- var currentLine = "";
135
- var output = [];
133
+ let words;
134
+ let currentLine = "";
135
+ let output = [];
136
136
 
137
137
  if (Array.isArray(text)) {
138
138
  // join into a single string
@@ -150,8 +150,8 @@ import setContextStyle from './textstyle.js';
150
150
  }
151
151
 
152
152
  for (let i = 0; i < words.length; i++) {
153
- var word = words[i];
154
- var lineWidth = this.lineWidth(currentLine + word + " ", context);
153
+ let word = words[i];
154
+ let lineWidth = this.lineWidth(currentLine + word + " ", context);
155
155
  if (lineWidth < width) {
156
156
  // add the word to the current line
157
157
  currentLine += word + " ";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -270,21 +270,21 @@ let Easing = {
270
270
  /** @ignore */
271
271
  In: function ( k ) {
272
272
 
273
- var s = 1.70158;
273
+ const s = 1.70158;
274
274
  return k * k * ( ( s + 1 ) * k - s );
275
275
 
276
276
  },
277
277
  /** @ignore */
278
278
  Out: function ( k ) {
279
279
 
280
- var s = 1.70158;
280
+ const s = 1.70158;
281
281
  return --k * k * ( ( s + 1 ) * k + s ) + 1;
282
282
 
283
283
  },
284
284
  /** @ignore */
285
285
  InOut: function ( k ) {
286
286
 
287
- var s = 1.70158 * 1.525;
287
+ const s = 1.70158 * 1.525;
288
288
  if ( ( k *= 2 ) < 1 ) return 0.5 * ( k * k * ( ( s + 1 ) * k - s ) );
289
289
  return 0.5 * ( ( k -= 2 ) * k * ( ( s + 1 ) * k + s ) + 2 );
290
290
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -27,7 +27,7 @@ let Interpolation = {
27
27
  /** @ignore */
28
28
  Linear: function ( v, k ) {
29
29
 
30
- var m = v.length - 1, f = m * k, i = Math.floor( f ), fn = Interpolation.Utils.Linear;
30
+ let m = v.length - 1, f = m * k, i = Math.floor( f ), fn = Interpolation.Utils.Linear;
31
31
 
32
32
  if ( k < 0 ) return fn( v[ 0 ], v[ 1 ], f );
33
33
  if ( k > 1 ) return fn( v[ m ], v[ m - 1 ], m - f );
@@ -38,7 +38,7 @@ let Interpolation = {
38
38
  /** @ignore */
39
39
  Bezier: function ( v, k ) {
40
40
 
41
- var b = 0, n = v.length - 1, pw = Math.pow, bn = Interpolation.Utils.Bernstein, i;
41
+ let b = 0, n = v.length - 1, pw = Math.pow, bn = Interpolation.Utils.Bernstein, i;
42
42
 
43
43
  for ( i = 0; i <= n; i++ ) {
44
44
  b += pw( 1 - k, n - i ) * pw( k, i ) * v[ i ] * bn( n, i );
@@ -50,7 +50,7 @@ let Interpolation = {
50
50
  /** @ignore */
51
51
  CatmullRom: function ( v, k ) {
52
52
 
53
- var m = v.length - 1, f = m * k, i = Math.floor( f ), fn = Interpolation.Utils.CatmullRom;
53
+ let m = v.length - 1, f = m * k, i = Math.floor( f ), fn = Interpolation.Utils.CatmullRom;
54
54
 
55
55
  if ( v[ 0 ] === v[ m ] ) {
56
56
 
@@ -79,18 +79,18 @@ let Interpolation = {
79
79
  /** @ignore */
80
80
  Bernstein: function ( n, i ) {
81
81
 
82
- var fc = Interpolation.Utils.Factorial;
82
+ let fc = Interpolation.Utils.Factorial;
83
83
  return fc( n ) / fc( i ) / fc( n - i );
84
84
 
85
85
  },
86
86
  /* @ignore */
87
87
  Factorial: ( function () {
88
88
 
89
- var a = [ 1 ];
89
+ let a = [ 1 ];
90
90
 
91
91
  return function ( n ) {
92
92
 
93
- var s = 1, i;
93
+ let s = 1, i;
94
94
  if ( a[ n ] ) return a[ n ];
95
95
  for ( i = n; i > 1; i-- ) s *= i;
96
96
  a[ n ] = s;
@@ -102,7 +102,7 @@ let Interpolation = {
102
102
  /** @ignore */
103
103
  CatmullRom: function ( p0, p1, p2, p3, t ) {
104
104
 
105
- var v0 = ( p2 - p0 ) * 0.5, v1 = ( p3 - p1 ) * 0.5, t2 = t * t, t3 = t * t2;
105
+ let v0 = ( p2 - p0 ) * 0.5, v1 = ( p3 - p1 ) * 0.5, t2 = t * t, t3 = t * t2;
106
106
  return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1;
107
107
  }
108
108
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -89,7 +89,7 @@ import { Interpolation } from './interpolation.js';
89
89
  this.isRenderable = false;
90
90
 
91
91
  // Set all starting values present on the target object
92
- for ( var field in object ) {
92
+ for ( let field in object ) {
93
93
  if (typeof object !== "object") {
94
94
  this._valuesStart[ field ] = parseFloat(object[field]);
95
95
  }
@@ -181,7 +181,7 @@ import { Interpolation } from './interpolation.js';
181
181
 
182
182
  this._startTime = time + this._delayTime;
183
183
 
184
- for ( var property in this._valuesEnd ) {
184
+ for ( let property in this._valuesEnd ) {
185
185
 
186
186
  // check if an Array was provided as property value
187
187
  if ( this._valuesEnd[ property ] instanceof Array ) {
@@ -357,9 +357,9 @@ import { Interpolation } from './interpolation.js';
357
357
  // the original Tween implementation expect
358
358
  // a timestamp and not a time delta
359
359
  this._tweenTimeTracker = (game.lastUpdate > this._tweenTimeTracker) ? game.lastUpdate : this._tweenTimeTracker + dt;
360
- var time = this._tweenTimeTracker;
360
+ let time = this._tweenTimeTracker;
361
361
 
362
- var property;
362
+ let property;
363
363
 
364
364
  if ( time < this._startTime ) {
365
365
 
@@ -379,15 +379,15 @@ import { Interpolation } from './interpolation.js';
379
379
 
380
380
  }
381
381
 
382
- var elapsed = ( time - this._startTime ) / this._duration;
382
+ let elapsed = ( time - this._startTime ) / this._duration;
383
383
  elapsed = elapsed > 1 ? 1 : elapsed;
384
384
 
385
- var value = this._easingFunction( elapsed );
385
+ let value = this._easingFunction( elapsed );
386
386
 
387
387
  for ( property in this._valuesEnd ) {
388
388
 
389
- var start = this._valuesStart[ property ] || 0;
390
- var end = this._valuesEnd[ property ];
389
+ let start = this._valuesStart[ property ] || 0;
390
+ let end = this._valuesEnd[ property ];
391
391
 
392
392
  if ( end instanceof Array ) {
393
393
 
@@ -431,7 +431,7 @@ import { Interpolation } from './interpolation.js';
431
431
  }
432
432
 
433
433
  if (this._yoyo) {
434
- var tmp = this._valuesStartRepeat[ property ];
434
+ let tmp = this._valuesStartRepeat[ property ];
435
435
  this._valuesStartRepeat[ property ] = this._valuesEnd[ property ];
436
436
  this._valuesEnd[ property ] = tmp;
437
437
  }
@@ -457,7 +457,7 @@ import { Interpolation } from './interpolation.js';
457
457
 
458
458
  }
459
459
 
460
- for ( var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i ++ ) {
460
+ for ( let i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i ++ ) {
461
461
 
462
462
  this._chainedTweens[ i ].start( time );
463
463
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -33,11 +33,11 @@ function prefixed(name, obj) {
33
33
  return obj[name];
34
34
  }
35
35
 
36
- var uc_name = capitalize(name);
36
+ let uc_name = capitalize(name);
37
37
 
38
- var result;
38
+ let result;
39
39
  vendors.some((vendor) => {
40
- var name = vendor + uc_name;
40
+ let name = vendor + uc_name;
41
41
  return (result = (name in obj) ? obj[name] : undefined);
42
42
  });
43
43
  return result;
@@ -60,10 +60,10 @@ function setPrefixed(name, value, obj) {
60
60
  return;
61
61
  }
62
62
 
63
- var uc_name = capitalize(name);
63
+ let uc_name = capitalize(name);
64
64
 
65
65
  vendors.some((vendor) => {
66
- var name = vendor + uc_name;
66
+ let name = vendor + uc_name;
67
67
  if (name in obj) {
68
68
  obj[name] = value;
69
69
  return true;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -20,12 +20,12 @@ import { random as random$1, weightedRandom as weightedRandom$1 } from '../math/
20
20
  * @param {Array} arr - array from which to remove an object
21
21
  * @param {object} obj - to be removed
22
22
  * @returns {Array} the modified Array
23
- * var arr = [ "foo", "bar", "baz" ];
23
+ * let arr = [ "foo", "bar", "baz" ];
24
24
  * // remove "foo" from the array
25
25
  * me.utils.array.remove(arr, "foo");
26
26
  */
27
27
  function remove(arr, obj) {
28
- var i = Array.prototype.indexOf.call(arr, obj);
28
+ let i = Array.prototype.indexOf.call(arr, obj);
29
29
  if (i !== -1) {
30
30
  Array.prototype.splice.call(arr, i, 1);
31
31
  }
@@ -41,7 +41,7 @@ function remove(arr, obj) {
41
41
  * @returns {any} random member of array
42
42
  * @example
43
43
  * // Select a random array element
44
- * var arr = [ "foo", "bar", "baz" ];
44
+ * let arr = [ "foo", "bar", "baz" ];
45
45
  * console.log(me.utils.array.random(arr));
46
46
  */
47
47
  function random(arr) {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -41,15 +41,15 @@ function defer(func, thisArg, ...args) {
41
41
  * @returns {Function} the function that will be throttled
42
42
  */
43
43
  function throttle(fn, delay, no_trailing) {
44
- var last = globalThis.performance.now(), deferTimer;
44
+ let last = globalThis.performance.now(), deferTimer;
45
45
  // `no_trailing` defaults to false.
46
46
  if (typeof no_trailing !== "boolean") {
47
47
  no_trailing = false;
48
48
  }
49
49
  return function () {
50
- var now = globalThis.performance.now();
51
- var elasped = now - last;
52
- var args = arguments;
50
+ let now = globalThis.performance.now();
51
+ let elasped = now - last;
52
+ let args = arguments;
53
53
  if (elasped < delay) {
54
54
  if (no_trailing === false) {
55
55
  // hold on to it
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -46,7 +46,7 @@ function isNumeric(str) {
46
46
  * @returns {boolean} true if the string is either true or false
47
47
  */
48
48
  function isBoolean(str) {
49
- var trimmed = str.trim();
49
+ const trimmed = str.trim();
50
50
  return (trimmed === "true") || (trimmed === "false");
51
51
  }
52
52
 
@@ -59,7 +59,7 @@ function isBoolean(str) {
59
59
  * @returns {string} the converted hexadecimal value
60
60
  */
61
61
  function toHex(str) {
62
- var res = "", c = 0;
62
+ let res = "", c = 0;
63
63
  while (c < str.length) {
64
64
  res += str.charCodeAt(c++).toString(16);
65
65
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * melonJS Game Engine - v15.0.0
2
+ * melonJS Game Engine - v15.1.1
3
3
  * http://www.melonjs.org
4
4
  * melonjs is licensed under the MIT License.
5
5
  * http://www.opensource.org/licenses/mit-license
@@ -18,10 +18,10 @@ import * as _function from './function.js';
18
18
  */
19
19
 
20
20
  // guid default value
21
- var GUID_base = "";
22
- var GUID_index = 0;
21
+ let GUID_base = "";
22
+ let GUID_index = 0;
23
23
 
24
- var utils = {
24
+ let utils = {
25
25
 
26
26
  agent : agent,
27
27
  array : array,
@@ -47,12 +47,12 @@ var utils = {
47
47
  * }
48
48
  */
49
49
  checkVersion : function (first, second) {
50
- var a = first.split(".");
51
- var b = second.split(".");
52
- var len = Math.min(a.length, b.length);
53
- var result = 0;
50
+ let a = first.split(".");
51
+ let b = second.split(".");
52
+ let len = Math.min(a.length, b.length);
53
+ let result = 0;
54
54
 
55
- for (var i = 0; i < len; i++) {
55
+ for (let i = 0; i < len; i++) {
56
56
  if ((result = +a[i] - +b[i])) {
57
57
  break;
58
58
  }
@@ -76,15 +76,15 @@ var utils = {
76
76
  * @property {string} [debugToggleKey="s"] show/hide the debug panel (if preloaded)
77
77
  * @example
78
78
  * // http://www.example.com/index.html#debug&hitbox=true&mytag=value
79
- * var UriFragment = me.utils.getUriFragment();
79
+ * let UriFragment = me.utils.getUriFragment();
80
80
  * console.log(UriFragment["mytag"]); //> "value"
81
81
  */
82
82
  getUriFragment : function (url) {
83
- var hash = {};
83
+ let hash = {};
84
84
 
85
85
  if (typeof url === "undefined") {
86
86
  if (typeof globalThis.document !== "undefined") {
87
- var location = globalThis.document.location;
87
+ let location = globalThis.document.location;
88
88
 
89
89
  if (location && location.hash) {
90
90
  url = location.hash;
@@ -98,7 +98,7 @@ var utils = {
98
98
  }
99
99
  } else {
100
100
  // never cache if a url is passed as parameter
101
- var index = url.indexOf("#");
101
+ let index = url.indexOf("#");
102
102
  if (index !== -1) {
103
103
  url = url.slice(index, url.length);
104
104
  } else {
@@ -108,9 +108,9 @@ var utils = {
108
108
 
109
109
  // parse the url
110
110
  url.slice(1).split("&").filter((value) => value !== "").forEach((value) => {
111
- var kv = value.split("=");
112
- var k = kv.shift();
113
- var v = kv.join("=");
111
+ let kv = value.split("=");
112
+ let k = kv.shift();
113
+ let v = kv.join("=");
114
114
  hash[k] = v || true;
115
115
  });
116
116