From 8f41932c8f1f0cb5aab222915c47bb1eae23c2c6 Mon Sep 17 00:00:00 2001 From: Evan Hahn <me@evanhahn.com> Date: Thu, 19 Sep 2024 18:00:23 +0000 Subject: [PATCH] chore: remove unused utils `utils.js` exported `idToKey` and `parseVersion`, neither of which are used anywhere. This removes them. --- src/utils.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/utils.js b/src/utils.js index d1ee17b70..da310a1a2 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,4 +1,3 @@ -import b4a from 'b4a' import sodium from 'sodium-universal' import { keyToPublicId } from '@mapeo/crypto' import { createHash } from 'node:crypto' @@ -6,18 +5,6 @@ import stableStringify from 'json-stable-stringify' const PROJECT_INVITE_ID_SALT = Buffer.from('mapeo project invite id', 'ascii') -/** - * @param {String|Buffer} id - * @returns {Buffer | Uint8Array} - */ -export function idToKey(id) { - if (b4a.isBuffer(id)) { - return /** @type {Buffer} */ (id) - } - - return b4a.from(/** @type {String} */ (id), 'hex') -} - /** * * @param {Buffer|String} key @@ -31,18 +18,6 @@ export function keyToId(key) { return key.toString('hex') } -/** - * @param {String} version - * @returns {{coreId: String, blockIndex: Number}} - */ -export function parseVersion(version) { - const [coreId, blockIndex] = version.split('@') - return { - coreId, - blockIndex: Number(blockIndex), - } -} - export class ExhaustivenessError extends Error { /** @param {never} value */ constructor(value) {