Skip to content

Commit 869812c

Browse files
committed
update to es2015 and use Array.from
1 parent bd87171 commit 869812c

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

dist/aspnet-validation.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/aspnet-validation.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/aspnet-validation.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ export class ValidationService {
464464
* Scans document for all validation message <span> generated by ASP.NET Core MVC, then tracks them.
465465
*/
466466
private scanMessages(root: HTMLElement) {
467-
let validationMessageElements = Array.prototype.slice.call(root.querySelectorAll<HTMLElement>('[data-valmsg-for]')) as HTMLElement[];
467+
let validationMessageElements = Array.from(root.querySelectorAll<HTMLElement>('[data-valmsg-for]')) as HTMLElement[];
468468

469469
// querySelectorAll does not include the root element itself.
470470
// we could use 'matches', but that's newer than querySelectorAll so we'll keep it simple and compatible.
@@ -796,7 +796,7 @@ export class ValidationService {
796796
* Scans the entire document for input elements to be validated.
797797
*/
798798
private scanInputs(root: HTMLElement) {
799-
let inputs = Array.prototype.slice.call(root.querySelectorAll<HTMLElement>('[data-val="true"]')) as HTMLElement[];
799+
let inputs = Array.from(root.querySelectorAll<HTMLElement>('[data-val="true"]')) as HTMLElement[];
800800

801801
// querySelectorAll does not include the root element itself.
802802
// we could use 'matches', but that's newer than querySelectorAll so we'll keep it simple and compatible.

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"lib": [
2727
"dom",
2828
"es5",
29-
"es2015.promise",
29+
"es2015",
3030
"es2018.promise"
3131
]
3232
},

0 commit comments

Comments
 (0)