New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

oarsjs

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oarsjs

a JavaScript function lib

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-88.89%
Maintainers
1
Weekly downloads
 
Created
Source

OarsJS

一个函数库,包含一些常用函数。

安装

npm

npm install OarsJS
import oars from oarsjs
oars.foo()

CDN

<script src="https://unpkg.com/oarsjs/dist/oars.js"></script>
<script>
    this.oars.foo()
</script>

使用指南

build_query

将对象序列化为查询字符串

let obj = {
    name:'foo',
    age:23
}
oars.build_query(obj) //return 'name=foo&age=23'

reg

常用正则表达式,包含邮箱、手机号等的判断

//第一个参数传入需要判断的规则,第二个参数传入需要判断的数据
oars.reg('email','example@foo.com'); //return true
oars.reg('phone','1122uujjj'); //return false
oars.reg('ip','192.168.10.1'); // return true

所有支持的规则

  • phone(手机号)
  • email(邮箱)
  • url(网址)

Keywords

FAQs

Package last updated on 26 Apr 2021

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc