graphql-scalar
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -0,1 +1,2 @@ | ||
import * as tslib_1 from "tslib"; | ||
import { GraphQLScalarType } from 'graphql'; | ||
@@ -5,3 +6,3 @@ import { defaultErrorHandler, defaultSerialize, getValueFromValueNode, } from './common'; | ||
export const createFloatScalar = (config) => { | ||
const { coerce, errorHandler, maximum, minimum, parse, sanitize, validate, serialize, ...scalarConfig } = config; | ||
const { coerce, errorHandler, maximum, minimum, parse, sanitize, validate, serialize } = config, scalarConfig = tslib_1.__rest(config, ["coerce", "errorHandler", "maximum", "minimum", "parse", "sanitize", "validate", "serialize"]); | ||
const handleError = errorHandler || defaultErrorHandler; | ||
@@ -73,9 +74,4 @@ const parseValue = (unknownValue, ast) => { | ||
}; | ||
return new GraphQLScalarType({ | ||
...scalarConfig, | ||
serialize: serialize || defaultSerialize, | ||
parseValue, | ||
parseLiteral: (ast) => parseValue(getValueFromValueNode(ast), ast), | ||
}); | ||
return new GraphQLScalarType(Object.assign({}, scalarConfig, { serialize: serialize || defaultSerialize, parseValue, parseLiteral: (ast) => parseValue(getValueFromValueNode(ast), ast) })); | ||
}; | ||
//# sourceMappingURL=float.js.map |
@@ -0,1 +1,2 @@ | ||
import * as tslib_1 from "tslib"; | ||
import { GraphQLScalarType } from 'graphql'; | ||
@@ -11,3 +12,3 @@ import { defaultErrorHandler, defaultSerialize, getValueFromValueNode, } from './common'; | ||
export const createIntScalar = (config) => { | ||
const { coerce, errorHandler, maximum, minimum, parse, sanitize, validate, serialize, ...scalarConfig } = config; | ||
const { coerce, errorHandler, maximum, minimum, parse, sanitize, validate, serialize } = config, scalarConfig = tslib_1.__rest(config, ["coerce", "errorHandler", "maximum", "minimum", "parse", "sanitize", "validate", "serialize"]); | ||
const handleError = errorHandler || defaultErrorHandler; | ||
@@ -79,9 +80,4 @@ const parseValue = (unknownValue, ast) => { | ||
}; | ||
return new GraphQLScalarType({ | ||
...scalarConfig, | ||
serialize: serialize || defaultSerialize, | ||
parseValue, | ||
parseLiteral: (ast) => parseValue(getValueFromValueNode(ast), ast), | ||
}); | ||
return new GraphQLScalarType(Object.assign({}, scalarConfig, { serialize: serialize || defaultSerialize, parseValue, parseLiteral: (ast) => parseValue(getValueFromValueNode(ast), ast) })); | ||
}; | ||
//# sourceMappingURL=int.js.map |
@@ -0,1 +1,2 @@ | ||
import * as tslib_1 from "tslib"; | ||
import { GraphQLScalarType } from 'graphql'; | ||
@@ -11,3 +12,3 @@ import { defaultErrorHandler, defaultSerialize, getValueFromValueNode, } from './common'; | ||
export const createStringScalar = (config) => { | ||
const { capitalize, coerce, collapseWhitespace, errorHandler, lowercase, maxLength, minLength, nonEmpty, parse, pattern, sanitize, serialize, singleline, trim, trimLeft, trimRight, truncate, uppercase, validate, ...scalarConfig } = config; | ||
const { capitalize, coerce, collapseWhitespace, errorHandler, lowercase, maxLength, minLength, nonEmpty, parse, pattern, sanitize, serialize, singleline, trim, trimLeft, trimRight, truncate, uppercase, validate } = config, scalarConfig = tslib_1.__rest(config, ["capitalize", "coerce", "collapseWhitespace", "errorHandler", "lowercase", "maxLength", "minLength", "nonEmpty", "parse", "pattern", "sanitize", "serialize", "singleline", "trim", "trimLeft", "trimRight", "truncate", "uppercase", "validate"]); | ||
const regex = typeof pattern === 'string' ? new RegExp(pattern) : pattern; | ||
@@ -153,9 +154,4 @@ const handleError = errorHandler || defaultErrorHandler; | ||
}; | ||
return new GraphQLScalarType({ | ||
...scalarConfig, | ||
serialize: serialize || defaultSerialize, | ||
parseValue, | ||
parseLiteral: (ast) => parseValue(getValueFromValueNode(ast), ast), | ||
}); | ||
return new GraphQLScalarType(Object.assign({}, scalarConfig, { serialize: serialize || defaultSerialize, parseValue, parseLiteral: (ast) => parseValue(getValueFromValueNode(ast), ast) })); | ||
}; | ||
//# sourceMappingURL=string.js.map |
{ | ||
"name": "graphql-scalar", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Configurable custom GraphQL Scalars (string, number, date, etc) with sanitization / validation / transformation in TypeScript.", | ||
@@ -22,2 +22,12 @@ "keywords": [ | ||
], | ||
"author": "Joon Ho Cho", | ||
"license": "MIT", | ||
"homepage": "https://github.com/joonhocho/graphql-scalar#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/joonhocho/graphql-scalar.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/joonhocho/graphql-scalar/issues" | ||
}, | ||
"module": "lib/index.js", | ||
@@ -27,2 +37,3 @@ "main": "dist/node/index.js", | ||
"types": "lib/index.d.ts", | ||
"sideEffects": false, | ||
"scripts": { | ||
@@ -48,12 +59,6 @@ "all": "npm run clean && npm run format && npm run lint:fix && npm run build:all && npm run test", | ||
"pre-commit": "precommit", | ||
"author": "Joon Ho Cho", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/joonhocho/graphql-scalar.git" | ||
"peerDependencies": { | ||
"graphql": "*", | ||
"tslib": "^1.10.0" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/joonhocho/graphql-scalar/issues" | ||
}, | ||
"homepage": "https://github.com/joonhocho/graphql-scalar#readme", | ||
"devDependencies": { | ||
@@ -70,3 +75,3 @@ "@types/graphql": "^14.2.2", | ||
"tscpaths": "^0.0.9", | ||
"tsdef": "^0.0.9", | ||
"tsdef": "^0.0.13", | ||
"tslint": "^5.18.0", | ||
@@ -77,10 +82,5 @@ "tslint-config-airbnb": "^5.11.1", | ||
}, | ||
"peerDependencies": { | ||
"graphql": "*", | ||
"tslib": "^1.10.0" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"sideEffects": false | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
100220
1272