@neo4j-cypher/codemirror
Advanced tools
Comparing version 1.0.0-next.6 to 1.0.0-next.7
@@ -105,4 +105,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
export const getDefaultOptions = () => _objectSpread({}, defaultOptions); | ||
export const withDefaultOptions = options => { | ||
const combinedOptions = _objectSpread({}, defaultOptions); | ||
for (let key of Object.keys(options)) { | ||
if (options[key] !== undefined) { | ||
combinedOptions[key] = options[key]; | ||
} | ||
} | ||
return combinedOptions; | ||
}; | ||
export function createCypherEditor(parentDOMElement, options = {}) { | ||
const combinedOptions = _objectSpread(_objectSpread({}, defaultOptions), options); | ||
const combinedOptions = withDefaultOptions(options); | ||
const { | ||
@@ -109,0 +118,0 @@ autofocus, |
@@ -10,6 +10,7 @@ "use strict"; | ||
getDefaultOptions: true, | ||
withDefaultOptions: true, | ||
createCypherEditor: true | ||
}; | ||
exports.createCypherEditor = createCypherEditor; | ||
exports.getExtensions = exports.getDefaultOptions = void 0; | ||
exports.withDefaultOptions = exports.getExtensions = exports.getDefaultOptions = void 0; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -118,4 +119,14 @@ var _autocomplete = require("@codemirror/autocomplete"); | ||
exports.getDefaultOptions = getDefaultOptions; | ||
const withDefaultOptions = options => { | ||
const combinedOptions = _objectSpread({}, defaultOptions); | ||
for (let key of Object.keys(options)) { | ||
if (options[key] !== undefined) { | ||
combinedOptions[key] = options[key]; | ||
} | ||
} | ||
return combinedOptions; | ||
}; | ||
exports.withDefaultOptions = withDefaultOptions; | ||
function createCypherEditor(parentDOMElement, options = {}) { | ||
const combinedOptions = _objectSpread(_objectSpread({}, defaultOptions), options); | ||
const combinedOptions = withDefaultOptions(options); | ||
const { | ||
@@ -122,0 +133,0 @@ autofocus, |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "1.0.0-next.6", | ||
"version": "1.0.0-next.7", | ||
"author": "Neo4j Inc.", | ||
@@ -12,0 +12,0 @@ "license": "GPL-3.0", |
@@ -455,3 +455,3 @@ /** | ||
* Whether pressing the tab key affects editor indentation | ||
* | ||
* | ||
* @defaultValue true | ||
@@ -458,0 +458,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143066
3502