Skip to content

Commit 9a5227f

Browse files
authored
bug(browser/ie11): remove Array.includes usage
1 parent dcfa1f3 commit 9a5227f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/plugins/editor/components/editor.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default function makeEditor({ editorPluginsToRun }) {
223223
//// Mange the yaml lifecycle...
224224
// If the yaml doesn't match _what we already have in state_ then update the yaml in the editor
225225
// Taking care to manage the other things in lifecycle
226-
if(newValue !== this.props.value && !this.yaml.includes(newValue)) {
226+
if(newValue !== this.props.value && !this.yaml.indexOf(newValue) > -1) {
227227

228228
// Remove markers
229229
if(this.removeMarkers) {
@@ -250,7 +250,7 @@ export default function makeEditor({ editorPluginsToRun }) {
250250
}
251251

252252
// If the yaml was in our stack, we should clear it up
253-
if(this.yaml.includes(newValue)) {
253+
if(this.yaml.indexOf(newValue) > -1) {
254254
// remove all previous yaml's ( leave newValue in though ).
255255
// In case another onChange is still in flight
256256
this.yaml = this.yaml.slice(this.yaml.indexOf(newValue) + 1)

src/plugins/validate-json-schema/path-translator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function transformPathToArray(property, jsSpec) {
2222
str
2323
.map(item => {
2424
// "key[0]" becomes ["key", "0"]
25-
if(item.includes("[")) {
25+
if(item.indexOf("[") > -1) {
2626
let index = parseInt(item.match(/\[(.*)\]/)[1])
2727
let keyName = item.slice(0, item.indexOf("["))
2828
return [keyName, index.toString()]

src/plugins/validate-semantic/validators/parameters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export const validateParameterBadKeys = () => (system) => {
33
.allParameters()
44
.then(nodes => {
55
return nodes.reduce((acc, node) => {
6-
if(node.keys.includes("example")) {
6+
if(node.keys.indexOf("example") > -1) {
77
acc.push({
88
level: "error",
99
message: "'example' field is not allowed in parameter",

0 commit comments

Comments
 (0)