Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphql-scalars

Package Overview
Dependencies
Maintainers
5
Versions
1607
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-scalars - npm Package Compare versions

Comparing version 1.20.1 to 1.20.2

31

cjs/scalars/BigInt.js

@@ -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 @@ }

4

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc