code cleanup. Docs.

This commit is contained in:
Dominick Gendill 2017-05-22 09:25:09 -06:00
parent 413ba101d3
commit 6c6c51320b
3 changed files with 16 additions and 22 deletions

View File

@ -2,22 +2,22 @@
## Install
This repo depends on js-yaml. It is not compatible with YAML 1.1.
First install [js-yaml](https://github.com/connec/yaml-js). Note, purescript-yaml is not compatible with YAML 1.1.
```
npm install js-yaml@^3.4.6
```
If you're using bower, add this repo as a project dependency, e.g.
Then add purescript-yaml-next as a project dependency.
```
bower install --save git://github.com/dgendill/purescript-yaml#v0.1.0
bower install --save purescript-yaml-next
```
Or you can manually add the github repo as a project dependency, e.g.
Alternatively, you can add the repo itself as a project dependency, e.g.
```
"dependencies": {
"purescript-yaml" : git://github.com/dgendill/purescript-yaml#tagOrBranch
}
bower install --save git://github.com/archaeron/purescript-yaml#tagOrBranch
```
## YAML to Data Type Usage

View File

@ -1,6 +1,6 @@
{
"name": "purescript-yaml",
"license": "Apache 2.0",
"name": "purescript-yaml-next",
"license": "SEE LICENSE FILE",
"repository": "",
"private": true,
"contributors": [ ],

View File

@ -1,17 +1,11 @@
"use strict";
// module Data.YAML.Foreign.Decode
var yaml = require('js-yaml');
exports.parseYAMLImpl = function(left, right, str)
{
try
{
return right(yaml.safeLoad(str));
}
catch (e)
{
return left(e.toString());
}
};
exports.parseYAMLImpl = function(left, right, str) {
try {
return right(yaml.safeLoad(str));
} catch (e) {
return left(e.toString());
}
};