Socket
Socket
Sign inDemoInstall

monaco-web-component

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.20 to 1.0.21

61

monaco.js

@@ -15,35 +15,36 @@ class MonacoEditor extends HTMLElement {

this.defaultValue = this.safeMakeJSON(rawDefaultValue);
console.debug(this)
console.debug(this);
}
/**
* Safely serialize to JSON
* @param {string | object} rawValue
* @returns {string}
*/
safeMakeJSON(rawValue) {
if (typeof rawValue === "string") return rawValue;
if (!rawValue) "";
try {
return JSON.stringify(rawValue);
} catch (error) {
console.error("Error serializeing to JSON", error);
return "";
}
/**
* Safely serialize to JSON
* @param {string | object} rawValue
* @returns {string}
*/
safeMakeJSON(rawValue) {
if (typeof rawValue === "string") return rawValue;
if (!rawValue) "";
try {
return JSON.stringify(rawValue);
} catch (error) {
console.error("Error serializeing to JSON", error);
return "";
}
}
/**
* Safe parse JSON
* @param {string | object} rawValue
* @returns {object}
*/
safeParseJSON(rawValue) {
if (typeof rawValue !== "string") return rawValue;
if (!rawValue) return {};
try {
return JSON.parse(rawValue);
} catch (error) {
console.error("Error parsing JSON", error);
return {};
}
/**
* Safe parse JSON
* @param {string | object} rawValue
* @returns {object}
*/
safeParseJSON(rawValue) {
if (typeof rawValue !== "string") return rawValue;
if (!rawValue) return {};
try {
return JSON.parse(rawValue);
} catch (error) {
console.error("Error parsing JSON", error);
return {};
}
}

@@ -93,3 +94,3 @@ static get observedAttributes() {

const language = this.language;
require(["vs/editor/editor.main"], function() {
require(["vs/editor/editor.main"], function () {
if (schema) {

@@ -96,0 +97,0 @@ monaco.languages.json.jsonDefaults.setDiagnosticsOptions({

{
"name": "monaco-web-component",
"version": "1.0.20",
"version": "1.0.21",
"description": "WebComponent version of Monaco Editor. Fully compatible with HTML Forms",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc