
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@xylabs/error
Advanced tools
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### functions
### <a id="assertError"></a>assertError
function assertError(
value,
assert,
defaultMessage): undefined;
Throws an Error based on the assert configuration when a value fails validation.
unknown
The value being validated
AssertConfig | undefined
Assertion config controlling the error message
string
Fallback message if no custom message is provided
undefined
### <a id="handleError"></a>handleError
function handleError<T>(error, handler): T;
Invokes the handler if the value is an Error, otherwise re-throws it.
T
any
The caught value to inspect
(error) => T
Callback invoked with the Error if it is one
T
The handler's return value
### <a id="handleErrorAsync"></a>handleErrorAsync
function handleErrorAsync<T>(error, handler): Promise<T>;
Async version of handleError. Invokes the async handler if the value is an Error, otherwise re-throws it.
T
any
The caught value to inspect
(error) => Promise<T>
Async callback invoked with the Error if it is one
Promise<T>
The handler's resolved return value
### type-aliases
### <a id="AssertConfig"></a>AssertConfig
type AssertConfig = string | AssertCallback | boolean;
Configuration for assertion behavior: a static message string, a boolean toggle, or a callback.
FAQs
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
The npm package @xylabs/error receives a total of 8,271 weekly downloads. As such, @xylabs/error popularity was classified as popular.
We found that @xylabs/error demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.