Skip to content

Commit

Permalink
feat: Replaced calls to lodash.includes() by calls to native (es2025)…
Browse files Browse the repository at this point in the history
… String.includes()
  • Loading branch information
flozz committed Jul 31, 2024
1 parent a5f4c04 commit 302b18b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Tu run tests, use the following command:
* **[NEXT]** (changes on master that have not been released yet):

* feat: Removed dependency to the uuid library. Use browser's secure implementation if available, or a fallback one else (@flozz)
* feat: Replaced calls to lodash.includes() by calls to native (es2025) String.includes() (@flozz)

* **v1.0.9:**

Expand Down
12 changes: 6 additions & 6 deletions lib/helpers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"use strict";

var includes = require("lodash/includes");

module.exports = {
var helpers = {

/**
* Get an UUID version 4 (RFC 4122).
Expand All @@ -15,7 +13,7 @@ module.exports = {
if (window.crypto && window.crypto.randomUUID) {
return window.crypto.randomUUID();
} else {
return module.exports.fallbackUuid4();
return helpers.fallbackUuid4();
}
},

Expand All @@ -34,7 +32,7 @@ module.exports = {
parseUrlParams: function(url) {
var params = {};

if (includes(url, "#")) {
if (url.includes("#")) {
url = url.split("#")[1];
}

Expand All @@ -44,7 +42,7 @@ module.exports = {
if (kvPair[i].length === 0) {
continue;
}
if (!includes(kvPair[i], "=")) {
if (!kvPair[i].includes("=")) {
params[kvPair[i]] = null;
continue;
}
Expand Down Expand Up @@ -166,3 +164,5 @@ module.exports = {
}

};

module.exports = helpers;

0 comments on commit 302b18b

Please sign in to comment.