Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@revmob/minimum-bid-validator
Advanced tools
This module contains simple rules for minimum bid retrieval and validation for different countries and OSs.
npm install --save @revmob/minimum-bid-validator
// CommonJS:
const minimumBidValidator = require('@revmob/minimum-bid-validation').default
// or with ES6 modules:
import minimumBidValidator from '@revmob/minimum-bid-validation'
minimumBidValidator.setDefaultMinimumBid(defaults: BidInfo) => Void
minimumBidValidator.setAllBidsByCountry(bids: CountryBids) => Void
minimumBidValidator.getMinimumBid(os: String, countryList: String[]) => Number | undefined
minimumBidValidator.validate(os: String, countryList: String[], currentBid: Number) => Void, throws: Error
interface BidInfo {
[os: String]: Number
}
interface CountryBids {
[countryCode: String]: BidInfo
}
getMinimumBid
setAllBidsByCountry
, returns the default minimum bid.undefined
.validate
setAllBidsByCountry
, uses the default minimum bid to validate.// First setup...
const defaultBids = {
'android': 1,
'ios': 2
}
// Setting the default bids
minimumBidValidator.setDefaultMinimumBid(defaultBids)
// Setting the bids for each country
const bids = {
BR: { 'android': 1, 'ios': 1 }
US: { 'android': 2, 'ios': 2 }
IN: { 'android': 0.5, 'ios': 0.75 }
}
minimumBidValidator.setAllBidsByCountry(bids)
// Then using...
// Getting the minimum bid for android in ['BR', 'US']
minimumBidValidator.getMinimumBid('android', ['BR', 'US']) // returns 2
// Validate if a given bid is greater than or equal the minimum bid
minimumBidValidator.validate('android', ['BR', 'US'], 1) // throws Error
FAQs
Revmob minimum bid validation utility
The npm package @revmob/minimum-bid-validator receives a total of 6 weekly downloads. As such, @revmob/minimum-bid-validator popularity was classified as not popular.
We found that @revmob/minimum-bid-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.