Skip to content

Commit

Permalink
Initial version.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidTPate committed Mar 31, 2016
1 parent 122a23d commit 6c00291
Show file tree
Hide file tree
Showing 11 changed files with 499 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
coverage
96 changes: 96 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"env": {
"node": true,
"mocha": true,
"amd": true,
"es6": true
},
"rules": {
"no-restricted-modules": [2, "cluster"],
"no-alert": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-bitwise": 0,
"no-catch-shadow": 2,
"no-console": 2,
"comma-dangle": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-div-regex": 2,
"no-dupe-keys": 2,
"no-else-return": 2,
"no-empty": 2,
"no-empty-character-class": 2,
"no-eq-null": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-func-assign": 0,
"no-floating-decimal": 2,
"no-implied-eval": 2,
"no-with": 2,
"no-fallthrough": 2,
"no-unreachable": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-unused-expressions": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-obj-calls": 2,
"no-multi-str": 2,
"no-new-wrappers": 2,
"no-new": 0,
"no-new-func": 2,
"no-native-reassign": 2,
"no-plusplus": 0,
"no-delete-var": 2,
"no-return-assign": 2,
"no-new-object": 2,
"no-label-var": 2,
"no-ternary": 0,
"no-self-compare": 2,
"no-sequences": 2,
"no-sync": 2,
"no-underscore-dangle": 0,
"no-loop-func": 2,
"no-labels": 2,
"no-unused-vars": [2, {"vars": "all", "args": "none"}],
"no-script-url": 2,
"no-proto": 2,
"no-iterator": 2,
"no-mixed-requires": [0, false],
"no-extra-parens": 2,
"no-irregular-whitespace": 2,
"no-extend-native": 2,
"no-shadow": 2,
"no-use-before-define": [2, "nofunc"],
"no-redeclare": 2,
"no-regex-spaces": 2,
"brace-style": 0,
"block-scoped-var": 2,
"camelcase": 2,
"complexity": [0, 11],
"consistent-this": [0, "that"],
"curly": 2,
"dot-notation": [2, {"allowKeywords": true}],
"eqeqeq": 2,
"guard-for-in": 2,
"max-depth": [0, 4],
"max-len": [0, 80, 4],
"max-params": [0, 3],
"max-statements": [0, 10],
"new-cap": 0,
"new-parens": 2,
"one-var": 0,
"quotes": [2, "single"],
"quote-props": 0,
"radix": 0,
"semi": 2,
"strict": 2,
"unnecessary-strict": 0,
"use-isnan": 2,
"valid-typeof": 2,
"wrap-iife": 2,
"wrap-regex": 0,
"eol-last": 0
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ node_modules

# Users Environment Variables
.lock-wscript

# IntelliJ
.idea
74 changes: 74 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

{
"excludeFiles": [
"node_modules/*",
"learn/*",
"coverage/*",
"test/karma/*"
],
"fileExtensions": [
".js"
],
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"case",
"switch",
"return",
"try",
"catch",
"function",
"typeof"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"requireBlocksOnNewline": 1,
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowDanglingUnderscores": true,
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
],
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"disallowKeywords": [
"with"
],
"disallowMultipleLineBreaks": true,
"validateQuoteMarks": "'",
"validateIndentation": 4,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywordsOnNewLine": [
"else"
],
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"disallowYodaConditions": true,
"disallowNewlineBeforeBlockStatements": true
}
7 changes: 7 additions & 0 deletions .jsinspectrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"threshold": 40,
"identifiers": true,
"diff": true,
"color": true,
"ignore": "node_modules|coverage|test"
}
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
coverage
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: node_js
sudo: false
node_js:
- '0.10'
- '0.11'
- '0.12'
- 'iojs'
- '4'
- '5'
script: npm test
after_script: npm install coveralls && cat ./coverage/lcov.info | coveralls
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# rfc-3986
Javascript implementation of RFC-3986 and its components for use with matching and validation
Javascript implementation of the ABNF from RFC-3986 to allow validation of parts of the specification.

[![Build Status](https://travis-ci.org/DavidTPate/rfc-3986.svg?branch=master)](https://travis-ci.org/DavidTPate/rfc-3986)
[![Coverage Status](https://coveralls.io/repos/github/DavidTPate/rfc-3986/badge.svg?branch=master)](https://coveralls.io/github/DavidTPate/rfc-3986?branch=master)
[![npm](https://img.shields.io/npm/v/rfc-3986.svg)](https://www.npmjs.com/package/rfc-3986)
[![Downloads](https://img.shields.io/npm/dm/rfc-3986.svg)](https://www.npmjs.com/package/rfc-3986)
[![Node.js Version](https://img.shields.io/node/v/rfc-3986.svg)](https://www.npmjs.com/package/rfc-3986)

## Install

```bash
$ npm install rfc-3986
```

## API

```js
var rfc3986 = require('rfc-3986')
```

## RFC-3986
This is an object which has various properties containing regular expressions matching parts of the specification.

### rfc3968.cidr
Matches the CIDR part of an IP address, matches numbers 0-32.

### rfc3986.IPv4address
Matches an IPv4 address.

### rfc3986.IPv6address
Matches an IPv6 address.

### rfc3986.IPvFuture
Matches an IPvFuture address.

### rfc3986.IPLiteral
Matches an IPLiteral which is either an IPv4, IPv6, or IPvFuture.

### rfc3986.scheme
Matches the scheme part of the URI.

### rfc3986.hierPart
Matches the hierarchial part of the URI which identifies the authority (domain/ip address) and the path.

### rfc3986.query
Matches the query part of a URI which contains the query parameters and the `?` delimiter.

### rfc3986.fragment
Matches the fragment part of a URI which contains the hash value.

### rfc3986.uri
Matches a URI which conforms to RFC-3986.
Loading

0 comments on commit 6c00291

Please sign in to comment.