@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.
- package/_site/assets/highlight.css +57 -0
- package/_site/assets/main.js +59 -0
- package/_site/assets/navigation.js +1 -0
- package/_site/assets/search.js +1 -0
- package/_site/assets/style.css +1383 -0
- package/_site/classes/AbstractError.html +28 -0
- package/_site/classes/Canvas.html +44 -0
- package/_site/classes/InternalError.html +32 -0
- package/_site/classes/InvalidArgumentError.html +28 -0
- package/_site/classes/InvalidOperationError.html +28 -0
- package/_site/classes/NotImplementedError.html +27 -0
- package/_site/classes/PermissionViolationError.html +28 -0
- package/_site/classes/Random.html +43 -0
- package/_site/classes/RenderLoop.html +30 -0
- package/_site/classes/ResourceConflictError.html +27 -0
- package/_site/classes/UnexpectedNilError.html +15 -0
- package/_site/classes/UnknownError.html +31 -0
- package/_site/classes/Vector2.html +113 -0
- package/_site/classes/Vector3.html +28 -0
- package/_site/functions/addVector2.html +5 -0
- package/_site/functions/blend.html +8 -0
- package/_site/functions/blendAdditive.html +8 -0
- package/_site/functions/blendSubtractive.html +8 -0
- package/_site/functions/cosDeg.html +4 -0
- package/_site/functions/deg2rad.html +4 -0
- package/_site/functions/difference.html +7 -0
- package/_site/functions/distance.html +7 -0
- package/_site/functions/errorToJSON.html +4 -0
- package/_site/functions/errorToRecord.html +4 -0
- package/_site/functions/errorToSimpleSerializable.html +4 -0
- package/_site/functions/filterType.html +7 -0
- package/_site/functions/formatString.html +7 -0
- package/_site/functions/formatStringTemplate.html +7 -0
- package/_site/functions/fromRGB.html +7 -0
- package/_site/functions/fromRGBA.html +7 -0
- package/_site/functions/getA.html +4 -0
- package/_site/functions/getB.html +4 -0
- package/_site/functions/getDocumentElementTypeById.html +9 -0
- package/_site/functions/getG.html +4 -0
- package/_site/functions/getR.html +4 -0
- package/_site/functions/intersect.html +8 -0
- package/_site/functions/is.html +7 -0
- package/_site/functions/isError.html +4 -0
- package/_site/functions/isInteger.html +4 -0
- package/_site/functions/isNil.html +5 -0
- package/_site/functions/isqrt.html +4 -0
- package/_site/functions/multiplyVector2.html +5 -0
- package/_site/functions/mustExist.html +6 -0
- package/_site/functions/nextPalette.html +2 -0
- package/_site/functions/putPixel32.html +7 -0
- package/_site/functions/putPixel32Add.html +7 -0
- package/_site/functions/putPixel32Sub.html +7 -0
- package/_site/functions/putSubPixel32.html +8 -0
- package/_site/functions/rad2deg.html +4 -0
- package/_site/functions/randomRange.html +6 -0
- package/_site/functions/safeRGBComponent.html +4 -0
- package/_site/functions/seedFromString.html +5 -0
- package/_site/functions/shuffleArray.html +5 -0
- package/_site/functions/sinDeg.html +4 -0
- package/_site/functions/sleep.html +4 -0
- package/_site/functions/somecolor.html +4 -0
- package/_site/functions/subtractVector2.html +5 -0
- package/_site/functions/toGrayScale.html +4 -0
- package/_site/functions/unknownToError.html +6 -0
- package/_site/index.html +1 -0
- package/_site/modules.html +72 -0
- package/_site/types/AnyConstructor.html +2 -0
- package/_site/types/AnyFunction.html +2 -0
- package/_site/types/ConstructorOf.html +2 -0
- package/_site/types/FunctionReturning.html +2 -0
- package/_site/types/Maybe.html +2 -0
- package/_site/types/Mixin.html +3 -0
- package/_site/types/Nil.html +3 -0
- package/_site/types/RenderLoopCallback.html +2 -0
- package/_site/types/SerializedError.html +2 -0
- package/_site/variables/PALETTES.html +2 -0
- package/_site/variables/TWO_PI.html +2 -0
- package/_site/variables/random-1.html +2 -0
- package/lib/array.d.ts +8 -0
- package/lib/array.js +8 -0
- package/lib/array.js.map +1 -1
- package/lib/dom/core.d.ts +3 -2
- package/lib/dom/core.js +3 -2
- package/lib/dom/core.js.map +1 -1
- package/lib/error-serializer.d.ts +12 -6
- package/lib/error-serializer.js +10 -5
- package/lib/error-serializer.js.map +1 -1
- package/lib/errors/AbstractError.d.ts +4 -16
- package/lib/errors/AbstractError.js +4 -16
- package/lib/errors/AbstractError.js.map +1 -1
- package/lib/errors/InternalError.d.ts +6 -5
- package/lib/errors/InternalError.js +6 -7
- package/lib/errors/InternalError.js.map +1 -1
- package/lib/errors/InvalidArgumentError.d.ts +2 -1
- package/lib/errors/InvalidArgumentError.js +2 -1
- package/lib/errors/InvalidArgumentError.js.map +1 -1
- package/lib/errors/InvalidOperationError.d.ts +2 -1
- package/lib/errors/InvalidOperationError.js +2 -1
- package/lib/errors/InvalidOperationError.js.map +1 -1
- package/lib/errors/NotImplementedError.d.ts +2 -1
- package/lib/errors/NotImplementedError.js +2 -1
- package/lib/errors/NotImplementedError.js.map +1 -1
- package/lib/errors/PermissionViolationError.d.ts +2 -1
- package/lib/errors/PermissionViolationError.js +2 -1
- package/lib/errors/PermissionViolationError.js.map +1 -1
- package/lib/errors/ResourceConflictError.d.ts +2 -1
- package/lib/errors/ResourceConflictError.js +2 -1
- package/lib/errors/ResourceConflictError.js.map +1 -1
- package/lib/errors/UnknownError.d.ts +6 -5
- package/lib/errors/UnknownError.js +6 -5
- package/lib/errors/UnknownError.js.map +1 -1
- package/lib/graphics/canvas.d.ts +40 -25
- package/lib/graphics/canvas.js +51 -24
- package/lib/graphics/canvas.js.map +1 -1
- package/lib/graphics/core.d.ts +18 -0
- package/lib/graphics/core.js +18 -0
- package/lib/graphics/core.js.map +1 -1
- package/lib/graphics/render-loop.d.ts +14 -2
- package/lib/graphics/render-loop.js +13 -2
- package/lib/graphics/render-loop.js.map +1 -1
- package/lib/math/core.d.ts +12 -1
- package/lib/math/core.js +12 -1
- package/lib/math/core.js.map +1 -1
- package/lib/math/vector2.d.ts +32 -1
- package/lib/math/vector2.js +45 -1
- package/lib/math/vector2.js.map +1 -1
- package/lib/math/vector3.d.ts +2 -1
- package/lib/math/vector3.js +2 -1
- package/lib/math/vector3.js.map +1 -1
- package/lib/nil.d.ts +1 -0
- package/lib/nil.js +1 -0
- package/lib/nil.js.map +1 -1
- package/lib/random.d.ts +34 -1
- package/lib/random.js +160 -2
- package/lib/random.js.map +1 -1
- package/lib/string-formatter.d.ts +2 -0
- package/lib/string-formatter.js +2 -0
- package/lib/string-formatter.js.map +1 -1
- 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;
|
package/lib/string-formatter.js
CHANGED
|
@@ -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
|
|
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.
|
|
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"
|