![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
A JavaScript library that helps with the enum pattern. Also supports TypeScript.
A JavaScript library that helps with the enum pattern. Also supports TypeScript.
Installation:
npm install enumify
class Color extends Enumify {
static red = new Color();
static orange = new Color();
static yellow = new Color();
static green = new Color();
static blue = new Color();
static purple = new Color();
static _ = this.closeEnum(); // TypeScript: Color.closeEnum()
}
// Instance properties
assert.equal(
Color.red.enumKey, 'red');
assert.equal(
Color.red.enumOrdinal, 0);
// Prototype methods
assert.equal(
'Color: ' + Color.red, // .toString()
'Color: Color.red');
// Static `.enumKeys` and static `.enumValues`
assert.deepEqual(
Color.enumKeys,
['red', 'orange', 'yellow', 'green', 'blue', 'purple']);
assert.deepEqual(
Color.enumValues,
[ Color.red, Color.orange, Color.yellow,
Color.green, Color.blue, Color.purple ]);
// Static `.enumValueOf()`
assert.equal(
Color.enumValueOf('yellow'),
Color.yellow);
// Iterability
const result = [];
const iterated = [...Color];
for (const c of Color) {
result.push('Color: ' + c);
}
assert.deepEqual(
iterated, [
Color.red,
Color.orange,
Color.yellow,
Color.green,
Color.blue,
Color.purple,
]);
See:
ts/test/index_test.ts
ts/test/state.ts
Run tests like this (after compiling TypeScript, e.g. via npm run build
):
npm t dist/test/index_test.js
FAQs
A JavaScript library that helps with the enum pattern. Also supports TypeScript.
The npm package enumify receives a total of 31,864 weekly downloads. As such, enumify popularity was classified as popular.
We found that enumify 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
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.