Gathering detailed insights and metrics for @janiscommerce/superstruct
Gathering detailed insights and metrics for @janiscommerce/superstruct
Gathering detailed insights and metrics for @janiscommerce/superstruct
Gathering detailed insights and metrics for @janiscommerce/superstruct
npm install @janiscommerce/superstruct
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1 Stars
30 Commits
2 Watching
12 Branches
4 Contributors
Updated on 20 Sept 2022
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
1.6%
62
Compared to previous day
Last week
1.1%
356
Compared to previous week
Last month
-1.5%
1,658
Compared to previous month
Last year
5.9%
22,436
Compared to previous year
1
The following package complements the superstruct package, the same adds some methods to easily validate different types of data
1npm install @janiscommerce/superstruct
The custom types that you can use in addition to the superstruct are:
email
This type checks if is a valid emailURL
This type checks if is a valid URLempty
This type checks if it's an empty string, array or a falsy value!empty
This type checks if it's not an empty string, array or a falsy valuelowercase
This type checks if is a valid lowercase stringuppercase
This type checks if is a valid uppercase stringcamelcase
This type checks if is a valid camelcase stringnumeric
This type checks if is a valid numeric valuemd5
This type checks if is a valid md5 hashJSON
This type checks if is a valid JSONISODate
This type checks if is a valid ISO Dateinteger
This type checks if is a integer numberpositive
This type checks if is a positive numberpositiveOrZero
This type checks if is a positive number or zeroobjectId
This type checks if is a ObjectId with 24 charactersUUID
This type checks if is a V4 UUIDhexColor
This type checks if is a Hexadecimal Color1const { struct } = require('@janiscommerce/superstruct'); 2 3const userStruct = struct({ 4 name: 'string', 5 email: 'email', 6 age: 'number', 7 password: 'md5', 8 image: 'URL', 9 mainColor: 'hexColor 10}); 11 12const userData = { 13 name: 'John Doe', 14 email: 'emai@asd.com', 15 age: 28, 16 password: 'be5b0158b79c90c8358990f34ec18d43', 17 image: 'https://gravatar.com/avatar/23463b99b62a72f26ed677cc556c44e8?s=200', 18 hexColor: '#123456' 19}; 20 21userStruct(userData);
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
Found 3/17 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
17 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More