npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

verify-tool

v1.0.2

Published

a simple type checking tool with TypeScript

Downloads

12

Readme

verify-tool

styled with prettier Greenkeeper badge Build Status Coverage Status

a simple type checking tool with TypeScript

Useage

npm install verify-tool -D
// or
yarn install verify-tool --dev

import verify from 'verify-tool'

API

Still in the process of replenishment, so the API is messy and there is no time to sort it out. Follow-up will organize the structure

more case can found in ./test/verify.test.ts

1. verify.isString(input: string)

return true if the input is a string. otherwise return false instead.

2. verify.isArray(input: any)

return true if the input is an array. otherwise return false instead.

3. verify.isDate(input: any)

return true if the input is a date. otherwise return false instead.

4. verify.isNumber(input: any)

return true if the input is a number. otherwise return false instead.

5. verify.isInfinity(input: any)

return true if the input is a infinity. otherwise return false instead.

6. verify.isBoolean(input: any)

return true if the input is a boolean. otherwise return false instead.

7. verify.isError(input: any)

return true if the input is a error object. otherwise return false instead.

8. verify.isRegExp(input: any)

return true if the input is a regexp object. otherwise return false instead.

9. verify.isObject(input: any)

return true if the input is an object. otherwise return false instead.

10. verify.isFunction(input: any)

return true if the input is a Function/AsyncFunction/GeneratorFunction. otherwise return false instead.

11. verify.isPlainObject(input: any)

return true if the input is a plain object. otherwise return false instead.

12. verify.isDomNode(input: any)

return true if the input is a dom node. otherwise return false instead.

const divNode = document.createElement('div')
verify.isDomNode(divNode)

13. verify.isNull(input: any)

return true if the input is null. otherwise return false instead.

14. verify.isUndefined(input: any)

return true if the input is undefined. otherwise return false instead.

15. verify.isJsonStr(input: string)

return true if the input is standard json str. otherwise return false instead.

16. verify.isNaN(input: any)

return true if the input is NaN. otherwise return false instead.

17. verify.isUrl(input: string)

return true if the input is an url. otherwise return false instead.

18. verify.isNullOrUndefined(input: any)

return true if the input is null or undefined. otherwise return false instead.

19. verify.isEmail(input: string)

return true if the input is an email str. otherwise return false instead.

20. verify.isIdCard(input: string)

return true if the input is an id card number str(for china). otherwise return false instead.

21. verify.isPlateNumber(input: string)

return true if the input is a car plate number str(for china). otherwise return false instead.

verify.isPlateNumber('川A·B45N4') // true
verify.isPlateNumber('川AB45N4') // true

22. verify.isPhone(input: string)

return true if the input is a phone number str(for china). otherwise return false instead.

23. verify.isInteger(input: number)

return true if the input is a integer number str. otherwise return false instead.

24. verify.isOdd(input: number)

Check if it is odd

25. verify.isEven(input: number)

Check if it is even

26. verify.isAndroid(userAgent: string)

Check if the operating system is Android

verify.isAndroid(window.navigator.userAgent)

27. verify.isIOS(userAgent: string)

Check if the operating system is IOS

28. verify.isMobileDevice(userAgent: string)

Check if it is a mobile device

29. verify.isEmpty(input: string|array|object)

Check if the input value is '' or [] or {}

30. verify.isArguments(input: any)

Check if it is arguments

31. verify.isPromise(input: any)

Check if it is Promise or a fake promise, like this:

{then(){}, catch(){}}