Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js

Issue 800513006: Added vulcanize under third_party/npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js
diff --git a/node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d368bf70690162ae98702097eeda134496e95a0
--- /dev/null
+++ b/node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/js-yaml/lib/js-yaml/type.js
@@ -0,0 +1,65 @@
+'use strict';
+
+
+var YAMLException = require('./exception');
+
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'loadKind',
+ 'loadResolver',
+ 'dumpInstanceOf',
+ 'dumpPredicate',
+ 'dumpRepresenter',
+ 'dumpDefaultStyle',
+ 'dumpStyleAliases'
+];
+
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (null !== map) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.tag = tag;
+ this.loadKind = options['loadKind'] || null;
+ this.loadResolver = options['loadResolver'] || null;
+ this.dumpInstanceOf = options['dumpInstanceOf'] || null;
+ this.dumpPredicate = options['dumpPredicate'] || null;
+ this.dumpRepresenter = options['dumpRepresenter'] || null;
+ this.dumpDefaultStyle = options['dumpDefaultStyle'] || null;
+ this.dumpStyleAliases = compileStyleAliases(options['dumpStyleAliases'] || null);
+
+ if (-1 === YAML_NODE_KINDS.indexOf(this.loadKind)) {
+ throw new YAMLException('Unknown loadKind "' + this.loadKind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+
+module.exports = Type;

Powered by Google App Engine
This is Rietveld 408576698