@@ -374,7 +374,7 @@ export function createComposer(
374374
375375 // runtime context
376376 let _context : RuntimeContext // eslint-disable-line prefer-const
377- const getRuntimeContext = ( ) : RuntimeContext => {
377+ function getRuntimeContext ( ) : RuntimeContext {
378378 return createRuntimeContext ( {
379379 locale : _locale . value ,
380380 fallbackLocale : _fallbackLocale . value ,
@@ -442,9 +442,9 @@ export function createComposer(
442442 isFunction ( _postTranslation ) ? _postTranslation : null
443443
444444 // setPostTranslationHandler
445- const setPostTranslationHandler = (
445+ function setPostTranslationHandler (
446446 handler : PostTranslationHandler | null
447- ) : void => {
447+ ) : void {
448448 _postTranslation = handler
449449 _context . postTranslation = handler
450450 }
@@ -453,22 +453,22 @@ export function createComposer(
453453 const getMissingHandler = ( ) : MissingHandler | null => _missing
454454
455455 // setMissingHandler
456- const setMissingHandler = ( handler : MissingHandler | null ) : void => {
456+ function setMissingHandler ( handler : MissingHandler | null ) : void {
457457 if ( handler !== null ) {
458458 _runtimeMissing = defineRuntimeMissingHandler ( handler )
459459 }
460460 _missing = handler
461461 _context . missing = _runtimeMissing
462462 }
463463
464- const defineComputed = < T > (
464+ function defineComputed < T > (
465465 fn : ( context : RuntimeContext ) => unknown ,
466466 argumentParser : ( ) => string ,
467467 warnType : string ,
468468 fallbackSuccess : ( root : Composer & ComposerInternal ) => T ,
469469 fallbackFail : ( key : string ) => T ,
470470 successCondition : ( val : unknown ) => boolean
471- ) : ComputedRef < T > => {
471+ ) : ComputedRef < T > {
472472 // NOTE:
473473 // if this composer is global (__root is `undefined`), add dependency trakcing!
474474 // by containing this, we can reactively notify components that reference the global composer.
@@ -503,7 +503,7 @@ export function createComposer(
503503 }
504504
505505 // t
506- const t = ( ...args : unknown [ ] ) : string => {
506+ function t ( ...args : unknown [ ] ) : string {
507507 return defineComputed < string > (
508508 context => translate ( context , ...args ) ,
509509 ( ) => parseTranslateArgs ( ...args ) [ 0 ] ,
@@ -515,7 +515,7 @@ export function createComposer(
515515 }
516516
517517 // d
518- const d = ( ...args : unknown [ ] ) : string => {
518+ function d ( ...args : unknown [ ] ) : string {
519519 return defineComputed < string > (
520520 context => datetime ( context , ...args ) ,
521521 ( ) => parseDateTimeArgs ( ...args ) [ 0 ] ,
@@ -527,7 +527,7 @@ export function createComposer(
527527 }
528528
529529 // n
530- const n = ( ...args : unknown [ ] ) : string => {
530+ function n ( ...args : unknown [ ] ) : string {
531531 return defineComputed < string > (
532532 context => number ( context , ...args ) ,
533533 ( ) => parseNumberArgs ( ...args ) [ 0 ] ,
@@ -539,7 +539,7 @@ export function createComposer(
539539 }
540540
541541 // for custom processor
542- const normalize = ( values : unknown [ ] ) : unknown => {
542+ function normalize ( values : unknown [ ] ) : unknown {
543543 return values . map ( val =>
544544 isString ( val ) ? createVNode ( Text , null , val , 0 ) : val
545545 )
@@ -552,7 +552,7 @@ export function createComposer(
552552 } as MessageProcessor
553553
554554 // __transrateVNode, using for `i18n-t` component
555- const __transrateVNode = ( ...args : unknown [ ] ) : unknown => {
555+ function __transrateVNode ( ...args : unknown [ ] ) : unknown {
556556 return defineComputed < unknown > (
557557 context => {
558558 let ret : unknown
@@ -573,9 +573,7 @@ export function createComposer(
573573 }
574574
575575 // __numberParts, using for `i18n-n` component
576- const __numberParts = (
577- ...args : unknown [ ]
578- ) : string | Intl . NumberFormatPart [ ] => {
576+ function __numberParts ( ...args : unknown [ ] ) : string | Intl . NumberFormatPart [ ] {
579577 return defineComputed < string | Intl . NumberFormatPart [ ] > (
580578 context => number ( context , ...args ) ,
581579 ( ) => parseNumberArgs ( ...args ) [ 0 ] ,
@@ -587,9 +585,9 @@ export function createComposer(
587585 }
588586
589587 // __datetimeParts, using for `i18n-d` component
590- const __datetimeParts = (
588+ function __datetimeParts (
591589 ...args : unknown [ ]
592- ) : string | Intl . DateTimeFormatPart [ ] => {
590+ ) : string | Intl . DateTimeFormatPart [ ] {
593591 return defineComputed < string | Intl . DateTimeFormatPart [ ] > (
594592 context => datetime ( context , ...args ) ,
595593 ( ) => parseDateTimeArgs ( ...args ) [ 0 ] ,
@@ -605,13 +603,13 @@ export function createComposer(
605603 _messages . value [ locale ] || { }
606604
607605 // setLocaleMessage
608- const setLocaleMessage = ( locale : Locale , message : LocaleMessage ) : void => {
606+ function setLocaleMessage ( locale : Locale , message : LocaleMessage ) : void {
609607 _messages . value [ locale ] = message
610608 _context . messages = _messages . value
611609 }
612610
613611 // mergeLocaleMessage
614- const mergeLocaleMessage = ( locale : Locale , message : LocaleMessage ) : void => {
612+ function mergeLocaleMessage ( locale : Locale , message : LocaleMessage ) : void {
615613 _messages . value [ locale ] = Object . assign (
616614 _messages . value [ locale ] || { } ,
617615 message
@@ -624,17 +622,14 @@ export function createComposer(
624622 _datetimeFormats . value [ locale ] || { }
625623
626624 // setDateTimeFormat
627- const setDateTimeFormat = ( locale : Locale , format : DateTimeFormat ) : void => {
625+ function setDateTimeFormat ( locale : Locale , format : DateTimeFormat ) : void {
628626 _datetimeFormats . value [ locale ] = format
629627 _context . datetimeFormats = _datetimeFormats . value
630628 clearDateTimeFormat ( _context , locale , format )
631629 }
632630
633631 // mergeDateTimeFormat
634- const mergeDateTimeFormat = (
635- locale : Locale ,
636- format : DateTimeFormat
637- ) : void => {
632+ function mergeDateTimeFormat ( locale : Locale , format : DateTimeFormat ) : void {
638633 _datetimeFormats . value [ locale ] = Object . assign (
639634 _datetimeFormats . value [ locale ] || { } ,
640635 format
@@ -648,14 +643,14 @@ export function createComposer(
648643 _numberFormats . value [ locale ] || { }
649644
650645 // setNumberFormat
651- const setNumberFormat = ( locale : Locale , format : NumberFormat ) : void => {
646+ function setNumberFormat ( locale : Locale , format : NumberFormat ) : void {
652647 _numberFormats . value [ locale ] = format
653648 _context . numberFormats = _numberFormats . value
654649 clearNumberFormat ( _context , locale , format )
655650 }
656651
657652 // mergeNumberFormat
658- const mergeNumberFormat = ( locale : Locale , format : NumberFormat ) : void => {
653+ function mergeNumberFormat ( locale : Locale , format : NumberFormat ) : void {
659654 _numberFormats . value [ locale ] = Object . assign (
660655 _numberFormats . value [ locale ] || { } ,
661656 format
0 commit comments