Skip to content

Commit

Permalink
Fix PathLoader#load documentation
Browse files Browse the repository at this point in the history
Fixes #20
  • Loading branch information
whitlockjc committed Sep 6, 2018
1 parent 4952814 commit adcb19e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Release Notes

### v1.0.9 (2018-09-06)

* Fix `PathLoader#load` documentation _(Issue #20)_

### v1.0.8 (2018-08-31)

* Another fix for TypeScript declarations
Expand Down
5 changes: 3 additions & 2 deletions browser/path-loader.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ Utility that provides a single API for loading the content of a path/URL.


* [path-loader](#module_path-loader)
* [.load(location)](#module_path-loader.load) ⇒ <code>Promise.&lt;\*&gt;</code>
* [.load(location, [options])](#module_path-loader.load) ⇒ <code>Promise.&lt;\*&gt;</code>
* [.LoadOptions](#module_path-loader.LoadOptions) : <code>object</code>
* [.PrepareRequestCallback](#module_path-loader.PrepareRequestCallback) : <code>function</code>
* [.ProcessResponseCallback](#module_path-loader.ProcessResponseCallback) ⇒ <code>\*</code>

<a name="module_path-loader.load"></a>

### path-loader.load(location) ⇒ <code>Promise.&lt;\*&gt;</code>
### path-loader.load(location, [options]) ⇒ <code>Promise.&lt;\*&gt;</code>
Loads a document at the provided location and returns a JavaScript object representation.

**Kind**: static method of <code>[path-loader](#module_path-loader)</code>
**Returns**: <code>Promise.&lt;\*&gt;</code> - Always returns a promise even if there is a callback provided

| Param | Type | Description |
| --- | --- | --- |
| location | <code>module:path-loader~LoadOptions</code> | The location to the document |
| location | <code>string</code> | The location to the document |
| [options] | <code>module:path-loader~LoadOptions</code> | The loader options |

**Example**
```js
Expand Down
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ declare module 'path-loader' {
/**
* Loads a document at the provided location and returns a JavaScript object representation.
* @param location - The location to the document
* @param options - The loader options
* @returns Always returns a promise even if there is a callback provided
*/
export function load(location: LoadOptions): Promise<any>;
export function load(location: string, options?: LoadOptions): Promise<any>;

/**
* Options used when loading a path.
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ function getLoader (location) {
/**
* Loads a document at the provided location and returns a JavaScript object representation.
*
* @param {module:path-loader~LoadOptions} location - The location to the document
* @param {string} location - The location to the document
* @param {module:path-loader~LoadOptions} [options] - The loader options
*
* @returns {Promise<*>} Always returns a promise even if there is a callback provided
*
Expand Down

0 comments on commit adcb19e

Please sign in to comment.