Skip to content

Commit

Permalink
feat: update current list
Browse files Browse the repository at this point in the history
  • Loading branch information
JadsonLucena committed Mar 23, 2023
1 parent 3ee853a commit f5cd655
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/MimeTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,44 @@ class MimeTypes {

}

#updateList(content) {

let updated = false;

for (let mimeType in content) {

mimeType = mimeType.trim().toLowerCase();

if (mimeType in this.#mimeTypes) {

content[mimeType].forEach(extension => {

extension = extension.trim().toLowerCase();

if (!this.#mimeTypes[mimeType].includes(extension)) {

this.#mimeTypes[mimeType].push(extension);

updated = true;

}

});

} else {

this.#mimeTypes[mimeType] = content[mimeType];

updated = true;

}

}

return updated;

}

get list() {

return this.#mimeTypes;
Expand Down

0 comments on commit f5cd655

Please sign in to comment.