{"size": 531, "ext": "js", "max_stars_repo_path": "package/Structure/dictionary/scalars/Number.js", "max_stars_repo_name": "colohr/sxy", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "package/Structure/dictionary/scalars/Number.js", "max_issues_repo_name": "colohr/sxy", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "package/Structure/dictionary/scalars/Number.js", "max_forks_repo_name": "colohr/sxy", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.4230769231, "max_line_length": 48, "alphanum_fraction": 0.6647834275}
const { GraphQLScalarType } = require('graphql')
const fxy = require('fxy')

//exports
module.exports = new GraphQLScalarType({
	description: 'A whole number',
	name: 'Number',
	structure: 'INTEGER',
	kind: 'INT',
	parseValue(value) {
		let n = fxy.as.number(value)
		if(!fxy.is.nothing(n)) return n
		return null
	},
	parseLiteral(ast) {
		let n = fxy.as.number(ast.value)
		if(!fxy.is.nothing(n)) return n
		return null
	},
	serialize(value) {
		let n = fxy.as.number(value)
		if(!fxy.is.nothing(n)) return n
		return null
	}
})
