Permalink
Browse files

Rename `settings` to `options` in the code.

  • Loading branch information...
1 parent fcb2d2e commit 7e1cafc03c033d3c37e52d8fc6712b5e054acbc2 @dervus dervus committed Feb 9, 2013
Showing with 33 additions and 33 deletions.
  1. +7 −7 lib/js-yaml/dumper.js
  2. +13 −13 lib/js-yaml/loader.js
  3. +13 −13 lib/js-yaml/type.js
View
@@ -125,11 +125,11 @@ function encodeHex(character) {
}
-function dump(input, settings) {
- var schema = common.getOption(settings, 'schema', DEFAULT_SCHEMA),
- indent = Math.max(1, common.getOption(settings, 'indent', 2)),
- flowLevel = common.getOption(settings, 'flowLevel', -1),
- styleMap = compileStyleMap(schema, common.getOption(settings, 'styles', null)),
+function dump(input, options) {
+ var schema = common.getOption(options, 'schema', DEFAULT_SCHEMA),
+ indent = Math.max(1, common.getOption(options, 'indent', 2)),
+ flowLevel = common.getOption(options, 'flowLevel', -1),
+ styleMap = compileStyleMap(schema, common.getOption(options, 'styles', null)),
implicitTypes = schema.compiledImplicit,
explicitTypes = schema.compiledExplicit,
@@ -426,8 +426,8 @@ function dump(input, settings) {
}
-function safeDump(input, settings) {
- return dump(input, common.extend({ schema: SAFE_SCHEMA }, settings));
+function safeDump(input, options) {
+ return dump(input, common.extend({ schema: SAFE_SCHEMA }, options));
}
View
@@ -114,13 +114,13 @@ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
-function loadAll(input, output, settings) {
- var filename = common.getOption(settings, 'filename', null),
- schema = common.getOption(settings, 'schema', DEFAULT_SCHEMA),
- resolve = common.getOption(settings, 'resolve', true),
- validate = common.getOption(settings, 'validate', true),
- strict = common.getOption(settings, 'strict', false),
- legacy = common.getOption(settings, 'legacy', false),
+function loadAll(input, output, options) {
+ var filename = common.getOption(options, 'filename', null),
+ schema = common.getOption(options, 'schema', DEFAULT_SCHEMA),
+ resolve = common.getOption(options, 'resolve', true),
+ validate = common.getOption(options, 'validate', true),
+ strict = common.getOption(options, 'strict', false),
+ legacy = common.getOption(options, 'legacy', false),
directiveHandlers = {},
implicitTypes = schema.compiledImplicit,
@@ -1513,7 +1513,7 @@ function loadAll(input, output, settings) {
}
-function load(input, settings) {
+function load(input, options) {
var result = null, received = false;
function callback(data) {
@@ -1525,19 +1525,19 @@ function load(input, settings) {
}
}
- loadAll(input, callback, settings);
+ loadAll(input, callback, options);
return result;
}
-function safeLoadAll(input, output, settings) {
- loadAll(input, output, common.extend({ schema: SAFE_SCHEMA }, settings));
+function safeLoadAll(input, output, options) {
+ loadAll(input, output, common.extend({ schema: SAFE_SCHEMA }, options));
}
-function safeLoad(input, settings) {
- return load(input, common.extend({ schema: SAFE_SCHEMA }, settings));
+function safeLoad(input, options) {
+ return load(input, common.extend({ schema: SAFE_SCHEMA }, options));
}
View
@@ -6,10 +6,10 @@ var YAMLException = require('./exception');
// TODO: Add tag format check.
-function Type(tag, settings) {
+function Type(tag, options) {
this.tag = tag;
- this.loader = common.getOption(settings, 'loader', null);
- this.dumper = common.getOption(settings, 'dumper', null);
+ this.loader = common.getOption(options, 'loader', null);
+ this.dumper = common.getOption(options, 'dumper', null);
if (null === this.loader && null === this.dumper) {
throw new YAMLException('Incomplete YAML type definition. "loader" or "dumper" setting must be specified.');
@@ -25,9 +25,9 @@ function Type(tag, settings) {
}
-Type.Loader = function TypeLoader(settings) {
- this.kind = common.getSetting(settings, 'kind');
- this.resolver = common.getOption(settings, 'resolver', null);
+Type.Loader = function TypeLoader(options) {
+ this.kind = common.getSetting(options, 'kind');
+ this.resolver = common.getOption(options, 'resolver', null);
if ('string' !== this.kind &&
'array' !== this.kind &&
@@ -52,13 +52,13 @@ function compileAliases(map) {
}
-Type.Dumper = function TypeDumper(settings) {
- this.kind = common.getSetting(settings, 'kind');
- this.defaultStyle = common.getOption(settings, 'defaultStyle', null);
- this.instanceOf = common.getOption(settings, 'instanceOf', null);
- this.predicate = common.getOption(settings, 'predicate', null);
- this.representer = common.getOption(settings, 'representer', null);
- this.styleAliases = compileAliases(common.getOption(settings, 'styleAliases', null));
+Type.Dumper = function TypeDumper(options) {
+ this.kind = common.getSetting(options, 'kind');
+ this.defaultStyle = common.getOption(options, 'defaultStyle', null);
+ this.instanceOf = common.getOption(options, 'instanceOf', null);
+ this.predicate = common.getOption(options, 'predicate', null);
+ this.representer = common.getOption(options, 'representer', null);
+ this.styleAliases = compileAliases(common.getOption(options, 'styleAliases', null));
if ('undefined' !== this.kind &&
'null' !== this.kind &&

0 comments on commit 7e1cafc

Please sign in to comment.