![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Familiar classes, mixins, and interfaces in ES5 Javascript. Member decorations for powerful objects that keep your code DRY
Typedef is a lightweight library (1.7 KB, 4.7 KB with underscore.js bundled in) that brings some much-needed sanity to object-oriented programming in Javascript. These features will feel very familiar and refreshing to anyone experienced in a more civilized staticly-typed language like C# or Java.
Typedef introduces two interesting concepts for Javascript: class member decorations, and the idea of "define-time" (semi-static) checking. In addition it rolls in classical-style inheritance, interfaces, and mixins.
The goal is to let you build scalable web apps with a rich class hierarchy using proven object-oriented concepts and semantics-enforcing constructs. Wed with the dynamic nature of Javascript-- it's a potent mix.
The Javascript romantic in you may recoil and shout back about the virtues of embracing the native prototype-style inheritance model. This is understandable-- but if you can unburden yourself from the limitations you've built around the language and keep an open mind... you're in for a wild ride.
Class inheritance. Classical inheritance goodness in Javascipt. Create a rich class hierarchy that feels sane, with all the power and common sense you've come to expect in an object-oriented language.
Mixins. Add member functions to a class without enforcing a
strict single-inheritance relationships. The before
, after
, and wrapped
"advice" decorations can be used to modify existing functions.
Interfaces. Classical interface
pattern lets you write code that is
self-documenting and forces define-time checks on code contracts.
Member decorations. Use modifiers on class members, mixin members, or interface members to change their behavior or enforce inheritance and access semantics, or use custom decorations and reflection to amp up your own classes and reduce boilerplate.
Define-time semantics checking. Use the virtual
, abstract
, and
override
member decorations to ensure predictable inheritance behavior, and
get feedback in the form of define-time errors when implementation contracts
are broken.
Member decorations are a key part of Typedef. They allow for the attachment of meta tags onto members during class definition. This meta information can then be used to inforce certain rules, or change the behavior of the member.
All decorations are surrounded by 2 underscores, and multiple decorations can be set on a single member.
The inheritance decorations are used to govern and check the inheritance semantics of your classes.
All inheritance decorations only add additional checking overhead during define time; no run-time overhead is incurred after the initial load and definition.
Typedef will work with the following browsers:
npm install
grunt test
Copyright 2013 Brandon Valosek
Typedef is released under the MIT licenses.
FAQs
Low-level type-centric utility functions for Javascript.
The npm package typedef receives a total of 163 weekly downloads. As such, typedef popularity was classified as not popular.
We found that typedef 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
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.