From da2cdb240f1f1211fbd85b48c1a826258c6c968a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 4 Jul 2026 14:53:19 +0800 Subject: [PATCH] Remove unused jsUtils module Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01RaRBJFZKSTA7naHGuQHfnQ --- src/utils/jsUtils.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/utils/jsUtils.js diff --git a/src/utils/jsUtils.js b/src/utils/jsUtils.js deleted file mode 100644 index bd1cac5..0000000 --- a/src/utils/jsUtils.js +++ /dev/null @@ -1,39 +0,0 @@ -// The Lucia project. -// Copyright 2023-2026 DSP, inc. All rights reserved. -// Authors: -// chiayin.kuo@dsp.im (chiayin), 2023/1/31 -// imacat.yang@dsp.im (imacat), 2023/9/23 -// cindy.chang@dsp.im (Cindy Chang), 2024/5/30 -/** @module jsUtils General JavaScript utility functions. */ - -/** - * Recursively prints an object's properties to the console. - * @param {Object} obj - The object to print. - * @param {number} [indent=0] - The current indentation level. - */ -export const printObject = (obj, indent = 0) => { - const padding = " ".repeat(indent); - - for (const key in obj) { - if (obj.hasOwnProperty(key)) { - if (typeof obj[key] === "object" && obj[key] !== null) { - console.log(`${padding}${key}: {`); - printObject(obj[key], indent + 2); - console.log(`${padding}}`); - } else { - console.log(`${padding}${key}: ${obj[key]}`); - } - } - } -}; - -/** - * Returns a cryptographically random integer between 0 and max (inclusive). - * @param {number} max - The upper bound (inclusive). - * @returns {number} A random integer in [0, max]. - */ -export const getRandomInt = (max) => { - const array = new Uint32Array(1); - globalThis.crypto.getRandomValues(array); - return Math.floor((array[0] / (0xffffffff + 1)) * (max + 1)); -};