graphql-language-service
Advanced tools
Comparing version 5.1.2 to 5.1.3
@@ -83,3 +83,3 @@ "use strict"; | ||
function normalizeText(text) { | ||
return text.toLowerCase().replace(/\W/g, ''); | ||
return text.toLowerCase().replaceAll(/\W/g, ''); | ||
} | ||
@@ -86,0 +86,0 @@ function getProximity(suggestion, text) { |
@@ -644,3 +644,3 @@ "use strict"; | ||
function canUseDirective(state, directive) { | ||
if (!state || !state.kind) { | ||
if (!(state === null || state === void 0 ? void 0 : state.kind)) { | ||
return false; | ||
@@ -647,0 +647,0 @@ } |
@@ -52,3 +52,3 @@ "use strict"; | ||
const regex = new RegExp(pattern, caseFold ? 'i' : 'g'); | ||
match = regex.test(this._sourceText.substr(this._pos, pattern.length)); | ||
match = regex.test(this._sourceText.slice(this._pos, this._pos + pattern.length)); | ||
token = pattern; | ||
@@ -55,0 +55,0 @@ } |
@@ -81,4 +81,4 @@ "use strict"; | ||
levels.length > 0 && | ||
levels[levels.length - 1] < state.indentLevel) { | ||
state.indentLevel = levels[levels.length - 1]; | ||
levels.at(-1) < state.indentLevel) { | ||
state.indentLevel = levels.at(-1); | ||
} | ||
@@ -85,0 +85,0 @@ } |
@@ -75,3 +75,3 @@ import { isCompositeType, } from 'graphql'; | ||
function normalizeText(text) { | ||
return text.toLowerCase().replace(/\W/g, ''); | ||
return text.toLowerCase().replaceAll(/\W/g, ''); | ||
} | ||
@@ -78,0 +78,0 @@ function getProximity(suggestion, text) { |
@@ -636,3 +636,3 @@ import { isInterfaceType, GraphQLInterfaceType, GraphQLObjectType, Kind, DirectiveLocation, isListType, isNonNullType, isScalarType, isObjectType, isUnionType, isEnumType, isInputObjectType, isOutputType, GraphQLBoolean, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, assertAbstractType, doTypesOverlap, getNamedType, getNullableType, isAbstractType, isCompositeType, isInputType, visit, BREAK, parse, } from 'graphql'; | ||
export function canUseDirective(state, directive) { | ||
if (!state || !state.kind) { | ||
if (!(state === null || state === void 0 ? void 0 : state.kind)) { | ||
return false; | ||
@@ -639,0 +639,0 @@ } |
@@ -50,3 +50,3 @@ export default class CharacterStream { | ||
const regex = new RegExp(pattern, caseFold ? 'i' : 'g'); | ||
match = regex.test(this._sourceText.substr(this._pos, pattern.length)); | ||
match = regex.test(this._sourceText.slice(this._pos, this._pos + pattern.length)); | ||
token = pattern; | ||
@@ -53,0 +53,0 @@ } |
@@ -78,4 +78,4 @@ import { LexRules, ParseRules, isIgnored } from './Rules'; | ||
levels.length > 0 && | ||
levels[levels.length - 1] < state.indentLevel) { | ||
state.indentLevel = levels[levels.length - 1]; | ||
levels.at(-1) < state.indentLevel) { | ||
state.indentLevel = levels.at(-1); | ||
} | ||
@@ -82,0 +82,0 @@ } |
{ | ||
"name": "graphql-language-service", | ||
"version": "5.1.2", | ||
"version": "5.1.3", | ||
"description": "The official, runtime independent Language Service for GraphQL", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -143,3 +143,3 @@ /** | ||
function normalizeText(text: string): string { | ||
return text.toLowerCase().replace(/\W/g, ''); | ||
return text.toLowerCase().replaceAll(/\W/g, ''); | ||
} | ||
@@ -146,0 +146,0 @@ |
@@ -647,3 +647,3 @@ /** | ||
) { | ||
inlineInterfaces.add(<string>state.name); | ||
inlineInterfaces.add(state.name); | ||
} | ||
@@ -1051,3 +1051,3 @@ // gather the other interfaces the current type/interface definition implements | ||
): boolean { | ||
if (!state || !state.kind) { | ||
if (!state?.kind) { | ||
return false; | ||
@@ -1054,0 +1054,0 @@ } |
@@ -42,3 +42,3 @@ /** | ||
assert(location, 'Expected ASTNode to have a location.'); | ||
return locToRange(text, location) as Range; | ||
return locToRange(text, location); | ||
} | ||
@@ -45,0 +45,0 @@ |
@@ -90,3 +90,3 @@ /** | ||
{ | ||
severity: DIAGNOSTIC_SEVERITY.Error as DiagnosticSeverity, | ||
severity: DIAGNOSTIC_SEVERITY.Error, | ||
message: error.message, | ||
@@ -93,0 +93,0 @@ source: 'GraphQL: Syntax', |
@@ -125,3 +125,3 @@ /** | ||
} | ||
const fieldName = typeInfo.fieldDef.name as string; | ||
const fieldName = typeInfo.fieldDef.name; | ||
if (fieldName.slice(0, 2) !== '__') { | ||
@@ -128,0 +128,0 @@ renderType(into, typeInfo, options, typeInfo.parentType as GraphQLType); |
@@ -133,3 +133,3 @@ import OnlineParser from '../onlineParser'; | ||
const utils = getUtils( | ||
source.replace(/__VALUE__/g, value).replace(/__TYPE__/g, type), | ||
source.replaceAll('__VALUE__', value).replaceAll('__TYPE__', type), | ||
); | ||
@@ -136,0 +136,0 @@ test(utils, { type, value, kind, valueType }); |
@@ -27,4 +27,3 @@ import { opt, list, butNot, t, p } from '../RuleHelpers'; | ||
match: token => | ||
token.kind === 'Name' && | ||
Boolean(token.value.match(/^[_A-Za-z][_0-9A-Za-z]*/)), | ||
token.kind === 'Name' && /^[_A-Za-z][_0-9A-Za-z]*/.test(token.value), | ||
}; | ||
@@ -31,0 +30,0 @@ |
@@ -114,3 +114,5 @@ /** | ||
const regex = new RegExp(pattern, caseFold ? 'i' : 'g'); | ||
match = regex.test(this._sourceText.substr(this._pos, pattern.length)); | ||
match = regex.test( | ||
this._sourceText.slice(this._pos, this._pos + pattern.length), | ||
); | ||
token = pattern; | ||
@@ -117,0 +119,0 @@ } else if (pattern instanceof RegExp) { |
@@ -82,2 +82,3 @@ /** | ||
if (state.inBlockstring) { | ||
// eslint-disable-next-line unicorn/prefer-regexp-test -- false positive stream is not string | ||
if (stream.match(/.*"""/)) { | ||
@@ -152,5 +153,5 @@ state.inBlockstring = false; | ||
levels.length > 0 && | ||
levels[levels.length - 1] < state.indentLevel | ||
levels.at(-1)! < state.indentLevel | ||
) { | ||
state.indentLevel = levels[levels.length - 1]; | ||
state.indentLevel = levels.at(-1); | ||
} | ||
@@ -157,0 +158,0 @@ } |
@@ -24,3 +24,3 @@ /** | ||
// An constraint described as `but not` in the GraphQL spec. | ||
// A constraint described as `but not` in the GraphQL spec. | ||
export function butNot(rule: Rule, exclusions: Array<Rule>) { | ||
@@ -35,2 +35,3 @@ const ruleMatch = rule.match; | ||
check && | ||
// eslint-disable-next-line unicorn/prefer-regexp-test -- false positive exclusion is not string | ||
exclusions.every(exclusion => exclusion.match && !exclusion.match(token)) | ||
@@ -37,0 +38,0 @@ ); |
@@ -246,3 +246,3 @@ /** | ||
}); | ||
definitions![type.name] = fieldDef; | ||
definitions[type.name] = fieldDef; | ||
} | ||
@@ -249,0 +249,0 @@ } |
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
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
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
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
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
775512
14415