Browse Source

chore: upgrade js-yaml for stricter parser

Gerald 3 năm trước cách đây
mục cha
commit
8e7e871800
4 tập tin đã thay đổi với 15 bổ sung31 xóa
  1. 0 28
      .github/ISSUE_TEMPLATE.md
  2. 1 1
      package.json
  3. 2 2
      scripts/i18n.js
  4. 12 0
      yarn.lock

+ 0 - 28
.github/ISSUE_TEMPLATE.md

@@ -1,28 +0,0 @@
-<!--
-Make sure you searched for existing issues that already reported this problem.
-
-Note that issues without a reproduction may be closed immediately!
--->
-
-### What is the problem?
-
-### How to reproduce it?
-1.
-2.
-3.
-
-### What is the expected result?
-
-### What is the actual result?
-
-### What is the result in the [upcoming release](https://github.com/violentmonkey/violentmonkey/releases)?<br>WARNING! Do an export in settings before testing!
-
-<!--
-If this is a bug report, please also provide logs in the console.
--->
-
-### Environment
-- Browser:
-- Browser version:
-- Violentmonkey version:
-- OS:

+ 1 - 1
package.json

@@ -40,7 +40,7 @@
     "gulp": "^4.0.2",
     "gulp-plumber": "^1.1.0",
     "husky": "^4.2.3",
-    "js-yaml": "^3.13.1",
+    "js-yaml": "^4.1.0",
     "jsdom": "^16.2.1",
     "npm-run-all": "^4.1.5",
     "plugin-error": "^1.0.0",

+ 2 - 2
scripts/i18n.js

@@ -6,7 +6,7 @@ const through = require('through2');
 const yaml = require('js-yaml');
 
 const transformers = {
-  '.yml': data => yaml.safeLoad(data),
+  '.yml': data => yaml.load(data),
   '.json': data => JSON.parse(data),
 };
 
@@ -63,7 +63,7 @@ class Locale {
       }
       data = JSON.stringify(data, null, 2);
     } else if (extension === '.yml') {
-      data = yaml.safeDump(data, { sortKeys: true });
+      data = yaml.dump(data, { sortKeys: true });
     } else {
       throw 'Unknown extension name!';
     }

+ 12 - 0
yarn.lock

@@ -1578,6 +1578,11 @@ argparse@^1.0.7:
   dependencies:
     sprintf-js "~1.0.2"
 
+argparse@^2.0.1:
+  version "2.0.1"
+  resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
+  integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
+
 aria-query@^3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
@@ -5834,6 +5839,13 @@ js-yaml@^3.13.1:
     argparse "^1.0.7"
     esprima "^4.0.0"
 
+js-yaml@^4.1.0:
+  version "4.1.0"
+  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
+  integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
+  dependencies:
+    argparse "^2.0.1"
+
 jsbn@~0.1.0:
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"