Skip to content

Commit

Permalink
Fix slow types in new namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed Sep 8, 2024
1 parent bd6fa6c commit 3c06200
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/common/all-managed-namespaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CONFIG } from "$common/mod.ts";
* This includes the generic namespaces and the additional managed namespaces.
* @returns all managed namespaces
*/
export function allManagedNamespaces() {
export function allManagedNamespaces(): number[] {
const minGeneric = getMinimumGenericRangeNamespace();
const maxGeneric = getMaximumGenericRangeNamespace();

Expand All @@ -23,7 +23,7 @@ export function allManagedNamespaces() {
* This is the maximum value smaller than the `ASN_NAMESPACE_RANGE` configuration parameter.
* @returns the maximum namespace value for the generic range
*/
function getMaximumGenericRangeNamespace() {
function getMaximumGenericRangeNamespace(): number {
return CONFIG.ASN_NAMESPACE_RANGE - 1;
}

Expand All @@ -33,7 +33,7 @@ function getMaximumGenericRangeNamespace() {
* the `ASN_NAMESPACE_RANGE` configuration parameter.
* @returns the minimum namespace value for the generic range
*/
function getMinimumGenericRangeNamespace() {
function getMinimumGenericRangeNamespace(): number {
return Number.parseInt(
"1" + "0".repeat(CONFIG.ASN_NAMESPACE_RANGE.toString().length - 1),
);
Expand All @@ -47,7 +47,7 @@ function getMinimumGenericRangeNamespace() {
* @param namespace the namespace to check
* @returns `true` if the namespace is managed by the system, `false` otherwise
*/
export function isManagedNamespace(namespace: number) {
export function isManagedNamespace(namespace: number): boolean {
if (namespace < getMinimumGenericRangeNamespace()) {
return false;
}
Expand Down

0 comments on commit 3c06200

Please sign in to comment.