Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
http-assert-value
Advanced tools
npm install http-assert-value --save
const assert = require('http-assert-value');
// Common assert interface
assert(+0 === -0, 'Zeros are not equal', 500, 'ZNE', {
leftOperand: +0,
reghtOperand: -0,
operation: '==='
}); // Ok
// Assert typed values
assert.identity('green-mile'); // Ok
assert.float('3.14'); // Ok
assert.positiveInt('12'); // Ok
assert.text('The Green Mile'); // Ok
// Assert by JSON schema
// @see: http://json-schema.org/
assert.bySchema('1', { type: 'integer' }); // Ok
// All methods have duplicates with `try...`
assert.text(undefined); // Error
assert.tryText(undefined); // Ok
try {
assert.text('DROP DATABASE BOOKS;');
} catch (error) {
error.message; // 'Text is invalid'
error.statusCode; // 400
error.options; // { value: 'DROP DATABASE BOOKS;', internalCode: '400_TVI' }
}
Assert value with http-specific error data
Any
- asserting valueString
- error textNumber
- error http-codeString
- three-letter error codeObject
- error additional informationAssert slug or unique identity value
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert float value
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert positive integer value
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert text, like search request
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert object by schema
Any|Array<Any>
- asserting valueObject
- asserting valueObject
- ajv constructor optionsAssert slug or unique identity value, when value is defined
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert float value, when value is defined
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert positive integer value, when value is defined
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert text, like search request, when value is defined
String|Array<String>
- asserting valueString
- name of the parameter containing valueAssert object by schema, when value is defined
Any|Array<Any>
- asserting valueObject
- asserting valueObject
- ajv constructor optionsFAQs
assert values with status codes
We found that http-assert-value demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.