Skip to content

Commit 0d29ea4

Browse files
authored
Merge pull request #9 from purescript-contrib/bump
Update dependencies & add Travis build
2 parents eb7a489 + 9e9d794 commit 0d29ea4

File tree

9 files changed

+95
-20
lines changed

9 files changed

+95
-20
lines changed

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
.psci*
2-
bower_components/
3-
output/
4-
1+
/.*
2+
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
5+
!/.travis.yml
6+
/bower_components/
7+
/node_modules/
8+
/output/

.jscsrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"preset": "grunt",
3+
"disallowSpacesInFunctionExpression": null,
4+
"requireSpacesInFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
8+
"disallowSpacesInAnonymousFunctionExpression": null,
9+
"requireSpacesInAnonymousFunctionExpression": {
10+
"beforeOpeningRoundBrace": true,
11+
"beforeOpeningCurlyBrace": true
12+
},
13+
"disallowSpacesInsideObjectBrackets": null,
14+
"requireSpacesInsideObjectBrackets": "all",
15+
"validateQuoteMarks": "\"",
16+
"requireCurlyBraces": null
17+
}

.jshintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bitwise": true,
3+
"eqeqeq": true,
4+
"forin": true,
5+
"freeze": true,
6+
"funcscope": true,
7+
"futurehostile": true,
8+
"strict": "global",
9+
"latedef": true,
10+
"noarg": true,
11+
"nocomma": true,
12+
"nonew": true,
13+
"notypeof": true,
14+
"singleGroups": true,
15+
"undef": true,
16+
"unused": true,
17+
"eqnull": true,
18+
"predef": ["exports"]
19+
}

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
5+
install:
6+
- npm install -g bower
7+
- npm install
8+
script:
9+
- bower install --production
10+
- npm run -s build
11+
- bower install
12+
- npm -s test
13+
after_success:
14+
- >-
15+
test $TRAVIS_TAG &&
16+
echo $GITHUB_TOKEN | pulp login &&
17+
echo y | pulp publish --no-push

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# purescript-nullable
22

33
[![Latest release](http://img.shields.io/bower/v/purescript-nullable.svg)](https://github.com/purescript-contrib/purescript-nullable/releases)
4+
[![Build Status](https://travis-ci.org/purescript-contrib/purescript-nullable.svg?branch=master)](https://travis-ci.org/purescript-contrib/purescript-nullable)
45
[![Maintainer: paf31](https://img.shields.io/badge/maintainer-paf31-lightgrey.svg)](http://github.com/paf31)
56

67
A library for dealing with null values in foreign libraries.

bower.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
"license": "MIT",
88
"ignore": [
99
"**/.*",
10-
"node_modules",
1110
"bower_components",
12-
"test",
13-
"tests"
11+
"node_modules",
12+
"output",
13+
"bower.json",
14+
"package.json"
1415
],
1516
"dependencies": {
16-
"purescript-maybe": "^1.0.0-rc.1",
17-
"purescript-functions": "^1.0.0-rc.1"
17+
"purescript-maybe": "^2.0.0",
18+
"purescript-functions": "^2.0.0"
1819
},
1920
"repository": {
2021
"type": "git",
2122
"url": "git://github.com/paf31/purescript-nullable.git"
23+
},
24+
"devDependencies": {
25+
"purescript-console": "^2.0.0"
2226
}
2327
}

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"clean": "rimraf output && rimraf .pulp-cache",
5+
"build": "jshint src && jscs src && pulp build --censor-lib --strict",
6+
"test": "pulp test"
7+
},
8+
"devDependencies": {
9+
"jscs": "^2.8.0",
10+
"jshint": "^2.9.1",
11+
"pulp": "^9.0.1",
12+
"purescript-psa": "^0.3.9",
13+
"purescript": "^0.10.1",
14+
"rimraf": "^2.5.0"
15+
}
16+
}

src/Data/Nullable.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/* global exports */
21
"use strict";
32

43
exports["null"] = null;
54

6-
exports.nullable = function(a, r, f) {
7-
return a == null ? r : f(a);
5+
exports.nullable = function (a, r, f) {
6+
return a == null ? r : f(a);
87
};
98

10-
exports.notNull = function(x) {
11-
return x;
9+
exports.notNull = function (x) {
10+
return x;
1211
};

src/Data/Nullable.purs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
-- | using the FFI.
33

44
module Data.Nullable
5-
( Nullable()
5+
( Nullable
66
, toMaybe
77
, toNullable
88
) where
99

10-
import Prelude (class Ord, class Eq, class Show, compare, eq, show)
10+
import Prelude
1111

1212
import Data.Function (on)
1313
import Data.Function.Uncurried (Fn3, runFn3)
@@ -35,10 +35,8 @@ toNullable = maybe null notNull
3535
toMaybe :: forall a. Nullable a -> Maybe a
3636
toMaybe n = runFn3 nullable n Nothing Just
3737

38-
instance showNullable :: (Show a) => Show (Nullable a) where
39-
show n = case toMaybe n of
40-
Nothing -> "null"
41-
Just a -> show a
38+
instance showNullable :: Show a => Show (Nullable a) where
39+
show = maybe "null" show <<< toMaybe
4240

4341
instance eqNullable :: (Eq a) => Eq (Nullable a) where
4442
eq = eq `on` toMaybe

0 commit comments

Comments
 (0)