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.
@op-engineering/toolkit
Advanced tools
In every project I work I end up needing the same bunch of functions. This is just a repo which contains them so I can easily install them and import them.
yarn add osp-toolkit
Some shorthand costants for React Native.
import { isIOS, isAndroid, ANDROID_VERSION, IOS_VERSION } from "osp-toolkit";
Although hooks are not my favorite, sometimes there are useful patterns.
import { useBoolean } from "osp-toolkit";
function myComponent() {
const [isFoo, fooOn, fooOff] = useBoolean();
}
Invariant checks allow to assure the state of your app, by default they crash on releases so you better have error tracking via Sentry or similar set up.
import { invariant, nullthrows } from "osp-toolkit";
invariant(myVar === "foo", "myVar does not match, this crashes");
nullthrows(myVar, "myVar is null, this is crashes");
A simple sleep function for async contexts
import { sleep } from "osp-toolkit";
async function foo() {
await sleep(500);
}
I love logging to console, so there are a couple utilities inserted on the global namespace that make your logs a little easier to visually parse
marker(`1`) // Outputs 🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷 MARK ${i} 🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷🔷 to console
const myObj = {
...
// some complex obj
}
debug(myObj) // Will pretty print an object to the RN console
FAQs
Toolkit useful functions
The npm package @op-engineering/toolkit receives a total of 1 weekly downloads. As such, @op-engineering/toolkit popularity was classified as not popular.
We found that @op-engineering/toolkit demonstrated a healthy version release cadence and project activity because the last version was released less than 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.