Fix option object, replace `sourceMap` with `sourcemap` if needed.

@param {Object} options Original option object.
@return {Object} The new fixed option object.
490972
function fixSourceMapOptions(options) {
  // Rollup <= 0.48 used `sourceMap` in camelcase, so this plugin used
  // this convention at the beginning.
  // Now, the `sourcemap` key should be used, but legacy version should still
  // be able to use the `sourceMap` key.
  const newOptions = _.omitBy(options, (value, key) => (
    key === 'sourceMap'
  ));

  // If the old `sourceMap` key is used, set it to `sourcemap` key.
  if (_.hasIn(options, 'sourceMap')) {
    console.warn(`[${PLUGIN_NAME}] sourceMap has been deprecated, please use sourcemap instead.`);
    if (!_.hasIn(newOptions, 'sourcemap')) {
      newOptions.sourcemap = options.sourceMap;
    }
  }

  // Validate options.
  validateOptions(newOptions);

  return newOptions;
}
274548
function genPugSourceMap (filename, compiled, options) {
  options = options || {}

  const basedir = options.root ? path.resolve(path.normalize(options.root)) : process.cwd()
  filename = path.resolve(basedir, path.normalize(filename))

  const reLineAndPath = /;pug_debug_line = ([0-9]+);pug_debug_filename = "([^"]*)";/
  const reEntryPoint  = /^function [$\w]+\(locals\)\{var pug_html\s*=/
  const compiledLines = compiled.split('\n')
  const debugSources  = extractSources(compiledLines)
  const matchedFiles  = {}
  let lineCount = 0
  let lastLine = -1

  if (!debugSources) {
    throw new Error('Cannot get the source code. Please compile with compileDebug:true.')
  }

  const mapGenerator = new SourceMapGenerator({
    file: relative(basedir, filename) + '.js',
  })

  // allow breakpoints in 1st line, better support is in To Do
  if (reEntryPoint.test(compiledLines[0])) {
    mapGenerator.addMapping({
      generated: { line: 1, column: 0 },
      original: { line: 1, column: 0 },
      source: relative(basedir, filename),
    })
  }

  compiledLines.forEach((line, lineno) => {
    lineCount++

    const match = line.match(reLineAndPath)
    if (!match) {
      return
    }

    const originalLine = ~~match[1]
    if (originalLine <= 0) {
      return
    }

    // avoid normalize the path here to match the name in debugSources
    const fname = match[2] && match[2].replace(/\\u002F/g, '/').replace(/\\\\/g, '\\') || filename

    let matchedLines = matchedFiles[fname]
    if (!matchedLines) {
      // new included file - add source content
      matchedFiles[fname] = matchedLines = []

      if (!options.excludeContent) {
        addSourceContent(mapGenerator, basedir, fname, debugSources)
      }
    }

    // remove pug debug line from generated code, adjust line counter
    if (!options.keepDebugLines) {
      const len = match[0].length

      compiledLines[lineno] = line.length === len
        ? '' : line.slice(0, match.index) + line.slice(match.index + len)
      if (!compiledLines[lineno].trim()) {
        compiledLines[lineno] = '\0'
        lineCount--
      }
    }

    // have a recognized generated line?
    if (!/^;pug_debug/.test(compiledLines[lineno + 1])) {
      let generatedLine = lineCount + 1

      lastLine = lineno + 1
      if (compiledLines[lastLine].slice(0, 2) === '//' &&
          compiledLines[lastLine + 1] === ';(function(){') {
        generatedLine++
        lastLine++
      }

      // adds the new mapping if line is not matched yet
      if (matchedLines.indexOf(originalLine) < 0) {
        matchedLines.push(originalLine)
        mapGenerator.addMapping({
          generated: {
            line: generatedLine,
            column: 0,
          },
          original: {
            line: originalLine,
            column: 0,
          },
          source: relative(basedir, fname),
        })
      }
    }
  })

  // use the resulting non-empty lines to recreate the code
  if (!options.keepDebugLines) {

    // split the last row having the root catch clause
    if (~lastLine) {
      const line = compiledLines[lastLine]
      const pos = line.lastIndexOf(';}.call(this,') + 1
      if (pos && line.lastIndexOf('rethrow(err,') > pos) {
        compiledLines[lastLine] = line.slice(0, pos) + '\n' + line.slice(pos)
      }
    }

    compiled = compiledLines.filter((line) => line !== '\0').join('\n')
  }

  return { data: compiled, map: mapGenerator.toJSON() }
}
586212
function(option) {

  // Swap alias and name around.
  if (option.name && option.alias && option.name.length > option.alias.length) {
    var name = option.alias;
    option.alias = option.name;
    option.name = name;
  }

  var defaults = {
    alias: null,
    kind: 'boolean'
  };
  var keys = Object.keys(option);
  _.each(defaults, function(val, key) {
    if (!_.contains(keys, key)) {
      option[key] = val;
    }
  });
}
741911
function(options) {
     inputEx.widget.dtInPlaceEdit.superclass.setOptions.call(this, options);
     
     this.options.allowModify = false;
		this.options.insertWithDialog = lang.isUndefined(options.insertWithDialog) ? false : options.insertWithDialog; 
   }
404976
function(option){
		option = option || {};
		var opt = {
			type   : (option.type   || this.instancetype || ''),
			width  : (option.width  || this.painter.canvasWidth),
			height : (option.height || this.painter.canvasHeight)
		};
		var newpuzzle = new pzpr.Puzzle(opt).open(this.getFileData(1,{history:!!option.history}));
		newpuzzle.restoreConfig(this.saveConfig());
		return newpuzzle;
	}
693155
function normalizeOptions(options = undefined) {
  switch (true) {
    case isPlainObject(options):
      return {
        ...defaults, ...options
      }

    case options && typeof options === "string":
      return {
        ...defaults, encoding: options
      }

    default:
      return defaults
  }
}
519353
private void replaceOptions(LinkedHashMap<String, String> options) {

        String oldValue = m_selectBox.getFormValueAsString();
        for (String additionalValue : new String[] {oldValue, m_externalValue}) {
            if (!options.containsKey(additionalValue)) {
                options.put(additionalValue, additionalValue);
            }
        }
        if (options.containsKey("")) {
            options.put(
                "",
                org.opencms.gwt.client.Messages.get().key(
                    org.opencms.gwt.client.Messages.GUI_SELECTBOX_EMPTY_SELECTION_0));
        }
        m_selectBox.setItems(options);
        m_selectBox.setFormValueAsString(oldValue);
    }
346407
def fix_config(self, options):
        
        options = super(Console, self).fix_config(options)

        opt = "prefix"
        if opt not in options:
            options[opt] = ""
        if opt not in self.help:
            self.help[opt] = "The prefix for the output (string)."

        return options
1035873
function (newOptions) {
        OpenLayers.Util.extend(this.options, newOptions);
        OpenLayers.Util.extend(this, newOptions);
    }
825034
function optionalResolve(options) {
    setupOptions(options);
    return new Promise(function (res, rej) {
        if (options.resolve)
            loopReferences(options, res, rej)
        else
            res(options);
    });
}
653094
function (options) {
			var defaultOptions = this._defaultOptions();
			for (var option in options) {
				if (options.hasOwnProperty(option)) {
					var newValue = options[option], oldValue = this["_" + option]; //$NON-NLS-1$
					if (compare(oldValue, newValue)) { continue; }
					var update = defaultOptions[option] ? defaultOptions[option].update : null;
					if (update) {
						update.call(this, newValue);
						continue;
					}
					this["_" + option] = clone(newValue); //$NON-NLS-1$
				}
			}
			this.onOptions({type: "Options", options: options}); //$NON-NLS-1$
		}
77882
function( options ) {
			options = options ? _.clone( options ) : {};
			if ( options.silent ) {
				options.silentChange = true;
				delete options.silent;
			}
			return options;
		}
108546
function(callback, options, params) {
        var options = options || ((_.isObject(callback) && !_.isFunction(callback)) ? callback : {});
        if (params) {
            options = _.extend({}, options, params);
        }

        return options
    }
634898
function createOptions( options ) {
	var object = optionsCache[ options ] = {};
	jQuery.each( options.split( core_rspace ), function( _, flag ) {
		object[ flag ] = true;
	});
	return object;
}
853881
function merge(target, options) {
  var key;
  if (!target) { target = {}; }
  if (options) {
    for (key in options) {
      if (options.hasOwnProperty(key)) {
        var targetHasIt = target.hasOwnProperty(key),
            optionsValueType = typeof options[key],
            shouldReplace = !targetHasIt || (typeof target[key] !== optionsValueType);

        if (shouldReplace) {
          target[key] = options[key];
        } else if (optionsValueType === 'object') {
          // go deep, don't care about loops here, we are simple API!:
          target[key] = merge(target[key], options[key]);
        }
      }
    }
  }

  return target;
}
1359964
function fixImportedSourceMap(file, state, callback) {
  if (!state.map) {
    return callback();
  }

  state.map.sourcesContent = state.map.sourcesContent || [];

  nal.map(state.map.sources, normalizeSourcesAndContent, callback);

  function assignSourcesContent(sourceContent, idx) {
    state.map.sourcesContent[idx] = sourceContent;
  }

  function normalizeSourcesAndContent(sourcePath, idx, cb) {
    var sourceRoot = state.map.sourceRoot || '';
    var sourceContent = state.map.sourcesContent[idx] || null;

    if (isRemoteSource(sourcePath)) {
      assignSourcesContent(sourceContent, idx);
      return cb();
    }

    if (state.map.sourcesContent[idx]) {
      return cb();
    }

    if (sourceRoot && isRemoteSource(sourceRoot)) {
      assignSourcesContent(sourceContent, idx);
      return cb();
    }

    var basePath = path.resolve(file.base, sourceRoot);
    var absPath = path.resolve(state.path, sourceRoot, sourcePath);
    var relPath = path.relative(basePath, absPath);
    var unixRelPath = normalizePath(relPath);

    state.map.sources[idx] = unixRelPath;

    if (absPath !== file.path) {
      // Load content from file async
      return fs.readFile(absPath, onRead);
    }

    // If current file: use content
    assignSourcesContent(state.content, idx);
    cb();

    function onRead(err, data) {
      if (err) {
        assignSourcesContent(null, idx);
        return cb();
      }
      assignSourcesContent(removeBOM(data).toString('utf8'), idx);
      cb();
    }
  }
}
527299
function (options) {
            google.maps.Marker.prototype.setMap.apply(this, [options]);
            (this.MarkerLabel) && this.MarkerLabel.setMap.apply(this.MarkerLabel, [options]);
        }