-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- action.type must be a string or Symbol (the latter may or may not be dropped, so test support can also be removed easily) - use npm scripts instead of Makefile - use Babel 6 - use nyc for code coverage and coveralls - test against latest versions of Node LTS - add editorconfig - upgrade all dependencies except eslint-plugin-import - Remove unnecessary test helper - Add yarn.lock
- Loading branch information
Showing
14 changed files
with
3,297 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"stage": 0, | ||
"loose": "all" | ||
"presets": ["stage-0", ["es2015", { "loose": true }]], | ||
"env": { | ||
"test": { | ||
"plugins": ["istanbul"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ node_modules | |
coverage | ||
*.log | ||
lib | ||
.idea | ||
.nyc_output |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "iojs" | ||
- "stable" | ||
- 4 | ||
|
||
after_success: "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,17 @@ | |
"version": "0.6.1", | ||
"description": "A human-friendly standard for Flux action objects", | ||
"main": "lib/index.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"scripts": { | ||
"test": "make test", | ||
"prepublish": "make clean build" | ||
"prebuild": "npm run clean", | ||
"build": "babel src --out-dir lib", | ||
"clean": "rimraf lib/", | ||
"lint": "eslint src/ test/", | ||
"prepublish": "npm test && npm run build", | ||
"pretest": "npm run lint", | ||
"test": "cross-env NODE_ENV=test nyc mocha" | ||
}, | ||
"keywords": [ | ||
"flux", | ||
|
@@ -16,15 +24,39 @@ | |
"author": "Andrew Clark <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"babel": "^5.6.14", | ||
"babel-core": "^5.6.15", | ||
"babel-eslint": "^4.1.8", | ||
"babel-cli": "^6.16.0", | ||
"babel-core": "^6.17.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-plugin-istanbul": "^2.0.1", | ||
"babel-preset-es2015": "^6.16.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"chai": "^3.0.0", | ||
"eslint": "^0.24.0", | ||
"eslint-config-airbnb": "0.0.6", | ||
"mocha": "^2.2.5" | ||
"coveralls": "^2.11.14", | ||
"cross-env": "^3.1.1", | ||
"eslint": "^3.7.1", | ||
"eslint-config-airbnb-base": "^8.0.0", | ||
"eslint-plugin-import": "^1.0.0", | ||
"mocha": "^3.0.0", | ||
"nyc": "^8.3.0", | ||
"rimraf": "^2.5.4" | ||
}, | ||
"dependencies": { | ||
"lodash.isplainobject": "^3.2.0" | ||
"lodash.isplainobject": "^4.0.6", | ||
"lodash.isstring": "^4.0.1", | ||
"lodash.issymbol": "^4.0.1" | ||
}, | ||
"nyc": { | ||
"all": true, | ||
"sourceMap": false, | ||
"instrument": false, | ||
"reporter": [ | ||
"text-summary", | ||
"lcov" | ||
], | ||
"check-coverage": true, | ||
"lines": 100, | ||
"statements": 100, | ||
"functions": 100, | ||
"branches": 100 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import isPlainObject from 'lodash.isplainobject'; | ||
|
||
const validKeys = [ | ||
'type', | ||
'payload', | ||
'error', | ||
'meta' | ||
]; | ||
|
||
function isValidKey(key) { | ||
return validKeys.indexOf(key) > -1; | ||
} | ||
import isString from 'lodash.isstring'; | ||
import isSymbol from 'lodash.issymbol'; | ||
|
||
export function isFSA(action) { | ||
return ( | ||
isPlainObject(action) && | ||
typeof action.type !== 'undefined' && | ||
(isString(action.type) || isSymbol(action.type)) && | ||
Object.keys(action).every(isValidKey) | ||
); | ||
} | ||
|
||
export function isError(action) { | ||
return action.error === true; | ||
} | ||
|
||
function isValidKey(key) { | ||
return [ | ||
'type', | ||
'payload', | ||
'error', | ||
'meta', | ||
].indexOf(key) > -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--compilers js:babel-core/register | ||
--recursive |
Oops, something went wrong.