w-ftp 1.0.5 → 1.0.7

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.
package/docs/index.html CHANGED
@@ -14,6 +14,7 @@
14
14
  <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
15
  <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
16
  <script src="scripts/nav.js" defer></script>
17
+
17
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
19
  </head>
19
20
  <body>
@@ -27,7 +28,9 @@
27
28
 
28
29
  <nav >
29
30
 
30
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#conn">conn</a></li><li><a href="global.html#download">download</a></li><li><a href="global.html#isFile">isFile</a></li><li><a href="global.html#isFolder">isFolder</a></li><li><a href="global.html#ls">ls</a></li><li><a href="global.html#quit">quit</a></li><li><a href="global.html#stateFile">stateFile</a></li><li><a href="global.html#syncToLocal">syncToLocal</a></li><li><a href="global.html#syncToRemote">syncToRemote</a></li><li><a href="global.html#upload">upload</a></li><li><a href="global.html#WFtp">WFtp</a></li></ul>
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WFtp">WFtp</a></li><li><a href="global.html#conn">conn</a></li><li><a href="global.html#download">download</a></li><li><a href="global.html#isFile">isFile</a></li><li><a href="global.html#isFolder">isFolder</a></li><li><a href="global.html#ls">ls</a></li><li><a href="global.html#quit">quit</a></li><li><a href="global.html#stateFile">stateFile</a></li><li><a href="global.html#syncToLocal">syncToLocal</a></li><li><a href="global.html#syncToRemote">syncToRemote</a></li><li><a href="global.html#upload">upload</a></li></ul>
33
+
31
34
  </nav>
32
35
 
33
36
  <div id="main">
@@ -68,7 +71,7 @@
68
71
  <br class="clear">
69
72
 
70
73
  <footer>
71
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Sep 03 2022 15:35:03 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Mar 29 2023 12:23:37 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
72
75
  </footer>
73
76
 
74
77
  <script>prettyPrint();</script>
@@ -14,6 +14,7 @@
14
14
  <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
15
  <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
16
  <script src="scripts/nav.js" defer></script>
17
+
17
18
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
19
  </head>
19
20
  <body>
@@ -27,7 +28,9 @@
27
28
 
28
29
  <nav >
29
30
 
30
- <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#conn">conn</a></li><li><a href="global.html#download">download</a></li><li><a href="global.html#isFile">isFile</a></li><li><a href="global.html#isFolder">isFolder</a></li><li><a href="global.html#ls">ls</a></li><li><a href="global.html#quit">quit</a></li><li><a href="global.html#stateFile">stateFile</a></li><li><a href="global.html#syncToLocal">syncToLocal</a></li><li><a href="global.html#syncToRemote">syncToRemote</a></li><li><a href="global.html#upload">upload</a></li><li><a href="global.html#WFtp">WFtp</a></li></ul>
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WFtp">WFtp</a></li><li><a href="global.html#conn">conn</a></li><li><a href="global.html#download">download</a></li><li><a href="global.html#isFile">isFile</a></li><li><a href="global.html#isFolder">isFolder</a></li><li><a href="global.html#ls">ls</a></li><li><a href="global.html#quit">quit</a></li><li><a href="global.html#stateFile">stateFile</a></li><li><a href="global.html#syncToLocal">syncToLocal</a></li><li><a href="global.html#syncToRemote">syncToRemote</a></li><li><a href="global.html#upload">upload</a></li></ul>
33
+
31
34
  </nav>
32
35
 
33
36
  <div id="main">
@@ -916,7 +919,7 @@ module.exports = Ftp
916
919
  <br class="clear">
917
920
 
918
921
  <footer>
919
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Sep 03 2022 15:35:03 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
922
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Wed Mar 29 2023 12:23:37 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
920
923
  </footer>
921
924
 
922
925
  <script>prettyPrint();</script>
@@ -1,15 +1,34 @@
1
1
  function hideAllButCurrent(){
2
2
  //by default all submenut items are hidden
3
3
  //but we need to rehide them for search
4
+ document.querySelectorAll("nav > ul").forEach(function(parent) {
5
+ if (parent.className.indexOf("collapse_top") !== -1) {
6
+ parent.style.display = "none";
7
+ }
8
+ });
4
9
  document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
5
10
  parent.style.display = "none";
6
11
  });
12
+ document.querySelectorAll("nav > h3").forEach(function(section) {
13
+ if (section.className.indexOf("collapsed_header") !== -1) {
14
+ section.addEventListener("click", function(){
15
+ if (section.nextSibling.style.display === "none") {
16
+ section.nextSibling.style.display = "block";
17
+ } else {
18
+ section.nextSibling.style.display = "none";
19
+ }
20
+ });
21
+ }
22
+ });
7
23
 
8
24
  //only current page (if it exists) should be opened
9
25
  var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
10
26
  document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
11
27
  var href = parent.attributes.href.value.replace(/\.html/, '');
12
28
  if (file === href) {
29
+ if (parent.parentNode.parentNode.className.indexOf("collapse_top") !== -1) {
30
+ parent.parentNode.parentNode.style.display = "block";
31
+ }
13
32
  parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
14
33
  elem.style.display = "block";
15
34
  });
@@ -0,0 +1,28 @@
1
+ if (typeof fetch === 'function') {
2
+ const init = () => {
3
+ if (typeof scrollToNavItem !== 'function') return false
4
+ scrollToNavItem()
5
+ // hideAllButCurrent not always loaded
6
+ if (typeof hideAllButCurrent === 'function') hideAllButCurrent()
7
+ return true
8
+ }
9
+ fetch('./nav.inc.html')
10
+ .then(response => response.ok ? response.text() : `${response.url} => ${response.status} ${response.statusText}`)
11
+ .then(body => {
12
+ document.querySelector('nav').innerHTML += body
13
+ // nav.js should be quicker to load than nav.inc.html, a fallback just in case
14
+ return init()
15
+ })
16
+ .then(done => {
17
+ if (done) return
18
+ let i = 0
19
+ ;(function waitUntilNavJs () {
20
+ if (init()) return
21
+ if (i++ < 100) return setTimeout(waitUntilNavJs, 300)
22
+ console.error(Error('nav.js not loaded after 30s waiting for it'))
23
+ })()
24
+ })
25
+ .catch(error => console.error(error))
26
+ } else {
27
+ console.error(Error('Browser too old to display commonNav (remove commonNav docdash option)'))
28
+ }
@@ -33,6 +33,9 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
33
33
  document.querySelectorAll("nav > ul > li").forEach(function(elem) {
34
34
  elem.style.display = "block";
35
35
  });
36
+ document.querySelectorAll("nav > ul").forEach(function(elem) {
37
+ elem.style.display = "block";
38
+ });
36
39
  //hide all results
37
40
  document.querySelectorAll("nav > ul > li > ul li").forEach(function(elem) {
38
41
  elem.style.display = "none";
@@ -79,5 +82,18 @@ document.getElementById("nav-search").addEventListener("keyup", function(event)
79
82
  parent.style.display = "none";
80
83
  }
81
84
  });
85
+ document.querySelectorAll("nav > ul.collapse_top").forEach(function(parent) {
86
+ var countVisible = 0;
87
+ parent.querySelectorAll("li").forEach(function(elem) {
88
+ if (elem.style.display !== "none") {
89
+ countVisible++;
90
+ }
91
+ });
92
+
93
+ if (countVisible == 0) {
94
+ //has no child at all and does not contain text
95
+ parent.style.display = "none";
96
+ }
97
+ });
82
98
  }
83
99
  });
@@ -162,12 +162,19 @@ h6 {
162
162
  }
163
163
 
164
164
 
165
- tt, code, kbd, samp {
165
+ tt, code, kbd, samp, pre {
166
166
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
167
167
  background: #f4f4f4;
168
+ }
169
+
170
+ tt, code, kbd, samp{
168
171
  padding: 1px 5px;
169
172
  }
170
173
 
174
+ pre {
175
+ padding-bottom: 1em;
176
+ }
177
+
171
178
  .class-description {
172
179
  font-size: 130%;
173
180
  line-height: 140%;
@@ -242,6 +249,10 @@ nav h3 {
242
249
  color: #000;
243
250
  }
244
251
 
252
+ nav h3.collapsed_header {
253
+ cursor: pointer;
254
+ }
255
+
245
256
  nav ul {
246
257
  font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
247
258
  font-size: 100%;
@@ -762,4 +773,4 @@ html[data-search-mode] .level-hide {
762
773
  font-weight: 300;
763
774
  font-style: normal;
764
775
 
765
- }
776
+ }
@@ -76,4 +76,5 @@
76
76
  ol.linenums {
77
77
  margin-top: 0;
78
78
  margin-bottom: 0;
79
+ padding-bottom: 2px;
79
80
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "w-ftp",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "main": "dist/w-ftp.umd.js",
5
5
  "dependencies": {
6
- "dayjs": "^1.11.5",
6
+ "dayjs": "^1.11.7",
7
7
  "debug": "^4.3.4",
8
8
  "ftp-response-parser": "^1.0.1",
9
9
  "lodash": "^4.17.21",
@@ -11,10 +11,10 @@
11
11
  "parse-listing": "^1.1.3",
12
12
  "stream-combiner": "^0.2.2",
13
13
  "unorm": "^1.6.0",
14
- "wsemi": "^1.6.78"
14
+ "wsemi": "^1.7.1"
15
15
  },
16
16
  "devDependencies": {
17
- "w-package-tools": "^1.0.66"
17
+ "w-package-tools": "^1.0.68"
18
18
  },
19
19
  "scripts": {
20
20
  "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
package/src/WFtp.mjs CHANGED
@@ -665,7 +665,7 @@ function WFtp() {
665
665
 
666
666
  //timeLimit
667
667
  let t = setTimeout(() => {
668
- pm.reject(`timeout[${timeLimit}]`)
668
+ pm.reject(`ftpLs timeout[${timeLimit}]`)
669
669
  }, timeLimit)
670
670
 
671
671
  Ftp.ls(fdRemote, (err, res) => {
@@ -711,7 +711,7 @@ function WFtp() {
711
711
  //clear
712
712
  Ftp = null
713
713
 
714
- pm.reject(`timeout[${timeLimit}]`)
714
+ pm.reject(`ftpQuit timeout[${timeLimit}]`)
715
715
  }, timeLimit)
716
716
 
717
717
  Ftp.raw('quit', (err, res) => {
@@ -876,7 +876,7 @@ function WFtp() {
876
876
 
877
877
  //timeLimit
878
878
  let t = setTimeout(() => {
879
- pm.reject(`timeout[${timeLimit}]`)
879
+ pm.reject(`ftpDownload timeout[${timeLimit}]`)
880
880
  }, timeLimit)
881
881
 
882
882
  Ftp.get(fpRemote, (err, socket) => {
@@ -996,7 +996,7 @@ function WFtp() {
996
996
 
997
997
  //timeLimit
998
998
  let t = setTimeout(() => {
999
- pm.reject(`timeout[${timeLimit}]`)
999
+ pm.reject(`ftpUpload timeout[${timeLimit}]`)
1000
1000
  }, timeLimit)
1001
1001
 
1002
1002
  let dss = 0