@@ -329,7 +329,6 @@ export default window.puter = (function() {
329
329
this . p_can_request_rao_ . resolve ( ) ;
330
330
} ) ( ) ;
331
331
332
-
333
332
this . net = {
334
333
generateWispV1URL : async ( ) => {
335
334
const { token : wispToken , server : wispServer } = ( await ( await fetch ( this . APIOrigin + '/wisp/relay-token/create' , {
@@ -348,8 +347,6 @@ export default window.puter = (function() {
348
347
} ,
349
348
fetch : pFetch
350
349
}
351
-
352
-
353
350
}
354
351
355
352
/**
@@ -523,43 +520,8 @@ export default window.puter = (function() {
523
520
}
524
521
525
522
print = function ( ...args ) {
526
- let container = document . getElementById ( "--puter-printbox" ) ;
527
- if ( ! container ) {
528
- document . body . innerHTML += `<pre><code id="--puter-printbox"></code></pre>`
529
- container = document . getElementById ( "--puter-printbox" ) ;
530
- }
531
-
532
- // Copy args to avoid modifying the original array
533
- let processedArgs = [ ...args ] ;
534
-
535
- // Check if the last argument is an options object
536
- const lastArg = processedArgs . length > 0 ? processedArgs [ processedArgs . length - 1 ] : null ;
537
- let options = { newline : false } ;
538
-
539
- if ( lastArg && typeof lastArg === 'object' && lastArg !== null &&
540
- ! Array . isArray ( lastArg ) &&
541
- Object . getPrototypeOf ( lastArg ) === Object . prototype &&
542
- typeof lastArg . toString === 'undefined' ) {
543
- options = processedArgs . pop ( ) ;
544
- }
545
-
546
- // Process each argument
547
- for ( let arg of processedArgs ) {
548
- // If arg has custom toString, use it
549
- if ( arg && typeof arg === 'object' && typeof arg . toString === 'function' ) {
550
- const stringValue = arg . toString ( ) ;
551
- if ( typeof stringValue === 'string' ) {
552
- container . innerText += stringValue ;
553
- } else {
554
- container . innerText += String ( arg ) ;
555
- }
556
- } else {
557
- container . innerText += arg ;
558
- }
559
-
560
- if ( options . newline ) {
561
- container . innerText += '\n' ;
562
- }
523
+ for ( let arg of args ) {
524
+ document . body . innerHTML += arg ;
563
525
}
564
526
}
565
527
}
0 commit comments