UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

28 lines (22 loc) 670 B
// SPDX-License-Identifier: Apache-2.0 import {type ConfigSource} from '../../data/configuration/spi/config-source.js'; export class Comparators { private constructor() { // Utility class throw new Error('Cannot instantiate utility class'); } public static readonly number: (l: number, r: number) => number = (l: number, r: number): number => { if (l < r) { return -1; } else if (l > r) { return 1; } return 0; }; public static readonly configSource: (l: ConfigSource, r: ConfigSource) => number = ( l: ConfigSource, r: ConfigSource, ): number => { return Comparators.number(l.ordinal, r.ordinal); }; }