Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: migrate object.js to typescript (#2161)

Abdulrehman-Jaferb6a3394dee66
diff --git a/apps/web/src/utils/object.js b/apps/web/src/utils/object.ts
similarity index 88%
rename from apps/web/src/utils/object.js
rename to apps/web/src/utils/object.ts
index add01f28f..16164d3b2 100644
--- a/apps/web/src/utils/object.js
+++ b/apps/web/src/utils/object.ts
@@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-export function objectMap(obj, fn) {
+export function objectMap<T, U>(
+ obj: Record<string, T>,
+ fn: (k: string, v: T, i: number) => U
+) {
return Object.entries(obj).map(([k, v], i) => fn(k, v, i));
}