@quenty/metricutils 2.4.0 → 2.4.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.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/Shared/MetricUtils.lua +18 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.4.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/metricutils@2.4.0...@quenty/metricutils@2.4.1) (2025-03-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/metricutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/metricutils@2.3.0...@quenty/metricutils@2.4.0) (2024-11-12)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/metricutils",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Provides ways to convert to or from metric",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
|
|
31
31
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Provides ways to convert studs to metric and back.
|
|
3
4
|
@class MetricUtils
|
|
@@ -15,9 +16,9 @@ local KPH_TO_MPH = 0.621371192
|
|
|
15
16
|
@param studs number
|
|
16
17
|
@return number -- seconds
|
|
17
18
|
]=]
|
|
18
|
-
function MetricUtils.getSoundDelaySeconds(studs)
|
|
19
|
+
function MetricUtils.getSoundDelaySeconds(studs: number): number
|
|
19
20
|
local meters = MetricUtils.studsToMeters(studs)
|
|
20
|
-
return meters/SPEED_OF_SOUND_IN_METERS_PER_SECOND
|
|
21
|
+
return meters / SPEED_OF_SOUND_IN_METERS_PER_SECOND
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
--[=[
|
|
@@ -25,8 +26,8 @@ end
|
|
|
25
26
|
@param studs number
|
|
26
27
|
@return number -- kilometers
|
|
27
28
|
]=]
|
|
28
|
-
function MetricUtils.studsToKilometers(studs)
|
|
29
|
-
return studs/STUDS_PER_METER/1000
|
|
29
|
+
function MetricUtils.studsToKilometers(studs: number): number
|
|
30
|
+
return studs / STUDS_PER_METER / 1000
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
--[=[
|
|
@@ -34,8 +35,8 @@ end
|
|
|
34
35
|
@param studs number
|
|
35
36
|
@return number -- meters
|
|
36
37
|
]=]
|
|
37
|
-
function MetricUtils.studsToMeters(studs)
|
|
38
|
-
return studs/STUDS_PER_METER
|
|
38
|
+
function MetricUtils.studsToMeters(studs: number): number
|
|
39
|
+
return studs / STUDS_PER_METER
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
--[=[
|
|
@@ -43,8 +44,8 @@ end
|
|
|
43
44
|
@param studsPerSecond number
|
|
44
45
|
@return number -- kph
|
|
45
46
|
]=]
|
|
46
|
-
function MetricUtils.studsPerSecondToKph(studsPerSecond)
|
|
47
|
-
return studsPerSecond/STUDS_PER_METER/1000*SECONDS_PER_HOUR
|
|
47
|
+
function MetricUtils.studsPerSecondToKph(studsPerSecond: number): number
|
|
48
|
+
return studsPerSecond / STUDS_PER_METER / 1000 * SECONDS_PER_HOUR
|
|
48
49
|
end
|
|
49
50
|
|
|
50
51
|
--[=[
|
|
@@ -53,8 +54,8 @@ end
|
|
|
53
54
|
@param studsPerSecond number
|
|
54
55
|
@return number -- kph
|
|
55
56
|
]=]
|
|
56
|
-
function MetricUtils.studsPerSecondToMetersPerSecond(studsPerSecond)
|
|
57
|
-
return studsPerSecond/STUDS_PER_METER
|
|
57
|
+
function MetricUtils.studsPerSecondToMetersPerSecond(studsPerSecond: number): number
|
|
58
|
+
return studsPerSecond / STUDS_PER_METER
|
|
58
59
|
end
|
|
59
60
|
|
|
60
61
|
--[=[
|
|
@@ -62,8 +63,8 @@ end
|
|
|
62
63
|
@param studsPerSecond number
|
|
63
64
|
@return number -- mph
|
|
64
65
|
]=]
|
|
65
|
-
function MetricUtils.studsPerSecondToMph(studsPerSecond)
|
|
66
|
-
return studsPerSecond/STUDS_PER_METER/1000*SECONDS_PER_HOUR*KPH_TO_MPH
|
|
66
|
+
function MetricUtils.studsPerSecondToMph(studsPerSecond: number): number
|
|
67
|
+
return studsPerSecond / STUDS_PER_METER / 1000 * SECONDS_PER_HOUR * KPH_TO_MPH
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
--[=[
|
|
@@ -71,8 +72,8 @@ end
|
|
|
71
72
|
@param kph number
|
|
72
73
|
@return number -- studs per a second
|
|
73
74
|
]=]
|
|
74
|
-
function MetricUtils.kphToStudsPerSecond(kph)
|
|
75
|
-
return kph*STUDS_PER_METER*1000/SECONDS_PER_HOUR
|
|
75
|
+
function MetricUtils.kphToStudsPerSecond(kph: number): number
|
|
76
|
+
return kph * STUDS_PER_METER * 1000 / SECONDS_PER_HOUR
|
|
76
77
|
end
|
|
77
78
|
|
|
78
79
|
--[=[
|
|
@@ -80,8 +81,8 @@ end
|
|
|
80
81
|
@param mph number
|
|
81
82
|
@return number -- studs per a second
|
|
82
83
|
]=]
|
|
83
|
-
function MetricUtils.mphToStudsPerSecond(mph)
|
|
84
|
-
return mph*STUDS_PER_METER*1000/SECONDS_PER_HOUR/KPH_TO_MPH
|
|
84
|
+
function MetricUtils.mphToStudsPerSecond(mph: number): number
|
|
85
|
+
return mph * STUDS_PER_METER * 1000 / SECONDS_PER_HOUR / KPH_TO_MPH
|
|
85
86
|
end
|
|
86
87
|
|
|
87
|
-
return MetricUtils
|
|
88
|
+
return MetricUtils
|