-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge to main
- Loading branch information
Showing
11 changed files
with
98 additions
and
173 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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Note: | ||
* Only functions related to Abolish Should be added here. | ||
*/ | ||
import type { AbolishSchema } from "./types"; | ||
import Abolish from "./Abolish"; | ||
import type { AbolishSchemaTyped } from "./functions"; | ||
|
||
/** | ||
* Compile a schema object. | ||
* @param schema | ||
* @param abolish | ||
*/ | ||
export function compileSchema(schema: AbolishSchema, abolish?: typeof Abolish) { | ||
if (!abolish) abolish = Abolish; | ||
return abolish.compileObject(schema); | ||
} | ||
|
||
/** | ||
* Compile a rule object. | ||
* @param rule | ||
* @param abolish | ||
*/ | ||
export function compileRule(rule: any, abolish?: typeof Abolish) { | ||
if (!abolish) abolish = Abolish; | ||
return abolish.compile(rule); | ||
} | ||
|
||
/** | ||
* Compile a schema object typed. | ||
* @param schema | ||
* @param abolish | ||
*/ | ||
export function compileSchemaT(schema: AbolishSchemaTyped, abolish?: typeof Abolish) { | ||
return compileSchema(schema, abolish); | ||
} | ||
|
||
/** | ||
* Compile a rule object typed. | ||
* @param rule | ||
* @param abolish | ||
*/ | ||
export function compileRuleT(rule: any, abolish?: typeof Abolish) { | ||
return compileRule(rule, abolish); | ||
} |
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.