mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2026-04-21 22:17:44 -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:
+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 {
|
||||
|
||||
Reference in New Issue
Block a user