🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@wopjs/cast

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wopjs/cast

Filter types from unknown

Source
npmnpm
Version
0.1.7
Version published
Maintainers
2
Created
Source

@wopjs/cast

Docs Build Status npm-version Coverage Status minified-size

Filter types from unknown.

Install

npm add @wopjs/cast

Usage

import * as c from "@wopjs/cast";
import { Option } from "@wopjs/tsur";

const dataParser = {
  width: c.toNumber,
  position: a => Option.from(a, a => a && c.isNumber(a.x) && c.isNumber(a.y)),
  metadata: c.toNonEmptyPlainObject,
};

function parseData(data) {
  const d = c.asObject(data);
  return Object.fromEntries(Object.keys(dataParser).map(k => [k, Option.unwrapOr(dataParser[k](d[k]))]));
}

Publish New Version

You can use npm version to bump version.

npm version patch

Push the tag to remote and CI will publish the new version to npm.

git push --follow-tags

CI Publish

If you want to publish the package in CI, you need to set the NPM_TOKEN secrets in GitHub repository settings. See how to create a NPM access token.

Keywords

typescript

FAQs

Package last updated on 16 Jan 2026

Did you know?

Socket

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.

Install

Related posts