@putkoff/abstract-utilities 1.0.26 → 1.0.27
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/dist/cjs/index.js +19 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +17 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/types/functions/auth_utils/imports.d.ts +0 -0
- package/dist/types/functions/auth_utils/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/token_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/imports.d.ts +0 -0
- package/dist/types/functions/config_utils/index.d.ts +0 -0
- package/dist/types/functions/config_utils/src/config_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/src/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/constants.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/imports.d.ts +0 -0
- package/dist/types/functions/env_utils/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/window_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/imports.d.ts +0 -0
- package/dist/types/functions/fetch_utils/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/fetch_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/url_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/index.d.ts +0 -0
- package/dist/types/functions/math_utils/constants.d.ts +3 -0
- package/dist/types/functions/math_utils/conversions.d.ts +0 -0
- package/dist/types/functions/math_utils/index.d.ts +0 -0
- package/dist/types/functions/math_utils/safe_math.d.ts +0 -0
- package/dist/types/functions/path_utils/imports.d.ts +0 -0
- package/dist/types/functions/path_utils/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/base_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/function_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/misc_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/path_utils.d.ts +0 -0
- package/dist/types/functions/path_utils/src/paths.d.ts +0 -0
- package/dist/types/functions/path_utils/src/src_dirs.d.ts +0 -0
- package/dist/types/functions/read_utils/imports.d.ts +0 -0
- package/dist/types/functions/read_utils/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/rndm_utils/imports.d.ts +0 -0
- package/dist/types/functions/rndm_utils/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/safe_utils/imports.d.ts +0 -0
- package/dist/types/functions/safe_utils/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_document.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_globals.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_storage.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_window.d.ts +0 -0
- package/dist/types/functions/string_utils/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/string_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/clean_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/ensure_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/src/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/json_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/mime_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/type_utils.d.ts +0 -0
- package/dist/types/functions/ui_utils/imports.d.ts +0 -0
- package/dist/types/functions/ui_utils/index.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/button.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/checkbox.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/index.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/input.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/spinner.d.ts +0 -0
- package/dist/types/functions/variable_utils/imports.d.ts +0 -0
- package/dist/types/functions/variable_utils/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/variable_utils.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/types/index.d.ts +0 -0
- package/dist/types/types/src/ChangePassword.d.ts +0 -0
- package/dist/types/types/src/Files.d.ts +0 -0
- package/dist/types/types/src/index.d.ts +0 -0
- package/dist/types/types/src/login.d.ts +0 -0
- package/dist/types/types/src/logout.d.ts +0 -0
- package/dist/types/types/src/utils.d.ts +0 -0
- package/dist/types/utils/imports.d.ts +0 -0
- package/dist/types/utils/index.d.ts +0 -0
- package/dist/types/utils/src/Input.d.ts +0 -0
- package/dist/types/utils/src/config.d.ts +0 -0
- package/dist/types/utils/src/index.d.ts +0 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2023,6 +2023,7 @@ function exponential(i, k) {
|
|
|
2023
2023
|
return i * (10 ** (k));
|
|
2024
2024
|
}
|
|
2025
2025
|
|
|
2026
|
+
// Time
|
|
2026
2027
|
const SECOND = 1;
|
|
2027
2028
|
const ZEPTOSECOND = exponential(SECOND, -21);
|
|
2028
2029
|
const ATTOSECOND = exponential(SECOND, -18);
|
|
@@ -2033,14 +2034,19 @@ const MICROSECOND = exponential(SECOND, -6);
|
|
|
2033
2034
|
const MILISECOND = exponential(SECOND, -3);
|
|
2034
2035
|
const CENTISECOND = exponential(SECOND, -2);
|
|
2035
2036
|
const DECISECOND = exponential(SECOND, -1);
|
|
2036
|
-
const MINUTE =
|
|
2037
|
-
const HOUR =
|
|
2038
|
-
const DAY =
|
|
2039
|
-
const YEAR =
|
|
2037
|
+
const MINUTE = 60 * SECOND;
|
|
2038
|
+
const HOUR = 60 * MINUTE;
|
|
2039
|
+
const DAY = 24 * HOUR;
|
|
2040
|
+
const YEAR = 365 * DAY;
|
|
2040
2041
|
const MONTH = YEAR / 12;
|
|
2042
|
+
// Derived: explicit names
|
|
2043
|
+
const SECONDS_PER_MINUTE = MINUTE;
|
|
2044
|
+
const SECONDS_PER_HOUR = HOUR;
|
|
2045
|
+
const SECONDS_PER_DAY = DAY;
|
|
2041
2046
|
//math
|
|
2042
2047
|
const PI = Math.PI;
|
|
2043
2048
|
const PI2 = 2 * PI;
|
|
2049
|
+
// Distance
|
|
2044
2050
|
const M_IN_KM = 1000;
|
|
2045
2051
|
const M_IN_MI = 1609.34;
|
|
2046
2052
|
const M_IN_FT = 0.3048;
|
|
@@ -2055,12 +2061,13 @@ const MONTH_IN_S = 1 / MONTH;
|
|
|
2055
2061
|
const MiPerH_TO_MPerS = M_IN_MI * HOUR_IN_S;
|
|
2056
2062
|
const MPerS_TO_MiPerH = 1 / MiPerH_TO_MPerS;
|
|
2057
2063
|
|
|
2064
|
+
// Conversion helpers
|
|
2058
2065
|
const toMeters = (v, unit) => {
|
|
2059
2066
|
switch (unit) {
|
|
2060
2067
|
case 'km': return v * M_IN_KM;
|
|
2061
2068
|
case 'mi': return v * M_IN_MI;
|
|
2062
2069
|
case 'ft': return v * M_IN_FT;
|
|
2063
|
-
default: return v;
|
|
2070
|
+
default: return v; // meters
|
|
2064
2071
|
}
|
|
2065
2072
|
};
|
|
2066
2073
|
const toSeconds = (v, unit) => {
|
|
@@ -2073,10 +2080,10 @@ const toSeconds = (v, unit) => {
|
|
|
2073
2080
|
};
|
|
2074
2081
|
const fromMeters = (d, unit) => {
|
|
2075
2082
|
switch (unit) {
|
|
2076
|
-
case 'km': return d
|
|
2077
|
-
case 'mi': return d
|
|
2078
|
-
case 'ft': return d
|
|
2079
|
-
default: return d;
|
|
2083
|
+
case 'km': return d / M_IN_KM;
|
|
2084
|
+
case 'mi': return d / M_IN_MI;
|
|
2085
|
+
case 'ft': return d / M_IN_FT;
|
|
2086
|
+
default: return d; // meters
|
|
2080
2087
|
}
|
|
2081
2088
|
};
|
|
2082
2089
|
const velocityToMs = (value, unit) => {
|
|
@@ -2298,6 +2305,9 @@ exports.PICOSECOND = PICOSECOND;
|
|
|
2298
2305
|
exports.PROD_PREFIX = PROD_PREFIX;
|
|
2299
2306
|
exports.PROTOCOL = PROTOCOL;
|
|
2300
2307
|
exports.SECOND = SECOND;
|
|
2308
|
+
exports.SECONDS_PER_DAY = SECONDS_PER_DAY;
|
|
2309
|
+
exports.SECONDS_PER_HOUR = SECONDS_PER_HOUR;
|
|
2310
|
+
exports.SECONDS_PER_MINUTE = SECONDS_PER_MINUTE;
|
|
2301
2311
|
exports.SUB_DIR = SUB_DIR;
|
|
2302
2312
|
exports.Spinner = Spinner;
|
|
2303
2313
|
exports.YEAR = YEAR;
|