-
-
Notifications
You must be signed in to change notification settings - Fork 878
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: shared function scoped names
- Loading branch information
1 parent
60c4b3c
commit 47d172c
Showing
18 changed files
with
145 additions
and
116 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
import {Name} from "./codegen" | ||
|
||
const names = { | ||
validate: new Name("validate"), | ||
validate: new Name("validate"), // validation function name | ||
// validation function arguments | ||
data: new Name("data"), // data passed to validation function | ||
// args passed from referencing schema | ||
dataPath: new Name("dataPath"), | ||
rootData: new Name("rootData"), | ||
parentData: new Name("parentData"), | ||
parentDataProperty: new Name("parentDataProperty"), | ||
rootData: new Name("rootData"), // data passed to the first/top validation function | ||
// function scoped variables | ||
vErrors: new Name("vErrors"), // null or array of validation errors | ||
errors: new Name("errors"), // counter of validation errors | ||
this: new Name("this"), | ||
// "globals" | ||
self: new Name("self"), | ||
} | ||
|
||
export default names |
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
Oops, something went wrong.