graphql-scalars
Advanced tools
Comparing version 1.20.1 to 1.20.2
@@ -41,27 +41,6 @@ "use strict"; | ||
} | ||
return new Proxy({}, { | ||
has(_, prop) { | ||
if (prop === 'toJSON') { | ||
return true; | ||
} | ||
return prop in BigInt.prototype; | ||
}, | ||
get(_, prop) { | ||
if (prop === 'toJSON') { | ||
return function toJSON() { | ||
if (num > Number.MAX_SAFE_INTEGER) { | ||
return num.toString(); | ||
} | ||
return Number(num); | ||
}; | ||
} | ||
if (prop === Symbol.toStringTag) { | ||
return num.toString(); | ||
} | ||
if (prop in BigInt.prototype) { | ||
return BigInt.prototype[prop].bind(num); | ||
} | ||
return undefined; | ||
}, | ||
}); | ||
if (Number.isSafeInteger(Number(num))) { | ||
return num; | ||
} | ||
return num.toString(); | ||
}, | ||
@@ -76,3 +55,3 @@ parseValue(inputValue) { | ||
parseLiteral(valueNode) { | ||
if (valueNode.kind !== graphql_1.Kind.INT) { | ||
if (valueNode.kind !== graphql_1.Kind.INT || !Number.isInteger(Number(valueNode.value))) { | ||
throw (0, error_js_1.createGraphQLError)(`BigInt cannot represent non-integer value: ${(0, graphql_1.print)(valueNode)}`, { nodes: valueNode }); | ||
@@ -79,0 +58,0 @@ } |
@@ -38,27 +38,6 @@ /* eslint-disable @typescript-eslint/ban-types */ | ||
} | ||
return new Proxy({}, { | ||
has(_, prop) { | ||
if (prop === 'toJSON') { | ||
return true; | ||
} | ||
return prop in BigInt.prototype; | ||
}, | ||
get(_, prop) { | ||
if (prop === 'toJSON') { | ||
return function toJSON() { | ||
if (num > Number.MAX_SAFE_INTEGER) { | ||
return num.toString(); | ||
} | ||
return Number(num); | ||
}; | ||
} | ||
if (prop === Symbol.toStringTag) { | ||
return num.toString(); | ||
} | ||
if (prop in BigInt.prototype) { | ||
return BigInt.prototype[prop].bind(num); | ||
} | ||
return undefined; | ||
}, | ||
}); | ||
if (Number.isSafeInteger(Number(num))) { | ||
return num; | ||
} | ||
return num.toString(); | ||
}, | ||
@@ -73,3 +52,3 @@ parseValue(inputValue) { | ||
parseLiteral(valueNode) { | ||
if (valueNode.kind !== Kind.INT) { | ||
if (valueNode.kind !== Kind.INT || !Number.isInteger(Number(valueNode.value))) { | ||
throw createGraphQLError(`BigInt cannot represent non-integer value: ${print(valueNode)}`, { nodes: valueNode }); | ||
@@ -76,0 +55,0 @@ } |
{ | ||
"name": "graphql-scalars", | ||
"version": "1.20.1", | ||
"version": "1.20.2", | ||
"description": "A collection of scalar types not included in base GraphQL.", | ||
@@ -10,3 +10,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"tslib": "~2.4.0" | ||
"tslib": "~2.5.0" | ||
}, | ||
@@ -13,0 +13,0 @@ "repository": { |
import { GraphQLScalarType } from 'graphql'; | ||
export declare type RegularExpressionErrorMessageFn = (r: RegExp, v: any) => string; | ||
export type RegularExpressionErrorMessageFn = (r: RegExp, v: any) => string; | ||
export interface RegularExpressionOptions { | ||
@@ -4,0 +4,0 @@ errorMessage?: RegularExpressionErrorMessageFn; |
import { GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; | ||
export declare const GraphQLBigIntConfig: GraphQLScalarTypeConfig<bigint, bigint | BigInt | string | number>; | ||
export declare const GraphQLBigIntConfig: GraphQLScalarTypeConfig<bigint, bigint | string | number>; | ||
export declare const GraphQLBigInt: GraphQLScalarType; |
/// <reference types="node" /> | ||
import { GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; | ||
declare type BufferJson = { | ||
type BufferJson = { | ||
type: 'Buffer'; | ||
@@ -5,0 +5,0 @@ data: number[]; |
import { GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; | ||
export declare type ISO8601Duration = string; | ||
export type ISO8601Duration = string; | ||
export declare const GraphQLDurationConfig: GraphQLScalarTypeConfig<string, string>; | ||
export declare const GraphQLISO8601Duration: GraphQLScalarType; | ||
export declare const GraphQLDuration: GraphQLScalarType; |
import { GraphQLScalarType } from 'graphql'; | ||
export declare const GraphQLLongConfig: import("graphql").GraphQLScalarTypeConfig<bigint, string | number | bigint | BigInt> & { | ||
export declare const GraphQLLongConfig: import("graphql").GraphQLScalarTypeConfig<bigint, string | number | bigint> & { | ||
name: string; | ||
}; | ||
export declare const GraphQLLong: GraphQLScalarType; |
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
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
426131
8664
+ Addedtslib@2.5.3(transitive)
- Removedtslib@2.4.1(transitive)
Updatedtslib@~2.5.0