@@ -47,13 +47,13 @@ export function to_string(term) {
47
47
}
48
48
49
49
export function float_to_string ( float ) {
50
- const string = float . toString ( ) . replace ( '+' , '' ) ;
50
+ const string = float . toString ( ) . replace ( "+" , "" ) ;
51
51
if ( string . indexOf ( "." ) >= 0 ) {
52
52
return string ;
53
53
} else {
54
54
const index = string . indexOf ( "e" ) ;
55
55
if ( index >= 0 ) {
56
- return string . slice ( 0 , index ) + '.0' + string . slice ( index ) ;
56
+ return string . slice ( 0 , index ) + ".0" + string . slice ( index ) ;
57
57
} else {
58
58
return string + ".0" ;
59
59
}
@@ -186,7 +186,7 @@ export function pop_grapheme(string) {
186
186
}
187
187
188
188
export function pop_codeunit ( str ) {
189
- return [ str . charCodeAt ( 0 ) | 0 , str . slice ( 1 ) ]
189
+ return [ str . charCodeAt ( 0 ) | 0 , str . slice ( 1 ) ] ;
190
190
}
191
191
192
192
export function lowercase ( string ) {
@@ -256,12 +256,15 @@ export function string_slice(string, idx, len) {
256
256
257
257
return result ;
258
258
} else {
259
- return string . match ( / ./ gsu) . slice ( idx , idx + len ) . join ( "" ) ;
259
+ return string
260
+ . match ( / ./ gsu)
261
+ . slice ( idx , idx + len )
262
+ . join ( "" ) ;
260
263
}
261
264
}
262
265
263
266
export function string_codeunit_slice ( str , from , length ) {
264
- return str . slice ( from , from + length )
267
+ return str . slice ( from , from + length ) ;
265
268
}
266
269
export function crop_string ( string , substring ) {
267
270
return string . substring ( string . indexOf ( substring ) ) ;
@@ -290,7 +293,8 @@ export function split_once(haystack, needle) {
290
293
}
291
294
}
292
295
293
- const unicode_whitespaces = [
296
+ /* @__PURE__ */
297
+ const unicode_whitespaces = /* @__PURE__ */ [
294
298
"\u0020" , // Space
295
299
"\u0009" , // Horizontal tab
296
300
"\u000A" , // Line feed
@@ -302,10 +306,17 @@ const unicode_whitespaces = [
302
306
"\u2029" , // Paragraph separator
303
307
] . join ( "" ) ;
304
308
305
- const trim_start_regex = new RegExp ( `^[${ unicode_whitespaces } ]*` ) ;
306
- const trim_end_regex = new RegExp ( `[${ unicode_whitespaces } ]*$` ) ;
307
- const trim_regex = new RegExp (
308
- `^[${ unicode_whitespaces } ]*(.*?)[${ unicode_whitespaces } ]*$`
309
+ /* @__PURE__ */
310
+ const trim_start_regex = /* @__PURE__ */ new RegExp (
311
+ `^[${ unicode_whitespaces } ]*` ,
312
+ ) ;
313
+ /* @__PURE__ */
314
+ const trim_end_regex = /* @__PURE__ */ new RegExp (
315
+ /* @__PURE__ */ `[${ unicode_whitespaces } ]*$` ,
316
+ ) ;
317
+ /* @__PURE__ */
318
+ const trim_regex = /* @__PURE__ */ new RegExp (
319
+ /* @__PURE__ */ `^[${ unicode_whitespaces } ]*(.*?)[${ unicode_whitespaces } ]*$` ,
309
320
) ;
310
321
311
322
export function trim ( string ) {
@@ -1014,4 +1025,3 @@ export function bit_array_starts_with(bits, prefix) {
1014
1025
1015
1026
return true ;
1016
1027
}
1017
-
0 commit comments