repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
opendigitaleducation/sijil.js
docs/libs/typescript.js
isSymbolAccessible
function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol...
javascript
function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { var initialSymbol = symbol; var meaningToLook = meaning; while (symbol...
[ "function", "isSymbolAccessible", "(", "symbol", ",", "enclosingDeclaration", ",", "meaning", ",", "shouldComputeAliasesToMakeVisible", ")", "{", "if", "(", "symbol", "&&", "enclosingDeclaration", "&&", "!", "(", "symbol", ".", "flags", "&", "262144", "/* TypeParame...
Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested @param symbol a Symbol to check if accessible @param enclosingDeclaration a Node containing reference to the symbol @param meaning a SymbolFlags to check if such meaning of the symbol is acce...
[ "Check", "if", "the", "given", "symbol", "in", "given", "enclosing", "declaration", "is", "accessible", "and", "mark", "all", "associated", "alias", "to", "be", "visible", "if", "requested" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L18705-L18766
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
appendPropertyOrElementAccessForSymbol
function appendPropertyOrElementAccessForSymbol(symbol, writer) { var symbolName = getNameOfSymbol(symbol); var firstChar = symbolName.charCodeAt(0); var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); if (needsElementAccess) { ...
javascript
function appendPropertyOrElementAccessForSymbol(symbol, writer) { var symbolName = getNameOfSymbol(symbol); var firstChar = symbolName.charCodeAt(0); var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); if (needsElementAccess) { ...
[ "function", "appendPropertyOrElementAccessForSymbol", "(", "symbol", ",", "writer", ")", "{", "var", "symbolName", "=", "getNameOfSymbol", "(", "symbol", ")", ";", "var", "firstChar", "=", "symbolName", ".", "charCodeAt", "(", "0", ")", ";", "var", "needsElement...
Writes a property access or element access with the name of the symbol out to the writer. Uses the original source text for the name of the symbol if it is available to match how the user wrote the name, ensuring that any names written with literals use element accesses.
[ "Writes", "a", "property", "access", "or", "element", "access", "with", "the", "name", "of", "the", "symbol", "out", "to", "the", "writer", ".", "Uses", "the", "original", "source", "text", "for", "the", "name", "of", "the", "symbol", "if", "it", "is", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L18953-L18971
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
buildSymbolDisplay
function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { var parentSymbol; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { // Write type arguments of instantiated class/interfa...
javascript
function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { var parentSymbol; function appendParentTypeArgumentsAndSymbolName(symbol) { if (parentSymbol) { // Write type arguments of instantiated class/interfa...
[ "function", "buildSymbolDisplay", "(", "symbol", ",", "writer", ",", "enclosingDeclaration", ",", "meaning", ",", "flags", ",", "typeFlags", ")", "{", "var", "parentSymbol", ";", "function", "appendParentTypeArgumentsAndSymbolName", "(", "symbol", ")", "{", "if", ...
Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope Meaning needs to be specified if the enclosing declaration is given
[ "Enclosing", "declaration", "is", "optional", "when", "we", "don", "t", "want", "to", "get", "qualified", "name", "in", "the", "enclosing", "declaration", "scope", "Meaning", "needs", "to", "be", "specified", "if", "the", "enclosing", "declaration", "is", "giv...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L18976-L19041
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
pushTypeResolution
function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found var length_2 = resolutionTargets.length; for (var i ...
javascript
function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found var length_2 = resolutionTargets.length; for (var i ...
[ "function", "pushTypeResolution", "(", "target", ",", "propertyName", ")", "{", "var", "resolutionCycleStartIndex", "=", "findResolutionCycleStartIndex", "(", "target", ",", "propertyName", ")", ";", "if", "(", "resolutionCycleStartIndex", ">=", "0", ")", "{", "// A...
Push an entry on the type resolution stack. If an entry with the given target and the given property name is already on the stack, and no entries in between already have a type, then a circularity has occurred. In this case, the result values of the existing entry and all entries pushed after it are changed to false, a...
[ "Push", "an", "entry", "on", "the", "type", "resolution", "stack", ".", "If", "an", "entry", "with", "the", "given", "target", "and", "the", "given", "property", "name", "is", "already", "on", "the", "stack", "and", "no", "entries", "in", "between", "alr...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L19670-L19684
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypeForBindingElement
function getTypeForBindingElement(declaration) { var pattern = declaration.parent; var parentType = getTypeForBindingElementParent(pattern.parent); // If parent has the unknown (error) type, then so does this binding element if (parentType === unknownType) { ...
javascript
function getTypeForBindingElement(declaration) { var pattern = declaration.parent; var parentType = getTypeForBindingElementParent(pattern.parent); // If parent has the unknown (error) type, then so does this binding element if (parentType === unknownType) { ...
[ "function", "getTypeForBindingElement", "(", "declaration", ")", "{", "var", "pattern", "=", "declaration", ".", "parent", ";", "var", "parentType", "=", "getTypeForBindingElementParent", "(", "pattern", ".", "parent", ")", ";", "// If parent has the unknown (error) typ...
Return the inferred type for a binding element
[ "Return", "the", "inferred", "type", "for", "a", "binding", "element" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L19779-L19851
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypeForVariableLikeDeclaration
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { if (declaration.flags & 134217728 /* JavaScriptFile */) { // If this is a variable in a JavaScript file, then use the JSDoc type (if it has // one as its type), otherwise fallback to the below stand...
javascript
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { if (declaration.flags & 134217728 /* JavaScriptFile */) { // If this is a variable in a JavaScript file, then use the JSDoc type (if it has // one as its type), otherwise fallback to the below stand...
[ "function", "getTypeForVariableLikeDeclaration", "(", "declaration", ",", "includeOptionality", ")", "{", "if", "(", "declaration", ".", "flags", "&", "134217728", "/* JavaScriptFile */", ")", "{", "// If this is a variable in a JavaScript file, then use the JSDoc type (if it has...
Return the inferred type for a variable, parameter, or property declaration
[ "Return", "the", "inferred", "type", "for", "a", "variable", "parameter", "or", "property", "declaration" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L19887-L19958
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypeFromBindingElement
function getTypeFromBindingElement(element, includePatternInType, reportErrors) { if (element.initializer) { return checkExpressionCached(element.initializer); } if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, in...
javascript
function getTypeFromBindingElement(element, includePatternInType, reportErrors) { if (element.initializer) { return checkExpressionCached(element.initializer); } if (ts.isBindingPattern(element.name)) { return getTypeFromBindingPattern(element.name, in...
[ "function", "getTypeFromBindingElement", "(", "element", ",", "includePatternInType", ",", "reportErrors", ")", "{", "if", "(", "element", ".", "initializer", ")", "{", "return", "checkExpressionCached", "(", "element", ".", "initializer", ")", ";", "}", "if", "...
Return the type implied by a binding pattern element. This is the type of the initializer of the element if one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding pattern. Otherwise, it is the type any.
[ "Return", "the", "type", "implied", "by", "a", "binding", "pattern", "element", ".", "This", "is", "the", "type", "of", "the", "initializer", "of", "the", "element", "if", "one", "is", "present", ".", "Otherwise", "if", "the", "element", "is", "itself", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L19962-L19973
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypeFromObjectBindingPattern
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; if (isComputedNonL...
javascript
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) { var members = ts.createMap(); var hasComputedProperties = false; ts.forEach(pattern.elements, function (e) { var name = e.propertyName || e.name; if (isComputedNonL...
[ "function", "getTypeFromObjectBindingPattern", "(", "pattern", ",", "includePatternInType", ",", "reportErrors", ")", "{", "var", "members", "=", "ts", ".", "createMap", "(", ")", ";", "var", "hasComputedProperties", "=", "false", ";", "ts", ".", "forEach", "(",...
Return the type implied by an object binding pattern
[ "Return", "the", "type", "implied", "by", "an", "object", "binding", "pattern" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L19975-L20000
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypeFromArrayBindingPattern
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType;...
javascript
function getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors) { var elements = pattern.elements; if (elements.length === 0 || elements[elements.length - 1].dotDotDotToken) { return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType;...
[ "function", "getTypeFromArrayBindingPattern", "(", "pattern", ",", "includePatternInType", ",", "reportErrors", ")", "{", "var", "elements", "=", "pattern", ".", "elements", ";", "if", "(", "elements", ".", "length", "===", "0", "||", "elements", "[", "elements"...
Return the type implied by an array binding pattern
[ "Return", "the", "type", "implied", "by", "an", "array", "binding", "pattern" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20002-L20015
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
appendTypeParameters
function appendTypeParameters(typeParameters, declarations) { for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!...
javascript
function appendTypeParameters(typeParameters, declarations) { for (var _i = 0, declarations_2 = declarations; _i < declarations_2.length; _i++) { var declaration = declarations_2[_i]; var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); if (!...
[ "function", "appendTypeParameters", "(", "typeParameters", ",", "declarations", ")", "{", "for", "(", "var", "_i", "=", "0", ",", "declarations_2", "=", "declarations", ";", "_i", "<", "declarations_2", ".", "length", ";", "_i", "++", ")", "{", "var", "dec...
Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set. The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set in-place and returns the same array.
[ "Appends", "the", "type", "parameters", "given", "by", "a", "list", "of", "declarations", "to", "a", "set", "of", "type", "parameters", "and", "returns", "the", "resulting", "set", ".", "The", "function", "allocates", "a", "new", "array", "if", "the", "inp...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20282-L20294
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
appendOuterTypeParameters
function appendOuterTypeParameters(typeParameters, node) { while (true) { node = node.parent; if (!node) { return typeParameters; } if (node.kind === 221 /* ClassDeclaration */ || node.kind === 192 /* ClassExpression */ || ...
javascript
function appendOuterTypeParameters(typeParameters, node) { while (true) { node = node.parent; if (!node) { return typeParameters; } if (node.kind === 221 /* ClassDeclaration */ || node.kind === 192 /* ClassExpression */ || ...
[ "function", "appendOuterTypeParameters", "(", "typeParameters", ",", "node", ")", "{", "while", "(", "true", ")", "{", "node", "=", "node", ".", "parent", ";", "if", "(", "!", "node", ")", "{", "return", "typeParameters", ";", "}", "if", "(", "node", "...
Appends the outer type parameters of a node to a set of type parameters and returns the resulting set. The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set in-place and returns the same array.
[ "Appends", "the", "outer", "type", "parameters", "of", "a", "node", "to", "a", "set", "of", "type", "parameters", "and", "returns", "the", "resulting", "set", ".", "The", "function", "allocates", "a", "new", "array", "if", "the", "input", "type", "paramete...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20298-L20313
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getOuterTypeParametersOfClassOrInterface
function getOuterTypeParametersOfClassOrInterface(symbol) { var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 222 /* InterfaceDeclaration */); return appendOuterTypeParameters(undefined, declaration); }
javascript
function getOuterTypeParametersOfClassOrInterface(symbol) { var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 222 /* InterfaceDeclaration */); return appendOuterTypeParameters(undefined, declaration); }
[ "function", "getOuterTypeParametersOfClassOrInterface", "(", "symbol", ")", "{", "var", "declaration", "=", "symbol", ".", "flags", "&", "32", "/* Class */", "?", "symbol", ".", "valueDeclaration", ":", "ts", ".", "getDeclarationOfKind", "(", "symbol", ",", "222",...
The outer type parameters are those defined by enclosing generic classes, methods, or functions.
[ "The", "outer", "type", "parameters", "are", "those", "defined", "by", "enclosing", "generic", "classes", "methods", "or", "functions", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20315-L20318
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isIndependentInterface
function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (declaration.kind === 222 /* InterfaceDeclaration */) { if (declaration.flags & 16384 /* ContainsThis */) { ...
javascript
function isIndependentInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (declaration.kind === 222 /* InterfaceDeclaration */) { if (declaration.flags & 16384 /* ContainsThis */) { ...
[ "function", "isIndependentInterface", "(", "symbol", ")", "{", "for", "(", "var", "_i", "=", "0", ",", "_a", "=", "symbol", ".", "declarations", ";", "_i", "<", "_a", ".", "length", ";", "_i", "++", ")", "{", "var", "declaration", "=", "_a", "[", "...
Returns true if the interface given by the symbol is free of "this" references. Specifically, the result is true if the interface itself contains no references to "this" in its body, if all base types are interfaces, and if none of the base interfaces have a "this" type.
[ "Returns", "true", "if", "the", "interface", "given", "by", "the", "symbol", "is", "free", "of", "this", "references", ".", "Specifically", "the", "result", "is", "true", "if", "the", "interface", "itself", "contains", "no", "references", "to", "this", "in",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20498-L20520
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isIndependentType
function isIndependentType(node) { switch (node.kind) { case 117 /* AnyKeyword */: case 132 /* StringKeyword */: case 130 /* NumberKeyword */: case 120 /* BooleanKeyword */: case 133 /* SymbolKeyword */: case 103...
javascript
function isIndependentType(node) { switch (node.kind) { case 117 /* AnyKeyword */: case 132 /* StringKeyword */: case 130 /* NumberKeyword */: case 120 /* BooleanKeyword */: case 133 /* SymbolKeyword */: case 103...
[ "function", "isIndependentType", "(", "node", ")", "{", "switch", "(", "node", ".", "kind", ")", "{", "case", "117", "/* AnyKeyword */", ":", "case", "132", "/* StringKeyword */", ":", "case", "130", "/* NumberKeyword */", ":", "case", "120", "/* BooleanKeyword ...
A type is considered independent if it the any, string, number, boolean, symbol, or void keyword, a string literal type, an array with an element type that is considered independent, or a type reference that is considered independent.
[ "A", "type", "is", "considered", "independent", "if", "it", "the", "any", "string", "number", "boolean", "symbol", "or", "void", "keyword", "a", "string", "literal", "type", "an", "array", "with", "an", "element", "type", "that", "is", "considered", "indepen...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20715-L20734
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isIndependentMember
function isIndependentMember(symbol) { if (symbol.declarations && symbol.declarations.length === 1) { var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { case 145 /* PropertyDeclaration */: ...
javascript
function isIndependentMember(symbol) { if (symbol.declarations && symbol.declarations.length === 1) { var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { case 145 /* PropertyDeclaration */: ...
[ "function", "isIndependentMember", "(", "symbol", ")", "{", "if", "(", "symbol", ".", "declarations", "&&", "symbol", ".", "declarations", ".", "length", "===", "1", ")", "{", "var", "declaration", "=", "symbol", ".", "declarations", "[", "0", "]", ";", ...
Returns true if the class or interface member given by the symbol is free of "this" references. The function may return false for symbols that are actually free of "this" references because it is not feasible to perform a complete analysis in all cases. In particular, property members with types inferred from their ini...
[ "Returns", "true", "if", "the", "class", "or", "interface", "member", "given", "by", "the", "symbol", "is", "free", "of", "this", "references", ".", "The", "function", "may", "return", "false", "for", "symbols", "that", "are", "actually", "free", "of", "th...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20759-L20775
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
createInstantiatedSymbolTable
function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) { var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; result[symbol.name] = mappingThisOnly && isIndependentMember(sy...
javascript
function createInstantiatedSymbolTable(symbols, mapper, mappingThisOnly) { var result = ts.createMap(); for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { var symbol = symbols_2[_i]; result[symbol.name] = mappingThisOnly && isIndependentMember(sy...
[ "function", "createInstantiatedSymbolTable", "(", "symbols", ",", "mapper", ",", "mappingThisOnly", ")", "{", "var", "result", "=", "ts", ".", "createMap", "(", ")", ";", "for", "(", "var", "_i", "=", "0", ",", "symbols_2", "=", "symbols", ";", "_i", "<"...
The mappingThisOnly flag indicates that the only type parameter being mapped is "this". When the flag is true, we check symbols to see if we can quickly conclude they are free of "this" references, thus needing no instantiation.
[ "The", "mappingThisOnly", "flag", "indicates", "that", "the", "only", "type", "parameter", "being", "mapped", "is", "this", ".", "When", "the", "flag", "is", "true", "we", "check", "symbols", "to", "see", "if", "we", "can", "quickly", "conclude", "they", "...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20786-L20793
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getUnionSignatures
function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var result = undefined; for (var i = 0; i < signatureLists.length; i++) { for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i+...
javascript
function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); var result = undefined; for (var i = 0; i < signatureLists.length; i++) { for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i+...
[ "function", "getUnionSignatures", "(", "types", ",", "kind", ")", "{", "var", "signatureLists", "=", "ts", ".", "map", "(", "types", ",", "function", "(", "t", ")", "{", "return", "getSignaturesOfType", "(", "t", ",", "kind", ")", ";", "}", ")", ";", ...
The signatures of a union type are those signatures that are present in each of the constituent types. Generic signatures must match exactly, but non-generic signatures are allowed to have extra optional parameters and may differ in return types. When signatures differ in return types, the resulting return type is the ...
[ "The", "signatures", "of", "a", "union", "type", "are", "those", "signatures", "that", "are", "present", "in", "each", "of", "the", "constituent", "types", ".", "Generic", "signatures", "must", "match", "exactly", "but", "non", "-", "generic", "signatures", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L20947-L20975
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getApparentTypeOfTypeParameter
function getApparentTypeOfTypeParameter(type) { if (!type.resolvedApparentType) { var constraintType = getConstraintOfTypeParameter(type); while (constraintType && constraintType.flags & 16384 /* TypeParameter */) { constraintType = getConstraintOfTypePara...
javascript
function getApparentTypeOfTypeParameter(type) { if (!type.resolvedApparentType) { var constraintType = getConstraintOfTypeParameter(type); while (constraintType && constraintType.flags & 16384 /* TypeParameter */) { constraintType = getConstraintOfTypePara...
[ "function", "getApparentTypeOfTypeParameter", "(", "type", ")", "{", "if", "(", "!", "type", ".", "resolvedApparentType", ")", "{", "var", "constraintType", "=", "getConstraintOfTypeParameter", "(", "type", ")", ";", "while", "(", "constraintType", "&&", "constrai...
The apparent type of a type parameter is the base constraint instantiated with the type parameter as the type argument for the 'this' type.
[ "The", "apparent", "type", "of", "a", "type", "parameter", "is", "the", "base", "constraint", "instantiated", "with", "the", "type", "parameter", "as", "the", "type", "argument", "for", "the", "this", "type", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L21130-L21139
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getApparentType
function getApparentType(type) { if (type.flags & 16384 /* TypeParameter */) { type = getApparentTypeOfTypeParameter(type); } if (type.flags & 34 /* StringLike */) { type = globalStringType; } else if (type.flags & 340 /* Number...
javascript
function getApparentType(type) { if (type.flags & 16384 /* TypeParameter */) { type = getApparentTypeOfTypeParameter(type); } if (type.flags & 34 /* StringLike */) { type = globalStringType; } else if (type.flags & 340 /* Number...
[ "function", "getApparentType", "(", "type", ")", "{", "if", "(", "type", ".", "flags", "&", "16384", "/* TypeParameter */", ")", "{", "type", "=", "getApparentTypeOfTypeParameter", "(", "type", ")", ";", "}", "if", "(", "type", ".", "flags", "&", "34", "...
For a type parameter, return the base constraint of the type parameter. For the string, number, boolean, and symbol primitive types, return the corresponding object types. Otherwise return the type itself. Note that the apparent type of a union type is the union type itself.
[ "For", "a", "type", "parameter", "return", "the", "base", "constraint", "of", "the", "type", "parameter", ".", "For", "the", "string", "number", "boolean", "and", "symbol", "primitive", "types", "return", "the", "corresponding", "object", "types", ".", "Otherw...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L21145-L21162
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getPropagatingFlagsOfTypes
function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { var type = types_3[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } ...
javascript
function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; for (var _i = 0, types_3 = types; _i < types_3.length; _i++) { var type = types_3[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } ...
[ "function", "getPropagatingFlagsOfTypes", "(", "types", ",", "excludeKinds", ")", "{", "var", "result", "=", "0", ";", "for", "(", "var", "_i", "=", "0", ",", "types_3", "=", "types", ";", "_i", "<", "types_3", ".", "length", ";", "_i", "++", ")", "{...
This function is used to propagate certain flags when creating new object type references and union types. It is only necessary to do so if a constituent type might be the undefined type, the null type, the type of an object literal or the anyFunctionType. This is because there are operations in the type checker that c...
[ "This", "function", "is", "used", "to", "propagate", "certain", "flags", "when", "creating", "new", "object", "type", "references", "and", "union", "types", ".", "It", "is", "only", "necessary", "to", "do", "so", "if", "a", "constituent", "type", "might", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L21701-L21710
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getUnionTypeFromSortedList
function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { return neverType; } if (types.length === 1) { return types[0]; } var id = getTypeListId(types); var type = union...
javascript
function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { return neverType; } if (types.length === 1) { return types[0]; } var id = getTypeListId(types); var type = union...
[ "function", "getUnionTypeFromSortedList", "(", "types", ",", "aliasSymbol", ",", "aliasTypeArguments", ")", "{", "if", "(", "types", ".", "length", "===", "0", ")", "{", "return", "neverType", ";", "}", "if", "(", "types", ".", "length", "===", "1", ")", ...
This function assumes the constituent type list is sorted and deduplicated.
[ "This", "function", "assumes", "the", "constituent", "type", "list", "is", "sorted", "and", "deduplicated", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L22118-L22135
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isKnownProperty
function isKnownProperty(type, name) { if (type.flags & 2588672 /* ObjectType */) { var resolved = resolveStructuredTypeMembers(type); if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resol...
javascript
function isKnownProperty(type, name) { if (type.flags & 2588672 /* ObjectType */) { var resolved = resolveStructuredTypeMembers(type); if ((relation === assignableRelation || relation === comparableRelation) && (type === globalObjectType || isEmptyObjectType(resol...
[ "function", "isKnownProperty", "(", "type", ",", "name", ")", "{", "if", "(", "type", ".", "flags", "&", "2588672", "/* ObjectType */", ")", "{", "var", "resolved", "=", "resolveStructuredTypeMembers", "(", "type", ")", ";", "if", "(", "(", "relation", "==...
Check if a property with the given name is known anywhere in the given type. In an object type, a property is considered known if the object type is empty and the check is for assignability, if the object type has index signatures, or if the property is actually declared in the object type. In a union or intersection t...
[ "Check", "if", "a", "property", "with", "the", "given", "name", "is", "known", "anywhere", "in", "the", "given", "type", ".", "In", "an", "object", "type", "a", "property", "is", "considered", "known", "if", "the", "object", "type", "is", "empty", "and",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L23089-L23108
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
objectTypeRelatedTo
function objectTypeRelatedTo(source, originalSource, target, reportErrors) { if (overflow) { return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; ...
javascript
function objectTypeRelatedTo(source, originalSource, target, reportErrors) { if (overflow) { return 0 /* False */; } var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; ...
[ "function", "objectTypeRelatedTo", "(", "source", ",", "originalSource", ",", "target", ",", "reportErrors", ")", "{", "if", "(", "overflow", ")", "{", "return", "0", "/* False */", ";", "}", "var", "id", "=", "relation", "!==", "identityRelation", "||", "so...
Determine if two object types are related by structure. First, check if the result is already available in the global cache. Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. Third, check if both types are part of deeply nested chains of generic ...
[ "Determine", "if", "two", "object", "types", "are", "related", "by", "structure", ".", "First", "check", "if", "the", "result", "is", "already", "available", "in", "the", "global", "cache", ".", "Second", "check", "if", "we", "have", "already", "started", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L23224-L23301
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
signatureRelatedTo
function signatureRelatedTo(source, target, reportErrors) { return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); }
javascript
function signatureRelatedTo(source, target, reportErrors) { return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); }
[ "function", "signatureRelatedTo", "(", "source", ",", "target", ",", "reportErrors", ")", "{", "return", "compareSignaturesRelated", "(", "source", ",", "target", ",", "/*ignoreReturnTypes*/", "false", ",", "reportErrors", ",", "reportError", ",", "isRelatedTo", ")"...
See signatureAssignableTo, compareSignaturesIdentical
[ "See", "signatureAssignableTo", "compareSignaturesIdentical" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L23454-L23456
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isAbstractConstructorType
function isAbstractConstructorType(type) { if (type.flags & 2097152 /* Anonymous */) { var symbol = type.symbol; if (symbol && symbol.flags & 32 /* Class */) { var declaration = getClassLikeDeclarationOfSymbol(symbol); if (declaration &...
javascript
function isAbstractConstructorType(type) { if (type.flags & 2097152 /* Anonymous */) { var symbol = type.symbol; if (symbol && symbol.flags & 32 /* Class */) { var declaration = getClassLikeDeclarationOfSymbol(symbol); if (declaration &...
[ "function", "isAbstractConstructorType", "(", "type", ")", "{", "if", "(", "type", ".", "flags", "&", "2097152", "/* Anonymous */", ")", "{", "var", "symbol", "=", "type", ".", "symbol", ";", "if", "(", "symbol", "&&", "symbol", ".", "flags", "&", "32", ...
Return true if the given type is the constructor type for an abstract class
[ "Return", "true", "if", "the", "given", "type", "is", "the", "constructor", "type", "for", "an", "abstract", "class" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L23565-L23576
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isObjectLiteralType
function isObjectLiteralType(type) { return type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */)) !== 0 && getSignaturesOfType(type, 0 /* Call */).length === 0 && getSignaturesOfType(type, 1 /* Construct */).length === 0; }
javascript
function isObjectLiteralType(type) { return type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */)) !== 0 && getSignaturesOfType(type, 0 /* Call */).length === 0 && getSignaturesOfType(type, 1 /* Construct */).length === 0; }
[ "function", "isObjectLiteralType", "(", "type", ")", "{", "return", "type", ".", "symbol", "&&", "(", "type", ".", "symbol", ".", "flags", "&", "(", "4096", "/* ObjectLiteral */", "|", "2048", "/* TypeLiteral */", ")", ")", "!==", "0", "&&", "getSignaturesOf...
Return true if type was inferred from an object literal or written as an object type literal with no call or construct signatures.
[ "Return", "true", "if", "type", "was", "inferred", "from", "an", "object", "literal", "or", "written", "as", "an", "object", "type", "literal", "with", "no", "call", "or", "construct", "signatures", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L23838-L23842
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getRegularTypeOfObjectLiteral
function getRegularTypeOfObjectLiteral(type) { if (!(type.flags & 16777216 /* FreshObjectLiteral */)) { return type; } var regularType = type.regularType; if (regularType) { return regularType; } var resolved = type;...
javascript
function getRegularTypeOfObjectLiteral(type) { if (!(type.flags & 16777216 /* FreshObjectLiteral */)) { return type; } var regularType = type.regularType; if (regularType) { return regularType; } var resolved = type;...
[ "function", "getRegularTypeOfObjectLiteral", "(", "type", ")", "{", "if", "(", "!", "(", "type", ".", "flags", "&", "16777216", "/* FreshObjectLiteral */", ")", ")", "{", "return", "type", ";", "}", "var", "regularType", "=", "type", ".", "regularType", ";",...
If the the provided object literal is subject to the excess properties check, create a new that is exempt. Recursively mark object literal members as exempt. Leave signatures alone since they are not subject to the check.
[ "If", "the", "the", "provided", "object", "literal", "is", "subject", "to", "the", "excess", "properties", "check", "create", "a", "new", "that", "is", "exempt", ".", "Recursively", "mark", "object", "literal", "members", "as", "exempt", ".", "Leave", "signa...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L23870-L23884
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
removeTypesFromUnionOrIntersection
function removeTypesFromUnionOrIntersection(type, typesToRemove) { var reducedTypes = []; for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; if (!typeIdenticalToSomeType(t, typesToRemove)) { reducedTypes.push(t); ...
javascript
function removeTypesFromUnionOrIntersection(type, typesToRemove) { var reducedTypes = []; for (var _i = 0, _a = type.types; _i < _a.length; _i++) { var t = _a[_i]; if (!typeIdenticalToSomeType(t, typesToRemove)) { reducedTypes.push(t); ...
[ "function", "removeTypesFromUnionOrIntersection", "(", "type", ",", "typesToRemove", ")", "{", "var", "reducedTypes", "=", "[", "]", ";", "for", "(", "var", "_i", "=", "0", ",", "_a", "=", "type", ".", "types", ";", "_i", "<", "_a", ".", "length", ";",...
Return a new union or intersection type computed by removing a given set of types from a given union or intersection type.
[ "Return", "a", "new", "union", "or", "intersection", "type", "computed", "by", "removing", "a", "given", "set", "of", "types", "from", "a", "given", "union", "or", "intersection", "type", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L24264-L24273
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getResolvedSymbol
function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol...
javascript
function getResolvedSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node) || unknownSymbol...
[ "function", "getResolvedSymbol", "(", "node", ")", "{", "var", "links", "=", "getNodeLinks", "(", "node", ")", ";", "if", "(", "!", "links", ".", "resolvedSymbol", ")", "{", "links", ".", "resolvedSymbol", "=", "!", "ts", ".", "nodeIsMissing", "(", "node...
EXPRESSION TYPE CHECKING
[ "EXPRESSION", "TYPE", "CHECKING" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L24324-L24330
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
containsMatchingReferenceDiscriminant
function containsMatchingReferenceDiscriminant(source, target) { return target.kind === 172 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); ...
javascript
function containsMatchingReferenceDiscriminant(source, target) { return target.kind === 172 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.text); ...
[ "function", "containsMatchingReferenceDiscriminant", "(", "source", ",", "target", ")", "{", "return", "target", ".", "kind", "===", "172", "/* PropertyAccessExpression */", "&&", "containsMatchingReference", "(", "source", ",", "target", ".", "expression", ")", "&&",...
Return true if target is a property access xxx.yyy, source is a property access xxx.zzz, the declared type of xxx is a union type, and yyy is a property that is possibly a discriminant. We consider a property a possible discriminant if its type differs in the constituents of containing union type, and if every choice i...
[ "Return", "true", "if", "target", "is", "a", "property", "access", "xxx", ".", "yyy", "source", "is", "a", "property", "access", "xxx", ".", "zzz", "the", "declared", "type", "of", "xxx", "is", "a", "union", "type", "and", "yyy", "is", "a", "property",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L24405-L24409
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getAssignmentReducedType
function getAssignmentReducedType(declaredType, assignedType) { if (declaredType !== assignedType) { var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); }); if (reducedType !== neverType) { return reduce...
javascript
function getAssignmentReducedType(declaredType, assignedType) { if (declaredType !== assignedType) { var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); }); if (reducedType !== neverType) { return reduce...
[ "function", "getAssignmentReducedType", "(", "declaredType", ",", "assignedType", ")", "{", "if", "(", "declaredType", "!==", "assignedType", ")", "{", "var", "reducedType", "=", "filterType", "(", "declaredType", ",", "function", "(", "t", ")", "{", "return", ...
Remove those constituent types of declaredType to which no constituent type of assignedType is assignable. For example, when a variable of type number | string | boolean is assigned a value of type number | boolean, we remove type string.
[ "Remove", "those", "constituent", "types", "of", "declaredType", "to", "which", "no", "constituent", "type", "of", "assignedType", "is", "assignable", ".", "For", "example", "when", "a", "variable", "of", "type", "number", "|", "string", "|", "boolean", "is", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L24483-L24491
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
narrowType
function narrowType(type, expr, assumeTrue) { switch (expr.kind) { case 69 /* Identifier */: case 97 /* ThisKeyword */: case 172 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); ...
javascript
function narrowType(type, expr, assumeTrue) { switch (expr.kind) { case 69 /* Identifier */: case 97 /* ThisKeyword */: case 172 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); ...
[ "function", "narrowType", "(", "type", ",", "expr", ",", "assumeTrue", ")", "{", "switch", "(", "expr", ".", "kind", ")", "{", "case", "69", "/* Identifier */", ":", "case", "97", "/* ThisKeyword */", ":", "case", "172", "/* PropertyAccessExpression */", ":", ...
Narrow the given type based on the given expression having the assumed boolean value. The returned type will be a subtype or the same type as the argument.
[ "Narrow", "the", "given", "type", "based", "on", "the", "given", "expression", "having", "the", "assumed", "boolean", "value", ".", "The", "returned", "type", "will", "be", "a", "subtype", "or", "the", "same", "type", "as", "the", "argument", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25194-L25213
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isParameterAssigned
function isParameterAssigned(symbol) { var func = ts.getRootDeclaration(symbol.valueDeclaration).parent; var links = getNodeLinks(func); if (!(links.flags & 4194304 /* AssignmentsMarked */)) { links.flags |= 4194304 /* AssignmentsMarked */; if (!hasPar...
javascript
function isParameterAssigned(symbol) { var func = ts.getRootDeclaration(symbol.valueDeclaration).parent; var links = getNodeLinks(func); if (!(links.flags & 4194304 /* AssignmentsMarked */)) { links.flags |= 4194304 /* AssignmentsMarked */; if (!hasPar...
[ "function", "isParameterAssigned", "(", "symbol", ")", "{", "var", "func", "=", "ts", ".", "getRootDeclaration", "(", "symbol", ".", "valueDeclaration", ")", ".", "parent", ";", "var", "links", "=", "getNodeLinks", "(", "func", ")", ";", "if", "(", "!", ...
Check if a parameter is assigned anywhere within its declaring function.
[ "Check", "if", "a", "parameter", "is", "assigned", "anywhere", "within", "its", "declaring", "function", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25256-L25266
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getSuperCallInConstructor
function getSuperCallInConstructor(constructor) { var links = getNodeLinks(constructor); // Only trying to find super-call if we haven't yet tried to find one. Once we try, we will record the result if (links.hasSuperCall === undefined) { links.superCall = findFirstS...
javascript
function getSuperCallInConstructor(constructor) { var links = getNodeLinks(constructor); // Only trying to find super-call if we haven't yet tried to find one. Once we try, we will record the result if (links.hasSuperCall === undefined) { links.superCall = findFirstS...
[ "function", "getSuperCallInConstructor", "(", "constructor", ")", "{", "var", "links", "=", "getNodeLinks", "(", "constructor", ")", ";", "// Only trying to find super-call if we haven't yet tried to find one. Once we try, we will record the result", "if", "(", "links", ".", "...
Return a cached result if super-statement is already found. Otherwise, find a super statement in a given constructor function and cache the result in the node-links of the constructor @param constructor constructor-function to look for super statement
[ "Return", "a", "cached", "result", "if", "super", "-", "statement", "is", "already", "found", ".", "Otherwise", "find", "a", "super", "statement", "in", "a", "given", "constructor", "function", "and", "cache", "the", "result", "in", "the", "node", "-", "li...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25477-L25485
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
classDeclarationExtendsNull
function classDeclarationExtendsNull(classDecl) { var classSymbol = getSymbolOfNode(classDecl); var classInstanceType = getDeclaredTypeOfSymbol(classSymbol); var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWid...
javascript
function classDeclarationExtendsNull(classDecl) { var classSymbol = getSymbolOfNode(classDecl); var classInstanceType = getDeclaredTypeOfSymbol(classSymbol); var baseConstructorType = getBaseConstructorTypeOfClass(classInstanceType); return baseConstructorType === nullWid...
[ "function", "classDeclarationExtendsNull", "(", "classDecl", ")", "{", "var", "classSymbol", "=", "getSymbolOfNode", "(", "classDecl", ")", ";", "var", "classInstanceType", "=", "getDeclaredTypeOfSymbol", "(", "classSymbol", ")", ";", "var", "baseConstructorType", "="...
Check if the given class-declaration extends null then return true. Otherwise, return false @param classDecl a class declaration to check if it extends null
[ "Check", "if", "the", "given", "class", "-", "declaration", "extends", "null", "then", "return", "true", ".", "Otherwise", "return", "false" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25491-L25496
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getContextuallyTypedParameterType
function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife) { var indexOfParameter = ts...
javascript
function getContextuallyTypedParameterType(parameter) { var func = parameter.parent; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife) { var indexOfParameter = ts...
[ "function", "getContextuallyTypedParameterType", "(", "parameter", ")", "{", "var", "func", "=", "parameter", ".", "parent", ";", "if", "(", "isContextSensitiveFunctionOrObjectLiteralMethod", "(", "func", ")", ")", "{", "var", "iife", "=", "ts", ".", "getImmediate...
Return contextual type of parameter or undefined if no contextual type is available
[ "Return", "contextual", "type", "of", "parameter", "or", "undefined", "if", "no", "contextual", "type", "is", "available" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25800-L25839
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getContextualTypeForInitializerExpression
function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { return getTypeFromTypeNode(declaration.type); } if (declaration.kind === 1...
javascript
function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; if (node === declaration.initializer) { if (declaration.type) { return getTypeFromTypeNode(declaration.type); } if (declaration.kind === 1...
[ "function", "getContextualTypeForInitializerExpression", "(", "node", ")", "{", "var", "declaration", "=", "node", ".", "parent", ";", "if", "(", "node", "===", "declaration", ".", "initializer", ")", "{", "if", "(", "declaration", ".", "type", ")", "{", "re...
In a variable, parameter or property declaration with a type annotation, the contextual type of an initializer expression is the type of the variable, parameter or property. Otherwise, in a parameter declaration of a contextually typed function expression, the contextual type of an initializer expression is the context...
[ "In", "a", "variable", "parameter", "or", "property", "declaration", "with", "a", "type", "annotation", "the", "contextual", "type", "of", "an", "initializer", "expression", "is", "the", "type", "of", "the", "variable", "parameter", "or", "property", ".", "Oth...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25848-L25877
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getContextualTypeForArgument
function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); var argIndex = ts.indexOf(args, arg); if (argIndex >= 0) { var signature = getResolvedOrAnySignature(callTarget); return getTypeAtPosition(signat...
javascript
function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); var argIndex = ts.indexOf(args, arg); if (argIndex >= 0) { var signature = getResolvedOrAnySignature(callTarget); return getTypeAtPosition(signat...
[ "function", "getContextualTypeForArgument", "(", "callTarget", ",", "arg", ")", "{", "var", "args", "=", "getEffectiveCallArguments", "(", "callTarget", ")", ";", "var", "argIndex", "=", "ts", ".", "indexOf", "(", "args", ",", "arg", ")", ";", "if", "(", "...
In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter.
[ "In", "a", "typed", "function", "call", "an", "argument", "or", "substitution", "expression", "is", "contextually", "typed", "by", "the", "type", "of", "the", "corresponding", "parameter", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L25930-L25938
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
contextualTypeIsTupleLikeType
function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 524288 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); }
javascript
function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 524288 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); }
[ "function", "contextualTypeIsTupleLikeType", "(", "type", ")", "{", "return", "!", "!", "(", "type", ".", "flags", "&", "524288", "/* Union */", "?", "ts", ".", "forEach", "(", "type", ".", "types", ",", "isTupleLikeType", ")", ":", "isTupleLikeType", "(", ...
Return true if the given contextual type is a tuple-like type
[ "Return", "true", "if", "the", "given", "contextual", "type", "is", "a", "tuple", "-", "like", "type" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L26011-L26013
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getContextualSignature
function getContextualSignature(node) { ts.Debug.assert(node.kind !== 147 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; } if (!(type.flag...
javascript
function getContextualSignature(node) { ts.Debug.assert(node.kind !== 147 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; } if (!(type.flag...
[ "function", "getContextualSignature", "(", "node", ")", "{", "ts", ".", "Debug", ".", "assert", "(", "node", ".", "kind", "!==", "147", "/* MethodDeclaration */", "||", "ts", ".", "isObjectLiteralMethod", "(", "node", ")", ")", ";", "var", "type", "=", "ge...
Return the contextual signature for a given expression node. A contextual type provides a contextual signature if it has a single call signature and if that call signature is non-generic. If the contextual type is a union type, get the signature from each type possible and if they are all identical ignoring their retur...
[ "Return", "the", "contextual", "signature", "for", "a", "given", "expression", "node", ".", "A", "contextual", "type", "provides", "a", "contextual", "signature", "if", "it", "has", "a", "single", "call", "signature", "and", "if", "that", "call", "signature", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L26204-L26242
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isJsxIntrinsicIdentifier
function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment if (tagName.kind === 172 /* PropertyAccessExpression */ || tagName.kind === 97 /* ThisKeyword */) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); ...
javascript
function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment if (tagName.kind === 172 /* PropertyAccessExpression */ || tagName.kind === 97 /* ThisKeyword */) { return false; } else { return ts.isIntrinsicJsxName(tagName.text); ...
[ "function", "isJsxIntrinsicIdentifier", "(", "tagName", ")", "{", "// TODO (yuisu): comment", "if", "(", "tagName", ".", "kind", "===", "172", "/* PropertyAccessExpression */", "||", "tagName", ".", "kind", "===", "97", "/* ThisKeyword */", ")", "{", "return", "fals...
Returns true iff React would emit this tag name as a string rather than an identifier or qualified name
[ "Returns", "true", "iff", "React", "would", "emit", "this", "tag", "name", "as", "a", "string", "rather", "than", "an", "identifier", "or", "qualified", "name" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L26556-L26564
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkClassPropertyAccess
function checkClassPropertyAccess(node, left, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); var errorNode = node.kind === 172 /* PropertyAccessExpression */ || node.kind === 218 /* VariableDeclara...
javascript
function checkClassPropertyAccess(node, left, type, prop) { var flags = getDeclarationFlagsFromSymbol(prop); var declaringClass = getDeclaredTypeOfSymbol(getParentOfSymbol(prop)); var errorNode = node.kind === 172 /* PropertyAccessExpression */ || node.kind === 218 /* VariableDeclara...
[ "function", "checkClassPropertyAccess", "(", "node", ",", "left", ",", "type", ",", "prop", ")", "{", "var", "flags", "=", "getDeclarationFlagsFromSymbol", "(", "prop", ")", ";", "var", "declaringClass", "=", "getDeclaredTypeOfSymbol", "(", "getParentOfSymbol", "(...
Check whether the requested property access is valid. Returns true if node is a valid property access, and false otherwise. @param node The node to be checked. @param left The left hand side of the property access (e.g.: the super in `super.foo`). @param type The type of left. @param prop The symbol for the right hand ...
[ "Check", "whether", "the", "requested", "property", "access", "is", "valid", ".", "Returns", "true", "if", "node", "is", "a", "valid", "property", "access", "and", "false", "otherwise", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L26952-L27025
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getForInVariableSymbol
function getForInVariableSymbol(node) { var initializer = node.initializer; if (initializer.kind === 219 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return ...
javascript
function getForInVariableSymbol(node) { var initializer = node.initializer; if (initializer.kind === 219 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return ...
[ "function", "getForInVariableSymbol", "(", "node", ")", "{", "var", "initializer", "=", "node", ".", "initializer", ";", "if", "(", "initializer", ".", "kind", "===", "219", "/* VariableDeclarationList */", ")", "{", "var", "variable", "=", "initializer", ".", ...
Return the symbol of the for-in variable declared or referenced by the given for-in statement.
[ "Return", "the", "symbol", "of", "the", "for", "-", "in", "variable", "declared", "or", "referenced", "by", "the", "given", "for", "-", "in", "statement", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L27107-L27119
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getSingleCallSignature
function getSingleCallSignature(type) { if (type.flags & 2588672 /* ObjectType */) { var resolved = resolveStructuredTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === ...
javascript
function getSingleCallSignature(type) { if (type.flags & 2588672 /* ObjectType */) { var resolved = resolveStructuredTypeMembers(type); if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === ...
[ "function", "getSingleCallSignature", "(", "type", ")", "{", "if", "(", "type", ".", "flags", "&", "2588672", "/* ObjectType */", ")", "{", "var", "resolved", "=", "resolveStructuredTypeMembers", "(", "type", ")", ";", "if", "(", "resolved", ".", "callSignatur...
If type has a single call signature and no other members, return that signature. Otherwise, return undefined.
[ "If", "type", "has", "a", "single", "call", "signature", "and", "no", "other", "members", "return", "that", "signature", ".", "Otherwise", "return", "undefined", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L27440-L27449
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getEffectiveDecoratorFirstArgumentType
function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. if (node.kind === 221 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" sid...
javascript
function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. if (node.kind === 221 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" sid...
[ "function", "getEffectiveDecoratorFirstArgumentType", "(", "node", ")", "{", "// The first argument to a decorator is its `target`.", "if", "(", "node", ".", "kind", "===", "221", "/* ClassDeclaration */", ")", "{", "// For a class decorator, the `target` is the type of the class (...
Returns the effective type of the first argument to a decorator. If 'node' is a class declaration or class expression, the effective argument type is the type of the static side of the class. If 'node' is a parameter declaration, the effective argument type is either the type of the static or instance side of the class...
[ "Returns", "the", "effective", "type", "of", "the", "first", "argument", "to", "a", "decorator", ".", "If", "node", "is", "a", "class", "declaration", "or", "class", "expression", "the", "effective", "argument", "type", "is", "the", "type", "of", "the", "s...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L27689-L27718
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getEffectiveArgumentType
function getEffectiveArgumentType(node, argIndex, arg) { // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors if (node.kind === 143 /* Deco...
javascript
function getEffectiveArgumentType(node, argIndex, arg) { // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors if (node.kind === 143 /* Deco...
[ "function", "getEffectiveArgumentType", "(", "node", ",", "argIndex", ",", "arg", ")", "{", "// Decorators provide special arguments, a tagged template expression provides", "// a special first argument, and string literals get string literal types", "// unless we're reporting errors", "if...
Gets the effective argument type for an argument in a call expression.
[ "Gets", "the", "effective", "argument", "type", "for", "an", "argument", "in", "a", "call", "expression", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L27829-L27842
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getResolvedSignature
function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. // However, it is possible that either candidatesOutArray was not passed in the first time, ...
javascript
function getResolvedSignature(node, candidatesOutArray) { var links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. // However, it is possible that either candidatesOutArray was not passed in the first time, ...
[ "function", "getResolvedSignature", "(", "node", ",", "candidatesOutArray", ")", "{", "var", "links", "=", "getNodeLinks", "(", "node", ")", ";", "// If getResolvedSignature has already been called, we will have cached the resolvedSignature.", "// However, it is possible that eithe...
candidatesOutArray is passed by signature help in the language service, and collectCandidates must fill it up with the appropriate candidate signatures
[ "candidatesOutArray", "is", "passed", "by", "signature", "help", "in", "the", "language", "service", "and", "collectCandidates", "must", "fill", "it", "up", "with", "the", "appropriate", "candidate", "signatures" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L28337-L28354
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkCallExpression
function checkCallExpression(node) { // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); if (nod...
javascript
function checkCallExpression(node) { // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); var signature = getResolvedSignature(node); if (nod...
[ "function", "checkCallExpression", "(", "node", ")", "{", "// Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true", "checkGrammarTypeArguments", "(", "node", ",", "node", ".", "typeArguments", ")", "||", "checkGrammarArguments", "(", "node", ",", ...
Syntactically and semantically checks a call or new expression. @param node The call/new expression to be checked. @returns On success, the expression's signature's return type. On failure, anyType.
[ "Syntactically", "and", "semantically", "checks", "a", "call", "or", "new", "expression", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L28372-L28408
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
maybeTypeOfKind
function maybeTypeOfKind(type, kind) { if (type.flags & kind) { return true; } if (type.flags & 1572864 /* UnionOrIntersection */) { var types = type.types; for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { ...
javascript
function maybeTypeOfKind(type, kind) { if (type.flags & kind) { return true; } if (type.flags & 1572864 /* UnionOrIntersection */) { var types = type.types; for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { ...
[ "function", "maybeTypeOfKind", "(", "type", ",", "kind", ")", "{", "if", "(", "type", ".", "flags", "&", "kind", ")", "{", "return", "true", ";", "}", "if", "(", "type", ".", "flags", "&", "1572864", "/* UnionOrIntersection */", ")", "{", "var", "types...
Return true if type might be of the given kind. A union or intersection type might be of a given kind if at least one constituent type is of the given kind.
[ "Return", "true", "if", "type", "might", "be", "of", "the", "given", "kind", ".", "A", "union", "or", "intersection", "type", "might", "be", "of", "a", "given", "kind", "if", "at", "least", "one", "constituent", "type", "is", "of", "the", "given", "kin...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L28986-L29000
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isTypeOfKind
function isTypeOfKind(type, kind) { if (type.flags & kind) { return true; } if (type.flags & 524288 /* Union */) { var types = type.types; for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { var t = type...
javascript
function isTypeOfKind(type, kind) { if (type.flags & kind) { return true; } if (type.flags & 524288 /* Union */) { var types = type.types; for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { var t = type...
[ "function", "isTypeOfKind", "(", "type", ",", "kind", ")", "{", "if", "(", "type", ".", "flags", "&", "kind", ")", "{", "return", "true", ";", "}", "if", "(", "type", ".", "flags", "&", "524288", "/* Union */", ")", "{", "var", "types", "=", "type"...
Return true if type is of the given kind. A union type is of a given kind if all constituent types are of the given kind. An intersection type is of a given kind if at least one constituent type is of the given kind.
[ "Return", "true", "if", "type", "is", "of", "the", "given", "kind", ".", "A", "union", "type", "is", "of", "a", "given", "kind", "if", "all", "constituent", "types", "are", "of", "the", "given", "kind", ".", "An", "intersection", "type", "is", "of", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L29004-L29028
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkForDisallowedESSymbolOperand
function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left : maybeTypeOfKind(rightType, 512 /* ESSymbol */) ? right : undefined; if (offendingSymbolOperand) { ...
javascript
function checkForDisallowedESSymbolOperand(operator) { var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left : maybeTypeOfKind(rightType, 512 /* ESSymbol */) ? right : undefined; if (offendingSymbolOperand) { ...
[ "function", "checkForDisallowedESSymbolOperand", "(", "operator", ")", "{", "var", "offendingSymbolOperand", "=", "maybeTypeOfKind", "(", "leftType", ",", "512", "/* ESSymbol */", ")", "?", "left", ":", "maybeTypeOfKind", "(", "rightType", ",", "512", "/* ESSymbol */"...
Return true if there was no error, false if there was an error.
[ "Return", "true", "if", "there", "was", "no", "error", "false", "if", "there", "was", "an", "error", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L29350-L29359
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkTypeParameter
function checkTypeParameter(node) { // Grammar Checking if (node.expression) { grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); getConstraintOfTypeParameter(getDeclaredTypeOfTypePar...
javascript
function checkTypeParameter(node) { // Grammar Checking if (node.expression) { grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); } checkSourceElement(node.constraint); getConstraintOfTypeParameter(getDeclaredTypeOfTypePar...
[ "function", "checkTypeParameter", "(", "node", ")", "{", "// Grammar Checking", "if", "(", "node", ".", "expression", ")", "{", "grammarErrorOnFirstToken", "(", "node", ".", "expression", ",", "ts", ".", "Diagnostics", ".", "Type_expected", ")", ";", "}", "che...
DECLARATION AND STATEMENT TYPE CHECKING
[ "DECLARATION", "AND", "STATEMENT", "TYPE", "CHECKING" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L29690-L29700
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getPromisedType
function getPromisedType(promise) { // // { // promise // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType // ) => any // ): any; ...
javascript
function getPromisedType(promise) { // // { // promise // then( // thenFunction // onfulfilled: ( // onfulfilledParameterType // value: T // valueParameterType // ) => any // ): any; ...
[ "function", "getPromisedType", "(", "promise", ")", "{", "//", "// { // promise", "// then( // thenFunction", "// onfulfilled: ( // onfulfilledParameterType", "// value: T // valueParameterType", "// ) => any", "// ): any;", "// }", "//", "if"...
Gets the "promised type" of a promise. @param type The type of the promise. @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback.
[ "Gets", "the", "promised", "type", "of", "a", "promise", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L30538-L30578
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkAsyncFunctionReturnType
function checkAsyncFunctionReturnType(node) { if (languageVersion >= 2 /* ES6 */) { var returnType = getTypeFromTypeNode(node.type); return checkCorrectPromiseType(returnType, node.type); } var globalPromiseConstructorLikeType = getGlobalPromiseConstru...
javascript
function checkAsyncFunctionReturnType(node) { if (languageVersion >= 2 /* ES6 */) { var returnType = getTypeFromTypeNode(node.type); return checkCorrectPromiseType(returnType, node.type); } var globalPromiseConstructorLikeType = getGlobalPromiseConstru...
[ "function", "checkAsyncFunctionReturnType", "(", "node", ")", "{", "if", "(", "languageVersion", ">=", "2", "/* ES6 */", ")", "{", "var", "returnType", "=", "getTypeFromTypeNode", "(", "node", ".", "type", ")", ";", "return", "checkCorrectPromiseType", "(", "ret...
Checks the return type of an async function to ensure it is a compatible Promise implementation. @param node The signature to check @param returnType The return type for the function @remarks This checks that an async function has a valid Promise-compatible return type, and returns the *awaited type* of the promise. An...
[ "Checks", "the", "return", "type", "of", "an", "async", "function", "to", "ensure", "it", "is", "a", "compatible", "Promise", "implementation", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L30713-L30781
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkDecorators
function checkDecorators(node) { if (!node.decorators) { return; } // skip this check for nodes that cannot have decorators. These should have already had an error reported by // checkGrammarDecorators. if (!ts.nodeCanBeDecorated(node)) { ...
javascript
function checkDecorators(node) { if (!node.decorators) { return; } // skip this check for nodes that cannot have decorators. These should have already had an error reported by // checkGrammarDecorators. if (!ts.nodeCanBeDecorated(node)) { ...
[ "function", "checkDecorators", "(", "node", ")", "{", "if", "(", "!", "node", ".", "decorators", ")", "{", "return", ";", "}", "// skip this check for nodes that cannot have decorators. These should have already had an error reported by", "// checkGrammarDecorators.", "if", "...
Check the decorators of a node
[ "Check", "the", "decorators", "of", "a", "node" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L30855-L30889
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkParameterInitializer
function checkParameterInitializer(node) { if (ts.getRootDeclaration(node).kind !== 142 /* Parameter */) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { if (ts.isTypeNode(n) ||...
javascript
function checkParameterInitializer(node) { if (ts.getRootDeclaration(node).kind !== 142 /* Parameter */) { return; } var func = ts.getContainingFunction(node); visit(node.initializer); function visit(n) { if (ts.isTypeNode(n) ||...
[ "function", "checkParameterInitializer", "(", "node", ")", "{", "if", "(", "ts", ".", "getRootDeclaration", "(", "node", ")", ".", "kind", "!==", "142", "/* Parameter */", ")", "{", "return", ";", "}", "var", "func", "=", "ts", ".", "getContainingFunction", ...
Check that a parameter initializer contains no references to parameters declared to the right of itself
[ "Check", "that", "a", "parameter", "initializer", "contains", "no", "references", "to", "parameters", "declared", "to", "the", "right", "of", "itself" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L31277-L31337
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkTypeParameterListsIdentical
function checkTypeParameterListsIdentical(node, symbol) { if (symbol.declarations.length === 1) { return; } var firstDecl; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (decl...
javascript
function checkTypeParameterListsIdentical(node, symbol) { if (symbol.declarations.length === 1) { return; } var firstDecl; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (decl...
[ "function", "checkTypeParameterListsIdentical", "(", "node", ",", "symbol", ")", "{", "if", "(", "symbol", ".", "declarations", ".", "length", "===", "1", ")", "{", "return", ";", "}", "var", "firstDecl", ";", "for", "(", "var", "_i", "=", "0", ",", "_...
Check that type parameter lists are identical across multiple declarations
[ "Check", "that", "type", "parameter", "lists", "are", "identical", "across", "multiple", "declarations" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L32095-L32111
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
checkSourceFileWorker
function checkSourceFileWorker(node) { var links = getNodeLinks(node); if (!(links.flags & 1 /* TypeChecked */)) { // If skipLibCheck is enabled, skip type checking if file is a declaration file. // If skipDefaultLibCheck is enabled, skip type checking if file con...
javascript
function checkSourceFileWorker(node) { var links = getNodeLinks(node); if (!(links.flags & 1 /* TypeChecked */)) { // If skipLibCheck is enabled, skip type checking if file is a declaration file. // If skipDefaultLibCheck is enabled, skip type checking if file con...
[ "function", "checkSourceFileWorker", "(", "node", ")", "{", "var", "links", "=", "getNodeLinks", "(", "node", ")", ";", "if", "(", "!", "(", "links", ".", "flags", "&", "1", "/* TypeChecked */", ")", ")", "{", "// If skipLibCheck is enabled, skip type checking i...
Fully type check a source file and collect the relevant diagnostics.
[ "Fully", "type", "check", "a", "source", "file", "and", "collect", "the", "relevant", "diagnostics", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L33250-L33283
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isInsideWithStatementBody
function isInsideWithStatementBody(node) { if (node) { while (node.parent) { if (node.parent.kind === 212 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; ...
javascript
function isInsideWithStatementBody(node) { if (node) { while (node.parent) { if (node.parent.kind === 212 /* WithStatement */ && node.parent.statement === node) { return true; } node = node.parent; ...
[ "function", "isInsideWithStatementBody", "(", "node", ")", "{", "if", "(", "node", ")", "{", "while", "(", "node", ".", "parent", ")", "{", "if", "(", "node", ".", "parent", ".", "kind", "===", "212", "/* WithStatement */", "&&", "node", ".", "parent", ...
Language service support
[ "Language", "service", "support" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L33315-L33325
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
copySymbol
function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; // We will copy all symbol regardless of its reserved name because // symbolsToArray will check whether the key is a reserved name and ...
javascript
function copySymbol(symbol, meaning) { if (symbol.flags & meaning) { var id = symbol.name; // We will copy all symbol regardless of its reserved name because // symbolsToArray will check whether the key is a reserved name and ...
[ "function", "copySymbol", "(", "symbol", ",", "meaning", ")", "{", "if", "(", "symbol", ".", "flags", "&", "meaning", ")", "{", "var", "id", "=", "symbol", ".", "name", ";", "// We will copy all symbol regardless of its reserved name because", "// symbolsToArray wil...
Copy the given symbol into symbol tables if the symbol has the given meaning and it doesn't already existed in the symbol table @param key a key for storing in symbol table; if undefined, use symbol.name @param symbol the symbol to be added into symbol table @param meaning meaning of symbol to filter by before adding t...
[ "Copy", "the", "given", "symbol", "into", "symbol", "tables", "if", "the", "symbol", "has", "the", "given", "meaning", "and", "it", "doesn", "t", "already", "existed", "in", "the", "symbol", "table" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L33390-L33400
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isTypeReferenceIdentifier
function isTypeReferenceIdentifier(entityName) { var node = entityName; while (node.parent && node.parent.kind === 139 /* QualifiedName */) { node = node.parent; } return node.parent && (node.parent.kind === 155 /* TypeReference */ || node.parent.kind === ...
javascript
function isTypeReferenceIdentifier(entityName) { var node = entityName; while (node.parent && node.parent.kind === 139 /* QualifiedName */) { node = node.parent; } return node.parent && (node.parent.kind === 155 /* TypeReference */ || node.parent.kind === ...
[ "function", "isTypeReferenceIdentifier", "(", "entityName", ")", "{", "var", "node", "=", "entityName", ";", "while", "(", "node", ".", "parent", "&&", "node", ".", "parent", ".", "kind", "===", "139", "/* QualifiedName */", ")", "{", "node", "=", "node", ...
True if the given identifier is part of a type reference
[ "True", "if", "the", "given", "identifier", "is", "part", "of", "a", "type", "reference" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L33426-L33432
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getExportSpecifierLocalTargetSymbol
function getExportSpecifierLocalTargetSymbol(node) { return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Al...
javascript
function getExportSpecifierLocalTargetSymbol(node) { return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 8388608 /* Al...
[ "function", "getExportSpecifierLocalTargetSymbol", "(", "node", ")", "{", "return", "node", ".", "parent", ".", "parent", ".", "moduleSpecifier", "?", "getExternalModuleMember", "(", "node", ".", "parent", ".", "parent", ",", "node", ")", ":", "resolveEntityName",...
Returns the target of an export specifier without following aliases
[ "Returns", "the", "target", "of", "an", "export", "specifier", "without", "following", "aliases" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L33645-L33649
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getReferencedDeclarationWithCollidingName
function getReferencedDeclarationWithCollidingName(node) { var symbol = getReferencedValueSymbol(node); return symbol && isSymbolOfDeclarationWithCollidingName(symbol) ? symbol.valueDeclaration : undefined; }
javascript
function getReferencedDeclarationWithCollidingName(node) { var symbol = getReferencedValueSymbol(node); return symbol && isSymbolOfDeclarationWithCollidingName(symbol) ? symbol.valueDeclaration : undefined; }
[ "function", "getReferencedDeclarationWithCollidingName", "(", "node", ")", "{", "var", "symbol", "=", "getReferencedValueSymbol", "(", "node", ")", ";", "return", "symbol", "&&", "isSymbolOfDeclarationWithCollidingName", "(", "symbol", ")", "?", "symbol", ".", "valueD...
When resolved as an expression identifier, if the given node references a nested block scoped entity with a name that either hides an existing name or might hide it when compiled downlevel, return the declaration of that entity. Otherwise, return undefined.
[ "When", "resolved", "as", "an", "expression", "identifier", "if", "the", "given", "node", "references", "a", "nested", "block", "scoped", "entity", "with", "a", "name", "that", "either", "hides", "an", "existing", "name", "or", "might", "hide", "it", "when",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L33902-L33905
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
encodeLastRecordedSourceMapSpan
function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { return; } var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; // Line/Comma delimiters i...
javascript
function encodeLastRecordedSourceMapSpan() { if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { return; } var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; // Line/Comma delimiters i...
[ "function", "encodeLastRecordedSourceMapSpan", "(", ")", "{", "if", "(", "!", "lastRecordedSourceMapSpan", "||", "lastRecordedSourceMapSpan", "===", "lastEncodedSourceMapSpan", ")", "{", "return", ";", "}", "var", "prevEncodedEmittedColumn", "=", "lastEncodedSourceMapSpan",...
Encoding for sourcemap span
[ "Encoding", "for", "sourcemap", "span" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L35513-L35548
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getExportDefaultTempVariableName
function getExportDefaultTempVariableName() { var baseName = "_default"; if (!(baseName in currentIdentifiers)) { return baseName; } var count = 0; while (true) { count++; var name_23 = baseName + "_" + count; ...
javascript
function getExportDefaultTempVariableName() { var baseName = "_default"; if (!(baseName in currentIdentifiers)) { return baseName; } var count = 0; while (true) { count++; var name_23 = baseName + "_" + count; ...
[ "function", "getExportDefaultTempVariableName", "(", ")", "{", "var", "baseName", "=", "\"_default\"", ";", "if", "(", "!", "(", "baseName", "in", "currentIdentifiers", ")", ")", "{", "return", "baseName", ";", "}", "var", "count", "=", "0", ";", "while", ...
Return a temp variable name to be used in `export default` statements. The temp name will be of the form _default_counter. Note that export default is only allowed at most once in a module, so we do not need to keep track of created temp names.
[ "Return", "a", "temp", "variable", "name", "to", "be", "used", "in", "export", "default", "statements", ".", "The", "temp", "name", "will", "be", "of", "the", "form", "_default_counter", ".", "Note", "that", "export", "default", "is", "only", "allowed", "a...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L36132-L36145
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
writeReferencePath
function writeReferencePath(referencedFile, addBundledFileReference, emitOnlyDtsFiles) { var declFileName; var addedBundledEmitReference = false; if (ts.isDeclarationFile(referencedFile)) { // Declaration file, use declaration file name declFileName = ...
javascript
function writeReferencePath(referencedFile, addBundledFileReference, emitOnlyDtsFiles) { var declFileName; var addedBundledEmitReference = false; if (ts.isDeclarationFile(referencedFile)) { // Declaration file, use declaration file name declFileName = ...
[ "function", "writeReferencePath", "(", "referencedFile", ",", "addBundledFileReference", ",", "emitOnlyDtsFiles", ")", "{", "var", "declFileName", ";", "var", "addedBundledEmitReference", "=", "false", ";", "if", "(", "ts", ".", "isDeclarationFile", "(", "referencedFi...
Adds the reference to referenced file, returns true if global file reference was emitted @param referencedFile @param addBundledFileReference Determines if global file reference corresponding to bundled file should be emitted or not
[ "Adds", "the", "reference", "to", "referenced", "file", "returns", "true", "if", "global", "file", "reference", "was", "emitted" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L37219-L37245
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
emitFiles
function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { // emit output for the __extends helper function var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor...
javascript
function emitFiles(resolver, host, targetSourceFile, emitOnlyDtsFiles) { // emit output for the __extends helper function var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor...
[ "function", "emitFiles", "(", "resolver", ",", "host", ",", "targetSourceFile", ",", "emitOnlyDtsFiles", ")", "{", "// emit output for the __extends helper function", "var", "extendsHelper", "=", "\"\\nvar __extends = (this && this.__extends) || function (d, b) {\\n for (var p in ...
targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature
[ "targetSourceFile", "is", "when", "users", "only", "want", "one", "file", "in", "entire", "project", "to", "be", "emitted", ".", "This", "is", "used", "in", "compileOnSave", "feature" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L37566-L44681
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
makeTempVariableName
function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { var name_24 = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name_24)) { tempFlags |= flags; return name_24; ...
javascript
function makeTempVariableName(flags) { if (flags && !(tempFlags & flags)) { var name_24 = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name_24)) { tempFlags |= flags; return name_24; ...
[ "function", "makeTempVariableName", "(", "flags", ")", "{", "if", "(", "flags", "&&", "!", "(", "tempFlags", "&", "flags", ")", ")", "{", "var", "name_24", "=", "flags", "===", "268435456", "/* _i */", "?", "\"_i\"", ":", "\"_n\"", ";", "if", "(", "isU...
Return the next available name in the pattern _a ... _z, _0, _1, ... TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. Note that names generated by makeTempVariableName and makeUniqueName will never conflict.
[ "Return", "the", "next", "available", "name", "in", "the", "pattern", "_a", "...", "_z", "_0", "_1", "...", "TempFlags", ".", "_i", "or", "TempFlags", ".", "_n", "may", "be", "used", "to", "express", "a", "preference", "for", "that", "dedicated", "name",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L37767-L37786
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
writeEmittedFiles
function writeEmittedFiles(emitOutput, jsFilePath, sourceMapFilePath, writeByteOrderMark, sourceFiles) { if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), /*writeByteOrderMark*/ false, s...
javascript
function writeEmittedFiles(emitOutput, jsFilePath, sourceMapFilePath, writeByteOrderMark, sourceFiles) { if (compilerOptions.sourceMap && !compilerOptions.inlineSourceMap) { ts.writeFile(host, emitterDiagnostics, sourceMapFilePath, sourceMap.getText(), /*writeByteOrderMark*/ false, s...
[ "function", "writeEmittedFiles", "(", "emitOutput", ",", "jsFilePath", ",", "sourceMapFilePath", ",", "writeByteOrderMark", ",", "sourceFiles", ")", "{", "if", "(", "compilerOptions", ".", "sourceMap", "&&", "!", "compilerOptions", ".", "inlineSourceMap", ")", "{", ...
Write emitted output to disk
[ "Write", "emitted", "output", "to", "disk" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L37847-L37855
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
emitToken
function emitToken(tokenKind, startPos, emitFn) { var tokenStartPos = ts.skipTrivia(currentText, startPos); emitPos(tokenStartPos); var tokenString = ts.tokenToString(tokenKind); if (emitFn) { emitFn(); } ...
javascript
function emitToken(tokenKind, startPos, emitFn) { var tokenStartPos = ts.skipTrivia(currentText, startPos); emitPos(tokenStartPos); var tokenString = ts.tokenToString(tokenKind); if (emitFn) { emitFn(); } ...
[ "function", "emitToken", "(", "tokenKind", ",", "startPos", ",", "emitFn", ")", "{", "var", "tokenStartPos", "=", "ts", ".", "skipTrivia", "(", "currentText", ",", "startPos", ")", ";", "emitPos", "(", "tokenStartPos", ")", ";", "var", "tokenString", "=", ...
Emit the text for the given token that comes after startPos This by default writes the text provided with the given tokenKind but if optional emitFn callback is provided the text is emitted using the callback instead of default text @param tokenKind the kind of the token to search and emit @param startPos the position ...
[ "Emit", "the", "text", "for", "the", "given", "token", "that", "comes", "after", "startPos", "This", "by", "default", "writes", "the", "text", "provided", "with", "the", "given", "tokenKind", "but", "if", "optional", "emitFn", "callback", "is", "provided", "...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L37892-L37905
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isImportedReference
function isImportedReference(node) { var declaration = resolver.getReferencedImportDeclaration(node); return declaration && (declaration.kind === 231 /* ImportClause */ || declaration.kind === 234 /* ImportSpecifier */); }
javascript
function isImportedReference(node) { var declaration = resolver.getReferencedImportDeclaration(node); return declaration && (declaration.kind === 231 /* ImportClause */ || declaration.kind === 234 /* ImportSpecifier */); }
[ "function", "isImportedReference", "(", "node", ")", "{", "var", "declaration", "=", "resolver", ".", "getReferencedImportDeclaration", "(", "node", ")", ";", "return", "declaration", "&&", "(", "declaration", ".", "kind", "===", "231", "/* ImportClause */", "||",...
Return true if identifier resolves to an imported identifier
[ "Return", "true", "if", "identifier", "resolves", "to", "an", "imported", "identifier" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L39111-L39114
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
tryEmitStartOfVariableDeclarationList
function tryEmitStartOfVariableDeclarationList(decl) { if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { // variables in variable declaration list were already hoisted return false; } if (convertedLoopState && (t...
javascript
function tryEmitStartOfVariableDeclarationList(decl) { if (shouldHoistVariable(decl, /*checkIfSourceFileLevelDecl*/ true)) { // variables in variable declaration list were already hoisted return false; } if (convertedLoopState && (t...
[ "function", "tryEmitStartOfVariableDeclarationList", "(", "decl", ")", "{", "if", "(", "shouldHoistVariable", "(", "decl", ",", "/*checkIfSourceFileLevelDecl*/", "true", ")", ")", "{", "// variables in variable declaration list were already hoisted", "return", "false", ";", ...
Returns true if start of variable declaration list was emitted. Returns false if nothing was written - this can happen for source file level variable declarations in system modules where such variable declarations are hoisted.
[ "Returns", "true", "if", "start", "of", "variable", "declaration", "list", "was", "emitted", ".", "Returns", "false", "if", "nothing", "was", "written", "-", "this", "can", "happen", "for", "source", "file", "level", "variable", "declarations", "in", "system",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L39887-L39919
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
emitAssignment
function emitAssignment(name, value, shouldEmitCommaBeforeAssignment, nodeForSourceMap) { if (shouldEmitCommaBeforeAssignment) { write(", "); } var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); if (...
javascript
function emitAssignment(name, value, shouldEmitCommaBeforeAssignment, nodeForSourceMap) { if (shouldEmitCommaBeforeAssignment) { write(", "); } var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); if (...
[ "function", "emitAssignment", "(", "name", ",", "value", ",", "shouldEmitCommaBeforeAssignment", ",", "nodeForSourceMap", ")", "{", "if", "(", "shouldEmitCommaBeforeAssignment", ")", "{", "write", "(", "\", \"", ")", ";", "}", "var", "exportChanged", "=", "isNameO...
Emit an assignment to a given identifier, 'name', with a given expression, 'value'. @param name an identifier as a left-hand-side operand of the assignment @param value an expression as a right-hand-side operand of the assignment @param shouldEmitCommaBeforeAssignment a boolean indicating whether to prefix an assignmen...
[ "Emit", "an", "assignment", "to", "a", "given", "identifier", "name", "with", "a", "given", "expression", "value", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L40741-L40769
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getSuperCallAtGivenIndex
function getSuperCallAtGivenIndex(ctor, index) { if (!ctor.body) { return undefined; } var statements = ctor.body.statements; if (!statements || index >= statements.length) { return undefined; } ...
javascript
function getSuperCallAtGivenIndex(ctor, index) { if (!ctor.body) { return undefined; } var statements = ctor.body.statements; if (!statements || index >= statements.length) { return undefined; } ...
[ "function", "getSuperCallAtGivenIndex", "(", "ctor", ",", "index", ")", "{", "if", "(", "!", "ctor", ".", "body", ")", "{", "return", "undefined", ";", "}", "var", "statements", "=", "ctor", ".", "body", ".", "statements", ";", "if", "(", "!", "stateme...
Return the statement at a given index if it is a super-call statement @param ctor a constructor declaration @param index an index to constructor's body to check
[ "Return", "the", "statement", "at", "a", "given", "index", "if", "it", "is", "a", "super", "-", "call", "statement" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L41661-L41673
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isTripleSlashComment
function isTripleSlashComment(comment) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments if (currentText.charCodeAt(comment.p...
javascript
function isTripleSlashComment(comment) { // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments if (currentText.charCodeAt(comment.p...
[ "function", "isTripleSlashComment", "(", "comment", ")", "{", "// Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text", "// so that we don't end up computing comment string and doing match for all // comments", "if", "(", "currentText", ".", ...
Determine if the given comment is a triple-slash @return true if the comment is a triple-slash comment else false
[ "Determine", "if", "the", "given", "comment", "is", "a", "triple", "-", "slash" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L44521-L44533
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getAutomaticTypeDirectiveNames
function getAutomaticTypeDirectiveNames(options, host) { // Use explicit type list from tsconfig.json if (options.types) { return options.types; } // Walk the primary type lookup locations var result = []; if (host.directoryExists && host.getDirectories) { ...
javascript
function getAutomaticTypeDirectiveNames(options, host) { // Use explicit type list from tsconfig.json if (options.types) { return options.types; } // Walk the primary type lookup locations var result = []; if (host.directoryExists && host.getDirectories) { ...
[ "function", "getAutomaticTypeDirectiveNames", "(", "options", ",", "host", ")", "{", "// Use explicit type list from tsconfig.json", "if", "(", "options", ".", "types", ")", "{", "return", "options", ".", "types", ";", "}", "// Walk the primary type lookup locations", "...
Given a set of options, returns the set of type directive names that should be included for this program automatically. This list could either come from the config file, or from enumerating the types root + initial secondary types lookup location. More type directives might appear in the program later as a result of lo...
[ "Given", "a", "set", "of", "options", "returns", "the", "set", "of", "type", "directive", "names", "that", "should", "be", "included", "for", "this", "program", "automatically", ".", "This", "list", "could", "either", "come", "from", "the", "config", "file",...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L45064-L45093
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
findSourceFile
function findSourceFile(fileName, path, isDefaultLib, isReference, refFile, refPos, refEnd) { if (filesByName.contains(path)) { var file_1 = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path // NOTE: thi...
javascript
function findSourceFile(fileName, path, isDefaultLib, isReference, refFile, refPos, refEnd) { if (filesByName.contains(path)) { var file_1 = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path // NOTE: thi...
[ "function", "findSourceFile", "(", "fileName", ",", "path", ",", "isDefaultLib", ",", "isReference", ",", "refFile", ",", "refPos", ",", "refEnd", ")", "{", "if", "(", "filesByName", ".", "contains", "(", "path", ")", ")", "{", "var", "file_1", "=", "fil...
Get source file from normalized fileName
[ "Get", "source", "file", "from", "normalized", "fileName" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L45823-L45889
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
verifyEmitFilePath
function verifyEmitFilePath(emitFileName, emitFilesSeen) { if (emitFileName) { var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName); // Report error if the output overwrites input file if (filesByName.contains(emit...
javascript
function verifyEmitFilePath(emitFileName, emitFilesSeen) { if (emitFileName) { var emitFilePath = ts.toPath(emitFileName, currentDirectory, getCanonicalFileName); // Report error if the output overwrites input file if (filesByName.contains(emit...
[ "function", "verifyEmitFilePath", "(", "emitFileName", ",", "emitFilesSeen", ")", "{", "if", "(", "emitFileName", ")", "{", "var", "emitFilePath", "=", "ts", ".", "toPath", "(", "emitFileName", ",", "currentDirectory", ",", "getCanonicalFileName", ")", ";", "// ...
Verify that all the emit files are unique and don't overwrite input files
[ "Verify", "that", "all", "the", "emit", "files", "are", "unique", "and", "don", "t", "overwrite", "input", "files" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L46169-L46185
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
parseConfigFileTextToJson
function parseConfigFileTextToJson(fileName, jsonText, stripComments) { if (stripComments === void 0) { stripComments = true; } try { var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText; return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToPars...
javascript
function parseConfigFileTextToJson(fileName, jsonText, stripComments) { if (stripComments === void 0) { stripComments = true; } try { var jsonTextToParse = stripComments ? removeComments(jsonText) : jsonText; return { config: /\S/.test(jsonTextToParse) ? JSON.parse(jsonTextToPars...
[ "function", "parseConfigFileTextToJson", "(", "fileName", ",", "jsonText", ",", "stripComments", ")", "{", "if", "(", "stripComments", "===", "void", "0", ")", "{", "stripComments", "=", "true", ";", "}", "try", "{", "var", "jsonTextToParse", "=", "stripCommen...
Parse the text of the tsconfig.json file @param fileName The path to the config file @param jsonText The text of the config file
[ "Parse", "the", "text", "of", "the", "tsconfig", ".", "json", "file" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L46852-L46861
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
matchFileNames
function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { basePath = ts.normalizePath(basePath); // The exclude spec list is converted into a regular expression, which allows us to quickly // test whether a file or directory should be excluded before recursively tra...
javascript
function matchFileNames(fileNames, include, exclude, basePath, options, host, errors) { basePath = ts.normalizePath(basePath); // The exclude spec list is converted into a regular expression, which allows us to quickly // test whether a file or directory should be excluded before recursively tra...
[ "function", "matchFileNames", "(", "fileNames", ",", "include", ",", "exclude", ",", "basePath", ",", "options", ",", "host", ",", "errors", ")", "{", "basePath", "=", "ts", ".", "normalizePath", "(", "basePath", ")", ";", "// The exclude spec list is converted ...
Expands an array of file specifications. @param fileNames The literal file names to include. @param include The wildcard file specifications to include. @param exclude The wildcard file specifications to exclude. @param basePath The base path for any relative file specifications. @param options Compiler options. @para...
[ "Expands", "an", "array", "of", "file", "specifications", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47212-L47279
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getWildcardDirectories
function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { // We watch a directory recursively if it contains a wildcard anywhere in a directory segment // of the pattern: // // /a/b/**/d - Watch /a/b recursively to catch changes to any d in any subfolder rec...
javascript
function getWildcardDirectories(include, exclude, path, useCaseSensitiveFileNames) { // We watch a directory recursively if it contains a wildcard anywhere in a directory segment // of the pattern: // // /a/b/**/d - Watch /a/b recursively to catch changes to any d in any subfolder rec...
[ "function", "getWildcardDirectories", "(", "include", ",", "exclude", ",", "path", ",", "useCaseSensitiveFileNames", ")", "{", "// We watch a directory recursively if it contains a wildcard anywhere in a directory segment", "// of the pattern:", "//", "// /a/b/**/d - Watch /a/b recu...
Gets directories in a set of include patterns that should be watched for changes.
[ "Gets", "directories", "in", "a", "set", "of", "include", "patterns", "that", "should", "be", "watched", "for", "changes", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47302-L47349
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
hasFileWithHigherPriorityExtension
function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); for (var i = 0 /* Highest */; i < adjustedExte...
javascript
function hasFileWithHigherPriorityExtension(file, literalFiles, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); var adjustedExtensionPriority = ts.adjustExtensionPriority(extensionPriority); for (var i = 0 /* Highest */; i < adjustedExte...
[ "function", "hasFileWithHigherPriorityExtension", "(", "file", ",", "literalFiles", ",", "wildcardFiles", ",", "extensions", ",", "keyMapper", ")", "{", "var", "extensionPriority", "=", "ts", ".", "getExtensionPriority", "(", "file", ",", "extensions", ")", ";", "...
Determines whether a literal or wildcard file has already been included that has a higher extension priority. @param file The path to the file. @param extensionPriority The priority of the extension. @param context The expansion context.
[ "Determines", "whether", "a", "literal", "or", "wildcard", "file", "has", "already", "been", "included", "that", "has", "a", "higher", "extension", "priority", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47358-L47369
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
removeWildcardFilesWithLowerPriorityExtension
function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); for (var i = nextExtensionPriority; i < extens...
javascript
function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, extensions, keyMapper) { var extensionPriority = ts.getExtensionPriority(file, extensions); var nextExtensionPriority = ts.getNextLowestExtensionPriority(extensionPriority); for (var i = nextExtensionPriority; i < extens...
[ "function", "removeWildcardFilesWithLowerPriorityExtension", "(", "file", ",", "wildcardFiles", ",", "extensions", ",", "keyMapper", ")", "{", "var", "extensionPriority", "=", "ts", ".", "getExtensionPriority", "(", "file", ",", "extensions", ")", ";", "var", "nextE...
Removes files included via wildcard expansion with a lower extension priority that have already been included. @param file The path to the file. @param extensionPriority The priority of the extension. @param context The expansion context.
[ "Removes", "files", "included", "via", "wildcard", "expansion", "with", "a", "lower", "extension", "priority", "that", "have", "already", "been", "included", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47378-L47386
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
startNode
function startNode(node) { var navNode = emptyNavigationBarNode(node); pushChild(parent, navNode); // Save the old parent parentsStack.push(parent); parent = navNode; }
javascript
function startNode(node) { var navNode = emptyNavigationBarNode(node); pushChild(parent, navNode); // Save the old parent parentsStack.push(parent); parent = navNode; }
[ "function", "startNode", "(", "node", ")", "{", "var", "navNode", "=", "emptyNavigationBarNode", "(", "node", ")", ";", "pushChild", "(", "parent", ",", "navNode", ")", ";", "// Save the old parent", "parentsStack", ".", "push", "(", "parent", ")", ";", "par...
Add a new level of NavigationBarNodes. This pushes to the stack, so you must call `endNode` when you are done adding to this node.
[ "Add", "a", "new", "level", "of", "NavigationBarNodes", ".", "This", "pushes", "to", "the", "stack", "so", "you", "must", "call", "endNode", "when", "you", "are", "done", "adding", "to", "this", "node", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47827-L47833
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
endNode
function endNode() { if (parent.children) { mergeChildren(parent.children); sortChildren(parent.children); } parent = parentsStack.pop(); }
javascript
function endNode() { if (parent.children) { mergeChildren(parent.children); sortChildren(parent.children); } parent = parentsStack.pop(); }
[ "function", "endNode", "(", ")", "{", "if", "(", "parent", ".", "children", ")", "{", "mergeChildren", "(", "parent", ".", "children", ")", ";", "sortChildren", "(", "parent", ".", "children", ")", ";", "}", "parent", "=", "parentsStack", ".", "pop", "...
Call after calling `startNode` and adding children to it.
[ "Call", "after", "calling", "startNode", "and", "adding", "children", "to", "it", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47835-L47841
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
mergeChildren
function mergeChildren(children) { var nameToItems = ts.createMap(); ts.filterMutate(children, function (child) { var decl = child.node; var name = decl.name && nodeText(decl.name); if (!name) { // Anonymous items are never merg...
javascript
function mergeChildren(children) { var nameToItems = ts.createMap(); ts.filterMutate(children, function (child) { var decl = child.node; var name = decl.name && nodeText(decl.name); if (!name) { // Anonymous items are never merg...
[ "function", "mergeChildren", "(", "children", ")", "{", "var", "nameToItems", "=", "ts", ".", "createMap", "(", ")", ";", "ts", ".", "filterMutate", "(", "children", ",", "function", "(", "child", ")", "{", "var", "decl", "=", "child", ".", "node", ";"...
Merge declarations of the same kind.
[ "Merge", "declarations", "of", "the", "same", "kind", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L47969-L48038
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
shouldReallyMerge
function shouldReallyMerge(a, b) { return a.kind === b.kind && (a.kind !== 225 /* ModuleDeclaration */ || areSameModule(a, b)); // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge ...
javascript
function shouldReallyMerge(a, b) { return a.kind === b.kind && (a.kind !== 225 /* ModuleDeclaration */ || areSameModule(a, b)); // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge ...
[ "function", "shouldReallyMerge", "(", "a", ",", "b", ")", "{", "return", "a", ".", "kind", "===", "b", ".", "kind", "&&", "(", "a", ".", "kind", "!==", "225", "/* ModuleDeclaration */", "||", "areSameModule", "(", "a", ",", "b", ")", ")", ";", "// We...
a and b have the same name, but they may not be mergeable.
[ "a", "and", "b", "have", "the", "same", "name", "but", "they", "may", "not", "be", "mergeable", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L48010-L48023
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
areSameModule
function areSameModule(a, b) { if (a.body.kind !== b.body.kind) { return false; } if (a.body.kind !== 225 /* ModuleDeclaration */) { return true; } return areSameModule(a.b...
javascript
function areSameModule(a, b) { if (a.body.kind !== b.body.kind) { return false; } if (a.body.kind !== 225 /* ModuleDeclaration */) { return true; } return areSameModule(a.b...
[ "function", "areSameModule", "(", "a", ",", "b", ")", "{", "if", "(", "a", ".", "body", ".", "kind", "!==", "b", ".", "body", ".", "kind", ")", "{", "return", "false", ";", "}", "if", "(", "a", ".", "body", ".", "kind", "!==", "225", "/* Module...
We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'!
[ "We", "use", "1", "NavNode", "to", "represent", "A", ".", "B", ".", "C", "but", "there", "are", "multiple", "source", "nodes", ".", "Only", "merge", "module", "nodes", "that", "have", "the", "same", "chain", ".", "Don", "t", "merge", "A", ".", "B", ...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L48014-L48022
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
merge
function merge(target, source) { target.additionalNodes = target.additionalNodes || []; target.additionalNodes.push(source.node); if (source.additionalNodes) { (_a = target.additionalNodes).push.apply(_a, source.additionalNodes); } ...
javascript
function merge(target, source) { target.additionalNodes = target.additionalNodes || []; target.additionalNodes.push(source.node); if (source.additionalNodes) { (_a = target.additionalNodes).push.apply(_a, source.additionalNodes); } ...
[ "function", "merge", "(", "target", ",", "source", ")", "{", "target", ".", "additionalNodes", "=", "target", ".", "additionalNodes", "||", "[", "]", ";", "target", ".", "additionalNodes", ".", "push", "(", "source", ".", "node", ")", ";", "if", "(", "...
Merge source into target. Source should be thrown away after this is called.
[ "Merge", "source", "into", "target", ".", "Source", "should", "be", "thrown", "away", "after", "this", "is", "called", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L48025-L48037
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
topLevelItems
function topLevelItems(root) { var topLevel = []; function recur(item) { if (isTopLevel(item)) { topLevel.push(item); if (item.children) { for (var _i = 0, _a = item.children; _i < _a.length; _i++) { ...
javascript
function topLevelItems(root) { var topLevel = []; function recur(item) { if (isTopLevel(item)) { topLevel.push(item); if (item.children) { for (var _i = 0, _a = item.children; _i < _a.length; _i++) { ...
[ "function", "topLevelItems", "(", "root", ")", "{", "var", "topLevel", "=", "[", "]", ";", "function", "recur", "(", "item", ")", "{", "if", "(", "isTopLevel", "(", "item", ")", ")", "{", "topLevel", ".", "push", "(", "item", ")", ";", "if", "(", ...
Flattens the NavNode tree to a list, keeping only the top-level items.
[ "Flattens", "the", "NavNode", "tree", "to", "a", "list", "keeping", "only", "the", "top", "-", "level", "items", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L48154-L48213
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getArgumentIndexForTemplatePiece
function getArgumentIndexForTemplatePiece(spanIndex, node, position) { // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. // There are three cases we can encounter: // 1. We are precisely in the template literal (argIn...
javascript
function getArgumentIndexForTemplatePiece(spanIndex, node, position) { // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. // There are three cases we can encounter: // 1. We are precisely in the template literal (argIn...
[ "function", "getArgumentIndexForTemplatePiece", "(", "spanIndex", ",", "node", ",", "position", ")", "{", "// Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1.", "// There are three cases we can encounter:", "// 1. We are precis...
spanIndex is either the index for a given template span. This does not give appropriate results for a NoSubstitutionTemplateLiteral
[ "spanIndex", "is", "either", "the", "index", "for", "a", "given", "template", "span", ".", "This", "does", "not", "give", "appropriate", "results", "for", "a", "NoSubstitutionTemplateLiteral" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L49218-L49238
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTokenAtPosition
function getTokenAtPosition(sourceFile, position, includeJsDocComment) { if (includeJsDocComment === void 0) { includeJsDocComment = false; } return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ true, /*includeItemAtEndPosition*/ undefined, includeJsDocComment); }
javascript
function getTokenAtPosition(sourceFile, position, includeJsDocComment) { if (includeJsDocComment === void 0) { includeJsDocComment = false; } return getTokenAtPositionWorker(sourceFile, position, /*allowPositionInLeadingTrivia*/ true, /*includeItemAtEndPosition*/ undefined, includeJsDocComment); }
[ "function", "getTokenAtPosition", "(", "sourceFile", ",", "position", ",", "includeJsDocComment", ")", "{", "if", "(", "includeJsDocComment", "===", "void", "0", ")", "{", "includeJsDocComment", "=", "false", ";", "}", "return", "getTokenAtPositionWorker", "(", "s...
Returns a token if position is in [start-of-leading-trivia, end)
[ "Returns", "a", "token", "if", "position", "is", "in", "[", "start", "-", "of", "-", "leading", "-", "trivia", "end", ")" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L49657-L49660
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isInsideJsxElementOrAttribute
function isInsideJsxElementOrAttribute(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); if (!token) { return false; } if (token.kind === 244 /* JsxText */) { return true; } // <div>Hello |</div> if (token.kind =...
javascript
function isInsideJsxElementOrAttribute(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position); if (!token) { return false; } if (token.kind === 244 /* JsxText */) { return true; } // <div>Hello |</div> if (token.kind =...
[ "function", "isInsideJsxElementOrAttribute", "(", "sourceFile", ",", "position", ")", "{", "var", "token", "=", "getTokenAtPosition", "(", "sourceFile", ",", "position", ")", ";", "if", "(", "!", "token", ")", "{", "return", "false", ";", "}", "if", "(", "...
returns true if the position is in between the open and close elements of an JSX expression.
[ "returns", "true", "if", "the", "position", "is", "in", "between", "the", "open", "and", "close", "elements", "of", "an", "JSX", "expression", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L49843-L49870
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
isInCommentHelper
function isInCommentHelper(sourceFile, position, predicate) { var token = getTokenAtPosition(sourceFile, position); if (token && position <= token.getStart(sourceFile)) { var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); // The end marker of a single-lin...
javascript
function isInCommentHelper(sourceFile, position, predicate) { var token = getTokenAtPosition(sourceFile, position); if (token && position <= token.getStart(sourceFile)) { var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); // The end marker of a single-lin...
[ "function", "isInCommentHelper", "(", "sourceFile", ",", "position", ",", "predicate", ")", "{", "var", "token", "=", "getTokenAtPosition", "(", "sourceFile", ",", "position", ")", ";", "if", "(", "token", "&&", "position", "<=", "token", ".", "getStart", "(...
Returns true if the cursor at position in sourceFile is within a comment that additionally satisfies predicate, and false otherwise.
[ "Returns", "true", "if", "the", "cursor", "at", "position", "in", "sourceFile", "is", "within", "a", "comment", "that", "additionally", "satisfies", "predicate", "and", "false", "otherwise", "." ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L49881-L49903
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
mergeTypings
function mergeTypings(typingNames) { if (!typingNames) { return; } for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { var typing = typingNames_1[_i]; if (!(typing in inferredTypings)...
javascript
function mergeTypings(typingNames) { if (!typingNames) { return; } for (var _i = 0, typingNames_1 = typingNames; _i < typingNames_1.length; _i++) { var typing = typingNames_1[_i]; if (!(typing in inferredTypings)...
[ "function", "mergeTypings", "(", "typingNames", ")", "{", "if", "(", "!", "typingNames", ")", "{", "return", ";", "}", "for", "(", "var", "_i", "=", "0", ",", "typingNames_1", "=", "typingNames", ";", "_i", "<", "typingNames_1", ".", "length", ";", "_i...
Merge a given list of typingNames to the inferredTypings map
[ "Merge", "a", "given", "list", "of", "typingNames", "to", "the", "inferredTypings", "map" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L50444-L50454
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypingNamesFromJson
function getTypingNamesFromJson(jsonPath, filesToWatch) { if (host.fileExists(jsonPath)) { filesToWatch.push(jsonPath); } var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }); if (result.config) { ...
javascript
function getTypingNamesFromJson(jsonPath, filesToWatch) { if (host.fileExists(jsonPath)) { filesToWatch.push(jsonPath); } var result = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }); if (result.config) { ...
[ "function", "getTypingNamesFromJson", "(", "jsonPath", ",", "filesToWatch", ")", "{", "if", "(", "host", ".", "fileExists", "(", "jsonPath", ")", ")", "{", "filesToWatch", ".", "push", "(", "jsonPath", ")", ";", "}", "var", "result", "=", "ts", ".", "rea...
Get the typing info from common package manager json files like package.json or bower.json
[ "Get", "the", "typing", "info", "from", "common", "package", "manager", "json", "files", "like", "package", ".", "json", "or", "bower", ".", "json" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L50458-L50478
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypingNamesFromSourceFileNames
function getTypingNamesFromSourceFileNames(fileNames) { var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension); var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); var cleanedT...
javascript
function getTypingNamesFromSourceFileNames(fileNames) { var jsFileNames = ts.filter(fileNames, ts.hasJavaScriptFileExtension); var inferredTypingNames = ts.map(jsFileNames, function (f) { return ts.removeFileExtension(ts.getBaseFileName(f.toLowerCase())); }); var cleanedT...
[ "function", "getTypingNamesFromSourceFileNames", "(", "fileNames", ")", "{", "var", "jsFileNames", "=", "ts", ".", "filter", "(", "fileNames", ",", "ts", ".", "hasJavaScriptFileExtension", ")", ";", "var", "inferredTypingNames", "=", "ts", ".", "map", "(", "jsFi...
Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" should be inferred to the 'jquery' typing name; and "angular-route.1.2.3.js" should be inferred to the 'angular-route' typing name. @param fileNames are the names for source files in the project
[ "Infer", "typing", "names", "from", "given", "file", "names", ".", "For", "example", "the", "file", "name", "jquery", "-", "min", ".", "2", ".", "3", ".", "4", ".", "js", "should", "be", "inferred", "to", "the", "jquery", "typing", "name", ";", "and"...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L50485-L50496
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getTypingNamesFromNodeModuleFolder
function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { // Todo: add support for ModuleResolutionHost too if (!host.directoryExists(nodeModulesPath)) { return; } var typingNames = []; var fileNames = host.readDire...
javascript
function getTypingNamesFromNodeModuleFolder(nodeModulesPath) { // Todo: add support for ModuleResolutionHost too if (!host.directoryExists(nodeModulesPath)) { return; } var typingNames = []; var fileNames = host.readDire...
[ "function", "getTypingNamesFromNodeModuleFolder", "(", "nodeModulesPath", ")", "{", "// Todo: add support for ModuleResolutionHost too", "if", "(", "!", "host", ".", "directoryExists", "(", "nodeModulesPath", ")", ")", "{", "return", ";", "}", "var", "typingNames", "=",...
Infer typing names from node_module folder @param nodeModulesPath is the path to the "node_modules" folder
[ "Infer", "typing", "names", "from", "node_module", "folder" ]
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L50501-L50540
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
getScanStartPosition
function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { return start; } var precedingToken = ts.findPrecedingTok...
javascript
function getScanStartPosition(enclosingNode, originalRange, sourceFile) { var start = enclosingNode.getStart(sourceFile); if (start === originalRange.pos && enclosingNode.end === originalRange.end) { return start; } var precedingToken = ts.findPrecedingTok...
[ "function", "getScanStartPosition", "(", "enclosingNode", ",", "originalRange", ",", "sourceFile", ")", "{", "var", "start", "=", "enclosingNode", ".", "getStart", "(", "sourceFile", ")", ";", "if", "(", "start", "===", "originalRange", ".", "pos", "&&", "encl...
Start of the original range might fall inside the comment - scanner will not yield appropriate results This function will look for token that is located before the start of target range and return its end as start position for the scanner.
[ "Start", "of", "the", "original", "range", "might", "fall", "inside", "the", "comment", "-", "scanner", "will", "not", "yield", "appropriate", "results", "This", "function", "will", "look", "for", "token", "that", "is", "located", "before", "the", "start", "...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L52155-L52171
train
opendigitaleducation/sijil.js
docs/libs/typescript.js
tryComputeIndentationForListItem
function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { ...
javascript
function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos) || ts.rangeContainsStartEnd(range, startPos, endPos) /* Not to miss zero-range nodes e.g. JsxText */) { ...
[ "function", "tryComputeIndentationForListItem", "(", "startPos", ",", "endPos", ",", "parentStartLine", ",", "range", ",", "inheritedIndentation", ")", "{", "if", "(", "ts", ".", "rangeOverlapsWithStartEnd", "(", "range", ",", "startPos", ",", "endPos", ")", "||",...
local functions Tries to compute the indentation for a list element. If list element is not in range then function will pick its actual indentation so it can be pushed downstream as inherited indentation. If list element is in the range - its indentation will be equal to inherited indentation from its predecessors.
[ "local", "functions", "Tries", "to", "compute", "the", "indentation", "for", "a", "list", "element", ".", "If", "list", "element", "is", "not", "in", "range", "then", "function", "will", "pick", "its", "actual", "indentation", "so", "it", "can", "be", "pus...
c0cd5250a573689a8bcd9733b958d4215b0ecfa4
https://github.com/opendigitaleducation/sijil.js/blob/c0cd5250a573689a8bcd9733b958d4215b0ecfa4/docs/libs/typescript.js#L52246-L52265
train