mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-26 22:56:27 -04:00
address semicolon insertion lint
> Code that uses automatic semicolon insertion inconsistently is hard to read and maintain. See: https://github.com/PrivateBin/PrivateBin/security/quality/rules/js%2Fautomatic-semicolon-insertion
This commit is contained in:
+3
-3
@@ -10,7 +10,7 @@ global.WebCrypto = require('@peculiar/webcrypto').Crypto;
|
||||
|
||||
// application libraries to test
|
||||
global.$ = global.jQuery = require('./jquery-3.7.1');
|
||||
global.zlib = require('./zlib-1.3.1-1').zlib;
|
||||
global.zlib = require('./zlib-1.3.1-2').zlib;
|
||||
require('./prettify');
|
||||
global.prettyPrint = window.PR.prettyPrint;
|
||||
global.prettyPrintOne = window.PR.prettyPrintOne;
|
||||
@@ -82,10 +82,10 @@ function parseMime(line) {
|
||||
// these to be character encoding agnostic
|
||||
exports.atob = function(encoded) {
|
||||
return Buffer.from(encoded, 'base64').toString('binary');
|
||||
}
|
||||
};
|
||||
exports.btoa = function(text) {
|
||||
return Buffer.from(text, 'binary').toString('base64');
|
||||
}
|
||||
};
|
||||
|
||||
// provides random lowercase characters from a to z
|
||||
exports.jscA2zString = function() {
|
||||
|
||||
+7
-5
@@ -555,13 +555,14 @@ jQuery.PrivateBin = (function($) {
|
||||
* @param {string} str
|
||||
* @return {string} escaped HTML
|
||||
*/
|
||||
me.htmlEntities = function(str) {
|
||||
me.htmlEntities = function(str)
|
||||
{
|
||||
return String(str).replace(
|
||||
/[&<>"'`=\/]/g, function(s) {
|
||||
return entityMap[s];
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* calculate expiration date given initial date and expiration period
|
||||
@@ -572,7 +573,8 @@ jQuery.PrivateBin = (function($) {
|
||||
* @param {string|number} expirationDisplayStringOrSecondsToExpire - may not be empty
|
||||
* @return {Date}
|
||||
*/
|
||||
me.calculateExpirationDate = function(initialDate, expirationDisplayStringOrSecondsToExpire) {
|
||||
me.calculateExpirationDate = function(initialDate, expirationDisplayStringOrSecondsToExpire)
|
||||
{
|
||||
let expirationDate = new Date(initialDate),
|
||||
secondsToExpiration = expirationDisplayStringOrSecondsToExpire;
|
||||
if (typeof expirationDisplayStringOrSecondsToExpire === 'string') {
|
||||
@@ -617,7 +619,7 @@ jQuery.PrivateBin = (function($) {
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* resets state, used for unit testing
|
||||
@@ -1312,7 +1314,7 @@ jQuery.PrivateBin = (function($) {
|
||||
spec[1] = atob(spec[1]);
|
||||
if (spec[7] === 'zlib') {
|
||||
if (typeof zlib === 'undefined') {
|
||||
throw 'Error decompressing document, your browser does not support WebAssembly. Please use another browser to view this document.'
|
||||
throw 'Error decompressing document, your browser does not support WebAssembly. Please use another browser to view this document.';
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('AttachmentViewer', function () {
|
||||
{value: function(blob) {
|
||||
return 'blob:' + location.origin + '/1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed';
|
||||
}}
|
||||
)
|
||||
);
|
||||
}
|
||||
$.PrivateBin.AttachmentViewer.init();
|
||||
$.PrivateBin.Model.init();
|
||||
@@ -152,7 +152,7 @@ describe('AttachmentViewer', function () {
|
||||
{value: function(blob) {
|
||||
return 'blob:' + location.origin + '/1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed';
|
||||
}}
|
||||
)
|
||||
);
|
||||
}
|
||||
$.PrivateBin.AttachmentViewer.init();
|
||||
$.PrivateBin.Model.init();
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
rawDef.destroy();
|
||||
return ret;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user