![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.
es7-checktypes-decorator
Advanced tools
An es7 decorator used to validate class and methods arguments.
v0.2.1
A simple es7 decorator to control your class and methods arguments types or instances.
If the decorator detects an anomaly, it will throw a ArgumentTypeError
with a message showing the wrong argument.
Configure babel to use decorators:
npm i --save-dev babel-transform-decorators-legacy
and add "plugins": ["transform-decorators-legacy"]
in your .babelrc.
then: npm i --save-dev es7-checktypes-decorator
First, require the decorator:
import { checktypes } from 'es7-checktypes-decorator';
The decorator will control if your arguments have the good type and / or are an instance of a Class.
You have simply to call the decorator before a method or a class. Like that:
@checktypes('Number', CustomClass)
// This class expects to receive arg1 as Number (typeof) and arg2 as CustomClass instance (instanceof).
class Class_expecting_Number_type_and_CustomClass_instance {
constructor(arg1, arg2) {}
@checktypes('String', 'Number')
method_expecting_String_type_and_Number_type(arg1, arg2) {}
@checktypes(Array, Date, CustomClass)
method_expecting_Array_and_Date_and_CustomClass_instances(arg1, arg2, arg3) {}
@checktypes(['String', CustomClass], ['Number', 'String'])
// This method expects to receive arg1 as String or CustomClass instance
// and arg2 as Number or String.
method_expecting_String_type_or_CustomClass_and_Number_type_or_String_type(arg1, arg2) {}
}
If the validation is ok, your class or your methods will be executed as always.
If the validation is wrong, the decorator will throw a ArgumentTypeError
(inherited from TypeError) with a custom message.
v0.2.1
Author: Guillaume Mousnier
Type: Hotfix
Changes:
FAQs
An es7 decorator used to validate class and methods arguments.
The npm package es7-checktypes-decorator receives a total of 2 weekly downloads. As such, es7-checktypes-decorator popularity was classified as not popular.
We found that es7-checktypes-decorator 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.