Skip to content

Commit

Permalink
Updated js.cookie / SystemJS / Underscore / ungap custom elements / U…
Browse files Browse the repository at this point in the history
…RLSearchParams polyfill to the latest versions.
  • Loading branch information
Dmitri-Sintsov committed Dec 12, 2023
1 parent 4e62c2f commit 2df09d4
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 68 deletions.
30 changes: 15 additions & 15 deletions django_jinja_knockout/static/djk/js/lib/js.cookie.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! js-cookie v3.0.1 | MIT */
/*! js-cookie v3.0.5 | MIT */
/* eslint-disable no-var */
function assign (target) {
for (var i = 1; i < arguments.length; i++) {
Expand Down Expand Up @@ -31,7 +31,7 @@ var defaultConverter = {
/* eslint-disable no-var */

function init (converter, defaultAttributes) {
function set (key, value, attributes) {
function set (name, value, attributes) {
if (typeof document === 'undefined') {
return
}
Expand All @@ -45,7 +45,7 @@ function init (converter, defaultAttributes) {
attributes.expires = attributes.expires.toUTCString();
}

key = encodeURIComponent(key)
name = encodeURIComponent(name)
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
.replace(/[()]/g, escape);

Expand All @@ -72,11 +72,11 @@ function init (converter, defaultAttributes) {
}

return (document.cookie =
key + '=' + converter.write(value, key) + stringifiedAttributes)
name + '=' + converter.write(value, name) + stringifiedAttributes)
}

function get (key) {
if (typeof document === 'undefined' || (arguments.length && !key)) {
function get (name) {
if (typeof document === 'undefined' || (arguments.length && !name)) {
return
}

Expand All @@ -89,25 +89,25 @@ function init (converter, defaultAttributes) {
var value = parts.slice(1).join('=');

try {
var foundKey = decodeURIComponent(parts[0]);
jar[foundKey] = converter.read(value, foundKey);
var found = decodeURIComponent(parts[0]);
jar[found] = converter.read(value, found);

if (key === foundKey) {
if (name === found) {
break
}
} catch (e) {}
}

return key ? jar[key] : jar
return name ? jar[name] : jar
}

return Object.create(
{
set: set,
get: get,
remove: function (key, attributes) {
set,
get,
remove: function (name, attributes) {
set(
key,
name,
'',
assign({}, attributes, {
expires: -1
Expand All @@ -131,4 +131,4 @@ function init (converter, defaultAttributes) {
var api = init(defaultConverter, { path: '/' });
/* eslint-enable no-var */

export default api;
export { api as default };
2 changes: 1 addition & 1 deletion django_jinja_knockout/static/djk/js/lib/system.min.js

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

4 changes: 2 additions & 2 deletions django_jinja_knockout/static/djk/js/lib/underscore-esm.js

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

Loading

0 comments on commit 2df09d4

Please sign in to comment.