File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ exports._fromCodePointArray = function (singleton) {
8080 }
8181 return cps . map ( singleton ) . join ( "" ) ;
8282 }
83- : function ( cps ) { return cps . map ( singleton ) . join ( "" ) ; } ;
83+ : function ( cps ) {
84+ return cps . map ( singleton ) . join ( "" ) ;
85+ } ;
8486} ;
8587
8688exports . _singleton = function ( fallback ) {
@@ -89,11 +91,7 @@ exports._singleton = function (fallback) {
8991
9092exports . _take = function ( fallback ) {
9193 return function ( n ) {
92- if ( hasArrayFrom ) {
93- return function ( str ) {
94- return Array . from ( str ) . slice ( 0 , Math . max ( 0 , n ) ) . join ( "" ) ;
95- } ;
96- } else if ( hasStringIterator ) {
94+ if ( hasStringIterator ) {
9795 return function ( str ) {
9896 var accum = "" ;
9997 var iter = str [ Symbol . iterator ] ( ) ;
@@ -115,16 +113,6 @@ exports._toCodePointArray = function (fallback) {
115113 return function ( str ) {
116114 return Array . from ( str , unsafeCodePointAt0 ) ;
117115 } ;
118- } else if ( hasStringIterator ) {
119- return function ( str ) {
120- var accum = [ ] ;
121- var iter = str [ Symbol . iterator ] ( ) ;
122- for ( ; ; ) {
123- var o = iter . next ( ) ;
124- if ( o . done ) return accum ;
125- accum . push ( unsafeCodePointAt0 ( o . value ) ) ;
126- }
127- } ;
128116 }
129117 return fallback ;
130118 } ;
You can’t perform that action at this time.
0 commit comments