[skip CI] switched from yaml/yaml.js to js-yaml

This commit is contained in:
Klemek
2019-07-18 09:14:00 +02:00
parent a8504b8cc4
commit 15779410fe
7 changed files with 10 additions and 37 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const fs = require('fs');
const YAML = require('yaml');
const yaml = require('js-yaml');
const rendering = require('./src/rendering')({
'scale': 0.05,
@@ -64,6 +64,6 @@ const data = {
]
};
fs.writeFileSync('docs/sample.yml', YAML.stringify(data, null, 4), {encoding: 'utf-8'});
fs.writeFileSync('docs/sample.yml', yaml.safeDump(data), {encoding: 'utf-8'});
fs.writeFileSync('preview/sample.svg', faDiagrams.compute(data), {encoding: 'utf-8'});
+3 -3
View File
@@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8">
<title>fa-diagrams example</title>
<script src="jquery-3.4.1.min.js"></script>
<script src="yaml.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-yaml@3.13.1/dist/js-yaml.min.js"></script>
<script src="github-cdn.js"></script>
<style>
* {
@@ -67,7 +67,7 @@
data[key] = data[key].replace(/\\n/gm, '\n');
});
};
let data = YAML.parse($('#input').val());
let data = jsyaml.load($('#input').val());
findLineBreaks(data);
$('#right').html(faDiagrams.compute(data));
} catch (err) {
-2
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,16 +1,16 @@
nodes:
- name: node1
icon: laptop-code
color: "#4E342E"
color: '#4E342E'
bottom: my app
- name: node2
icon: globe
color: "#455A64"
color: '#455A64'
bottom: world
links:
- from: node1
to: node2
color: "#333333"
color: '#333333'
top:
icon: envelope
bottom: '"hello"'
-1
View File
File diff suppressed because one or more lines are too long
-24
View File
@@ -151,15 +151,6 @@
"@babel/helper-plugin-utils": "^7.0.0"
}
},
"@babel/runtime": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.5.4.tgz",
"integrity": "sha512-Na84uwyImZZc3FKf4aUF1tysApzwf3p2yuFBIyBfbzT5glzKTdvYI4KVW4kcgjrzoGUjC7w3YyCHcJKaRxsr2Q==",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.2"
}
},
"@babel/template": {
"version": "7.4.4",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz",
@@ -4943,12 +4934,6 @@
"util.promisify": "^1.0.0"
}
},
"regenerator-runtime": {
"version": "0.13.2",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz",
"integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==",
"dev": true
},
"regex-not": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
@@ -6243,15 +6228,6 @@
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
"yaml": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.6.0.tgz",
"integrity": "sha512-iZfse3lwrJRoSlfs/9KQ9iIXxs9++RvBFVzAqbbBiFT+giYtyanevreF9r61ZTbGMgWQBxAua3FzJiniiJXWWw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.4.5"
}
},
"yargs": {
"version": "12.0.5",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz",
+2 -2
View File
@@ -41,10 +41,10 @@
"browserify": "^16.3.0",
"coveralls": "^3.0.4",
"jest": "^24.8.0",
"js-yaml": "^3.13.1",
"jshint": "^2.10.2",
"node-svn-ultimate": "^1.2.0",
"rimraf": "^2.6.3",
"uglify-es": "^3.3.9",
"yaml": "^1.6.0"
"uglify-es": "^3.3.9"
}
}