Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ath0mas committed Jun 20, 2022
2 parents 39c2395 + 169877e commit 3a8c5b3
Show file tree
Hide file tree
Showing 11 changed files with 1,239 additions and 1,634 deletions.
2,035 changes: 820 additions & 1,215 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
}
},
"devDependencies": {
"@cordova/eslint-config": "^3.0.0"
"@cordova/eslint-config": "^4.0.0"
}
}
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<repo>https://github.com/ns0m/cordova-plugin-ns0m-file-transfer</repo>
<issue>https://github.com/ns0m/cordova-plugin-ns0m-file-transfer/issues</issue>

<dependency id="cordova-plugin-file" version=">=5.0.0" />
<dependency id="cordova-plugin-file" version=">=7.0.0" />

<js-module src="www/FileTransferError.js" name="FileTransferError">
<clobbers target="window.FileTransferError" />
Expand Down
170 changes: 85 additions & 85 deletions src/windows/FileTransferProxy.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions tests/hooks/after_prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
*
*/

var path = require('path');
var fs = require('fs');
const path = require('path');
const fs = require('fs');

module.exports = function (context) {
function main () {
// get the file transfer server address from the specified variables
var fileTransferServerAddress = getFileTransferServerAddress(context) || getDefaultFileTransferServerAddress(context);
const fileTransferServerAddress = getFileTransferServerAddress(context) || getDefaultFileTransferServerAddress(context);
console.log('Tests will use the following file transfer server address: ' + fileTransferServerAddress);
console.log(
'If you\'re using [email protected] and the above address is wrong at "platform add", don\'t worry, it\'ll fix itself on "cordova run" or "cordova prepare".'
Expand All @@ -38,10 +38,10 @@ module.exports = function (context) {
}

function getDefaultFileTransferServerAddress (context) {
var address = null;
var configNodes = context.opts.plugin.pluginInfo._et._root._children;
let address = null;
const configNodes = context.opts.plugin.pluginInfo._et._root._children;

for (var node in configNodes) {
for (const node in configNodes) {
if (configNodes[node].attrib.name === 'FILETRANSFER_SERVER_ADDRESS') {
address = configNodes[node].attrib.default;
}
Expand All @@ -51,13 +51,13 @@ module.exports = function (context) {
}

function getFileTransferServerAddress (context) {
var platformJsonFile = path.join(
const platformJsonFile = path.join(
context.opts.projectRoot,
'platforms',
context.opts.platforms[0],
context.opts.platforms[0] + '.json'
);
var platformJson = JSON.parse(fs.readFileSync(platformJsonFile, 'utf8'));
const platformJson = JSON.parse(fs.readFileSync(platformJsonFile, 'utf8'));

if (
platformJson &&
Expand All @@ -72,12 +72,12 @@ module.exports = function (context) {
}

function writeFileTransferOptions (address, context) {
for (var p in context.opts.paths) {
var ftOpts = {
for (const p in context.opts.paths) {
const ftOpts = {
serverAddress: address
};
var ftOptsString = JSON.stringify(ftOpts);
var ftOptsFile = path.join(context.opts.paths[p], 'fileTransferOpts.json');
const ftOptsString = JSON.stringify(ftOpts);
const ftOptsFile = path.join(context.opts.paths[p], 'fileTransferOpts.json');
fs.writeFileSync(ftOptsFile, ftOptsString, 'utf8');
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/server/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const http = require('http');
const stringify = require('json-stringify-safe');
const Busboy = require('busboy');
var { Iconv } = require('iconv');
const { Iconv } = require('iconv');

const port = process.env.PORT || 5000;
const DIRECT_UPLOAD_LIMIT = 85; // bytes
Expand All @@ -18,7 +18,7 @@ function parseMultipartForm (req, res, finishCb) {
const busboy = new Busboy({ headers: req.headers });

busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
var currentFile = { size: 0 };
const currentFile = { size: 0 };

file.on('data', function (data) {
currentFile.name = filename;
Expand Down Expand Up @@ -62,7 +62,7 @@ function respondWithParsedForm (req, res, parseResultObj) {

function respondWithParsedFormNonUTF (req, res, parseResultObj) {
parseResultObj.latin1Symbols = LATIN1_SYMBOLS;
var buffer = iconv.convert(stringify(parseResultObj));
const buffer = iconv.convert(stringify(parseResultObj));
res.writeHead(200, { 'Content-Type': 'application/json' });
res.write(buffer);
res.end('\n');
Expand Down Expand Up @@ -111,7 +111,7 @@ http.createServer(function (req, res) {
parseMultipartForm(req, res, respondWithParsedForm);
} else {
console.log('direct upload');
var body = '';
let body = '';
req.on('data', function (chunk) {
body += chunk;
if (body.length > DIRECT_UPLOAD_LIMIT) {
Expand Down
6 changes: 3 additions & 3 deletions tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3a8c5b3

Please sign in to comment.