Comparing version 1.0.1 to 1.0.2
@@ -172,3 +172,5 @@ var request = require('request') | ||
// check for a match in the resource name or path | ||
var nameMatch = rgxName.test(resource) || rgxPath.test(resource) | ||
var nameMatch = (normName && rgxName.test(resource)) | ||
|| (normPath && rgxPath.test(resource)) | ||
// check that the verbs allowed with this resource match `verb` | ||
@@ -175,0 +177,0 @@ var verbMatch = candidate.methods.indexOf(verb) !== -1 |
{ | ||
"name": "unio", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "One REST API Client for All.", | ||
@@ -5,0 +5,0 @@ "main": "lib/unio.js", |
@@ -93,3 +93,3 @@ #unio | ||
// | ||
// add a new spec directly | ||
// add a new spec | ||
// | ||
@@ -112,2 +112,3 @@ var apiSpec = { | ||
// add the spec to the client, then use it and start making requests! | ||
unio() | ||
@@ -120,3 +121,2 @@ .spec(apiSpec) | ||
``` | ||
@@ -214,4 +214,17 @@ | ||
Each object in the `resources` array represents a resource. Each resource must contain the following keys: | ||
Each object in the `resources` array represents a REST API resource. For example, a `GET user` resource taking three optional parameters (id, name, and location) would look like this: | ||
```javascript | ||
{ | ||
path: 'user', | ||
methods: [ 'get' ], | ||
params: { | ||
id: 'optional', | ||
name: 'optional', | ||
location: 'optional' | ||
} | ||
} | ||
``` | ||
Each of the resource keys are described below: | ||
####`path` (String) | ||
@@ -223,3 +236,3 @@ | ||
Optional name of the resource. When you make a request with unio, for example with `.get(resource, ...)`, you can specify the resource by its `name` value rather than by its `path`. Think of it like an alias `path` value for the resource. | ||
**Optional** name of the resource. When you make a request with unio, for example with `.get(resource, ...)`, you can specify the resource by its `name` value rather than by its `path`. Think of it like an alias `path` value for the resource. | ||
@@ -226,0 +239,0 @@ E.g. If the following resource is specified: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25353
531
306