Skip to content

Commit 491cf50

Browse files
committed
Update index.js
1 parent b703b60 commit 491cf50

File tree

1 file changed

+2
-40
lines changed

1 file changed

+2
-40
lines changed

src/puter-js/src/index.js

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ export default window.puter = (function() {
329329
this.p_can_request_rao_.resolve();
330330
})();
331331

332-
333332
this.net = {
334333
generateWispV1URL: async () => {
335334
const { token: wispToken, server: wispServer } = (await (await fetch(this.APIOrigin + '/wisp/relay-token/create', {
@@ -348,8 +347,6 @@ export default window.puter = (function() {
348347
},
349348
fetch: pFetch
350349
}
351-
352-
353350
}
354351

355352
/**
@@ -523,43 +520,8 @@ export default window.puter = (function() {
523520
}
524521

525522
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;
563525
}
564526
}
565527
}

0 commit comments

Comments
 (0)