-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: return support for Node.js >=12.20.0 (#3356)
- Loading branch information
Showing
12 changed files
with
21 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,7 +343,7 @@ export const visit = ( | |
} while (stack !== undefined); | ||
|
||
if (edits.length !== 0) { | ||
return edits.at(-1)[1]; | ||
return edits[edits.length - 1][1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
} | ||
|
||
return root; | ||
|
@@ -501,7 +501,7 @@ visit[Symbol.for('nodejs.util.promisify.custom')] = async ( | |
} while (stack !== undefined); | ||
|
||
if (edits.length !== 0) { | ||
return edits.at(-1)[1]; | ||
return edits[edits.length - 1][1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
} | ||
|
||
return root; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1044,7 +1044,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -1069,7 +1069,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,7 +192,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -217,7 +217,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,7 +206,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -231,7 +231,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,7 +220,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -245,7 +245,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,7 +349,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -374,7 +374,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -618,7 +618,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -643,7 +643,7 @@ const plugin = () => () => { | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,8 @@ const plugin = | |
if (ancestors.some(predicates.isComponentsElement)) return; | ||
if (!ancestors.some(predicates.isOpenApi3_1Element)) return; | ||
|
||
const parentPathItemElement = ancestors.findLast(predicates.isPathItemElement); | ||
// @TODO([email protected]): can be replaced by Array.prototype.findLast in future | ||
const parentPathItemElement = [...ancestors].reverse().find(predicates.isPathItemElement); | ||
const isServersUndefined = typeof operationElement.servers === 'undefined'; | ||
const isServersArrayElement = predicates.isArrayElement(operationElement.servers); | ||
const isServersEmpty = isServersArrayElement && operationElement.servers!.length === 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -687,7 +687,7 @@ const plugin = | |
if (!isEmptyElement(element.value)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
const elementFactory = findElementFactory(ancestor, toValue(element.key)); | ||
|
||
// no element factory found | ||
|
@@ -712,7 +712,7 @@ const plugin = | |
if (!isEmptyElement(element)) return undefined; | ||
|
||
const [, , , ancestors] = rest; | ||
const ancestor = ancestors.at(-1); | ||
const ancestor = ancestors[ancestors.length - 1]; // @TODO([email protected]): can be replaced by Array.prototype.at in future | ||
|
||
// we're only interested in empty elements in ArrayElements | ||
if (!predicates.isArrayElement(ancestor)) return undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters