Socket
Book a DemoInstallSign in
Socket

@vbs/utils

Package Overview
Dependencies
Maintainers
0
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vbs/utils

Team front end tool library

1.3.0
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

VUtils

Team front end tool library

npm version GitHub issues GitHub forks GitHub stars GitHub license

Install

npm i @vbs/utils -S

Use

Mode 1

<script src="//cdn.jsdelivr.net/npm/@vbs/utils/dist/index.umd.js"></script>
<script>
  console.log(window.VUtils);
  const { isQQ, getType } = window.VUtils;

  console.log(isQQ(2323333339)); // true
  console.log(isQQ(1000)); // false

  console.log(getType(true)); // boolean
  console.log(getType(0)); // number
</script>

Mode 2

<script type="module">
  import { isQQ, getType } = '../dist/index.esm.js';

  console.log(isQQ(2323333339)); // true
  console.log(isQQ(1000)); // false

  console.log(getType(true)); // boolean
  console.log(getType(0)); // number
</script>

Mode 3

import { isQQ, getType } from "@vbs/utils";

console.log(isQQ(2323333339)); // true
console.log(isQQ(1000)); // false

console.log(getType(true)); // boolean
console.log(getType(0)); // number

API

  • 校验
    • isQQ: (data: string | number) => boolean 校验是否是 QQ 号
    • isPhone: (data: string | number) => boolean 校验是否是手机号
    • isIDCard: (data: string) => boolean 校验是否是身份证号
    • isEmail: (data: string) => boolean 校验是否是邮箱
    • isBankCard: (data: string|number) => boolean 校验是否是银行卡
    • isName: (data: string, type: "CN" | "EN") => boolean 校验是否是姓名
  • 类型
    • getType: (data: unknown) => string 获取数据类型
  • 方法
    • compressImage: (file: File, quality = 1) => Promise<File> | Error 压缩图片
    • parseUrl: (url: string) => object | null 获取 URL 的相关对象
    • dataURLtoBlob: (dataURL: string) => Blob | null 将 Base64 字符串转为 Blob 对象
    • dataURLtoFile: (dataURL: string, fileName: string) => File | null 将 Base64 字符串转为 File 对象
  • 函数
    • cloneDeep: (data: Array | Record<string | number, unknown>) => Array | Record<string | number, unknown>

Keywords

utils

FAQs

Package last updated on 23 Jul 2025

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.