Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Reads an alphanumeric + underscore name from the source. [_AZaz][_09AZaz]
function readName(source, start, line, col, prev) { var body = source.body; var bodyLength = body.length; var position = start + 1; var code = 0; while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _ code >= 48 && code <= 57 || // 0-9 code >= 65 && code <= 90 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryReadVariableName(input, index) {\t\n\t/* Need to start with a letter or underscore. */\n\tif (!/[A-Za-z_]/.test(input.charAt(index))) return null;\n\n\t/* Keep reading characters while it's possible to do so. */\t\n\tvar result = \"\";\n\twhile (/[A-Za-z_0-9]/.test(input.charAt(index))) {\n\t\tresult +...
[ "0.69242716", "0.69093364", "0.6829715", "0.6829715", "0.6829715", "0.68044996", "0.6583544", "0.6545397", "0.6524183", "0.6524183", "0.6473978", "0.64677435", "0.6454978", "0.63683015", "0.63683015", "0.63683015", "0.63683015", "0.6362096", "0.6331537", "0.6331537", "0.63100...
0.64251363
15
Converts a name lex token into a name parse node.
function parseName(lexer) { var token = expectToken(lexer, TokenKind.NAME); return { kind: Kind.NAME, value: token.value, loc: loc(lexer, token) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n }", "function parseName(lexer) {\n\t var token = expect(lexer, _lexer.TokenKind.NAME);\n\t return {\n\t kind: _kinds.NAME,\n\t value: token.valu...
[ "0.78052753", "0.747944", "0.747944", "0.7455579", "0.7455579", "0.7455579", "0.7455579", "0.7455579", "0.7455579", "0.7451912", "0.7451912", "0.7451912", "0.7451912", "0.7451912", "0.74373513", "0.7362186", "0.7330693", "0.7330693", "0.72114336", "0.71694773", "0.7030206", ...
0.74359643
15
Implements the parsing rules in the Document section. Document : Definition+
function parseDocument(lexer) { var start = lexer.token; return { kind: Kind.DOCUMENT, definitions: many(lexer, TokenKind.SOF, parseDefinition, TokenKind.EOF), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }", "constructor(schema, rules) {\n this.schema = schema;\n this.rules = rules;\n t...
[ "0.62960064", "0.5888885", "0.5772888", "0.57425183", "0.5736046", "0.56977725", "0.56977725", "0.568532", "0.5627307", "0.56254566", "0.5625318", "0.5585372", "0.55778307", "0.55778307", "0.55778307", "0.55778307", "0.5551567", "0.5545718", "0.5545718", "0.5545718", "0.55457...
0.5638602
8
Definition : ExecutableDefinition TypeSystemDefinition TypeSystemExtension
function parseDefinition(lexer) { if (peek(lexer, TokenKind.NAME)) { switch (lexer.token.value) { case 'query': case 'mutation': case 'subscription': case 'fragment': return parseExecutableDefinition(lexer); case 'schema': case 'scalar': case 'type': case '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n\n case 'schema':\n case 'scalar':\n ca...
[ "0.58387035", "0.5628583", "0.5588968", "0.5587208", "0.55546975", "0.5547226", "0.5547226", "0.5547226", "0.5547226", "0.5547226", "0.5547226", "0.55428934", "0.5521188", "0.5505745", "0.5497905", "0.54487175", "0.54487175", "0.54337996", "0.542171", "0.5388335", "0.5388335"...
0.5873064
0
ExecutableDefinition : OperationDefinition FragmentDefinition
function parseExecutableDefinition(lexer) { if (peek(lexer, TokenKind.NAME)) { switch (lexer.token.value) { case 'query': case 'mutation': case 'subscription': return parseOperationDefinition(lexer); case 'fragment': return parseFragmentDefinition(lexer); } } else if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseExecutableDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexe...
[ "0.71564996", "0.71564996", "0.71564996", "0.71564996", "0.71564996", "0.71124816", "0.70084894", "0.68876076", "0.67579025", "0.67579025", "0.6752113", "0.58463687", "0.58463687", "0.58463687", "0.56814134", "0.5605185", "0.5605185", "0.5368808", "0.5278838", "0.525151", "0....
0.71993536
0
Implements the parsing rules in the Operations section. OperationDefinition : SelectionSet OperationType Name? VariableDefinitions? Directives? SelectionSet
function parseOperationDefinition(lexer) { var start = lexer.token; if (peek(lexer, TokenKind.BRACE_L)) { return { kind: Kind.OPERATION_DEFINITION, operation: 'query', name: undefined, variableDefinitions: [], directives: [], selectionSet: parseSelectionSet(lexer), loc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n name: undefined,\n variableDefinitions: [],\n directives: [],\...
[ "0.7476615", "0.6957241", "0.6946463", "0.6946463", "0.6946463", "0.6946463", "0.69095504", "0.6902744", "0.68582433", "0.68582433", "0.68582433", "0.68582433", "0.68582433", "0.68582433", "0.68425566", "0.68345904", "0.68345904", "0.6822553", "0.6732535", "0.65711176", "0.65...
0.69615173
1
OperationType : one of query mutation subscription
function parseOperationType(lexer) { var operationToken = expectToken(lexer, TokenKind.NAME); switch (operationToken.value) { case 'query': return 'query'; case 'mutation': return 'mutation'; case 'subscription': return 'subscription'; } throw unexpected(lexer, operationToken);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationType...
[ "0.6767044", "0.6696435", "0.6696435", "0.6696435", "0.6696435", "0.6696435", "0.6696435", "0.6667136", "0.66366386", "0.66044563", "0.66044563", "0.66044563", "0.66044563", "0.6600803", "0.65488625", "0.64355683", "0.64009553", "0.63313407", "0.63313407", "0.625439", "0.6230...
0.66750133
7
VariableDefinitions : ( VariableDefinition+ )
function parseVariableDefinitions(lexer) { return peek(lexer, TokenKind.PAREN_L) ? many(lexer, TokenKind.PAREN_L, parseVariableDefinition, TokenKind.PAREN_R) : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }", "function parseVariableDefinitions(lexer$$1) {\n return peek(lexer$$1, lexer.TokenKind.PAREN_L) ? many(lexer$$1, lexer.TokenKind.PAREN_L, parseVaria...
[ "0.7294105", "0.7109119", "0.7006673", "0.7006673", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.69709283", "0.68373275", "0.6801801", "0.6702027", "0.66963965", "0.669627", "0.6...
0.6995079
4
VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
function parseVariableDefinition(lexer) { var start = lexer.token; return { kind: Kind.VARIABLE_DEFINITION, variable: parseVariable(lexer), type: (expectToken(lexer, TokenKind.COLON), parseTypeReference(lexer)), defaultValue: expectOptionalToken(lexer, TokenKind.EQUALS) ? parseValueLiteral(lexer, tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseCons...
[ "0.7362767", "0.6529986", "0.65268475", "0.6505122", "0.6505122", "0.6505122", "0.6505122", "0.64880013", "0.64880013", "0.64880013", "0.64880013", "0.64880013", "0.64880013", "0.632051", "0.63002473", "0.6295657", "0.6293685", "0.6280011", "0.62544304", "0.62513405", "0.6251...
0.65687674
1
Variable : $ Name
function parseVariable(lexer) { var start = lexer.token; expectToken(lexer, TokenKind.DOLLAR); return { kind: Kind.VARIABLE, name: parseName(lexer), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createVariable() {\n var id = nextVariableId++;\n var name = '$V';\n\n do {\n name += variableTokens[id % variableTokensLength];\n id = ~~(id / variableTokensLength);\n } while (id !== 0);\n\n return name;\n }", "function makeVar(root, name) {\n name = name.toLowerCase().rep...
[ "0.6945701", "0.6884038", "0.6858726", "0.6830075", "0.6722742", "0.669976", "0.66969347", "0.6647729", "0.6564104", "0.65095234", "0.6448056", "0.6433639", "0.6406728", "0.6377274", "0.63718086", "0.63441086", "0.6315028", "0.6285289", "0.62734824", "0.62667507", "0.62561864...
0.5737395
95
Selection : Field FragmentSpread InlineFragment
function parseSelection(lexer) { return peek(lexer, TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }", "function parseSelection(lexer) {\n\t return peek(lexer, _lexer.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n\t}", "function parseSelection(lexer) {\n\t return peek(le...
[ "0.69309527", "0.6232537", "0.6232537", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.622574", "0.61205184", "0.6051091", "0.6038953", "0.6020248", "0.5971852", "0.5954627", "0.5865732", "0.5863663...
0.6277677
1
Field : Alias? Name Arguments? Directives? SelectionSet? Alias : Name :
function parseField(lexer) { var start = lexer.token; var nameOrAlias = parseName(lexer); var alias; var name; if (expectOptionalToken(lexer, TokenKind.COLON)) { alias = nameOrAlias; name = parseName(lexer); } else { name = nameOrAlias; } return { kind: Kind.FIELD, alias: alias, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $Alias() {\n\t\treturn Field.apply(this, arguments);\n\t}", "field (field, alias = null, options = {}) {\n alias = alias ? this._sanitizeFieldAlias(alias) : alias;\n field = this._sanitizeField(field);\n\n // if field-alias combo already present then don't add\n let existingField = t...
[ "0.67461413", "0.5861788", "0.583103", "0.5825715", "0.57540786", "0.5662482", "0.5464285", "0.54340297", "0.5398831", "0.53741914", "0.53367126", "0.53101426", "0.5289533", "0.5271213", "0.5269528", "0.5256967", "0.5246766", "0.5243333", "0.5239582", "0.52185047", "0.5181147...
0.50261074
36
Arguments[Const] : ( Argument[?Const]+ )
function parseArguments(lexer, isConst) { var item = isConst ? parseConstArgument : parseArgument; return peek(lexer, TokenKind.PAREN_L) ? many(lexer, TokenKind.PAREN_L, item, TokenKind.PAREN_R) : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseArguments(lexer$$1, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer$$1, lexer.TokenKind.PAREN_L) ? many(lexer$$1, lexer.TokenKind.PAREN_L, item, lexer.TokenKind.PAREN_R) : [];\n}", "function parseArguments(lexer, isConst) {\n var item = isConst ? parseCo...
[ "0.73310494", "0.7010726", "0.7010726", "0.7010726", "0.7010726", "0.7010726", "0.6963879", "0.6892473", "0.68137336", "0.6798465", "0.6798465", "0.6792662", "0.62224144", "0.62224144", "0.61540276", "0.6151323", "0.6061067", "0.60609984", "0.60196626", "0.6000319", "0.595411...
0.7060046
1
Argument[Const] : Name : Value[?Const]
function parseArgument(lexer) { var start = lexer.token; var name = parseName(lexer); expectToken(lexer, TokenKind.COLON); return { kind: Kind.ARGUMENT, name: name, value: parseValueLiteral(lexer, false), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }", "function NamedArgument(nameArg...
[ "0.63956255", "0.5930621", "0.58516693", "0.5820122", "0.5820122", "0.5765281", "0.57012737", "0.5659389", "0.5615607", "0.5592124", "0.555192", "0.5535148", "0.5535148", "0.5535148", "0.5535148", "0.55168223", "0.5512358", "0.55027896", "0.55027896", "0.54899466", "0.5479792...
0.0
-1
Implements the parsing rules in the Fragments section. Corresponds to both FragmentSpread and InlineFragment in the spec. FragmentSpread : ... FragmentName Directives? InlineFragment : ... TypeCondition? Directives? SelectionSet
function parseFragment(lexer) { var start = lexer.token; expectToken(lexer, TokenKind.SPREAD); var hasTypeCondition = expectOptionalKeyword(lexer, 'on'); if (!hasTypeCondition && peek(lexer, TokenKind.NAME)) { return { kind: Kind.FRAGMENT_SPREAD, name: parseFragmentName(lexer), directives...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.par...
[ "0.7204786", "0.71663177", "0.69133043", "0.69115955", "0.69115955", "0.6909837", "0.68875766", "0.68787044", "0.6876488", "0.6861326", "0.6861326", "0.6861326", "0.6861326", "0.6858609", "0.6781864", "0.6781864", "0.67267644", "0.67096364", "0.66997546", "0.66997546", "0.664...
0.6796034
14
FragmentDefinition : fragment FragmentName on TypeCondition Directives? SelectionSet TypeCondition : NamedType
function parseFragmentDefinition(lexer) { var start = lexer.token; expectKeyword(lexer, 'fragment'); // Experimental support for defining variables within fragments changes // the grammar of FragmentDefinition: // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet if (le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.par...
[ "0.7478656", "0.74603605", "0.7071043", "0.70084333", "0.70084333", "0.70084333", "0.70084333", "0.70084333", "0.70084333", "0.69281197", "0.6901346", "0.6901346", "0.6901346", "0.6901346", "0.6888519", "0.6859692", "0.68549776", "0.6853555", "0.6853555", "0.685011", "0.68494...
0.6904951
10
FragmentName : Name but not `on`
function parseFragmentName(lexer) { if (lexer.token.value === 'on') { throw unexpected(lexer); } return parseName(lexer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n }", "function parseFragmentName(parser) {\n\t if (parser.token.value === 'on') {\n\t throw unexpected(parser);\n\t }\n\t return parseName(parser);\n\t}", "function ...
[ "0.79567486", "0.77554125", "0.7729442", "0.7729442", "0.76232463", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.7619484", "0.74431455", "0.6615128", "0.6570366", "0.6559071", "0.65586376", "0.65447986...
0.7586637
19
Implements the parsing rules in the Values section. Value[Const] : [~Const] Variable IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue[?Const] ObjectValue[?Const] BooleanValue : one of `true` `false` NullValue : `null` EnumValue : Name but not `true`, `false` or `null`
function parseValueLiteral(lexer, isConst) { var token = lexer.token; switch (token.kind) { case TokenKind.BRACKET_L: return parseList(lexer, isConst); case TokenKind.BRACE_L: return parseObject(lexer, isConst); case TokenKind.INT: lexer.advance(); return { kind: Kind....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n ...
[ "0.70578915", "0.6686118", "0.6659595", "0.6659595", "0.6659595", "0.6659595", "0.6659595", "0.6659595", "0.66523737", "0.66523737", "0.66523737", "0.66523737", "0.6634999", "0.657071", "0.6567315", "0.6563676", "0.6563676", "0.65584725", "0.6556967", "0.64918774", "0.6486485...
0.6685394
2
ListValue[Const] : [ ] [ Value[?Const]+ ]
function parseList(lexer, isConst) { var start = lexer.token; var item = isConst ? parseConstValue : parseValueValue; return { kind: Kind.LIST, values: any(lexer, TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }", "function parseList(lexer$$1, isConst) {\n var start = lexer$$1.token;\n va...
[ "0.68530875", "0.67082024", "0.663753", "0.663753", "0.663753", "0.663753", "0.663753", "0.661275", "0.661275", "0.66044474", "0.66044474", "0.66044474", "0.66044474", "0.66044474", "0.66044474", "0.65464705", "0.6488943", "0.6437807", "0.64054286", "0.64054286", "0.6404618",...
0.6670494
2
ObjectField[Const] : Name : Value[?Const]
function parseObjectField(lexer, isConst) { var start = lexer.token; var name = parseName(lexer); expectToken(lexer, TokenKind.COLON); return { kind: Kind.OBJECT_FIELD, name: name, value: parseValueLiteral(lexer, isConst), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseObjectField(lexer$$1, isConst) {\n var start = lexer$$1.token;\n return {\n kind: kinds.OBJECT_FIELD,\n name: parseName(lexer$$1),\n value: (expect(lexer$$1, lexer.TokenKind.COLON), parseValueLiteral(lexer$$1, isConst)),\n loc: loc(lexer$$1, start)\n };\n}", "parseObjectField(isConst...
[ "0.7566483", "0.7412592", "0.7334251", "0.7334251", "0.7317285", "0.7317285", "0.7317285", "0.7317285", "0.7317285", "0.73163164", "0.73163164", "0.73163164", "0.73163164", "0.73163164", "0.73163164", "0.7045878", "0.7023354", "0.70039093", "0.6991812", "0.6977889", "0.697788...
0.74207675
1
Implements the parsing rules in the Directives section. Directives[Const] : Directive[?Const]+
function parseDirectives(lexer, isConst) { var directives = []; while (peek(lexer, TokenKind.AT)) { directives.push(parseDirective(lexer, isConst)); } return directives; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDirectives(lexer$$1, isConst) {\n var directives = [];\n while (peek(lexer$$1, lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer$$1, isConst));\n }\n return directives;\n}", "function parseDirectives(lexer, isConst) {\n\t var directives = [];\n\t while (peek(lexer, _lexer.Token...
[ "0.72564316", "0.72359455", "0.7184585", "0.7184585", "0.7184585", "0.7184585", "0.71780854", "0.703154", "0.69459665", "0.69459665", "0.6931454", "0.680028", "0.63647354", "0.5654529", "0.5531388", "0.54981023", "0.549082", "0.5367143", "0.53504354", "0.53504354", "0.5347905...
0.7199963
2
Implements the parsing rules in the Types section. Type : NamedType ListType NonNullType
function parseTypeReference(lexer) { var start = lexer.token; var type; if (expectOptionalToken(lexer, TokenKind.BRACKET_L)) { type = parseTypeReference(lexer); expectToken(lexer, TokenKind.BRACKET_R); type = { kind: Kind.LIST_TYPE, type: type, loc: loc(lexer, start) }; } else...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseType(parser) {\n\t var start = parser.token.start;\n\t var type = undefined;\n\t if (skip(parser, _lexer.TokenKind.BRACKET_L)) {\n\t type = parseType(parser);\n\t expect(parser, _lexer.TokenKind.BRACKET_R);\n\t type = {\n\t kind: _kinds.LIST_TYPE,\n\t type: type,\n\t loc: l...
[ "0.6704555", "0.6574905", "0.6418076", "0.6298877", "0.6223291", "0.62063384", "0.6164048", "0.6068236", "0.6064522", "0.60400367", "0.60400367", "0.6026385", "0.6026385", "0.6026385", "0.6026385", "0.6026385", "0.6026385", "0.60107213", "0.60096174", "0.5963252", "0.5963252"...
0.5924556
23
Implements the parsing rules in the Type Definition section. TypeSystemDefinition : SchemaDefinition TypeDefinition DirectiveDefinition TypeDefinition : ScalarTypeDefinition ObjectTypeDefinition InterfaceTypeDefinition UnionTypeDefinition EnumTypeDefinition InputObjectTypeDefinition
function parseTypeSystemDefinition(lexer) { // Many definitions begin with a description and require a lookahead. var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token; if (keywordToken.kind === TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return parseSch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseTypeSystemDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeD...
[ "0.7652302", "0.7652302", "0.7652302", "0.7652302", "0.7652302", "0.7652302", "0.7651102", "0.7421105", "0.7421105", "0.7421105", "0.7421105", "0.7408032", "0.7338144", "0.72693497", "0.72520846", "0.72462326", "0.72462326", "0.72399676", "0.6308467", "0.6139902", "0.6133348"...
0.7428921
7
OperationTypeDefinition : OperationType : NamedType
function parseOperationTypeDefinition(lexer) { var start = lexer.token; var operation = parseOperationType(lexer); expectToken(lexer, TokenKind.COLON); var type = parseNamedType(lexer); return { kind: Kind.OPERATION_TYPE_DEFINITION, operation: operation, type: type, loc: loc(lexer, start) };...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n }...
[ "0.83943063", "0.79171854", "0.7892767", "0.7892767", "0.7892767", "0.7892767", "0.7892767", "0.77349615", "0.76647806", "0.76647806", "0.7528038", "0.7520787", "0.6559186", "0.65340006", "0.6188843", "0.6184098", "0.6146576", "0.612933", "0.612933", "0.612933", "0.612933", ...
0.80674225
1
ScalarTypeDefinition : Description? scalar Name Directives[Const]?
function parseScalarTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'scalar'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); return { kind: Kind.SCALAR_TYPE_DEFINITION, description: description, name: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\...
[ "0.8412863", "0.7995804", "0.7979121", "0.7942067", "0.7942067", "0.7942067", "0.7942067", "0.7942067", "0.79089016", "0.79089016", "0.79089016", "0.79089016", "0.79089016", "0.79089016", "0.7897011", "0.7894969", "0.7894969", "0.78944457", "0.7878526", "0.7746881", "0.766883...
0.79761434
3
ObjectTypeDefinition : Description? type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
function parseObjectTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'type'); var name = parseName(lexer); var interfaces = parseImplementsInterfaces(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields...
[ "0.8002696", "0.7672459", "0.76326346", "0.76326346", "0.76326346", "0.76326346", "0.76326346", "0.7567656", "0.7566063", "0.7564777", "0.7564777", "0.7469407", "0.67549336", "0.6521066", "0.64491045", "0.64308393", "0.64308393", "0.64308393", "0.64308393", "0.64308393", "0.6...
0.7632698
2
ImplementsInterfaces : implements `&`? NamedType ImplementsInterfaces & NamedType
function parseImplementsInterfaces(lexer) { var types = []; if (expectOptionalKeyword(lexer, 'implements')) { // Optional leading ampersand expectOptionalToken(lexer, TokenKind.AMP); do { types.push(parseNamedType(lexer)); } while (expectOptionalToken(lexer, TokenKind.AMP) || // Legacy suppo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseImplementsInterfaces() {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : [];\n }", "function parseImplementsInterfaces(lexer) {\n\t var types = [];\n\t if (lexer.token.value === 'implements') {\n\t lexer.advance();\n\t do...
[ "0.7545547", "0.7521685", "0.7521685", "0.7495221", "0.7495221", "0.7495221", "0.7495221", "0.7495221", "0.7495221", "0.7448668", "0.74411047", "0.7431042", "0.7431042", "0.7431042", "0.7431042", "0.7387536", "0.73074704", "0.73074704", "0.7220446", "0.7212402", "0.7107219", ...
0.7547813
0
FieldDefinition : Description? Name ArgumentsDefinition? : Type Directives[Const]?
function parseFieldDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); var name = parseName(lexer); var args = parseArgumentDefs(lexer); expectToken(lexer, TokenKind.COLON); var type = parseTypeReference(lexer); var directives = parseDirectives(lexer, true); return { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseCon...
[ "0.7748093", "0.6935052", "0.6935052", "0.6935052", "0.6935052", "0.6935052", "0.6906932", "0.68805027", "0.6879352", "0.6879352", "0.6879352", "0.6879352", "0.6879352", "0.6879352", "0.68410045", "0.68111277", "0.67675704", "0.67675704", "0.6679028", "0.6547652", "0.6508213"...
0.70829904
1
ArgumentsDefinition : ( InputValueDefinition+ )
function parseArgumentDefs(lexer) { if (!peek(lexer, TokenKind.PAREN_L)) { return []; } return many(lexer, TokenKind.PAREN_L, parseInputValueDef, TokenKind.PAREN_R); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }", "function parseArgumentDefs(lexer$$1) {\n if (!peek(lexer$$1, lexer.TokenKind.PAREN_L)) {\n return [];\n }\n return many(lexer$$1, lexer.TokenKind.PAREN_L,...
[ "0.6459641", "0.6177845", "0.6175874", "0.60900456", "0.60900456", "0.60688555", "0.60688555", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929815", "0.5929642", "0.58954644", "0.5881806", "0.58314556...
0.59616387
7
InputValueDefinition : Description? Name : Type DefaultValue? Directives[Const]?
function parseInputValueDef(lexer) { var start = lexer.token; var description = parseDescription(lexer); var name = parseName(lexer); expectToken(lexer, TokenKind.COLON); var type = parseTypeReference(lexer); var defaultValue; if (expectOptionalToken(lexer, TokenKind.EQUALS)) { defaultValue = parseCo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n ...
[ "0.79218966", "0.73651105", "0.7361809", "0.7361809", "0.7361809", "0.7361809", "0.73420274", "0.7270547", "0.72513586", "0.7234239", "0.7234239", "0.7234239", "0.7234239", "0.7234239", "0.7234239", "0.7212006", "0.7157804", "0.7157804", "0.70508397", "0.6977084", "0.6933363"...
0.747369
1
InterfaceTypeDefinition : Description? interface Name Directives[Const]? FieldsDefinition?
function parseInterfaceTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'interface'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(lexer); return { kind: Kind.INTERFACE_TYP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n cons...
[ "0.7973073", "0.7704892", "0.76692116", "0.7669019", "0.76654154", "0.76654154", "0.764558", "0.764558", "0.764558", "0.764558", "0.764558", "0.7483703", "0.6633259", "0.6581793", "0.6581793", "0.6468472", "0.64038366", "0.6336793", "0.5729618", "0.57230526", "0.57209885", ...
0.7673024
2
UnionTypeDefinition : Description? union Name Directives[Const]? UnionMemberTypes?
function parseUnionTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'union'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var types = parseUnionMemberTypes(lexer); return { kind: Kind.UNION_TYPE_DEFINITION,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(star...
[ "0.8731564", "0.82611036", "0.8259903", "0.8259903", "0.8259903", "0.8259903", "0.8259903", "0.82416266", "0.82396096", "0.8236936", "0.8236936", "0.8088634", "0.80799925", "0.80799925", "0.80799925", "0.80799925", "0.80799925", "0.80799925", "0.7912688", "0.7779032", "0.7773...
0.8291724
1
UnionMemberTypes : = `|`? NamedType UnionMemberTypes | NamedType
function parseUnionMemberTypes(lexer) { var types = []; if (expectOptionalToken(lexer, TokenKind.EQUALS)) { // Optional leading pipe expectOptionalToken(lexer, TokenKind.PIPE); do { types.push(parseNamedType(lexer)); } while (expectOptionalToken(lexer, TokenKind.PIPE)); } return types; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n\n do {\n types.push(...
[ "0.8104542", "0.8080086", "0.8080086", "0.8080086", "0.8080086", "0.80782765", "0.8059775", "0.7996208", "0.7996208", "0.7862189", "0.75986916", "0.75986916", "0.75986916", "0.75986916", "0.75869125", "0.75869125", "0.7486798", "0.74143493", "0.734792", "0.7166787", "0.675190...
0.81590265
0
EnumTypeDefinition : Description? enum Name Directives[Const]? EnumValuesDefinition?
function parseEnumTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'enum'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var values = parseEnumValuesDefinition(lexer); return { kind: Kind.ENUM_TYPE_DEFINITIO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(s...
[ "0.8462083", "0.7852077", "0.77736765", "0.770938", "0.770938", "0.770938", "0.770938", "0.770938", "0.7662368", "0.766001", "0.76576704", "0.76576704", "0.75871104", "0.7233042", "0.71990156", "0.71857774", "0.71857774", "0.71857774", "0.71857774", "0.71857774", "0.7077015",...
0.77478653
3
EnumValueDefinition : Description? EnumValue Directives[Const]? EnumValue : Name
function parseEnumValueDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); var name = parseName(lexer); var directives = parseDirectives(lexer, true); return { kind: Kind.ENUM_VALUE_DEFINITION, description: description, name: name, directives: directives, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n n...
[ "0.8741834", "0.80596673", "0.8031719", "0.8031719", "0.8031719", "0.8031719", "0.8031719", "0.7965319", "0.78878", "0.78844345", "0.78844345", "0.78844345", "0.78844345", "0.78844345", "0.78844345", "0.7841735", "0.78339535", "0.78277975", "0.78277975", "0.7777325", "0.76154...
0.8081175
1
InputObjectTypeDefinition : Description? input Name Directives[Const]? InputFieldsDefinition?
function parseInputObjectTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'input'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseInputFieldsDefinition(lexer); return { kind: Kind.INPUT_OBJE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return th...
[ "0.84310955", "0.7931814", "0.7860475", "0.7860475", "0.7860475", "0.7860475", "0.7860475", "0.7752444", "0.7750537", "0.7747884", "0.7747884", "0.7724999", "0.7377299", "0.60488296", "0.6035411", "0.6009256", "0.60075295", "0.60063696", "0.60063696", "0.59779453", "0.5850287...
0.7880839
2
TypeSystemExtension : SchemaExtension TypeExtension TypeExtension : ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeDefinition
function parseTypeSystemExtension(lexer) { var keywordToken = lexer.lookahead(); if (keywordToken.kind === TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return parseSchemaExtension(lexer); case 'scalar': return parseScalarTypeExtension(lexer); case 'type': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseTypeSystemExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === _lexer.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaExtension(lexer);\n\n case 'scalar':\n return parseScalarTypeExtension(lexer);\...
[ "0.6785023", "0.6703063", "0.66873544", "0.6602949", "0.65872735", "0.65872735", "0.65807384", "0.6526274", "0.6526274", "0.65261954", "0.65261954", "0.63755953", "0.6337995", "0.63233435", "0.6314149", "0.63133526", "0.63133526", "0.63133526", "0.63133526", "0.63133526", "0....
0.6825724
0
ScalarTypeExtension : extend scalar Name Directives[Const]
function parseScalarTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'scalar'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); if (directives.length === 0) { throw unexpected(lexer); } return { kind: Kind.SCALAR_T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n retur...
[ "0.79573685", "0.7616764", "0.7616764", "0.7616764", "0.7616764", "0.76079005", "0.7581085", "0.75520927", "0.7495815", "0.74954206", "0.749193", "0.749193", "0.57897353", "0.56300664", "0.5290077", "0.5277471", "0.51089996", "0.5067954", "0.5067954", "0.50650173", "0.5053443...
0.76446724
1
ObjectTypeExtension : extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition extend type Name ImplementsInterfaces? Directives[Const] extend type Name ImplementsInterfaces
function parseObjectTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'type'); var name = parseName(lexer); var interfaces = parseImplementsInterfaces(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(lexer); if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFie...
[ "0.75068283", "0.7256109", "0.7230234", "0.7230234", "0.7230234", "0.7230234", "0.7227584", "0.72258544", "0.7224692", "0.7224692", "0.7171129", "0.7118581", "0.66247076", "0.64239275", "0.6390195", "0.63806474", "0.63748", "0.63748", "0.63748", "0.63748", "0.63100094", "0....
0.7270051
1
InterfaceTypeExtension : extend interface Name Directives[Const]? FieldsDefinition extend interface Name Directives[Const]
function parseInterfaceTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'interface'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(lexer); if (directives.length === 0 && fields.length ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (directives.length === 0 && fiel...
[ "0.7502169", "0.7500473", "0.7500473", "0.7500473", "0.7500473", "0.7458943", "0.7456795", "0.7454372", "0.7450773", "0.7450773", "0.7413556", "0.73309994", "0.6054245", "0.6037818", "0.59408367", "0.59408367", "0.5756888", "0.5706359", "0.5706359", "0.5706359", "0.5706359", ...
0.7531801
0
UnionTypeExtension : extend union Name Directives[Const]? UnionMemberTypes extend union Name Directives[Const]
function parseUnionTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'union'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var types = parseUnionMemberTypes(lexer); if (directives.length === 0 && types.length === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && type...
[ "0.79461354", "0.7586608", "0.7586608", "0.7586608", "0.7586608", "0.757947", "0.752858", "0.7526069", "0.752174", "0.75177675", "0.75177675", "0.7236613", "0.59786", "0.59786", "0.5881149", "0.5661701", "0.5620122", "0.5593093", "0.5550287", "0.5550287", "0.5550287", "0.55...
0.7614498
1
EnumTypeExtension : extend enum Name Directives[Const]? EnumValuesDefinition extend enum Name Directives[Const]
function parseEnumTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'enum'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var values = parseEnumValuesDefinition(lexer); if (directives.length === 0 && values.length === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && v...
[ "0.83435464", "0.8010591", "0.7987615", "0.7987615", "0.7987615", "0.7987615", "0.79567426", "0.7950683", "0.79490817", "0.79441243", "0.79441243", "0.7884603", "0.6707387", "0.6416061", "0.64133793", "0.64133793", "0.64124703", "0.64124703", "0.6390642", "0.6343313", "0.6332...
0.8040114
1
InputObjectTypeExtension : extend input Name Directives[Const]? InputFieldsDefinition extend input Name Directives[Const]
function parseInputObjectTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'input'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseInputFieldsDefinition(lexer); if (directives.length === 0 && fields.length ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length =...
[ "0.77224934", "0.73963296", "0.73963296", "0.73963296", "0.73963296", "0.73897004", "0.7388679", "0.738839", "0.7385791", "0.7385791", "0.73586434", "0.73030066", "0.6640263", "0.62144965", "0.62115127", "0.62106407", "0.62106407", "0.6198305", "0.6185935", "0.6185935", "0.61...
0.74134797
1
DirectiveLocations : `|`? DirectiveLocation DirectiveLocations | DirectiveLocation
function parseDirectiveLocations(lexer) { // Optional leading pipe expectOptionalToken(lexer, TokenKind.PIPE); var locations = []; do { locations.push(parseDirectiveLocation(lexer)); } while (expectOptionalToken(lexer, TokenKind.PIPE)); return locations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (expectOptionalToken(lexer, _tokenKind__WEBPACK_IMPORTED_...
[ "0.77547574", "0.7676766", "0.7676766", "0.7621344", "0.7619415", "0.7619415", "0.7619415", "0.7619415", "0.761385", "0.75098306", "0.75098306", "0.75098306", "0.75098306", "0.750941", "0.750941", "0.7505226", "0.74823904", "0.7440218", "0.739005", "0.5977693", "0.597613", ...
0.7881363
0
DirectiveLocation : ExecutableDirectiveLocation TypeSystemDirectiveLocation ExecutableDirectiveLocation : one of `QUERY` `MUTATION` `SUBSCRIPTION` `FIELD` `FRAGMENT_DEFINITION` `FRAGMENT_SPREAD` `INLINE_FRAGMENT` TypeSystemDirectiveLocation : one of `SCHEMA` `SCALAR` `OBJECT` `FIELD_DEFINITION` `ARGUMENT_DEFINITION` `I...
function parseDirectiveLocation(lexer) { var start = lexer.token; var name = parseName(lexer); if (DirectiveLocation.hasOwnProperty(name.value)) { return name; } throw unexpected(lexer, start); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n\n if (_directiveLocation__WEBPACK_IMPORTED_MODULE_7__[\"DirectiveLocation\"][name.value] !== undefined) {\n return name;\n }\n\n throw unexpected(lexer, start);\n}", "function parseDirectiveLocation(lexer...
[ "0.5756661", "0.5750863", "0.56943417", "0.5674265", "0.5559663", "0.547741", "0.54384553", "0.53679943", "0.53679943", "0.5365359", "0.5365359", "0.5365359", "0.5365359", "0.53609306", "0.5326122", "0.5313424", "0.5264004", "0.5199003", "0.51832587", "0.51832587", "0.5183258...
0.5373065
7
Core parsing utility functions Returns a location object, used to identify the place in the source that created a given parsed object.
function loc(lexer, startToken) { if (!lexer.options.noLocation) { return new Loc(startToken, lexer.lastToken, lexer.source); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loc(parser, start) {\n\t if (parser.options.noLocation) {\n\t return null;\n\t }\n\t if (parser.options.noSource) {\n\t return { start: start, end: parser.prevEnd };\n\t }\n\t return { start: start, end: parser.prevEnd, source: parser.source };\n\t}", "function loc(parser, start) {\n if (par...
[ "0.74248946", "0.73753", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.6481035", "0.64646435", "0.64646435", "0.6461187", "0.6424284", "0.6146902", "0.61040217", "0.61040217", "0.61040217", "0.61040217"...
0.64528567
27
Determines if the next token is of a given kind
function peek(lexer, kind) { return lexer.token.kind === kind; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "match(tokenKind) {\n if (this.check(tokenKind)) {\n this.current++; //advance\n return true;\n }\n return false;\n }", "isToken(type) { return this.tokenizer.isTokenType(type) }", "peek(kind) {\n return this._lexer.token.kind === kind;\n }", "isTokenType(type...
[ "0.7669077", "0.7138985", "0.71243644", "0.6991784", "0.6981886", "0.6981886", "0.69696575", "0.6958934", "0.6938066", "0.6907717", "0.6870581", "0.68650633", "0.6751013", "0.67288613", "0.6719839", "0.6683571", "0.6593374", "0.64219314", "0.636494", "0.636494", "0.63374966",...
0.70372933
18
If the next token is of the given kind, return that token after advancing the lexer. Otherwise, do not change the parser state and throw an error.
function expectToken(lexer, kind) { var token = lexer.token; if (token.kind === kind) { lexer.advance(); return token; } throw syntaxError(lexer.source, token.start, "Expected ".concat(kind, ", found ").concat(getTokenDesc(token))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expectToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n throw Object(_error_syntaxError__WEBPACK_IMPORTED_MODULE_3__[\"syntaxError\"])(lexer.source, token.start, \"Expected \".concat(kind, \", found \").concat(Object(_lexer_...
[ "0.75552666", "0.7540973", "0.7540973", "0.7499807", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74857515", "0.74561", "0.74561", "0.7446827", "0.73827106", "0.72546035", "0.721419", "0.71434...
0.7571456
0
If the next token is of the given kind, return that token after advancing the lexer. Otherwise, do not change the parser state and return undefined.
function expectOptionalToken(lexer, kind) { var token = lexer.token; if (token.kind === kind) { lexer.advance(); return token; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expectToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n throw Object(_error__WEBPACK_IMPORTED_MODULE_3__[\"syntaxError\"])(lexer.source, token.start, \"Expected \".concat(kind, \", found \").concat(Object(_lexer__WEBPACK_IMP...
[ "0.69422793", "0.69422793", "0.69293267", "0.68667984", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6823151", "0.6799922", "0.67860156", "0.67860156", "0.67294866", "0.67247117", "0.6660485", "0.65671...
0.6954374
3
If the next token is a given keyword, return that token after advancing the lexer. Otherwise, do not change the parser state and throw an error.
function expectKeyword(lexer, value) { var token = lexer.token; if (token.kind === TokenKind.NAME && token.value === value) { lexer.advance(); return token; } throw syntaxError(lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat(getTokenDesc(token))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expectKeyword(keyword,contextual){var token=lex();if(token.type !== (contextual?Token.Identifier:Token.Keyword) || token.value !== keyword){throwUnexpected(token);}} // Expect the next token to match the specified contextual keyword.", "parseKeyword () {\n if (this.char === CHAR_QUOT) {\n re...
[ "0.7111017", "0.71051955", "0.7069162", "0.7054583", "0.70357525", "0.70357525", "0.70357525", "0.70357525", "0.70357525", "0.70357525", "0.7034736", "0.6995176", "0.6981118", "0.6942977", "0.6942977", "0.6942977", "0.6942977", "0.6942977", "0.6942977", "0.6942977", "0.694297...
0.64294827
84
If the next token is a given keyword, return that token after advancing the lexer. Otherwise, do not change the parser state and return undefined.
function expectOptionalKeyword(lexer, value) { var token = lexer.token; if (token.kind === TokenKind.NAME && token.value === value) { lexer.advance(); return token; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseKeyword () {\n if (this.char === CHAR_QUOT) {\n return this.next(this.parseBasicString)\n } else if (this.char === CHAR_APOS) {\n return this.next(this.parseLiteralString)\n } else {\n return this.goto(this.parseBareKey)\n }\n }", "parseKeyword() {\n\t\t\tif ( thi...
[ "0.71700567", "0.7139185", "0.7137332", "0.69504106", "0.69504106", "0.69504106", "0.69504106", "0.69504106", "0.69433576", "0.69244057", "0.6900959", "0.6900959", "0.68939394", "0.68862617", "0.68862617", "0.68701714", "0.6844051", "0.68241817", "0.68241817", "0.68241817", "...
0.0
-1
Helper function for creating an error when an unexpected lexed token is encountered.
function unexpected(lexer, atToken) { var token = atToken || lexer.token; return syntaxError(lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unexpectedTokenError(token, message)\n\t\t{\n\t\t\tvar msg = Messages.UnexpectedToken;\n\t\t\tif (token)\n\t\t\t{\n\t\t\t\tmsg = message ? message : (token.type === Token.EOF) ? Messages.UnexpectedEOS : (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier : (token.type === Token.NumericLitera...
[ "0.7421297", "0.73534113", "0.7337508", "0.7335112", "0.7335112", "0.7331919", "0.7302289", "0.72845167", "0.7281797", "0.72380084", "0.72380084", "0.72380084", "0.72380084", "0.72380084", "0.72068286", "0.72068286", "0.72068286", "0.72068286", "0.72068286", "0.72068286", "0....
0.7206929
14
Returns a possibly empty list of parse nodes, determined by the parseFn. This list begins with a lex token of openKind and ends with a lex token of closeKind. Advances the parser to the next lex token after the closing token.
function any(lexer, openKind, parseFn, closeKind) { expectToken(lexer, openKind); var nodes = []; while (!expectOptionalToken(lexer, closeKind)) { nodes.push(parseFn(lexer)); } return nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }", "function many(parser, openKind, parseFn, closeKind) {\n\t expect(parser, openKind);\n\...
[ "0.7557073", "0.7245133", "0.7104669", "0.7073318", "0.7047257", "0.7047257", "0.70177674", "0.69966984", "0.69444", "0.69444", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.68919057", "0...
0.6795493
41
Returns a nonempty list of parse nodes, determined by the parseFn. This list begins with a lex token of openKind and ends with a lex token of closeKind. Advances the parser to the next lex token after the closing token.
function many(lexer, openKind, parseFn, closeKind) { expectToken(lexer, openKind); var nodes = [parseFn(lexer)]; while (!expectOptionalToken(lexer, closeKind)) { nodes.push(parseFn(lexer)); } return nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }", "function many(parser, openKind, parseFn, closeKind) {\n\t expect(parser, openKind);\n\...
[ "0.7481586", "0.71831673", "0.7038837", "0.7000684", "0.7000684", "0.69779414", "0.68984693", "0.68984693", "0.68935955", "0.6872364", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.6848527", "0.68131495...
0.6688699
37
Strip insignificant whitespace Note that this could do a lot more, such as reorder fields etc.
function normalize(string) { return string.replace(/[\s,]+/g, ' ').trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function skipWhitespace() {\n input = input.replace(/^\\s+/, \"\");\n }", "function strip(s) {\n\t\treturn s.replace(/^\\s+|\\s+$/g,'');\n\t}", "function removeWhiteSpace(data) {\n return data.replace(/^\\s*|\\s*$/g, '');\n}", "function stripWhitespace(str) {\n return str.trim().replace(/\\s*\\...
[ "0.74390054", "0.73905325", "0.72594595", "0.7230391", "0.72205764", "0.72101337", "0.7182883", "0.71792644", "0.7148303", "0.7109688", "0.7095353", "0.7095353", "0.7095353", "0.7070699", "0.7070699", "0.70573366", "0.7056645", "0.704643", "0.7031691", "0.7021025", "0.7021025...
0.0
-1
XXX This should eventually disallow arbitrary string interpolation, like Relay does
function gql(/* arguments */) { var args = Array.prototype.slice.call(arguments); var literals = args[0]; // We always get literals[0] and then matching post literals for each arg given var result = (typeof(literals) === "string") ? literals : literals[0]; for (var i = 1; i < args.length; i++) { if (ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get BackQuote() {}", "get DoubleQuote() {}", "set BackQuote(value) {}", "function stringsLiteral(){\n const x = \"todos\";\n const y = \"clase\";\n console.log(`Hola a ${x} los de la ${y}`);\n}", "set DoubleQuote(value) {}", "function TemplateStrings() {\n\n\n // Basic literal string creation...
[ "0.61599046", "0.6096577", "0.6078674", "0.59921765", "0.5900588", "0.58454305", "0.5665797", "0.55869025", "0.55869025", "0.55654395", "0.55373293", "0.55373293", "0.5516336", "0.5511904", "0.5454342", "0.5454098", "0.5440605", "0.5425758", "0.54133725", "0.54063094", "0.540...
0.0
-1
Creates a `Readable` store that allows reading by subscription.
function readable(value, start) { return { subscribe: writable(value, start).subscribe, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Readable(options) {\n\tif(!(this instanceof Readable)){\n\t\treturn new Readable(options);\n\t}\n\n\t//invoke supertype constructor\n\tStream.call(this);\n\n\t//create a ReadableState object to handle the states and pass the options to it.\n\tthis._readableState = new ReadableState(options, this);\n\n\t//...
[ "0.54518956", "0.53648734", "0.53648734", "0.49720344", "0.49023265", "0.49023265", "0.49023265", "0.48933068", "0.48647615", "0.4844274", "0.4844274", "0.48003092", "0.47873333", "0.4767804", "0.47555083", "0.47330835", "0.47321945", "0.47027045", "0.4694222", "0.46868417", ...
0.5600294
0
Create a `Writable` store that allows both updating and reading by subscription.
function writable(value, start = noop$1) { let stop; const subscribers = []; function set(new_value) { if (safe_not_equal(value, new_value)) { value = new_value; if (!stop) { return; // not ready } subscribers.forEach((s) => s[1]()); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStore (reducer){\n // The store should have four parts\n // 1. The state\n // 2. Get the state.\n // 3. Listen to changes on the state.\n // 4. Update the state\n\n let state;\n let listeners = []\n\n const getState = () => state\n const subscribe = (listener) => {\n ...
[ "0.5492996", "0.5447075", "0.5445091", "0.5445091", "0.53333855", "0.53019285", "0.523356", "0.523356", "0.51941043", "0.51688635", "0.5143564", "0.50097144", "0.50097144", "0.50097144", "0.50097144", "0.50097144", "0.50097144", "0.50097144", "0.50097144", "0.50097144", "0.50...
0.5305786
5
Decode response as ArrayBuffer
arrayBuffer() { return consumeBody.call(this).then(function (buf) { return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decode(buffer) {\n return this._decoder.decode(buffer);\n }", "parse(data) {\n if (data instanceof Response) {\n if (!data.ok) {\n throw `Error retrieving data from ${data.url}: ${data.statusText}`;\n }\n return data.arrayBuffer().then(data => this.parse(data));\n }\n if ...
[ "0.6704919", "0.63907653", "0.6319413", "0.6232115", "0.6202762", "0.6161801", "0.60603166", "0.60394835", "0.59465516", "0.5904724", "0.5895203", "0.5887123", "0.58662033", "0.5750557", "0.5749251", "0.57230294", "0.5720503", "0.5720503", "0.57164407", "0.57072365", "0.56920...
0.61817086
31
Return raw response as Blob
blob() { let ct = this.headers && this.headers.get('content-type') || ''; return consumeBody.call(this).then(function (buf) { return Object.assign( // Prevent copying new Blob([], { type: ct.toLowerCase() }), { [BUFFER]: buf }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS].body && this[INTERNALS].body.type) || '';\n\t\tconst buf = await this.buffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}", "function responseBlob(response) {\n if (!response.ok) throw new E...
[ "0.7750467", "0.77489245", "0.76299053", "0.76299053", "0.7178017", "0.6992916", "0.6629173", "0.65583014", "0.65583014", "0.65583014", "0.63678575", "0.6219111", "0.6203176", "0.618137", "0.60491127", "0.60491127", "0.6006995", "0.5953631", "0.59525025", "0.5879103", "0.5778...
0.6997805
27
Decode response as json
json() { var _this2 = this; return consumeBody.call(this).then(function (buffer) { try { return JSON.parse(buffer.toString()); } catch (err) { return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decodeResponse(response) {\n if ($options.format === 'json' && typeof response == 'string') {\n return JSON.parse(response)\n }\n\n return response\n }", "function parseResponseJson(response) {\n return response.json();\n }", "function json(response) {\n return response.json...
[ "0.7735108", "0.72471887", "0.7183572", "0.7143394", "0.70187134", "0.6934863", "0.6816445", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", "0.6756636", ...
0.60593
60
Decode response as text
text() { return consumeBody.call(this).then(function (buffer) { return buffer.toString(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static readResponseAsText(response) {\n return response.text();\n }", "decodeResponse(response) {\n if ($options.format === 'json' && typeof response == 'string') {\n return JSON.parse(response)\n }\n\n return response\n }", "function decode(text) {\n const el = document.createE...
[ "0.72121304", "0.65828085", "0.6521857", "0.63954633", "0.6377491", "0.6307803", "0.6229783", "0.61968076", "0.61968076", "0.61968076", "0.61880034", "0.6045528", "0.6022727", "0.6012286", "0.5932783", "0.5885076", "0.5861498", "0.5856523", "0.5840521", "0.5832887", "0.578054...
0.0
-1
Decode response as buffer (nonspec api)
buffer() { return consumeBody.call(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "decode(buffer) {\n return this._decoder.decode(buffer);\n }", "function decodeObjects(buffer) {\n const decodedResult = { decodedObjects: [], rest: buffer };\n return decode(decodedResult);\n}", "function decode(buf)\n{\n // read and validate the json length\n var len = buf.readUInt16BE(0);\n...
[ "0.72285306", "0.69088256", "0.6803179", "0.6631981", "0.6494603", "0.64836377", "0.6462634", "0.63395625", "0.61294633", "0.6116667", "0.6116667", "0.6049798", "0.5996865", "0.59188694", "0.5896298", "0.58695734", "0.5863554", "0.5832767", "0.57990944", "0.57891995", "0.5764...
0.0
-1
Decode response as text, while automatically detecting the encoding and trying to decode to UTF8 (nonspec api)
textConverted() { var _this3 = this; return consumeBody.call(this).then(function (buffer) { return convertBody(buffer, _this3.headers); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decode(text) {\n return utf8.decode(text)\n}", "function DecodeUTF8(cb) {\n this.ondata = cb;\n if (tds)\n this.t = new TextDecoder();\n else\n this.p = et;\n }", "function _getEncoding(innerResponse){\n\tvar matches = (innerResponse.headers...
[ "0.6726383", "0.65213835", "0.6291531", "0.6287877", "0.61441374", "0.6121529", "0.6117406", "0.6098974", "0.6083307", "0.6083307", "0.60768175", "0.6034865", "0.59887487", "0.5966261", "0.5961701", "0.5958475", "0.59448993", "0.5910382", "0.5910382", "0.5910382", "0.59054893...
0.0
-1
Consume and convert an entire Body to a Buffer. Ref:
function consumeBody() { var _this4 = this; if (this[INTERNALS].disturbed) { return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); } this[INTERNALS].disturbed = true; if (this[INTERNALS].error) { return Body.Promise.reject(this[INTERNALS].error); } let body = this.body; // bo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consumeBody() {\n var _this4 = this;\n\n if (this[INTERNALS].disturbed) {\n return Body.Promise.reject(new TypeError('body used already for: ' + this.url));\n }\n\n this[INTERNALS].disturbed = true;\n\n if (this[INTERNALS].error) {\n return Body.Promise.reject(this[INTERNALS]....
[ "0.71689516", "0.7071163", "0.7050685", "0.7008717", "0.69575167", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", "0.6947254", ...
0.6912843
60
Detect buffer encoding and convert to target encoding ref:
function convertBody(buffer, headers) { if (typeof convert !== 'function') { throw new Error('The package `encoding` must be installed to use the textConverted() function'); } const ct = headers.get('content-type'); let charset = 'utf-8'; let res, str; // header if (ct) { res = /charset=([^;]*)/i.exec(ct);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFullEncoding(spec){return spec.encoding;}", "function detect(buffer) {\n const results = getDetectResults(buffer)\n const priorityList = results.filter(({ encoding }) => encoding.includes('GB') || encoding.includes('UTF'))\n if (priorityList.length) {\n const { 0: { encoding, confidence } } = p...
[ "0.63199216", "0.6077964", "0.5975663", "0.59001535", "0.58764356", "0.5848576", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", "0.5845864", ...
0.0
-1
Detect a URLSearchParams object ref:
function isURLSearchParams(obj) { // Duck-typing as a necessary condition. if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUrlSearchParams(value) {\n return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;\n}", "function isURLSearchParams$1(obj) {\n\t// Duck-typing as a necessary condition.\n\tif (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' ||...
[ "0.8007941", "0.78543067", "0.7826134", "0.7805296", "0.7296138", "0.72953635", "0.72844267", "0.7059968", "0.67719907", "0.667821", "0.667654", "0.661367", "0.6564293", "0.65624154", "0.6541369", "0.6483646", "0.6473778", "0.64529645", "0.6447715", "0.64343035", "0.6421393",...
0.78460574
28
Clone body given Res/Req instance
function clone(instance) { let p1, p2; let body = instance.body; // don't allow cloning a used body if (instance.bodyUsed) { throw new Error('cannot clone body after it is used'); } // check that body is a stream and not form-data object // note: we can't clone the form-data object without having it as a dep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawBodySaver(req, res, buf) {\n req.rawBody = buf;\n}", "clone () {\n\t if (!(this instanceof Request)) {\n\t throw new TypeError('Illegal invocation')\n\t }\n\n\t // 1. If this is unusable, then throw a TypeError.\n\t if (this.bodyUsed || this.body?.locked) {\n\t throw new Type...
[ "0.68789345", "0.68774086", "0.68647426", "0.6778437", "0.6778437", "0.6778437", "0.67301965", "0.6680882", "0.6672232", "0.66697276", "0.666658", "0.66026896", "0.6413327", "0.6411066", "0.63721025", "0.6294325", "0.6233494", "0.6220175", "0.62029356", "0.61423254", "0.61423...
0.67701423
28
Performs the operation "extract a `ContentType` value from |object|" as specified in the specification: This function assumes that instance.body is present.
function extractContentType(body) { // istanbul ignore if: Currently, because of a guard in Request, body // can never be null. Included here for completeness. if (body === null) { // body is null return null; } else if (typeof body === 'string') { // body is string return 'text/plain;charset=UTF-8'; } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get contentType() {\r\n return new ContentType(this, \"ContentType\");\r\n }", "function extractContentType(instance) {\n var body = instance.body;\n\n // istanbul ignore if: Currently, because of a guard in Request, body\n // can never be null. Included here for completeness.\n\n if (body ...
[ "0.57024693", "0.55995643", "0.53830045", "0.53101283", "0.5308515", "0.52717733", "0.5224718", "0.5224718", "0.5224718", "0.5224718", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "0.52176464", "...
0.49676335
39
The Fetch Standard treats this as if "total bytes" is a property on the body. For us, we have to explicitly get it with a function. ref:
function getTotalBytes(instance) { const body = instance.body; // istanbul ignore if: included for completion if (body === null) { // body is null return 0; } else if (isBlob(body)) { return body.size; } else if (Buffer.isBuffer(body)) { // body is buffer return body.length; } else if (body && typeof ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalBytes(results) {\n var total = 0;\n var pageStats = results.pageStats;\n for(var key in pageStats) {\n if(key.endsWith('Bytes')) {\n total += parseInt(pageStats[key], 10);\n }\n }\n return total;\n}", "function totalBytes(results) {\n var total = 0;\n v...
[ "0.68375605", "0.6803719", "0.67497194", "0.6723741", "0.6613326", "0.65146077", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", "0.6506515", ...
0.6637777
4
Write a Body to a Node.js WritableStream (e.g. http.Request) object.
function writeToStream(dest, instance) { const body = instance.body; if (body === null) { // body is null dest.end(); } else if (isBlob(body)) { body.stream().pipe(dest); } else if (Buffer.isBuffer(body)) { // body is buffer dest.write(body); dest.end(); } else { // body is stream body.pipe(dest)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function streamFromBody(body) {\n return new stream.Readable({\n read() {\n this.push(body);\n this.push(null);\n },\n });\n}", "function writeToStream(dest, instance) {\n var body = instance.body;\n\n\n if (body === null) {\n // body is null\n dest.end();\n } else if (ty...
[ "0.70173126", "0.6624513", "0.62165093", "0.6097583", "0.554793", "0.5492234", "0.54554725", "0.54162616", "0.53442115", "0.5329103", "0.5325505", "0.5325505", "0.532492", "0.5284051", "0.5280768", "0.5280768", "0.5280768", "0.5280768", "0.5280768", "0.5280768", "0.5280768", ...
0.60997975
30
Find the key in the map object given a header name. Returns undefined if not found.
function find$1(map, name) { name = name.toLowerCase(); for (const key in map) { if (key.toLowerCase() === name) { return key; } } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeader(headers, headerName) {\n const headerFilter = matchHeaderPartialFn(headerName.toLowerCase());\n let firstItem;\n if (browserHasFind) {\n firstItem = headers[\"find\"](headerFilter);\n }\n else {\n firstItem = headers.map(headerFilter).pop();\n }\n return firstI...
[ "0.6930306", "0.69021726", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606", "0.68099606",...
0.6761024
33
Return combined header value given name
get(name) { name = `${name}`; validateName(name); const key = find$1(this[MAP], name); if (key === undefined) { return null; } return this[MAP][key].join(', '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeaderValue(headers, key) {\n let header = headers.find(header => header.name === key)\n return header ? header.value : '';\n}", "get(name) {\n this.init();\n const values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n }", "get(name) {...
[ "0.6881881", "0.6619128", "0.65030175", "0.65030175", "0.65030175", "0.65030175", "0.65030175", "0.6500325", "0.64678496", "0.64678496", "0.64678496", "0.6265117", "0.6212423", "0.6130289", "0.6120748", "0.6050388", "0.593155", "0.58981603", "0.5810313", "0.57396287", "0.5734...
0.0
-1
Iterate over all headers
forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; let pairs = getHeaders(this); let i = 0; while (i < pairs.length) { var _pairs$i = pairs[i]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iterateHeaders(headers, callback) {\n var iterator = headers[Symbol.iterator]();\n var entry = iterator.next();\n while(!entry.done) {\n callback(entry.value[0]);\n entry = iterator.next();\n }\n}", "[Symbol.iterator]() {\n return headerIterator(this._headersMap);\n }", "forEach(ca...
[ "0.83340377", "0.7545003", "0.7119512", "0.7018295", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", "0.6604222", ...
0.6958384
31
Overwrite header values given name
set(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find$1(this[MAP], name); this[MAP][key !== undefined ? key : name] = [value]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set(name, value) {\n this._headersMap.set(normalizeName(name), { name, value: String(value) });\n }", "setHeader(name,value){\n\t\tif(typeof name !== 'string')throw new Error('name of the header should be a String not an ' + typeof name);\n\t\tif(!this.headers)this.headers=[];\n\t\tthis.headers.push({n...
[ "0.7270905", "0.7162745", "0.7105708", "0.70907015", "0.7028433", "0.69874024", "0.6776229", "0.6686003", "0.6641528", "0.6641528", "0.6641528", "0.6558658", "0.65330917", "0.6528388", "0.6512023", "0.64600563", "0.64321864", "0.6430783", "0.63525134", "0.62869275", "0.622530...
0.0
-1
Append a value onto existing header
append(name, value) { name = `${name}`; value = `${value}`; validateName(name); validateValue(value); const key = find$1(this[MAP], name); if (key !== undefined) { this[MAP][key].push(value); } else { this[MAP][name] = [value]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addOrUpdateHeader(headers, headerName, headerValue) {\n var index =\n headers.findIndex(header => header.name.toLowerCase() == headerName);\n if (index != -1) {\n headers[index].value = headerValue;\n } else {\n headers.push({name: headerName, value: headerValue});\n }\n}", "function addH...
[ "0.7312881", "0.7259065", "0.72307897", "0.7168355", "0.71101296", "0.69837916", "0.6880852", "0.6822632", "0.67918754", "0.67508405", "0.6625429", "0.65546936", "0.6472663", "0.6458982", "0.64440525", "0.63608843", "0.63608843", "0.6349741", "0.6349741", "0.6349741", "0.6305...
0.0
-1
Check for header name existence
has(name) { name = `${name}`; validateName(name); return find$1(this[MAP], name) !== undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_hasHeader( key ) {\n key = String( key || '' ).replace( /[^\\w\\-]+/g, '' ).toLowerCase();\n return ( Object.keys( this._headers ).indexOf( key ) !== -1 );\n }", "hasHeader(name) {\n return this.response.hasHeader(name);\n }", "function checkHasHeader(headers, headerName) {\n return !!header...
[ "0.81266457", "0.79726726", "0.7855979", "0.7836712", "0.7693734", "0.7693734", "0.7693734", "0.7693734", "0.7693734", "0.7546047", "0.7301027", "0.714558", "0.7022309", "0.6989141", "0.68657607", "0.68252224", "0.65847063", "0.65572304", "0.6513639", "0.64835817", "0.6473813...
0.0
-1
Delete all header values given name
delete(name) { name = `${name}`; validateName(name); const key = find$1(this[MAP], name); if (key !== undefined) { delete this[MAP][key]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(name) {\n this._headersMap.delete(normalizeName(name));\n }", "removeHeader(name){\n\t\tif(typeof name !== 'string')throw new Error('name of the header should be a String not an ' + typeof name);\n\t\tif(this.headers.has(name))this.headers.delete(name)\n\t}", "function removeHeader(e) {\n l...
[ "0.73324937", "0.7056284", "0.638285", "0.6188458", "0.61696404", "0.6079", "0.6066298", "0.60646504", "0.59440744", "0.58971596", "0.5806112", "0.5806112", "0.5806112", "0.5783293", "0.57744783", "0.57334244", "0.57334244", "0.57334244", "0.57334244", "0.57334244", "0.573342...
0.5728059
45
Return raw headers (nonspec api)
raw() { return this[MAP]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "headers() {\n return this.parseHeaders()\n }", "rawHeaders() {\n return this.toJson({ preserveCase: true });\n }", "rawHeaders() {\n return this.toJson({ preserveCase: true });\n }", "rawHeaders() {\n return this.toJson({ preserveCase: true });\n }", "function getHeaders()...
[ "0.7125896", "0.7088043", "0.7088043", "0.7088043", "0.7006647", "0.6974856", "0.69619054", "0.6843275", "0.6812514", "0.66822153", "0.65791655", "0.65782845", "0.6576694", "0.65554416", "0.6498735", "0.6434578", "0.64027786", "0.6372873", "0.63663507", "0.63499695", "0.63316...
0.0
-1
Get an iterator on keys.
keys() { return createHeadersIterator(this, 'key'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "* keys() {\n\t\tfor (const [key] of this) {\n\t\t\tyield key;\n\t\t}\n\t}", "keys() {\n\t\treturn createHeadersIterator$1(this, 'key');\n\t}", "get keys() {}", "function demo() {\n var array1 = ['a', 'b', 'c'];\n var iterator = array1.keys();\n\n for (let key of iterator) {\n console.log(key)...
[ "0.7362036", "0.72951514", "0.68703926", "0.67579263", "0.67039543", "0.6488904", "0.64630836", "0.63769937", "0.63032764", "0.6273094", "0.62462735", "0.62337005", "0.62337005", "0.6231847", "0.6231847", "0.62083256", "0.62027174", "0.6202037", "0.61975175", "0.61975175", "0...
0.7270367
27
Get an iterator on values.
values() { return createHeadersIterator(this, 'value'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[Symbol.iterator]() {\n return this.values[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.values[Symbol.iterator]();\n }", "*[Symbol.iterator]() {\n let values = this.values;\n for (let i = 0; i < values.length; i++)\n yield values[i];\n }", "values() {\n ...
[ "0.72199774", "0.72199774", "0.72117", "0.7066868", "0.6913997", "0.67514825", "0.67514825", "0.6658371", "0.65884084", "0.6571827", "0.6571827", "0.6571827", "0.6555289", "0.6547711", "0.65429527", "0.6540495", "0.6540495", "0.6540495", "0.6540495", "0.6540495", "0.6540495",...
0.0
-1
Get an iterator on entries. This is the default iterator of the Headers object.
[Symbol.iterator]() { return createHeadersIterator(this, 'key+value'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "[Symbol.iterator]() {\n return headerIterator(this._headersMap);\n }", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "keys() {\n\t\treturn createHea...
[ "0.7515612", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925", "0.68711925",...
0.6696296
59
Export the Headers object in a form that Node.js can consume.
function exportNodeCompatibleHeaders(headers) { const obj = Object.assign({ __proto__: null }, headers[MAP]); // http.request() only supports string as Host header. This hack makes // specifying custom Host header possible. const hostHeaderKey = find$1(headers[MAP], 'Host'); if (hostHeaderKey !== undefined) { o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== un...
[ "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "0.7428899", "...
0.74238646
30
Create a Headers object from an object of headers, ignoring those that do not conform to HTTP grammar productions.
function createHeadersLenient(obj) { const headers = new Headers(); for (const name of Object.keys(obj)) { if (invalidTokenRegex.test(name)) { continue; } if (Array.isArray(obj[name])) { for (const val of obj[name]) { if (invalidHeaderCharRegex.test(val)) { continue; } if (headers[MAP][na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHeadersLenient$1(obj) {\n\tconst headers = new Headers$1();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex$1.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex$1.test(val)) {\n\t\t...
[ "0.7155281", "0.70337594", "0.6722854", "0.6722854", "0.6707864", "0.6639732", "0.66200715", "0.65700585", "0.65700585", "0.6559239", "0.6559239", "0.63712174", "0.6350516", "0.6350516", "0.6350516", "0.6350516", "0.6331646", "0.63120735", "0.6209585", "0.6162787", "0.6162787...
0.70555305
28
Convenience property representing if the request ended normally
get ok() { return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get aborted() {\n var _a, _b, _c;\n return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete);\n }", "get ended() {\n return this...
[ "0.7013888", "0.6451986", "0.6410449", "0.62309563", "0.608828", "0.6050663", "0.6050663", "0.5992452", "0.59648514", "0.5949979", "0.5896224", "0.58670866", "0.58554786", "0.58197373", "0.5806838", "0.5788841", "0.578467", "0.5744267", "0.5731251", "0.57179326", "0.5710559",...
0.5709766
53
Check if a value is an instance of Request.
function isRequest(input) { return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRequest$1(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2$1] === 'object';\n}", "function isRequest(input) {\n return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}", "function req(req) {\r\n\t\t\treturn req !== undefined;\r\n\t\t}", "function che...
[ "0.6870434", "0.68328947", "0.5988662", "0.5606717", "0.5536992", "0.5515127", "0.54467374", "0.54467374", "0.5440667", "0.54168457", "0.54168457", "0.54168457", "0.54168457", "0.5410973", "0.5409457", "0.5394135", "0.537199", "0.537199", "0.53699076", "0.53694856", "0.536948...
0.68927264
28
Convert a Request to Node.js http request options.
function getNodeRequestOptions(request) { const parsedURL = request[INTERNALS$2].parsedURL; const headers = new Headers(request[INTERNALS$2].headers); // fetch step 1.3 if (!headers.has('Accept')) { headers.set('Accept', '*/*'); } // Basic fetch if (!parsedURL.protocol || !parsedURL.hostname) { throw new T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function requestToOptions(request) {\n return {\n abortSignal: request.abortSignal,\n requestOptions: {\n timeout: request.timeout,\n },\n tracingOptions: request.tracingOptions,\n };\n}", "function requestOptions (requestOptions, options) {\n return {\n url: requ...
[ "0.7666781", "0.71348035", "0.6843842", "0.677994", "0.6767087", "0.67188674", "0.67188674", "0.67188674", "0.67188674", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517", "0.6707517",...
0.67762023
4
Content add active class
function content(contentId){ articles.forEach( (content) =>{ if(content.id===contentId){ cleanAllContentsActiveClasses(); content.classList.add('active'); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function active() {\n $html.addClass('active');\n }", "function putActiveClass(e) {\n removeActiveClass()\n e.classList.add(\"active\")\n}", "function addActiveClass() {\n const selected = \".navbar-large li a\";\n $(selected).on(\"click\", function(e) {\n $(selected).removeClass(\"active\...
[ "0.7916514", "0.74238914", "0.71774083", "0.7170289", "0.71484554", "0.7144154", "0.713835", "0.70835525", "0.7008548", "0.6944846", "0.68954813", "0.6885888", "0.686724", "0.6846655", "0.68171746", "0.6802602", "0.67951065", "0.67784286", "0.67779374", "0.67531323", "0.67218...
0.6212103
95
Remove all active clsses from content Elements
function cleanAllContentsActiveClasses(){ articles.forEach( (content) => content.classList.remove('active')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_clearActiveDropdownElements () {\n this._containerHeader.querySelector('#twox2').classList.remove('elementActive')\n this._containerHeader.querySelector('#twox4').classList.remove('elementActive')\n this._containerHeader.querySelector('#fourx2').classList.remove('elementActive')\n this._containerHeade...
[ "0.73681766", "0.72583514", "0.71971214", "0.698677", "0.694765", "0.69132984", "0.68966615", "0.68287945", "0.6826675", "0.68259186", "0.6789403", "0.6780397", "0.67538565", "0.6730723", "0.67205113", "0.6716864", "0.6711625", "0.6650629", "0.6645148", "0.66363084", "0.66362...
0.7917881
0
Remove all active clsses from button Elements
function cleanAllButtonsActiveClasses(){ btns.forEach( (button) => button.classList.remove('active')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeCurrentActiveStyles() {\r\n this.percentageBtns.forEach(b => b.classList.remove(\"active\"));\r\n }", "function removeActiveSelectorClass() {\n var pieceSelectorButtons = document.getElementsByClassName(pieceSelectorClassName);\n for (var i = 0; i < pieceSelectorButtons.length; i++)...
[ "0.78114605", "0.7729797", "0.76577187", "0.7638726", "0.7522489", "0.75120217", "0.7485797", "0.74851054", "0.7401627", "0.7283558", "0.7274929", "0.7195873", "0.7195778", "0.7187667", "0.7165383", "0.71477586", "0.7076745", "0.707429", "0.70314187", "0.70301986", "0.7029134...
0.8513415
0
The bellow method return a dictionary, which the key is the dbus object path and its value is another dictionary with the dbus interface as a key and the properties of that interface as value. We're just interested in the properties of devices interface so we need to filter the devices from the dbus's result
function mapObjectsToDevices(objects) { return _.chain(objects) .pickBy(function onPick(object) { return _.has(object, DEVICE_INTERFACE_NAME); }) .map(function onMap(object) { return setKeysToLowerCase(object[DEVICE_INTERFACE_NAME]); }) .value(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GetAll(objPath, binterface, callback) {\n this.dbus.driver.invoke({\n destination: 'org.freedesktop.NetworkManager',\n path: objPath,\n 'interface': 'org.freedesktop.DBus.Properties',\n member: 'GetAll',\n signature: 's',\n body: [\n new STRING(binterface)\n ]\n }, (...
[ "0.6340823", "0.5619861", "0.5594935", "0.5556598", "0.542271", "0.5412984", "0.53605586", "0.5350987", "0.5329379", "0.530218", "0.5285255", "0.52773577", "0.52293247", "0.5219132", "0.50872993", "0.50669086", "0.506423", "0.5058699", "0.5039596", "0.501455", "0.4996247", ...
0.59668976
1
import notesData from '../data';
function Notes({ notes, mode, editNote, deleteNote }) { // const [mode, setMode] = useState("edit-off"); return ( <> {notes.map(note => ( <Draggable> <div className="note" key={note.id}> <header> <button className="btn-red" o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readNotes() {\n return data;\n}", "static getNotes() {\n return fetch(`${baseURL}/notes`).then(resp => resp.json())\n }", "function getNoteData(){\n return JSON.parse(localStorage.getItem(\"notes\")) || {};\n}", "componentDidMount() {\n this.getNotes();\n }", "function App() {\...
[ "0.6157781", "0.61414397", "0.61360204", "0.594687", "0.59334505", "0.5798898", "0.57210875", "0.5707065", "0.5681679", "0.5663084", "0.564576", "0.56361526", "0.562982", "0.56097245", "0.5596619", "0.558051", "0.55569094", "0.5552117", "0.55326277", "0.54940265", "0.5493054"...
0.0
-1
Expect an ID > transformer_data
constructor(tableId) { this.tableId = tableId; this.htmlTagFactory = new HtmlTagElementFactory(); this.tableDom = $(tableId); this.emptyTable(); this.buildTableHeader(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddTransformer() {}", "getTransformedData() {\n const form = this.getData();\n\n return Object.keys(form)\n .map((id) => [id, this.getTransformedValue(id)])\n .reduce((acc, [id, value]) => {\n acc[id] = value;\n return acc;\n }, {});\n }", "static traktIdFromData(da...
[ "0.581864", "0.5559967", "0.53041697", "0.5277771", "0.52706707", "0.51028407", "0.5101299", "0.50328964", "0.5013312", "0.49788645", "0.49745345", "0.4964083", "0.4944237", "0.49254173", "0.49041542", "0.4894209", "0.48781338", "0.48519316", "0.484868", "0.48333877", "0.4798...
0.0
-1
Functions Complete the `minimum` exercise.
function min(a, b) { if (a < b) return a; else return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minimum() {\r\nvar mini = Math.min.apply(null, numbers);\r\nconsole.log(\"minimum cherez matem funchii-\",mini);\r\n}", "min() {}", "function min(one, two) {\n \n if (one > two) return two;\n else return one;\n \n}", "function min(a,b) {return a < b ? a : b; }", "function fmin(a, b) { return...
[ "0.8049998", "0.79900104", "0.78239274", "0.7729002", "0.7713521", "0.75634664", "0.7555773", "0.75531626", "0.754592", "0.7535299", "0.75344664", "0.75344664", "0.7526484", "0.7504504", "0.7493117", "0.74828833", "0.74688333", "0.74688333", "0.74423087", "0.743932", "0.74373...
0.753536
11
n = number; d = number of adjacent digits
function largestProduct(n, d) { var max = 0 for (var i = 0; i < n.length - d; i++) { var prod = 1; for (var j = 0; j < d; j++) { prod *= Number(n.charAt(i + j)); } if (prod > max) { max = prod; } } return max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nbDig(n, d) {\n let count = 0;\n d = '' + d;\n // square all numbers (k) between 0 and n (inclusive)\n const squares = Array.from({ length: n + 1 }, (_, i) => Math.pow(i, 2));\n // count the number of digits (d) used in the writing of k**2\n squares.forEach(square => (count += digitCount('' + square...
[ "0.7431231", "0.706519", "0.68931556", "0.6838965", "0.681963", "0.66089535", "0.6608947", "0.65869", "0.6567453", "0.65621096", "0.6544018", "0.6541218", "0.65236145", "0.6503618", "0.6484323", "0.64829844", "0.64820105", "0.64750826", "0.647292", "0.6470885", "0.64663464", ...
0.0
-1
TODO: do not make a commit with GitHub api key or access token in any file. (Only applies if your app uses access tokens or api keys.)
function api (response) { // TODO: Return promise for GitHub api response to get user data. // (Hint: Use axios to send a get request and return the promise created by calling axios.get()) function getUser(username) { const queryUrl = "https://api.github.com/users/"+{username}+"/repos?per_page=100"; axio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function commitGithub(GH, UI) {\n var d = new Date()\n var ds = d.toLocaleDateString()\n var ts = d.toLocaleTimeString()\n var data = GH.parse(UI);\n data['editcontent'] = UI.geteditor();\n data['commitmsg'] = \"Updated from Brython Server: \"+ds+\" \"+ts;\n $.ajax(...
[ "0.60916144", "0.6045169", "0.6035887", "0.60149276", "0.60064685", "0.5925217", "0.5890451", "0.5842507", "0.58371997", "0.582783", "0.58159727", "0.579509", "0.5772826", "0.5769447", "0.5712647", "0.571145", "0.5707878", "0.570085", "0.5696144", "0.5691729", "0.5671017", ...
0.52577525
88
TODO: Return promise for GitHub api response to get user data. (Hint: Use axios to send a get request and return the promise created by calling axios.get())
function getUser(username) { const queryUrl = "https://api.github.com/users/"+{username}+"/repos?per_page=100"; axios.get(queryUrl).then(function(res) { const repo = res.data; console.log(repo) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserInfo(username){\n return axios.get('https://api.github.com/users/' + username);\n}", "getUserById(username) {\n this.log.debug(`getUserById: ${username}`);\n let options = {\n method: 'GET',\n uri: `https://api.github.com/users/${username}`,\n headers: {\n 'User-Age...
[ "0.7899162", "0.7837996", "0.78314763", "0.77944195", "0.77569884", "0.7745623", "0.7692045", "0.76795", "0.76649725", "0.75934255", "0.7568843", "0.7439032", "0.7411871", "0.73521024", "0.73492414", "0.7282398", "0.72630674", "0.72026813", "0.71688193", "0.7150823", "0.71468...
0.7387922
13
Define a markerSize function that will give each airport a different radius based on its population
function markerSize(population) { return population / 60; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function markerSize(earthquake_size) {\n return 200;\n}", "function markerSize(magnitude){\n return magnitude * 2\n}", "function markerSize(magnitude) {\n return magnitude * 5;\n}", "function markerSize(magnitude) {\n return magnitude * 4;\n}", "function markerSize(magnitude) {\n return magnit...
[ "0.8047438", "0.77232176", "0.76755834", "0.7646723", "0.7616906", "0.76154935", "0.75933665", "0.7551066", "0.7524319", "0.7515122", "0.749854", "0.74886924", "0.74630576", "0.7419559", "0.740394", "0.73990136", "0.73522073", "0.7347048", "0.7323049", "0.7317128", "0.7262745...
0.78408474
1
Remove commas from numbers when grabbing them from page
function removeCommas(i){ if (i == null) { return 0; } else if (i.indexOf(",") >= 0){ integer = parseInt(i.replace(/,/g, "")); return integer } else{ return parseInt(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeCommas(num) {\n return num.toString().replace(/,/g, '');\n }", "function getNumberWithCommas(item) {\r\n return item.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n}", "function commas(xp) {\n return xp.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}", "function remov...
[ "0.6464663", "0.63862157", "0.6328282", "0.6283375", "0.62496644", "0.6235105", "0.62320316", "0.6230182", "0.62206376", "0.62090594", "0.62002814", "0.6188797", "0.6182785", "0.61484116", "0.61484116", "0.6144441", "0.61345375", "0.61341953", "0.61341953", "0.61305124", "0.6...
0.0
-1
adds up total points
function getTotalPts(){ totalPts = attendanceTotalPts + rxnTotalPts + blogTotalPts + sliderPts + teamPts // console.log(attendanceTotalPts +", " +rxnTotalPts +", " +blogTotalPts +", " +sliderPts +", " +teamPts) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "awardPoints(numPoints) {\n this.points += numPoints;\n }", "function setTotalPoints(num) {\n totalPoints = num;\n}", "function incrementPoints() {\n currentPointValue++;\n }", "function addPoints() {\n score += 10;\n points.innerHTML = score;\n }", "functio...
[ "0.7576857", "0.75195986", "0.7464298", "0.72597736", "0.7244852", "0.72245556", "0.71047395", "0.6974178", "0.69698155", "0.6968273", "0.6968273", "0.6968273", "0.69172573", "0.68643606", "0.6851618", "0.6815997", "0.6803392", "0.67638946", "0.6763662", "0.6754791", "0.67475...
0.7037345
7