File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,17 @@ exports._codePointAt = function (fallback) {
2424 return function ( str ) {
2525 var length = str . length ;
2626 if ( index < 0 || index >= length ) return Nothing ;
27- if ( hasArrayFrom ) {
28- var cps = Array . from ( str ) ;
29- if ( index >= cps . length ) return Nothing ;
30- return Just ( unsafeCodePointAt0 ( cps [ index ] ) ) ;
31- } else if ( hasStringIterator ) {
27+ if ( hasStringIterator ) {
3228 var iter = str [ Symbol . iterator ] ( ) ;
3329 for ( var i = index ; ; -- i ) {
3430 var o = iter . next ( ) ;
3531 if ( o . done ) return Nothing ;
3632 if ( i === 0 ) return Just ( unsafeCodePointAt0 ( o . value ) ) ;
3733 }
34+ } else if ( hasArrayFrom ) {
35+ var cps = Array . from ( str ) ;
36+ if ( index >= cps . length ) return Nothing ;
37+ return Just ( unsafeCodePointAt0 ( cps [ index ] ) ) ;
3838 }
3939 return fallback ( index ) ( str ) ;
4040 } ;
You can’t perform that action at this time.
0 commit comments