"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const editorCommon = require("../common/editorCommon.js");
function isCodeEditor(thing) {
  if (thing && typeof thing.getEditorType === "function") {
    return thing.getEditorType() === editorCommon.EditorType.ICodeEditor;
  } else {
    return false;
  }
}
function isDiffEditor(thing) {
  if (thing && typeof thing.getEditorType === "function") {
    return thing.getEditorType() === editorCommon.EditorType.IDiffEditor;
  } else {
    return false;
  }
}
function getCodeEditor(thing) {
  if (isCodeEditor(thing)) {
    return thing;
  }
  if (isDiffEditor(thing)) {
    return thing.getModifiedEditor();
  }
  return null;
}
exports.getCodeEditor = getCodeEditor;
exports.isCodeEditor = isCodeEditor;
exports.isDiffEditor = isDiffEditor;
