# @vill-v/type-as

> 开发中常用的类型判断

Latest version **2.0.1** (published 2025-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vill-v/type-as
pnpm add @vill-v/type-as
yarn add @vill-v/type-as
bun add @vill-v/type-as
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-06-27 |
| First published | 2022-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | whitekite |
| Maintainers | whitekite |

## Links

- npm: https://www.npmjs.com/package/@vill-v/type-as
- Repository: https://github.com/vill-v-kit/type-as
- Homepage: https://vill-v-kit.github.io/vill-v/
- Issues: https://github.com/vill-v-kit/type-as/issues
- npm.io page: https://npm.io/package/@vill-v/type-as

## Recent versions

- 2.0.1 (latest) — 2025-06-27
- 2.0.0 — 2025-06-27
- 1.3.3 — 2024-10-23
- 1.3.2 — 2024-09-27
- 1.3.1 — 2024-05-03
- 1.3.0 — 2023-08-20
- 1.2.5 — 2023-07-10
- 1.2.4 — 2023-07-10
- 1.2.3 — 2023-07-10
- 1.2.2 — 2023-02-08
- 1.2.0 — 2023-01-12
- 1.1.3 — 2022-12-05
- 1.1.2 — 2022-12-01
- 1.1.1 — 2022-11-17
- 1.1.0 — 2022-11-07
- … 21 more at https://npm.io/package/@vill-v/type-as/versions

## README

# @vill-v/type-as

neta了崩坏3 往世乐土的英杰维尔薇

<!-- automd:badges color="orange" license licenseBranch  bundlephobia packagephobia -->

[![npm version](https://img.shields.io/npm/v/@vill-v/type-as?color=orange)](https://npmjs.com/package/@vill-v/type-as)
[![npm downloads](https://img.shields.io/npm/dm/@vill-v/type-as?color=orange)](https://npm.chart.dev/@vill-v/type-as)
[![bundle size](https://img.shields.io/bundlephobia/minzip/@vill-v/type-as?color=orange)](https://bundlephobia.com/package/@vill-v/type-as)
[![install size](https://badgen.net/packagephobia/install/@vill-v/type-as?color=orange)](https://packagephobia.com/result?p=@vill-v/type-as)
[![license](https://img.shields.io/github/license/vill-v-kit/type-as?color=orange)](https://github.com/vill-v-kit/type-as/blob/true/LICENSE)

<!-- /automd -->

**开发中常用的类型判断**

## 安装
<!-- automd:pm-install -->

```sh
# ✨ Auto-detect
npx nypm install @vill-v/type-as

# npm
npm install @vill-v/type-as

# yarn
yarn add @vill-v/type-as

# pnpm
pnpm install @vill-v/type-as

# bun
bun install @vill-v/type-as

# deno
deno install @vill-v/type-as
```

<!-- /automd -->

## 说明

_只是个人项目，整体较为随便，作为开发途中的经验总结，如有相似的需求，推荐copy或阅读源码，不建议将该包在实际项目中使用_

**如有幸被实际使用在项目内，不胜荣幸**

```ts

const obj = {test: [{test1: 'test2'}]}

getByPath(obj, 'test[0].test1')
// -> test2

const obj1 = {test: [{test1: 'test2'}]}

setByPath(obj1, 'test[0].test1', 'test3')
// obj -> {test: [{test1: 'test3'}]}

const obj2 = {test: [{test1: 'test2'}]}

delByPath(obj2, 'test[0]')

// obj -> {test: []}

const obj3 = {test: [{test1: 'test2'}]}

hasByPath(obj3, 'test[0].test1')
// -> true
```

<!-- automd:contributors author="Colourlessglow" license="MIT" -->

Published under the [MIT](https://github.com/vill-v-kit/type-as/blob/main/LICENSE) license.
Made by [@Colourlessglow](https://github.com/Colourlessglow) and [community](https://github.com/vill-v-kit/type-as/graphs/contributors) 💛
<br><br>
<a href="https://github.com/vill-v-kit/type-as/graphs/contributors">
<img src="https://contrib.rocks/image?repo=vill-v-kit/type-as" />
</a>

<!-- /automd -->

<!-- automd:with-automd -->

---

_🤖 auto updated with [automd](https://automd.unjs.io)_

<!-- /automd -->

---
_Source: https://npm.io/package/@vill-v/type-as · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
