Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
commodo-fields-int
Advanced tools
A simple integer field, used with the Commodo "withFields" higher order function.
A simple integer field, used with the Commodo withFields
higher order function.
npm install --save commodo-fields-int
Or if you prefer yarn:
yarn add commodo-fields-int
import { compose } from "ramda";
import { withFields, string } from "@commodo/fields";
import { int } from "commodo-fields-int";
const Company = compose(
withFields({
name: string(),
age: int(), // Use it to store a single integer value.
topYears: int({ list: true }) // Or use it to store a list of integer values.
// Other fields you might need...
}),
// Other higher order functions (HOFs) you might need...
)();
const company = new Company();
company.name = "Acme Corporation";
// The int field can only accepts integers.
company.age = 17;
company.topYears = [2000, 2005, 2010];
// The following will throw the WithFieldsError error.
company.age = "17";
company.age = 16.2;
company.topYears = [2000, "2005", 2010];
Note: alternatively, you could've also used the populate
method to assign the data:
const company = new Company();
company.populate = { age: 17, topYears: [2000, 2005, 2010] };
Thanks goes to these wonderful people (emoji key):
Adrian Smijulj 💻 📖 💡 👀 ⚠️ |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
A simple integer field, used with the Commodo "withFields" higher order function.
The npm package commodo-fields-int receives a total of 14 weekly downloads. As such, commodo-fields-int popularity was classified as not popular.
We found that commodo-fields-int 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.