Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@kakasoo/proto-typescript
Advanced tools
Utility types and implementations based on JavaScript prototypes.
Utility types and implementations based on JavaScript prototypes. I plan to share the features that are officially available from 2.0.0.
new TypedArray([1, 2, 3] as const).unshift(4 as const); // TypedArray<[4, 1, 2, 3]>
new TypedArray([1, 2, 3] as const).join(','); // TypedString<'1,2,3'>
The return result of 'TypeClass' returns one of the instances of TypeClass again. Therefore, those who know the grammar of JavaScript can use it immediately.
refined
methods/**
* error case
*/
new TypedArray<'1-3'>([1, 2, 3]).refine([1, 2, 3] as const).join('-');
new TypedArray<'1-3'>([]).refine([1, 2, 3] as const).join('-');
new TypedArray<'1-3'>().refine([1, 2, 3, 4] as const).join('-');
new TypedArray<'1-3'>().refine([0, 1, 2, 3] as const).join('-');
/**
* right case
*/
new TypedArray<'1-3'>().refine([2, 3] as const).join('-');
TypedArray
, TypedNumber
has the refine
method, which serves to further narrow down the generic type received as a factor. This helps reduce developer mistakes, but it should be careful because it cannot guarantee actual runtime behavior.
In the future, improvements will be made at the type level.
new TypedString('abcdef').toPrimitive(); // 'abcdef'
You can change it to the primitive type of JavaScript.
const arr = [...new TypedArray([1, 2, 3, 4, 5] as const)]; // (1 | 2 | 3 | 4 | 5)[]
Iterable/Iterator
is supported.
FAQs
Utility types and implementations based on JavaScript prototypes.
The npm package @kakasoo/proto-typescript receives a total of 68 weekly downloads. As such, @kakasoo/proto-typescript popularity was classified as not popular.
We found that @kakasoo/proto-typescript demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.