From e4b5091f7216f887ea4c98f79c04702eaba7a64d Mon Sep 17 00:00:00 2001 From: jin Date: Fri, 10 Jan 2025 01:47:50 +0300 Subject: [PATCH] +1 --- emoji/safe/safe.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/emoji/safe/safe.ts b/emoji/safe/safe.ts index db62c735ad9..e212df4dd7d 100644 --- a/emoji/safe/safe.ts +++ b/emoji/safe/safe.ts @@ -1,13 +1,17 @@ namespace $ { - export function $mol_emoji_safe( - this: $ - ): Record< + + let cache = null! as Record< string /*group*/, Record< string /*emoji*/, readonly string[] /*keywords*/ > - > { - return this.$mol_fetch.json( './mol/emoji/safe/safe.json' ) as any + > + + export function $mol_emoji_safe( this: $ ) { + if( cache ) return cache + const uri = './mol/emoji/safe/safe.json' + return cache = this.$mol_fetch.json( uri ) as typeof cache } + }