Skip to content

Commit

Permalink
v0.0.6 transform -> parse
Browse files Browse the repository at this point in the history
  • Loading branch information
joonhocho committed Jun 9, 2016
1 parent d439439 commit a967a23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-input-string",
"version": "0.0.5",
"version": "0.0.6",
"description": "A configurable custom input string type for GraphQL with sanitization and validation.",
"main": "lib/index.js",
"directories": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export default ({
empty,
max,
min,
parse,
pattern,
sanitize,
test,
transform,
trim,
trimLeft,
trimRight,
Expand Down Expand Up @@ -93,8 +93,8 @@ export default ({
error(value, ast);
}

if (transform) {
return transform(value);
if (parse) {
return parse(value);
}

return value;
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ describe('GraphQLInputString', () => {
testEqual(schema, done, value, value);
});

it('transform', (done) => {
it('parse', (done) => {
const schema = getSchema({
typeName: 'transform',
min: 5, // not forced to transform.
transform: (s) => s.substring(0, 3),
typeName: 'parse',
min: 5, // not forced to parse.
parse: (s) => s.substring(0, 3),
});

const value = ' 921hluaocb1 au0[g2930,0.uh, ';
Expand Down

0 comments on commit a967a23

Please sign in to comment.