type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
currTok =>
tokenLabel(currTok) | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
ArrowFunction |
currtok =>
tokenLabel(currtok) | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
ArrowFunction |
currRule => currRule.name | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildMismatchTokenMessage({
expected,
actual,
previous,
ruleName
}): string {
let hasLabel = hasTokenLabel(expected)
let expectedMsg = hasLabel
? `--> ${tokenLabel(expected)} <--`
: `token of type --> ${expected.name} <--`
let msg = `... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildNotAllInputParsedMessage({ firstRedundant, ruleName }): string {
return (
"Redundant input, expecting EOF but found: " + firstRedundant.image
)
} | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildNoViableAltMessage({
expectedPathsPerAlt,
actual,
previous,
customUserDescription,
ruleName
}): string {
let errPrefix = "Expecting: "
// TODO: issue: No Viable Alternative Error may have incomplete details. #502
let actualText = first(actual).im... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildEarlyExitMessage({
expectedIterationPaths,
actual,
customUserDescription,
ruleName
}): string {
let errPrefix = "Expecting: "
// TODO: issue: No Viable Alternative Error may have incomplete details. #502
let actualText = first(actual).image
let e... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildRuleNotFoundError(
topLevelRule: Rule,
undefinedRule: NonTerminal
): string {
const msg =
"Invalid grammar, reference to a rule which is not defined: ->" +
undefinedRule.nonTerminalName +
"<-\n" +
"inside top level rule: ->" +
... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildDuplicateFoundError(
topLevelRule: Rule,
duplicateProds: IProductionWithOccurrence[]
): string {
function getExtraProductionArgument(
prod: IProductionWithOccurrence
): string {
if (prod instanceof Terminal) {
return prod.terminalType.nam... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildInvalidNestedRuleNameError(
topLevelRule: Rule,
nestedProd: IOptionallyNamedProduction
): string {
const msg =
`Invalid nested rule name: ->${nestedProd.name}<- inside rule: ->${topLevelRule.name}<-\n` +
`it must match the pattern: ->${validNestedRuleName.toStri... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildDuplicateNestedRuleNameError(
topLevelRule: Rule,
nestedProd: IOptionallyNamedProduction[]
): string {
const duplicateName = first(nestedProd).name
const errMsg =
`Duplicate nested rule name: ->${duplicateName}<- inside rule: ->${topLevelRule.name}<-\n` +
... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildNamespaceConflictError(rule: Rule): string {
const errMsg =
`Namespace conflict found in grammar.\n` +
`The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${rule.name}>.\n` +
`To resolve this make sure each Terminal and Non-Terminal names are unique... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildAlternationPrefixAmbiguityError(options: {
topLevelRule: Rule
prefixPath: TokenType[]
ambiguityIndices: number[]
alternation: Alternation
}): string {
const pathMsg = map(options.prefixPath, currTok =>
tokenLabel(currTok)
).join(", ")
const o... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildAlternationAmbiguityError(options: {
topLevelRule: Rule
prefixPath: TokenType[]
ambiguityIndices: number[]
alternation: Alternation
}): string {
let pathMsg = map(options.prefixPath, currtok =>
tokenLabel(currtok)
).join(", ")
let occurrence ... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildEmptyRepetitionError(options: {
topLevelRule: Rule
repetition: IProductionWithOccurrence
}): string {
let dslName = getProductionDslName(options.repetition)
if (options.repetition.idx !== 0) {
dslName += options.repetition.idx
}
const errMsg =
... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildTokenNameError(options: {
tokenType: TokenType
expectedPattern: RegExp
}): string {
const tokTypeName = options.tokenType.name
const errMsg = `Invalid Grammar Token name: ->${tokTypeName}<- it must match the pattern: ->${options.expectedPattern.toString()}<-`
return err... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildEmptyAlternationError(options: {
topLevelRule: Rule
alternation: Alternation
emptyChoiceIdx: number
}): string {
const errMsg =
`Ambiguous empty alternative: <${options.emptyChoiceIdx + 1}>` +
` in <OR${options.alternation.idx}> inside <${options.topLeve... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildTooManyAlternativesError(options: {
topLevelRule: Rule
alternation: Alternation
}): string {
const errMsg =
`An Alternation cannot have more than 256 alternatives:\n` +
`<OR${options.alternation.idx}> inside <${
options.topLevelRule.name
... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildLeftRecursionError(options: {
topLevelRule: Rule
leftRecursionPath: Rule[]
}): string {
const ruleName = options.topLevelRule.name
let pathNames = utils.map(
options.leftRecursionPath,
currRule => currRule.name
)
let leftRecursivePath = `... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildInvalidRuleNameError(options: {
topLevelRule: Rule
expectedPattern: RegExp
}): string {
const ruleName = options.topLevelRule.name
const expectedPatternString = options.expectedPattern.toString()
const errMsg = `Invalid grammar rule name: ->${ruleName}<- it must match t... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
MethodDeclaration |
buildDuplicateRuleNameError(options: {
topLevelRule: Rule | string
grammarName: string
}): string {
let ruleName
if (options.topLevelRule instanceof Rule) {
ruleName = options.topLevelRule.name
} else {
ruleName = options.topLevelRule
}
... | Hocdoc/chevrotain | packages/chevrotain/src/parse/errors_public.ts | TypeScript |
FunctionDeclaration |
function calculatePrizeForTierPercentage(
tierIndex: number,
tierValue: BigNumberish,
bitRangeSize: number,
prizeAmount: BigNumber
): BigNumber {
const numberOfPrizes = calculateNumberOfPrizesForTierIndex(
bitRangeSize,
tierIndex
);
const fractionOfPrize = calculateFractionO... | pooltogether/v4-js | src/calculate/calculatePrizeForTierPercentage.ts | TypeScript |
InterfaceDeclaration |
export interface IQuoteRequestRejectNoQuoteQualifiers {
QuoteQualifier?: string;
} | pvtienhoa/jspurefix | dist/types/FIXFXCM/quickfix/set/quote_request_reject_no_quote_qualifiers.d.ts | TypeScript |
ArrowFunction |
(appendToObject: JQuery) => {
var textNode: Text = document.createTextNode(this.text);
if(this.style){
var newSpan: HTMLSpanElement = document.createElement('span');
if(this.style.getFont()) newSpan.style.font = this.style.getFont();
if(this.style.getFontSize() != n... | A-Hilaly/deeplearning4j | deeplearning4j-ui-parent/deeplearning4j-ui-components/src/main/typescript/org/deeplearning4j/ui/components/text/ComponentText.ts | TypeScript |
ClassDeclaration | /*
*
* * Copyright 2016 Skymind,Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * U... | A-Hilaly/deeplearning4j | deeplearning4j-ui-parent/deeplearning4j-ui-components/src/main/typescript/org/deeplearning4j/ui/components/text/ComponentText.ts | TypeScript |
FunctionDeclaration |
function formatResponse(
response: LedgerEntryResponse
): FormattedPaymentChannel {
if (response.node === undefined ||
response.node.LedgerEntryType !== 'PayChannel') {
throw new NotFoundError('Payment channel ledger entry not found')
}
return parsePaymentChannel(response.node)
} | alexchiriac/ripple-lib | src/ledger/payment-channel.ts | TypeScript |
FunctionDeclaration |
async function getPaymentChannel(
this: RippleAPI, id: string
): Promise<FormattedPaymentChannel> {
// 1. Validate
validate.getPaymentChannel({id})
// 2. Make Request
const response = await this.request('ledger_entry', {
index: id,
binary: false,
ledger_index: 'validated'
})
// 3. Return Form... | alexchiriac/ripple-lib | src/ledger/payment-channel.ts | TypeScript |
ArrowFunction |
() => {
it("should return 4 space indentation correctly", () => {
const result = getDefaultIndentation(true, 4);
expect(result).to.equal(" ");
});
it("should return 2 space indentation correctly", () => {
const result = getDefaultIndentation(true, 2);
expect(result).to... | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => {
const result = getDefaultIndentation(true, 4);
expect(result).to.equal(" ");
} | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => {
const result = getDefaultIndentation(true, 2);
expect(result).to.equal(" ");
} | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => {
let result = getDefaultIndentation(false, 4);
expect(result).to.equal("\t");
result = getDefaultIndentation(false, 8);
expect(result).to.equal("\t");
} | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should trim lines passed.', () => {
const result = preprocessLines([
' foo ',
'\t\tbar\t\t',
'\r\rbatz\r\r',
'\t\rhello\t\r',
'\t\t \r\t world\t\r \r\t '
]);
expect(result).to.be.deep.equal([
'fo... | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => {
const result = preprocessLines([
' foo ',
'\t\tbar\t\t',
'\r\rbatz\r\r',
'\t\rhello\t\r',
'\t\t \r\t world\t\r \r\t '
]);
expect(result).to.be.deep.equal([
'foo',
'bar',
'batz',
... | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => {
const result = preprocessLines([
'foo',
'# hello world'
]);
expect(result).to.be.deep.equal([
'foo'
]);
} | 1021ky/autoDocstring | src/test/parse/utilities.spec.ts | TypeScript |
ArrowFunction |
() => this.settings.getServers(definition.private) | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
ArrowFunction |
(x) => ({
pattern: new RegExp(x.pattern),
key: x.key,
value: x.value
}) | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
ArrowFunction |
(x) => x.pattern.test(file.filePath) | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
InterfaceDeclaration | /**
* Data that is provided to the templates to generate a link.
*/
interface UrlData {
/**
* The base URL of the server.
*/
readonly base: string;
/**
* The path to the repository on the server.
*/
readonly repository: string;
/**
* The type of link being generated.
... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
InterfaceDeclaration |
interface FileData {
readonly match: RegExpMatchArray;
readonly http?: string;
readonly ssh?: string;
} | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
InterfaceDeclaration | /**
* The parsed query modification for making modifications to the URL's query string.
*/
export interface ParsedQueryModification {
/**
* The regular expression to match against the file name.
*/
readonly pattern: RegExp;
/**
* The key to add to the query string when the pattern matches.... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
InterfaceDeclaration | /**
* The parsed settings for getting file information from a URL.
*/
interface ParsedReverseSettings {
/**
* The regular expression pattern to match against the URL.
*/
readonly pattern: RegExp;
/**
* The template to produce a file name.
*/
readonly file: ParsedTemplate;
/**... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
TypeAliasDeclaration | /**
* Parsed templates.
*/
type ParsedTemplates<T> = { [K in keyof T]: ParsedTemplate }; | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Determines whether this handler can generate links for the given remote URL.
*
* @param remoteUrl The remote URL to check.
* @returns True if this handler handles the given remote URL; otherwise, false.
*/
public isMatch(remoteUrl: string): boolean {
return this.server.match(norma... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Creates a link for the specified file.
*
* @param repository The repository that the file is in.
* @param file The details of the file.
* @param options The options for creating the link.
* @returns The URL.
*/
public async createUrl(
repository: RepositoryWithRemote,
... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Applies the given query string modifications to the URL.
*
* @param url The URL to modify.
* @param modifications The modifications to apply.
* @returns The modified URL.
*/
private applyModifications(url: string, modifications: ParsedQueryModification[]): string {
if (modifi... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets the server address for the given remote URL.
*
* @param remote The remote URL.
* @returns The server address.
*/
private getAddress(remote: string): StaticServer {
let address: StaticServer | undefined;
address = this.server.match(remote);
if (!address) {
... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Normalizes the server URLs to make them consistent for use in the templates.
*
* @param address The server address to normalize.
* @returns The normalized server URLs.
*/
private normalizeServerUrls(address: StaticServer): StaticServer {
let http: string;
let ssh: string |... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets the path to the repository at the given server address.
*
* @param remoteUrl The remote URL of the repository.
* @param address The address of the server.
* @returns The path to the repository.
*/
private getRepositoryPath(remoteUrl: string, address: StaticServer): string {
... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets the ref to use when creating the link.
*
* @param type The type of ref to get.
* @param repository The repository.
* @returns The ref to use.
*/
private async getRef(type: LinkType, repository: RepositoryWithRemote): Promise<string> {
switch (type) {
case 'br... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets the name of the default branch in the remote.
*
* @param repository The repository.
* @returns The name of the default branch.
*/
private async getDefaultRemoteBranch(repository: RepositoryWithRemote): Promise<string> {
let branch: string;
try {
branch = ... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Escapes a value that can then be used in a Regular Expression.
*
* @param value The value to escape.
* @returns The escaped value.
*/
private escapeRegExp(value: string): string {
return value.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
} | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets the argument to use with `git rev-parse` to specify the output.
*
* @returns The argument to use.
*/
private getRevParseOutputArgument(): string {
switch (this.definition.branchRef) {
case 'symbolic':
return '--symbolic-full-name';
default:... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets the relative path from the specified directory to the specified file.
*
* @param from The directory to get the relative path from.
* @param to The file to get the relative path to.
* @returns The relative path of the file.
*/
private async getRelativePath(from: string, to: strin... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Determines whether the specified file is a symbolic link.
*
* @param filePath The path of the file to check.
* @param rootDirectory The path to the root of the repository.
* @returns True if the specified file is a symbolic link within the repository; otherwise, false.
*/
private asy... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Gets information about the given URL.
*
* @param url The URL to get the information from.
* @param strict Whether to require the URL to match the server address of the handler.
* @returns The URL information, or `undefined` if the information could not be determined.
*/
public getUrl... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
MethodDeclaration | /**
* Attempts to parse the given value to a number.
*
* @param value The value to parse.
* @returns The value as a number, or `undefined` if the value could not be parsed.
*/
private tryParseNumber(value: string | undefined): number | undefined {
if (value !== undefined) {
... | reduckted/GitWebLinks | vscode/src/link-handler.ts | TypeScript |
ArrowFunction |
aPath => path.join(assetPath, aPath) | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
ArrowFunction |
item => path.basename(item.path) !== '.DS_Store' | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
ArrowFunction |
img => (img.prefix === prefix && img.suffix === suffix) | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
InterfaceDeclaration |
interface AlloyAutoCompleteRule {
regExp: RegExp;
getCompletions: (range?: Range) => Promise<CompletionItem[]>|CompletionItem[];
requireRange?: boolean;
rangeRegex?: RegExp;
} | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
MethodDeclaration |
async getCompletions () {
const cfgPath = path.join(utils.getAlloyRootPath(), 'config.json');
const completions: CompletionItem[] = [];
if (utils.fileExists(cfgPath)) {
const document = await workspace.openTextDocument(cfgPath);
const cfgObj = JSON.parse(document.getText());
const deconstructedConfig = ... | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
MethodDeclaration |
async getCompletions () {
const defaultLang = ExtensionContainer.config.project.defaultI18nLanguage;
const i18nPath = utils.getI18nPath();
const completions: CompletionItem[] = [];
if (utils.directoryExists(i18nPath)) {
const i18nStringPath = path.join(i18nPath, defaultLang, 'strings.xml');
if (utils.fil... | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
MethodDeclaration |
getCompletions (range) {
const alloyRootPath = utils.getAlloyRootPath();
const assetPath = path.join(alloyRootPath, 'assets');
const completions: CompletionItem[] = [];
// limit search to these sub-directories
let paths = [ 'images', 'iphone', 'android', 'windows' ];
paths = paths.map(aPath => path.join(as... | devcode1981/vscode-appcelerator-titanium | src/providers/completion/alloyAutoCompleteRules.ts | TypeScript |
ClassDeclaration |
@Component({
tag: 'arcgis-expand',
styleUrl: 'arcgis-expand.css',
shadow: false,
})
export class ArcGISSearch {
@Element() el: HTMLDivElement;
@Prop() position: string;
@Prop() view : __esri.MapView | __esri.SceneView;
@Prop({ mutable: true }) widget: any;
@Watch('view')
validateView(value: __esr... | odoe/arcgis-comps | src/components/arcgis-expand/arcgis-expand.tsx | TypeScript |
MethodDeclaration |
@Watch('view')
validateView(value: __esri.MapView) {
if (value) {
this.widget.view = value;
this.widget.view.ui.add(this.el, this.position);
}
} | odoe/arcgis-comps | src/components/arcgis-expand/arcgis-expand.tsx | TypeScript |
MethodDeclaration |
componentWillLoad() {
const expand = new Expand({
container: this.el
});
this.widget = expand;
this.loaded.emit(true);
} | odoe/arcgis-comps | src/components/arcgis-expand/arcgis-expand.tsx | TypeScript |
MethodDeclaration |
componentDidRender() {
const elems = Array.from(this.el.children);
for (let e of elems) {
if (e.tagName.toLowerCase().includes('arcgis-')) {
(e as any).view = this.view;
this.widget.content = e;
this.widget.expandIconClass = (e as any).widget.iconClass;
}
}
} | odoe/arcgis-comps | src/components/arcgis-expand/arcgis-expand.tsx | TypeScript |
InterfaceDeclaration |
export interface IStrapiModelAttribute {
unique?: boolean;
required?: boolean;
type?: StrapiType;
default?: string | number | boolean;
dominant?: boolean;
collection?: string;
model?: string;
via?: string;
plugin?: string;
enum?: string[];
component?: string;
components?: string[];
repeatable... | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
InterfaceDeclaration |
export interface IStrapiModel {
/** Not from Strapi, but is the filename on disk */
_filename: string;
_isComponent?: boolean;
connection: string;
collectionName: string;
info: {
name: string;
description: string;
icon?: string;
};
options?: {
timestamps: boolean;
};
attributes: { ... | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
InterfaceDeclaration |
export interface IStrapiModelExtended extends IStrapiModel {
// use to output filename
ouputFile: string;
// interface name
interfaceName: string;
// model name extract from *.(settings|schema).json filename. Use to link model.
modelName: string;
} | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
InterfaceDeclaration |
export interface IStrapi4ModelAttribute {
type?: Strapi4AttributeType;
relation?: Strapi4RelationType;
target?: string;
mappedBy?: string;
inversedBy?: string;
repeatable?: boolean;
component?: string;
components?: string[];
required?: boolean;
max?: number;
min?: number;
minLength?: number;
... | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
InterfaceDeclaration |
export interface IStrapi4Model {
/** Not from Strapi, but is the filename on disk */
_filename: string;
_isComponent?: boolean;
kind: 'collectionType' | 'singleType',
tableName: string;
info: {
displayName: string;
singularName: string;
pluralName: string;
description: string;
icon: st... | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
InterfaceDeclaration |
export interface IStrapi4ModelExtended extends IStrapi4Model {
// use to output filename
ouputFile: string;
// interface name
interfaceName: string;
// model name extract from *.(settings|schema).json filename. Use to link model.
modelName: string;
} | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
TypeAliasDeclaration |
export type StrapiType = 'string' | 'number' | 'boolean' | 'text' | 'date' | 'email' | 'component' | 'enumeration' | 'dynamiczone'; | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
TypeAliasDeclaration |
export type Strapi4AttributeType = 'string' | 'text' | 'richtext' | 'enumeration' | 'email' | 'password' | 'uid' | 'date' | 'time' | 'datetime' | 'timestamp' | 'integer' | 'biginteger' | 'float' | 'decimal' | 'boolean' | 'array' | 'json' | 'media' | 'relation' | 'component' | 'dynamiczone' | 'locale' | 'localizations'... | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
TypeAliasDeclaration |
type Strapi4RelationType = 'oneToOne' | 'oneToMany' | 'manyToOne' | 'manyToMany' | JeremiFerre/strapi-to-typescript | src/models/strapi-model.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-async-observable-pipe',
template: `
<fieldset>
<h3>Async Observable :</h3>
<h5>
Count: {{counter$ | async}}
</h5>
</fieldset>
`,
styles: []
})
export class AsyncObservablePipeComponent {
counter$: Observable<number>;
constructor() {
this.counter$ = Ob... | Rachoor/AngularMaterialGo | src/app/pipes/async-observable-pipe.component.ts | TypeScript |
FunctionDeclaration | /**
* Start application
*/
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const port = app.get(ConfigService).get<number>("port");
const ip = app.get(ConfigService).get<string>("ip");
app.enableShutdownHooks();
await app.listen(port, ip);
Logger.log("Listening on " + ip ... | united-gameserver/TO4ST-core | to4st-core/src/main.ts | TypeScript |
ArrowFunction |
(ctor: any, superCtor: any) => {
if (superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
}
} | mikolaj6r/stencil | src/compiler_next/sys/modules/util.ts | TypeScript |
ArrowFunction |
(...args: any[]) =>
args.forEach(arg => console.log(arg)) | mikolaj6r/stencil | src/compiler_next/sys/modules/util.ts | TypeScript |
ArrowFunction |
arg => console.log(arg) | mikolaj6r/stencil | src/compiler_next/sys/modules/util.ts | TypeScript |
ArrowFunction |
(fn: Function): () => Promise<any> => {
if (typeof (fn as any)[promisify.custom] === 'function') {
// https://nodejs.org/api/util.html#util_custom_promisified_functions
return function (...args: any[]) {
return (fn as any)[promisify.custom].apply(this, args);
}
}
return function (...args: any[... | mikolaj6r/stencil | src/compiler_next/sys/modules/util.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
args.push((err: any, result: any) => {
if (err != null) {
reject(err);
} else {
resolve(result);
}
});
fn.apply(this, args);
} | mikolaj6r/stencil | src/compiler_next/sys/modules/util.ts | TypeScript |
ArrowFunction |
(err: any, result: any) => {
if (err != null) {
reject(err);
} else {
resolve(result);
}
} | mikolaj6r/stencil | src/compiler_next/sys/modules/util.ts | TypeScript |
ArrowFunction |
speed => {
this.playbackRate = speed;
} | ThomasWo/loaner | loaner/shared/components/animation_menu/animation_menu.ts | TypeScript |
ClassDeclaration | /**
* References the content to go into the animation menu.
* Also handles the dialog closing.
*/
@Component({
host: {
'class': 'mat-typography',
},
selector: 'animation-menu',
styleUrls: ['./animation_menu.scss'],
templateUrl: './animation_menu.ng.html',
})
export class AnimationMenuComponent {
play... | ThomasWo/loaner | loaner/shared/components/animation_menu/animation_menu.ts | TypeScript |
MethodDeclaration |
closeDialog() {
this.animationService.setAnimationSpeed(this.playbackRate);
this.dialogRef.close();
} | ThomasWo/loaner | loaner/shared/components/animation_menu/animation_menu.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: "root"
})
export class EventCourseTypeCommunicationService {
private viewEventCourseTypeSubject = new Subject<EventCourseType>();
private addEventCourseTypeSubject = new Subject<EventCourseType>();
constructor() {}
sendAddEventCourseTypeEvent(eventCourseType: EventCourseType) {
... | jkumwenda/AGP | frontend/src/app/shared/services/event-course-type-communication.service.ts | TypeScript |
MethodDeclaration |
sendAddEventCourseTypeEvent(eventCourseType: EventCourseType) {
this.addEventCourseTypeSubject.next(eventCourseType);
} | jkumwenda/AGP | frontend/src/app/shared/services/event-course-type-communication.service.ts | TypeScript |
MethodDeclaration |
getAddEventCourseType(): Observable<EventCourseType> {
return this.addEventCourseTypeSubject.asObservable();
} | jkumwenda/AGP | frontend/src/app/shared/services/event-course-type-communication.service.ts | TypeScript |
MethodDeclaration |
sendViewEventCourseTypeEvent(eventCourseTypes: EventCourseType) {
this.viewEventCourseTypeSubject.next(eventCourseTypes);
} | jkumwenda/AGP | frontend/src/app/shared/services/event-course-type-communication.service.ts | TypeScript |
MethodDeclaration |
getViewEventCourseType(): Observable<EventCourseType> {
return this.viewEventCourseTypeSubject.asObservable();
} | jkumwenda/AGP | frontend/src/app/shared/services/event-course-type-communication.service.ts | TypeScript |
ArrowFunction |
() => ({ contextId, iModelId, ...openParams }) | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
() => {
timedOut = true;
} | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
() => ({ token: requestContext.accessToken.toTokenString(), contextId, iModelId, ...openParams }) | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
() => ({ errorStatus: error.status, errorMessage: error.Message, iModelToken: imodelDb.iModelToken }) | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
() => ({ name: this.name, ...this.iModelToken }) | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
() => {
if (stmt.isShared)
this._statementCache.release(stmt);
else
stmt.dispose();
} | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
(_name: string, value: any) => {
if (typeof value === "string") {
if (value.length >= base64Header.length && value.startsWith(base64Header)) {
const out = value.substr(base64Header.length);
const buffer = Buffer.from(out, "base64");
return new Uint8Array(buffer);
... | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
ArrowFunction |
(_name: string, value: any) => {
if (value && value.constructor === Uint8Array) {
const buffer = Buffer.from(value);
return base64Header + buffer.toString("base64");
}
return value;
} | Ranjith-K-Soman/imodeljs | core/backend/src/IModelDb.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.