
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
A validation library creator
We all have seen a thousand validation libraries out there, but there is something they all have in common: they have way, way more tests than your project could ever need. All you need to do is validate strings, and you pull in something that validates social security numbers, canadian zip codes, and IPV6 addresses, which adds excess bloat to your application without any additional benefit.
With isifier, the library is only as targeted as you need it to be, as all it does is create a namespace for your tests and a method to add to it. It is 440 bytes minified and gzipped.
import is from "isifier";
// add common type tests
is.addTest("string", value => typeof value === "string");
console.log(is.string("foo")); // true
console.log(is.string(123)); // false
// or complex validation
is.addTest("important", ({ isImportant, textContent }) => {
return (
isImportant ||
(is.string(textContent) && textContent.toLowerCase().includes("important"))
);
});
console.log(is.important({ isImportant: true, textContent: null })); // true
console.log(
is.important({
isImportant: false,
textContent: "I have IMPORANT stuff!"
})
); // true
// it also adds "all" and "any" convienence methods to test multiple values at once
console.log(is.all.string("foo", "bar", "baz")); // true
console.log(
is.any.important(
{ isImportant: false, textContent: null },
{ isImportant: false, textContent: "I am important" }
)
); // true
is.addTest(name: string, validator: function): boolean
Adds a new validator test to the is object, accessible on all uses of is from that point on.
Create a unique instance of isifier. Useful if you want to avoid collisions with other library applications.
import is, { createInstance } from "isifier";
is.addTest("number", value => typeof value === "number");
const instance = createInstance();
console.log(instance === is); // false
instance.addTest("number", value => typeof value === "number" && !isNaN(value));
console.log(is.number(NaN)); // true
console.log(instance.number(NaN)); // false
Standard stuff, clone the repo and npm install dependencies. The npm scripts available:
build => run webpack to build development dist file with NODE_ENV=developmentbuild:minified => run webpack to build production dist file with NODE_ENV=productiondev => run webpack dev server to run example app / playgrounddist => runs build and build:minifiedlint => run ESLint against all files in the src folderprepublish => runs prepublish:compile when publishingprepublish:compile => run lint, test:coverage, transpile:es, transpile:lib, disttest => run AVA test functions with NODE_ENV=testtest:coverage => run test but with nyc for coverage checkertest:watch => run test, but with persistent watchertranspile:lib => run babel against all files in src to create files in libtranspile:es => run babel against all files in src to create files in es, preserving ES2015 modules (for
pkg.module)FAQs
Create objects with no inhereted prototype
We found that isifier 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.