@oliversalzburg/js-utils 0.0.8 → 0.0.9

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 (139) hide show
  1. package/_site/assets/highlight.css +57 -0
  2. package/_site/assets/main.js +59 -0
  3. package/_site/assets/navigation.js +1 -0
  4. package/_site/assets/search.js +1 -0
  5. package/_site/assets/style.css +1383 -0
  6. package/_site/classes/AbstractError.html +28 -0
  7. package/_site/classes/Canvas.html +44 -0
  8. package/_site/classes/InternalError.html +32 -0
  9. package/_site/classes/InvalidArgumentError.html +28 -0
  10. package/_site/classes/InvalidOperationError.html +28 -0
  11. package/_site/classes/NotImplementedError.html +27 -0
  12. package/_site/classes/PermissionViolationError.html +28 -0
  13. package/_site/classes/Random.html +43 -0
  14. package/_site/classes/RenderLoop.html +30 -0
  15. package/_site/classes/ResourceConflictError.html +27 -0
  16. package/_site/classes/UnexpectedNilError.html +15 -0
  17. package/_site/classes/UnknownError.html +31 -0
  18. package/_site/classes/Vector2.html +113 -0
  19. package/_site/classes/Vector3.html +28 -0
  20. package/_site/functions/addVector2.html +5 -0
  21. package/_site/functions/blend.html +8 -0
  22. package/_site/functions/blendAdditive.html +8 -0
  23. package/_site/functions/blendSubtractive.html +8 -0
  24. package/_site/functions/cosDeg.html +4 -0
  25. package/_site/functions/deg2rad.html +4 -0
  26. package/_site/functions/difference.html +7 -0
  27. package/_site/functions/distance.html +7 -0
  28. package/_site/functions/errorToJSON.html +4 -0
  29. package/_site/functions/errorToRecord.html +4 -0
  30. package/_site/functions/errorToSimpleSerializable.html +4 -0
  31. package/_site/functions/filterType.html +7 -0
  32. package/_site/functions/formatString.html +7 -0
  33. package/_site/functions/formatStringTemplate.html +7 -0
  34. package/_site/functions/fromRGB.html +7 -0
  35. package/_site/functions/fromRGBA.html +7 -0
  36. package/_site/functions/getA.html +4 -0
  37. package/_site/functions/getB.html +4 -0
  38. package/_site/functions/getDocumentElementTypeById.html +9 -0
  39. package/_site/functions/getG.html +4 -0
  40. package/_site/functions/getR.html +4 -0
  41. package/_site/functions/intersect.html +8 -0
  42. package/_site/functions/is.html +7 -0
  43. package/_site/functions/isError.html +4 -0
  44. package/_site/functions/isInteger.html +4 -0
  45. package/_site/functions/isNil.html +5 -0
  46. package/_site/functions/isqrt.html +4 -0
  47. package/_site/functions/multiplyVector2.html +5 -0
  48. package/_site/functions/mustExist.html +6 -0
  49. package/_site/functions/nextPalette.html +2 -0
  50. package/_site/functions/putPixel32.html +7 -0
  51. package/_site/functions/putPixel32Add.html +7 -0
  52. package/_site/functions/putPixel32Sub.html +7 -0
  53. package/_site/functions/putSubPixel32.html +8 -0
  54. package/_site/functions/rad2deg.html +4 -0
  55. package/_site/functions/randomRange.html +6 -0
  56. package/_site/functions/safeRGBComponent.html +4 -0
  57. package/_site/functions/seedFromString.html +5 -0
  58. package/_site/functions/shuffleArray.html +5 -0
  59. package/_site/functions/sinDeg.html +4 -0
  60. package/_site/functions/sleep.html +4 -0
  61. package/_site/functions/somecolor.html +4 -0
  62. package/_site/functions/subtractVector2.html +5 -0
  63. package/_site/functions/toGrayScale.html +4 -0
  64. package/_site/functions/unknownToError.html +6 -0
  65. package/_site/index.html +1 -0
  66. package/_site/modules.html +72 -0
  67. package/_site/types/AnyConstructor.html +2 -0
  68. package/_site/types/AnyFunction.html +2 -0
  69. package/_site/types/ConstructorOf.html +2 -0
  70. package/_site/types/FunctionReturning.html +2 -0
  71. package/_site/types/Maybe.html +2 -0
  72. package/_site/types/Mixin.html +3 -0
  73. package/_site/types/Nil.html +3 -0
  74. package/_site/types/RenderLoopCallback.html +2 -0
  75. package/_site/types/SerializedError.html +2 -0
  76. package/_site/variables/PALETTES.html +2 -0
  77. package/_site/variables/TWO_PI.html +2 -0
  78. package/_site/variables/random-1.html +2 -0
  79. package/lib/array.d.ts +8 -0
  80. package/lib/array.js +8 -0
  81. package/lib/array.js.map +1 -1
  82. package/lib/dom/core.d.ts +3 -2
  83. package/lib/dom/core.js +3 -2
  84. package/lib/dom/core.js.map +1 -1
  85. package/lib/error-serializer.d.ts +12 -6
  86. package/lib/error-serializer.js +10 -5
  87. package/lib/error-serializer.js.map +1 -1
  88. package/lib/errors/AbstractError.d.ts +4 -16
  89. package/lib/errors/AbstractError.js +4 -16
  90. package/lib/errors/AbstractError.js.map +1 -1
  91. package/lib/errors/InternalError.d.ts +6 -5
  92. package/lib/errors/InternalError.js +6 -7
  93. package/lib/errors/InternalError.js.map +1 -1
  94. package/lib/errors/InvalidArgumentError.d.ts +2 -1
  95. package/lib/errors/InvalidArgumentError.js +2 -1
  96. package/lib/errors/InvalidArgumentError.js.map +1 -1
  97. package/lib/errors/InvalidOperationError.d.ts +2 -1
  98. package/lib/errors/InvalidOperationError.js +2 -1
  99. package/lib/errors/InvalidOperationError.js.map +1 -1
  100. package/lib/errors/NotImplementedError.d.ts +2 -1
  101. package/lib/errors/NotImplementedError.js +2 -1
  102. package/lib/errors/NotImplementedError.js.map +1 -1
  103. package/lib/errors/PermissionViolationError.d.ts +2 -1
  104. package/lib/errors/PermissionViolationError.js +2 -1
  105. package/lib/errors/PermissionViolationError.js.map +1 -1
  106. package/lib/errors/ResourceConflictError.d.ts +2 -1
  107. package/lib/errors/ResourceConflictError.js +2 -1
  108. package/lib/errors/ResourceConflictError.js.map +1 -1
  109. package/lib/errors/UnknownError.d.ts +6 -5
  110. package/lib/errors/UnknownError.js +6 -5
  111. package/lib/errors/UnknownError.js.map +1 -1
  112. package/lib/graphics/canvas.d.ts +40 -25
  113. package/lib/graphics/canvas.js +51 -24
  114. package/lib/graphics/canvas.js.map +1 -1
  115. package/lib/graphics/core.d.ts +18 -0
  116. package/lib/graphics/core.js +18 -0
  117. package/lib/graphics/core.js.map +1 -1
  118. package/lib/graphics/render-loop.d.ts +14 -2
  119. package/lib/graphics/render-loop.js +13 -2
  120. package/lib/graphics/render-loop.js.map +1 -1
  121. package/lib/math/core.d.ts +12 -1
  122. package/lib/math/core.js +12 -1
  123. package/lib/math/core.js.map +1 -1
  124. package/lib/math/vector2.d.ts +32 -1
  125. package/lib/math/vector2.js +45 -1
  126. package/lib/math/vector2.js.map +1 -1
  127. package/lib/math/vector3.d.ts +2 -1
  128. package/lib/math/vector3.js +2 -1
  129. package/lib/math/vector3.js.map +1 -1
  130. package/lib/nil.d.ts +1 -0
  131. package/lib/nil.js +1 -0
  132. package/lib/nil.js.map +1 -1
  133. package/lib/random.d.ts +34 -1
  134. package/lib/random.js +160 -2
  135. package/lib/random.js.map +1 -1
  136. package/lib/string-formatter.d.ts +2 -0
  137. package/lib/string-formatter.js +2 -0
  138. package/lib/string-formatter.js.map +1 -1
  139. package/package.json +2 -1
@@ -6,6 +6,7 @@
6
6
  * @param string The input string with placeholders.
7
7
  * @param formatArguments An array of strings to place into the placeholders.
8
8
  * @returns The formatted string.
9
+ * @group Strings
9
10
  */
10
11
  export declare const formatString: (string: string, ...formatArguments: Array<string>) => string;
11
12
  /**
@@ -16,5 +17,6 @@ export declare const formatString: (string: string, ...formatArguments: Array<st
16
17
  * @param string The input string with placeholders.
17
18
  * @param parameters A hash of parameters to place in the placeholders.
18
19
  * @returns The formatted string.
20
+ * @group Strings
19
21
  */
20
22
  export declare const formatStringTemplate: (string: string, parameters: Record<string, string | undefined>) => string;
@@ -6,6 +6,7 @@
6
6
  * @param string The input string with placeholders.
7
7
  * @param formatArguments An array of strings to place into the placeholders.
8
8
  * @returns The formatted string.
9
+ * @group Strings
9
10
  */
10
11
  export const formatString = (string, ...formatArguments) => {
11
12
  return string.replace(/{(\d+)}/g, (match, matchedDigits) => typeof formatArguments[matchedDigits] !== "undefined" ? formatArguments[matchedDigits] : match);
@@ -18,6 +19,7 @@ export const formatString = (string, ...formatArguments) => {
18
19
  * @param string The input string with placeholders.
19
20
  * @param parameters A hash of parameters to place in the placeholders.
20
21
  * @returns The formatted string.
22
+ * @group Strings
21
23
  */
22
24
  export const formatStringTemplate = (string, parameters) => {
23
25
  string = string.replace(/#{[\w.]+}/g, query => parameters[query.slice(2, query.length - 1)] ?? "<missing parameter>");
@@ -1 +1 @@
1
- {"version":3,"file":"string-formatter.js","sourceRoot":"","sources":["../source/string-formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,GAAG,eAA8B,EAAU,EAAE;IACxF,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,aAAqB,EAAU,EAAE,CACzE,OAAO,eAAe,CAAC,aAAa,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAC/F,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAc,EACd,UAA8C,EACtC,EAAE;IACV,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,YAAY,EACZ,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,qBAAqB,CAC/E,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
1
+ {"version":3,"file":"string-formatter.js","sourceRoot":"","sources":["../source/string-formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAc,EAAE,GAAG,eAA8B,EAAU,EAAE;IACxF,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,aAAqB,EAAU,EAAE,CACzE,OAAO,eAAe,CAAC,aAAa,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAC/F,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAc,EACd,UAA8C,EACtC,EAAE;IACV,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,YAAY,EACZ,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,qBAAqB,CAC/E,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@oliversalzburg/js-utils",
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "license": "MIT",
6
6
  "author": "Oliver Salzburg <oliver.salzburg@gmail.com>",
7
7
  "type": "module",
@@ -51,6 +51,7 @@
51
51
  "prettier-package-json": "2.8.0",
52
52
  "prettier-plugin-organize-imports": "3.2.3",
53
53
  "typedoc": "0.25.3",
54
+ "typedoc-plugin-mdn-links": "3.1.0",
54
55
  "typescript": "5.2.2"
55
56
  },
56
57
  "packageManager": "yarn@4.0.1"