pinokiod 1.2.55 → 1.2.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,10 @@ class FS {
41
41
  // }
42
42
 
43
43
 
44
+ async link(req, ondata, kernel) {
45
+ let response = await this.share(req, ondata, kernel)
46
+ return response
47
+ }
44
48
 
45
49
  async share(req, ondata, kernel) {
46
50
  /////////////////////////////////////////////////////////////////////////////
@@ -311,7 +315,7 @@ class FS {
311
315
  params := {
312
316
  path: <filepath>,
313
317
  <json|buffer|text>: ___,
314
- delimiter: { // used when the data is an array
318
+ join: { // used when the data is an array
315
319
  <buffer|text>: <example: \n, {{os.EOL}} (default is nothing)>
316
320
  }
317
321
  }
@@ -335,25 +339,23 @@ class FS {
335
339
 
336
340
  // 2. get the data
337
341
  let data = req.params[type]
338
-
339
-
340
- // 3. if array, iterate through the data and append
341
- if (Array.isArray(data)) {
342
- let chunks = data
343
- for(let i=0; i<chunks.length; i++) {
344
- let chunk = chunks[i]
345
-
346
- await this._append(filepath, chunk, type)
347
- // 3.2. if there's a delimiter, append the delimiter (EXCEPT for the last item)
348
- // if (i < chunks.length-1) {
349
- await this._delimit(req, filepath)
350
- // }
351
-
352
- }
353
- } else {
354
- // 4. if not array, just append once
355
- await this._append(filepath, data, type)
356
- }
342
+ await this._append(filepath, data, type)
343
+
344
+
345
+ // // 3. if array, iterate through the data and append
346
+ // if (Array.isArray(data)) {
347
+ // let chunks = data
348
+ // for(let i=0; i<chunks.length; i++) {
349
+ // let chunk = chunks[i]
350
+ //
351
+ // await this._append(filepath, chunk, type)
352
+ // await this._delimit(req, filepath)
353
+ //
354
+ // }
355
+ // } else {
356
+ // // 4. if not array, just append once
357
+ // await this._append(filepath, data, type)
358
+ // }
357
359
 
358
360
  }
359
361
  async write (req, ondata, kernel) {
@@ -361,7 +363,7 @@ class FS {
361
363
  params := {
362
364
  path: <filepath>,
363
365
  <json|buffer|text>: ___,
364
- delimiter: { // used when the data is an array
366
+ join: { // used when the data is an array
365
367
  <buffer|text>: <example: \n, {{os.EOL}} (default is nothing)>
366
368
  }
367
369
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.2.55",
3
+ "version": "1.2.57",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -966,7 +966,7 @@ class Server {
966
966
  }
967
967
 
968
968
  // lib types should not be displayed on the home page
969
- if (config.type === "lib") {
969
+ if (config && config.type === "lib") {
970
970
  continue
971
971
  }
972
972
 
@@ -1,6 +1,6 @@
1
1
  document.addEventListener("click", async (e) => {
2
2
  // [data-filepath] should open in file explorer
3
- let el = e.target.closest("data-filepath")
3
+ let el = e.target.closest("[data-filepath]")
4
4
  if (!el) {
5
5
  let filepath = e.target.getAttribute("data-filepath")
6
6
  if (filepath) {
@@ -119,6 +119,7 @@ header .runner {
119
119
  <% if (ishome) { %>
120
120
  <div class='nav-btns'>
121
121
  <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
122
+ <a class='btn2' data-filepath="<%=filepath%>"><div><i class="fa-regular fa-folder-open"></i></div><div>Files</div></a>
122
123
  <a id='wifi' data-proxy="<%=proxy.proxy%>" class='btn2'><div><i class="fa-solid fa-wifi"></i></div><div>WiFi</div></a>
123
124
  <!--
124
125
  <a class='btn2' href="<%=proxy.proxy%>" target="_blank"><div><i class="fa-solid fa-wifi"></i></div><div>WiFi</div></a>