File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 11/** i18next polyfill to handle intl format for pluralization. For more info see https://www.i18next.com/misc/json-format#i-18-next-json-v4 */
22import 'intl-pluralrules' ;
3+ import './polyfills' ;
34
45export * from './components' ;
56export * from './hooks' ;
Original file line number Diff line number Diff line change 1+ ( function ( ) {
2+ if ( ! Array . prototype . at ) {
3+ // eslint-disable-next-line no-extend-native
4+ Object . defineProperty ( Array . prototype , 'at' , {
5+ configurable : true ,
6+ enumerable : false ,
7+ value : function at ( index : number ) {
8+ // Convert to integer if index is not provided
9+ const len = this . length ;
10+ let relativeIndex = Number ( index ) || 0 ;
11+
12+ // Handle negative indices
13+ if ( relativeIndex < 0 ) {
14+ relativeIndex += len ;
15+ }
16+
17+ // Return undefined if index is out of bounds
18+ if ( relativeIndex < 0 || relativeIndex >= len ) {
19+ return undefined ;
20+ }
21+
22+ // Return the element at the calculated index
23+ return this [ relativeIndex ] ;
24+ } ,
25+ writable : true ,
26+ } ) ;
27+ }
28+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments