![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
option-validator
Advanced tools
A simple option validator
$ npm install option-validator
import optionValidator from 'option-validator';
OR umd builds are also available
<script src="path/to/option-validator.js"></script>
Will expose the global variable to window.optionValidator
.
const option = {
a: 1,
b: '2',
c: {
d: () => null,
},
g: {
h: new Error('error'),
},
i: [1, '2', () => 3],
j: [1, 2, 3, 4, 5, 6],
k: '123456',
};
const scheme = {
// Shallow verification
a: 'number',
b: 'string',
// Deep verification
c: {
d: 'function',
},
// Validator functions
g: {
h: (value, type, path) => {
// value --> new Error('error')
// type --> 'error'
// path --> ['option', 'g', 'h']
// Returns string mean validation failed, and the string will thrown
return 'I will throw an exception';
// Returns error also mean validation failed, and the error will thrown
return new Error('I will throw an exception');
// Returns true mean verification passed
return type === 'error';
},
},
// Verify array elements
i: ['number', 'string', 'function'],
// If there is no corresponding validator, the first one is taken by default.
j: ['number'],
// Verify one of them
k: 'number|string',
};
optionValidator(option, scheme);
MIT © Harvey Zack
FAQs
A simple option validator
The npm package option-validator receives a total of 2,873 weekly downloads. As such, option-validator popularity was classified as popular.
We found that option-validator 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.