
Security News
Node.js Considers Public Workflow for Security Reports Amid AI-Driven Surge
Node.js is debating whether AI-driven security report volume warrants moving more vulnerability reports into public workflows.
iwt is a javascript utility that returns the value passed in when the passed variable is the value of the type you want, otherwise it returns the value of the default type.
iwt is a javascript utility that returns the value passed in when the passed variable is the value of the type you want, otherwise it returns the value of the default type.
var iwt = require("iwt");
const arr = { a: ["a"], b: 1 };
const obj = { a: { a: 1 }, b: 1 };
iwt.array(arr.a); // ['a'];
iwt.array(arr.b); // [];
iwt.array(arr.b, ["b"]); // ['b'];
iwt.object(obj.a); // {a: 1};
iwt.object(obj.b); // {};
iwt.object(obj.b, { b: 1 }); // {b: 1};
// ...
// iwt.null
// iwt.undefined
// iwt.function
// iwt.boolean
// iwt.number
// iwt.null
// iwt.null
const get = require("lodash/get");
const a = {};
iwt.object(get(a, "b.c.e.f.g.h")); // {};
| methods | return value |
|---|---|
| array(any, defaultValue) | [] |
| object(any, defaultValue) | {} |
| function(any, defaultValue) | new Function() |
| boolean(any, defaultValue) | true |
| string(any, defaultValue) | '' |
| number(any, defaultValue) | 0 |
| undefined(any, defaultValue) | undefined |
| null(any, defaultValue) | null |
| date(any, defaultValue) | new Date() |
| regExp(any, defaultValue) | new RegExp() |
| symbol(any, defaultValue) | Symbol('symbol') |
| getValue(type, any, defaultValue) | 无 |
| typeOf(any) | "number","string","function", "regExp", "null", "undefined", "date", "boolean", "object", "array", "symbol" |
FAQs
iwt is a javascript utility that returns the value passed in when the passed variable is the value of the type you want, otherwise it returns the value of the default type.
The npm package iwt receives a total of 2 weekly downloads. As such, iwt popularity was classified as not popular.
We found that iwt 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
Node.js is debating whether AI-driven security report volume warrants moving more vulnerability reports into public workflows.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.