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

@dbml/core

Package Overview
Dependencies
Maintainers
6
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbml/core - npm Package Compare versions

Comparing version 3.1.5 to 3.1.6

19

lib/export/DbmlExporter.js

@@ -39,3 +39,14 @@ "use strict";

value: function escapeNote(str) {
return str.replaceAll("'", "\\'");
if (str === null) {
return '';
}
var newStr = str.replaceAll('\\', '\\\\');
if (!newStr.match(/[\n\r']/)) {
// Only safe chars, no simple quotes nor CR/LF
return "'".concat(newStr, "'");
}
// see https://dbml.dbdiagram.io/docs/#multi-line-string
newStr = newStr.replaceAll("'''", "\\'''");
newStr = newStr.replaceAll('\r\n', '\n'); // turn all CRLF to LF
return "'''".concat(newStr, "'''");
}

@@ -49,3 +60,3 @@ }, {

return "Enum ".concat((0, _utils.shouldPrintSchema)(schema, model) ? "\"".concat(schema.name, "\".") : '', "\"").concat(_enum.name, "\" {\n").concat(_enum.valueIds.map(function (valueId) {
return " \"".concat(model.enumValues[valueId].name, "\"").concat(model.enumValues[valueId].note ? " [note: '".concat(DbmlExporter.escapeNote(model.enumValues[valueId].note), "']") : '');
return " \"".concat(model.enumValues[valueId].name, "\"").concat(model.enumValues[valueId].note ? " [note: ".concat(DbmlExporter.escapeNote(model.enumValues[valueId].note), "]") : '');
}).join('\n'), "\n}\n");

@@ -98,3 +109,3 @@ });

if (field.note) {
constraints.push("note: '".concat(DbmlExporter.escapeNote(field.note), "'"));
constraints.push("note: ".concat(DbmlExporter.escapeNote(field.note)));
}

@@ -191,3 +202,3 @@ if (constraints.length > 0) {

}
var tableNote = table.note ? " Note: '".concat(DbmlExporter.escapeNote(table.note), "'\n") : '';
var tableNote = table.note ? " Note: ".concat(DbmlExporter.escapeNote(table.note), "\n") : '';
var tableStr = "Table ".concat((0, _utils.shouldPrintSchema)(schema, model) ? "\"".concat(schema.name, "\".") : '', "\"").concat(table.name, "\"").concat(tableSettingStr, " {\n").concat(tableContent.fieldContents.map(function (line) {

@@ -194,0 +205,0 @@ return " ".concat(line);

{
"name": "@dbml/core",
"version": "3.1.5",
"version": "3.1.6",
"description": "> TODO: description",

@@ -35,3 +35,3 @@ "author": "Holistics <dev@holistics.io>",

"dependencies": {
"@dbml/parse": "^3.1.5",
"@dbml/parse": "^3.1.6",
"antlr4": "^4.13.1",

@@ -63,3 +63,3 @@ "lodash": "^4.17.15",

},
"gitHead": "ff90597690710144dafb2464b3d1a5134ef4e019"
"gitHead": "f82965d9636209e22f31794111f37e05c5da79ce"
}
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