Skip to content

Commit

Permalink
fix comments & arg guard
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Nov 3, 2022
1 parent cd821d6 commit deb0cbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/helpers/cookie-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { nativeIsNaN } from './number-utils';
* @returns {string|null} returns path string if ok OR null if not
*/
export const prepareCookiePath = (pathArg) => {
// eslint-disable-line no-console
// eslint-disable-next-line no-console
const log = console.log.bind(console);

let pathString;
Expand Down
11 changes: 7 additions & 4 deletions src/scriptlets/trusted-set-cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ export function trustedSetCookie(source, name, value, offsetExpiresSec = '', rel
// eslint-disable-next-line no-console
const log = console.log.bind(console);

if (typeof name === 'undefined' || typeof value === 'undefined') {
const logMessage = `log: Cookie name and value should be specified, name: ${name}, value: ${value}`;
log(source, logMessage);
if (typeof name === 'undefined') {
log('Cookie name should be specified.');
return;
}

if (typeof value === 'undefined') {
log('Cookie value should be specified.');
return;
}

Expand All @@ -91,7 +95,6 @@ export function trustedSetCookie(source, name, value, offsetExpiresSec = '', rel

let cookieToSet = '';

// const encodedName = encodeURIComponent(name);
let parsedValue;

if (value === NOW_VALUE_KEYWORD) {
Expand Down

0 comments on commit deb0cbb

Please sign in to comment.