Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lrnwebcomponents/utils

Package Overview
Dependencies
Maintainers
4
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrnwebcomponents/utils - npm Package Compare versions

Comparing version 7.0.18 to 8.0.0

4

lib/remoteLinkBehavior.js

@@ -40,2 +40,6 @@ export const remoteLinkBehavior = function (SuperClass) {

}
else if (target) {
target.removeAttribute("target");
target.removeAttribute("rel");
}
}

@@ -42,0 +46,0 @@ /**

4

package.json
{
"name": "@lrnwebcomponents/utils",
"version": "7.0.18",
"version": "8.0.0",
"description": "Helper functions to clean up web component data handling.",

@@ -20,3 +20,3 @@ "repository": {

},
"gitHead": "b9873176f9fe50a77dcf25e44bf3450d26fbb37a"
"gitHead": "2791492ff7ab40c7d4c827c4b305e33c0a971230"
}

@@ -197,2 +197,47 @@ /**

// convert mimetype into a readable file extension
export function mimeTypeToName(mimeType) {
let data = mimeType.split('/');
switch (data[1]) {
case 'msword':
return '.doc';
case 'application/vnd.ms-excel':
return '.xls';
case 'vnd.ms-powerpoint':
return '.ppt';
case 'vnd.openxmlformats-officedocument.wordprocessingml.document':
return '.docx';
case 'vnd.openxmlformats-officedocument.spreadsheetml.sheet':
return '.xlsx';
case 'vnd.openxmlformats-officedocument.presentationml.presentation':
return '.pptx';
case 'mpeg':
return '.mp3';
case 'svg+xml':
return '.svg';
case 'markdown':
return '.md';
case 'plain':
return 'text';
case 'text':
return '.txt';
case 'rtf':
case 'gif':
case 'jpeg':
case 'jpg':
case 'png':
case 'webm':
case 'webp':
case 'html':
case 'htm':
case 'zip':
case 'csv':
case 'pdf':
case 'mp4':
return `.${data[1]}`;
}
return 'file';
}
// set type safe variables

@@ -207,2 +252,11 @@ export function localStorageSet(name, newItem) {

// delete item from local storage
export function localStorageDelete(name) {
try {
return localStorage.removeItem(name);
} catch (e) {
return false;
}
}
// https://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-a-url

@@ -209,0 +263,0 @@ function validURL(str) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc