
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@tailored-apps/dedition
Advanced tools
Wrapper for AJV which can read all json files and adds them as schemas
ajv
(https://www.npmjs.com/package/ajv) and ajv-error
(https://www.npmjs.com/package/ajv-errors).json
filesimport validator from 'dedition'
const valid = validator({ ajvOptions = {}, logger = createDefaultLogger()} = {})
ajvOptions
are all the options which are normally passed to ajv
(https://www.npmjs.com/package/ajv#options)logger
can be passed optionally (i.e.: a winston instance), if not passed a default logger is createdThere are two ajv-options set at any time:
allErrors = true
jsonPointers = true
These are mandatory and CANNOT be overwritten, since ajv-errors
needs these two options to function
After initializing validator
you have access to several functions
Adds a given schema to the ajv
instance using the passed schemaName
as identifier
schemaName
Identifier for the schemaschemaObj
is a ajv
validation schema (https://www.npmjs.com/package/ajv#validation-keywords)Returns: void
Adds the schema from the given filePath
(must be a valid .json file) to the ajv
instance.
The identifier is the fileName without the .json-extension
i.e.: Person.json
-> Identifier: Person
filePath
is the path to the .json fileReturns: void
Adds all the schemas from the given folderPath
(only files inside this folder with extension .json are recognized) to the ajv
instance.
The identifier is the file name without the .json-extenision
i.e.: Person.json
-> Identifier: Person
folderPath
is the path to the folder where the schema files are locatedReturns: void
Validates an Object with the given schema which is identified by the schema identifier string
schemaName
: Name of the schemaobj
: Object to validateReturns: true if valid, otherwise 400: BadRequestError
(from package http-errors
)
Removes all the schemas from the ajv
instance
Returns: void
Checks wheter an schema exists or not
schemaName
: Name of the schemaReturns: True or False wheter the schema exists or not
Returns the schema for a given schemaName
schemaName
: Name of the schemaReturns: Validation Schema object or 500: InternalServerError
(from package http-errors
)
FAQs
Wrapper for AJV which can read all json files and adds them as schemas
We found that @tailored-apps/dedition demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.