Skip to content

Commit 573a638

Browse files
Fix the naming to comply with the docs
1 parent 38dc9e2 commit 573a638

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/js.cookie.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,29 @@
2323
var i = 0;
2424
var result = {};
2525
for (; i < arguments.length; i++) {
26-
var options = arguments[ i ];
27-
for (var key in options) {
28-
result[key] = options[key];
26+
var attributes = arguments[ i ];
27+
for (var key in attributes) {
28+
result[key] = attributes[key];
2929
}
3030
}
3131
return result;
3232
}
3333

3434
function init (converter) {
35-
function api (key, value, options) {
35+
function api (key, value, attributes) {
3636
var result;
3737

3838
// Write
3939

4040
if (arguments.length > 1) {
41-
options = extend({
41+
attributes = extend({
4242
path: '/'
43-
}, api.defaults, options);
43+
}, api.defaults, attributes);
4444

45-
if (typeof options.expires === 'number') {
45+
if (typeof attributes.expires === 'number') {
4646
var expires = new Date();
47-
expires.setMilliseconds(expires.getMilliseconds() + options.expires * 864e+5);
48-
options.expires = expires;
47+
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
48+
attributes.expires = expires;
4949
}
5050

5151
try {
@@ -64,10 +64,10 @@
6464

6565
return (document.cookie = [
6666
key, '=', value,
67-
options.expires && '; expires=' + options.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
68-
options.path && '; path=' + options.path,
69-
options.domain && '; domain=' + options.domain,
70-
options.secure && '; secure'
67+
attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE
68+
attributes.path && '; path=' + attributes.path,
69+
attributes.domain && '; domain=' + attributes.domain,
70+
attributes.secure && '; secure'
7171
].join(''));
7272
}
7373

@@ -122,8 +122,8 @@
122122
};
123123
api.defaults = {};
124124

125-
api.remove = function (key, options) {
126-
api(key, '', extend(options, {
125+
api.remove = function (key, attributes) {
126+
api(key, '', extend(attributes, {
127127
expires: -1
128128
}));
129129
};

0 commit comments

Comments
 (0)