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

chars.js

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chars.js

A tiny Javascript single-ascii-character utility/library

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

chars.js

All about single ascii characters. Experimental and under development, will evolve over time.

No proper readme yet, incomplete, will try to update soon.






API

ASCII_RANGE is an array with two indices: [bottomOfRange, topOfRange]

Chars.ASCII_RANGE_UPPERCASE Chars.ASCII_RANGE_LOWERCASE Chars.ASCII_RANGE_NUMBERS Chars.ASCII_RANGE_SPECIAL_1 Chars.ASCII_RANGE_SPECIAL_2 Chars.ASCII_RANGE_SPECIAL_3 Chars.ASCII_RANGE_SPECIAL_4 Chars.ASCII_RANGE_ALL

Chars.REGEXP_SPECIAL_CHARS

<array> REGEXP_SPECIAL_CHARS

Returns an array (like a set) with all special characters used in regular expressions.

Chars.ascii Chars.ordinal

Chars.isUpper

<boolean> Chars.isUpper( <string>/<number> char )

Returns true if char is uppercase.

Chars.isLower

<boolean> Chars.isLower( <string>/<number> char )

Returns true if char is lowercase.

Chars.isAlpha

<boolean> Chars.isAlpha( <string>/<number> char )

Returns true if char is uppercase or lowercase alpha.

Chars.isNumeric

<boolean> Chars.isNumeric( <string>/<number> char )

Returns true if char is a number.

Chars.isSpecial

<boolean> Chars.isSpecial( <string>/<number> char )

Returns true if char is a special character from the SPECIAL_1,2,3 or 4 range.

Chars.isAlphaNumeric

<boolean> Chars.isAlphaNumeric( <string>/<number> char )

Returns true if char is a uppercase, lowercase or number.

Chars.random

<string> Chars.random( range )

Returns a random character in range range. range defaults to the Chars.ASCII_RANGE_ALL range

Chars.prototype.constructor

<object> constructor( <string>/<number> char, <array> range )

char can be a number character or ordinal, range has the format of ASCII_RANGE

Chars.prototype.get

<string> get()

Returns this.char

Chars.prototype.set

<this> set( <string>/<number> char )

char can be a number character or ordinal. If char is an ordinal, the character represented by ordinal will be set.

Chars.prototype.next

<this> next( <string>/<number> amount )

Proceed this.char to the following ascii character, if no arguments are given. Proceed to amount ascii characters ahead, limited by this.range, if amount is set.

Chars.prototype.prev

<this> prev( <string>/<number> amount )

Proceed this.char to the following ascii character, if no arguments are given. Proceed to amount ascii characters back, limited by this.range, if amount is set.

Chars.prototype.isUpper

Chars.prototype.isLower

Chars.prototype.isAlpha

Chars.prototype.isNumeric

Chars.prototype.isSpecial

Chars.prototype.isAlphaNumeric

Chars.prototype.random

Keywords

FAQs

Package last updated on 02 Oct 2014

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