-
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.
Showing
7 changed files
with
87 additions
and
277 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
export const isValidSync: (input: string, schema: string) => boolean | ||
export declare class JSONSchema { | ||
isValid(input: any): boolean | ||
} | ||
|
||
export const validateSync: (input: string, schema: string) => void | ||
|
||
export const isValid: ( | ||
input: Buffer | string | ArrayBuffer | Uint8Array, | ||
schema: Buffer | string | ArrayBuffer | Uint8Array, | ||
) => Promise<boolean> | ||
|
||
export const validate: ( | ||
input: Buffer | string | ArrayBuffer | Uint8Array, | ||
schema: Buffer | string | ArrayBuffer | Uint8Array, | ||
) => Promise<null> | ||
export const compile: (schema: any) => (input: string) => boolean |
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,24 +1,7 @@ | ||
const { loadBinding } = require('@node-rs/helper') | ||
|
||
const { | ||
isValid: _isValid, | ||
validate: _validate, | ||
isValidSync: _isValidSync, | ||
validateSync: _validateSync, | ||
} = loadBinding(__dirname, 'jsonschema', '@node-rs/jsonschema') | ||
const { compile: _compile } = loadBinding(__dirname, 'jsonschema', '@node-rs/jsonschema') | ||
|
||
module.exports.isValid = function isValid(input, schema) { | ||
return _isValid(Buffer.from(input), Buffer.from(schema)) | ||
} | ||
|
||
module.exports.isValidSync = function isValidSync(input, schema) { | ||
return _isValidSync(input, schema) | ||
} | ||
|
||
module.exports.validate = function validate(input, schema) { | ||
return _validate(Buffer.from(input), Buffer.from(schema)) | ||
} | ||
|
||
module.exports.validateSync = function uncompress(input, schema) { | ||
return _validateSync(input, schema) | ||
module.exports.compile = function (schema) { | ||
return _compile(JSON.stringify(schema)) | ||
} |
Oops, something went wrong.