chore(utils/lightSet): minor improvement in clear method
This commit is contained in:
parent
1037083ed2
commit
454412d9d4
@ -293,7 +293,7 @@ export const parseXml = (function () {
|
|||||||
// - works only with strings
|
// - works only with strings
|
||||||
// - methods are already bound and chainable
|
// - methods are already bound and chainable
|
||||||
export const lightSet = collection => {
|
export const lightSet = collection => {
|
||||||
const data = createRawObject()
|
let data = createRawObject()
|
||||||
if (collection) {
|
if (collection) {
|
||||||
forEach(collection, value => {
|
forEach(collection, value => {
|
||||||
data[value] = true
|
data[value] = true
|
||||||
@ -307,9 +307,7 @@ export const lightSet = collection => {
|
|||||||
return set
|
return set
|
||||||
},
|
},
|
||||||
clear: () => {
|
clear: () => {
|
||||||
for (const value in data) {
|
data = createRawObject()
|
||||||
delete data[value]
|
|
||||||
}
|
|
||||||
return set
|
return set
|
||||||
},
|
},
|
||||||
delete: value => {
|
delete: value => {
|
||||||
|
Loading…
Reference in New Issue
Block a user