type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(err) => {
console.error(err, "Failed to generate QR code");
} | alex-phillips/waveline-server | src/app.ts | TypeScript |
ClassDeclaration |
export class App {
constructor() {
dotenv.config();
}
public async run() {
const REQUIRED_ENV_VARS = ["MUSIC_PATH", "ART_PATH", "TRANSCODE_PATH", "MONGO_URL", "PORT", "HOST"];
for (const key of REQUIRED_ENV_VARS) {
if (!process.env[key]) {
console.error(`${key} env variable missing`);
process.ex... | alex-phillips/waveline-server | src/app.ts | TypeScript |
MethodDeclaration |
public async run() {
const REQUIRED_ENV_VARS = ["MUSIC_PATH", "ART_PATH", "TRANSCODE_PATH", "MONGO_URL", "PORT", "HOST"];
for (const key of REQUIRED_ENV_VARS) {
if (!process.env[key]) {
console.error(`${key} env variable missing`);
process.exit(0);
}
}
bootstrap({
port: (process.env.PORT as... | alex-phillips/waveline-server | src/app.ts | TypeScript |
ClassDeclaration |
export default class ThemekitConfig {
environments(): any {
return this.parseConfigFile();
}
filePresent(): boolean{
return existsSync(this.configPath());
}
private parseConfigFile(): object{
return YAML.parse(this.interpolateEnvVariables());
}
private interpolateEnvVariables(): string {
... | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
MethodDeclaration |
environments(): any {
return this.parseConfigFile();
} | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
MethodDeclaration |
filePresent(): boolean{
return existsSync(this.configPath());
} | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
MethodDeclaration |
private parseConfigFile(): object{
return YAML.parse(this.interpolateEnvVariables());
} | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
MethodDeclaration |
private interpolateEnvVariables(): string {
return env(this.readConfigFile());
} | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
MethodDeclaration |
private readConfigFile(): string {
return readFileSync(this.configPath()).toString();
} | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
MethodDeclaration |
private configPath(): string {
return process.cwd() + '/config.yml';
} | TheBeyondGroup/shopkeeper | src/lib/themekit-config.ts | TypeScript |
ArrowFunction |
() => this.clear() | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
ArrowFunction |
s => s.unsubscribe() | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
ArrowFunction |
value => this.state.set(k, value) | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
ArrowFunction |
val => this.set(key, val) | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
ClassDeclaration | /**
* Service used to navigate between pages and managing the component state
*/
@Injectable({
providedIn: 'root',
})
export class StateManager {
private state = new Map<string, any>();
private subscriptions: Subscription[] = [];
private global = new Map<string, any>();
constructor(
dataForUiHolder: D... | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Clears the entire navigation state
*/
clear(): void {
this.subscriptions.forEach(s => s.unsubscribe());
this.subscriptions = [];
this.state.clear();
} | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Caches some data for the current path.
* @param key The data key. Is only valid for the current path
* @param fetch The observable used to fetch the data in case it is not already cached
*/
cache<T>(key: string, fetch: Observable<T>): Observable<T> {
const k = key + '@' + this.router.url;
if (... | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Stores the state related to the current path
* @param key The key (valid only for the current path)
* @param value The state value
*/
set(key: string, value: any): void {
if (value instanceof AbstractControl) {
value = value.value;
}
const k = key + '@' + this.router.url;
this.st... | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Stores a global shared value
*/
setGlobal(key: string, value: any): void {
this.global.set(key, value);
} | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Returns a global shared value
*/
getGlobal(key: string): any {
return this.global.get(key);
} | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Deletes a global shared value
*/
deleteGlobal(key: string): any {
return this.global.delete(key);
} | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Returns the state related to the current path
* @param key The key (valid only for the current path)
*/
get(key: string, producer: () => any = null): any {
const k = key + '@' + this.router.url;
let value = this.state.get(k);
if (value == null && producer != null) {
// If no value, but ... | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Initializes the control value with the current state, if any, and store the state whenever the value changes
* @param control Either the form control or a function that produces it
* @returns Whether a previous value was used
*/
manage<C extends AbstractControl>(control: C | (() => C), key = 'form'): ... | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
MethodDeclaration | /**
* Initializes the given value with the current state, if any, and store the state whenever the value changes
* @param value The value holder, as a BehaviorSubject
* @returns Whether a previous value was used
*/
manageValue(subject: BehaviorSubject<any>, key: string): boolean {
const value = this.get... | Kcire6/CyclosInfoUGT | src/app/core/state-manager.ts | TypeScript |
ClassDeclaration |
export class InvoiceForm {
currency: Currency = Currency.USD;
partnerId: string;
serialId: string = "2e978bc3-115d-4226-90a7-24bd24ef5054";
date: string;
dueDate: string;
lines: InvoiceLineForm[];
} | icatalin201/plutus-frontend | src/app/shared/models/invoice.form.ts | TypeScript |
ArrowFunction |
(format: string) => `scene-ui.${format}.js` | Sunburst7/scene-ui | build/vite.lib.config.ts | TypeScript |
ClassDeclaration |
export class Upload {
constructor(file: File | Blob | Pick<ReadableStreamDefaultReader, "read">, options: UploadOptions);
file: File | Blob | Pick<ReadableStreamDefaultReader, "read">;
options: UploadOptions;
url: string | null;
start(): void;
abort(): void;
} | 0l1v/DefinitelyTyped | types/tus-js-client/index.d.ts | TypeScript |
InterfaceDeclaration | // Type definitions for tus-js-client 1.7
// Project: https://github.com/tus/tus-js-client/
// Definitions by: Kevin Somers-Higgins <https://github.com/kevhiggins>
// Marius Kleidl <https://github.com/Acconut>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.2
... | 0l1v/DefinitelyTyped | types/tus-js-client/index.d.ts | TypeScript |
MethodDeclaration |
start(): void; | 0l1v/DefinitelyTyped | types/tus-js-client/index.d.ts | TypeScript |
MethodDeclaration |
abort(): void; | 0l1v/DefinitelyTyped | types/tus-js-client/index.d.ts | TypeScript |
ArrowFunction |
formWithConstraints => (this.form = formWithConstraints) | rexcrush/react-form-with-constraints | packages/react-form-with-constraints-material-ui/src/SignUp.tsx | TypeScript |
ArrowFunction |
value => value.length === 0 | rexcrush/react-form-with-constraints | packages/react-form-with-constraints-material-ui/src/SignUp.tsx | TypeScript |
ArrowFunction |
e => <FieldFeedback>{e.message}</FieldFeedback>}
/>
<FieldFeedback when | rexcrush/react-form-with-constraints | packages/react-form-with-constraints-material-ui/src/SignUp.tsx | TypeScript |
ClassDeclaration |
export default class SignUp extends React.Component {
form: FormWithConstraints | null = null;
username: HTMLInputElement | null = null;
password: HTMLInputElement | null = null;
passwordConfirm: HTMLInputElement | null = null;
render() {
return (
// Without MuiThemeProvider we get:
//
... | rexcrush/react-form-with-constraints | packages/react-form-with-constraints-material-ui/src/SignUp.tsx | TypeScript |
MethodDeclaration |
render() {
return (
// Without MuiThemeProvider we get:
//
// Warning: Material-UI: you are providing a theme function property to the MuiThemeProvider component:
// <MuiThemeProvider theme={outerTheme => outerTheme} />
// However, no outer theme is present.
// Make sure a theme... | rexcrush/react-form-with-constraints | packages/react-form-with-constraints-material-ui/src/SignUp.tsx | TypeScript |
InterfaceDeclaration | /**
* <p>Describes a disk image volume.</p>
*/
export interface _DiskImageVolumeDescription {
/**
* <p>The volume identifier.</p>
*/
Id?: string;
/**
* <p>The size of the volume, in GiB.</p>
*/
Size?: number;
} | Dylan0916/aws-sdk-js-v3 | clients/browser/client-ec2-browser/types/_DiskImageVolumeDescription.ts | TypeScript |
TypeAliasDeclaration |
export type _UnmarshalledDiskImageVolumeDescription = _DiskImageVolumeDescription; | Dylan0916/aws-sdk-js-v3 | clients/browser/client-ec2-browser/types/_DiskImageVolumeDescription.ts | TypeScript |
InterfaceDeclaration |
export interface GraphinContextType {
graph: IGraph;
apis: ApisType;
theme: ThemeType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
} | AlbertAZ1992/Graphin | packages/graphin/src/GraphinContext.tsx | TypeScript |
FunctionDeclaration |
export function DataProviderDtoFromJSON(json: any): DataProviderDto {
return DataProviderDtoFromJSONTyped(json, false);
} | koddsson/island.is | libs/api/domains/application/gen/fetch/models/DataProviderDto.ts | TypeScript |
FunctionDeclaration |
export function DataProviderDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataProviderDto {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': json['id'],
'type': json['type'],
};
} | koddsson/island.is | libs/api/domains/application/gen/fetch/models/DataProviderDto.ts | TypeScript |
FunctionDeclaration |
export function DataProviderDtoToJSON(value?: DataProviderDto | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'type': value.type,
};
} | koddsson/island.is | libs/api/domains/application/gen/fetch/models/DataProviderDto.ts | TypeScript |
InterfaceDeclaration | /**
*
* @export
* @interface DataProviderDto
*/
export interface DataProviderDto {
/**
*
* @type {string}
* @memberof DataProviderDto
*/
id: string;
/**
*
* @type {string}
* @memberof DataProviderDto
*/
type: DataProviderDtoTypeEnum;
} | koddsson/island.is | libs/api/domains/application/gen/fetch/models/DataProviderDto.ts | TypeScript |
EnumDeclaration | /**
* @export
* @enum {string}
*/
export enum DataProviderDtoTypeEnum {
ExpectedDateOfBirth = 'ExpectedDateOfBirth',
ExampleFails = 'ExampleFails',
ExampleSucceeds = 'ExampleSucceeds'
} | koddsson/island.is | libs/api/domains/application/gen/fetch/models/DataProviderDto.ts | TypeScript |
FunctionDeclaration |
export default function installDependencies(workingDir: string, silent: boolean): Promise<void>; | sirivus/studioonline | node_modules/decentraland/dist/project/installDependencies.d.ts | TypeScript |
ArrowFunction |
(response: Response) =>
response.json() | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
ArrowFunction |
(item:any, index:any) => {
questions.push(item._id);
} | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class TestService {
testServerUrl = 'http://localhost:3090';
constructor(private http: Http) { }
getTests() {
return this.http.get(this.testServerUrl + '/tests', this.jwt()).map((response: Response) =>
response.json()
);
}
getTestsById(testID: stri... | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
MethodDeclaration |
getTests() {
return this.http.get(this.testServerUrl + '/tests', this.jwt()).map((response: Response) =>
response.json()
);
} | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
MethodDeclaration |
getTestsById(testID: string) {
return this.http.get(this.testServerUrl + '/tests/' + testID, this.jwt()).map((response: Response) =>
response.json()
);
} | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
MethodDeclaration |
getTestsForClass(classID: any) {
console.log('getTestsForClass');
return this.http.get(this.testServerUrl + '/testsForClass/' + classID, this.jwt()).map((response: Response) =>
response.json()
);
} | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
MethodDeclaration |
create(t: any, name: any) {
var questions:any[] = [];
t.forEach((item:any, index:any) => {
questions.push(item._id);
});
var tObj = { name: name, questions };
return this.http.post(this.testServerUrl + '/tests', tObj, this.jwt()).map((response: Response) => respo... | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
MethodDeclaration |
jwt() {
// create authorization header with jwt token
let currentUser = JSON.parse(localStorage.getItem('currentUser'));
if (currentUser && currentUser.token) {
let headers = new Headers({ 'Authorization': currentUser.token });
return new RequestOptions({ headers: header... | thaddavis/CWILV3Cli | app/_services/test.service.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [RouterModule.forChild(sourceRoutes)],
exports: [RouterModule]
})
export class SourcesRoutingModule {} | DOSSIER-dev/DOSSIER-Sources | src/app/sources/sources-routing.module.ts | TypeScript |
ArrowFunction |
({ entityName }: $BuilderProps) => {
let history = useNavigate();
const systemDbName = useSelector(selectDBName);
const system = useSelector((state: RootState) => state.system);
const [entityObj, onEdit] = useState<IEntity>();
useEffect(() => {
let newObj: string = "{";
getEntityAttributes(system, e... | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
ArrowFunction |
(state: RootState) => state.system | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
ArrowFunction |
() => {
let newObj: string = "{";
getEntityAttributes(system, entityName).forEach((attr: string) => {
newObj += `"${attr}": "",`;
});
newObj = newObj.slice(0, -1) + "}";
console.log(newObj);
onEdit(JSON.parse(newObj));
} | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
ArrowFunction |
(attr: string) => {
newObj += `"${attr}": "",`;
} | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
ArrowFunction |
() => {
if (entityObj) {
let newEntity = { ...entityObj };
delete newEntity.id;
createNewWithId(systemDbName, entityName, newEntity, (id: number) => {
history(`/${entityName}-detail/${id}`);
toaster.push(
<Notification header={"Success"} type="success">
Succ... | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
ArrowFunction |
(id: number) => {
history(`/${entityName}-detail/${id}`);
toaster.push(
<Notification header={"Success"} type="success">
Success: Created new {entityName} named {newEntity.name}.
</Notification>,
{ placement: "bottomStart" }
);
} | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
InterfaceDeclaration |
interface $BuilderProps {
entityName: string;
} | DarthAmun/pnptome | src/components/generic/details/EntityBuilder.tsx | TypeScript |
ArrowFunction |
(
props: TopLoadingBarPropsInterface
): ReactElement => {
const {
height,
visibility,
[ "data-testid" ]: testId
} = props;
const [ loaderRef, setLoaderRef ] = useState(null);
useEffect(() => {
if (!loaderRef) {
return;
}
if (visibility)... | Anandi-K/identity-apps | modules/react-components/src/components/loader/top-loading-bar.tsx | TypeScript |
ArrowFunction |
() => {
if (!loaderRef) {
return;
}
if (visibility) {
loaderRef.continuousStart();
return;
}
loaderRef.complete();
} | Anandi-K/identity-apps | modules/react-components/src/components/loader/top-loading-bar.tsx | TypeScript |
InterfaceDeclaration | /**
* Top loading bar component Prop types.
*/
export interface TopLoadingBarPropsInterface extends TestableComponentInterface {
/**
* Height of the loading bar.
*/
height?: number;
/**
* If the loader is visible or not.
*/
visibility?: boolean;
} | Anandi-K/identity-apps | modules/react-components/src/components/loader/top-loading-bar.tsx | TypeScript |
ArrowFunction |
({ level, message, timestamp, stack }) => {
if (stack) {
return `${timestamp} - [${level}] : ${message} \n ${stack}`;
}
return `${timestamp} - [${level}] : ${message}`;
} | nenadfilipovic/iot-dashboard | services/device/src/utils/logger.ts | TypeScript |
ClassDeclaration |
export class TaskStatusValidationPipe implements PipeTransform {
readonly allowedStatuses = [
TaskStatus.OPEN,
TaskStatus.IN_PROGRESS,
TaskStatus.DONE
];
transform(value: any) {
value = value.toUpperCase();
if (!this._isValidStatus(value)) {
throw new BadRequestException(`$... | japoneizz/nestJs | src/tasks/pipes/task.status.validation.pipe.ts | TypeScript |
MethodDeclaration |
transform(value: any) {
value = value.toUpperCase();
if (!this._isValidStatus(value)) {
throw new BadRequestException(`${value} is not a valid status`);
}
return value;
} | japoneizz/nestJs | src/tasks/pipes/task.status.validation.pipe.ts | TypeScript |
MethodDeclaration |
private _isValidStatus(status: any) {
const idx = this.allowedStatuses.indexOf(status);
return idx !== -1;
} | japoneizz/nestJs | src/tasks/pipes/task.status.validation.pipe.ts | TypeScript |
ArrowFunction |
(h: IconHelper, props: ISvgIconProps) => (
<svg
width={props.size} | Mu-L/IconPark | packages/vue/src/icons/SandwichOne.tsx | TypeScript |
ClassDeclaration |
@Directive({
selector: '[appToggleFullscreen]'
})
export class ToggleFullscreenDirective {
@HostListener('click') onClick() {
return true;
// if (screenfull.enabled) {
// screenfull.toggle();
// }
}
} | mmercan/sentinel | Sentinel.UI.Admin/src/app/shared/fullscreen/toggle-fullscreen.directive.ts | TypeScript |
MethodDeclaration |
@HostListener('click') onClick() {
return true;
// if (screenfull.enabled) {
// screenfull.toggle();
// }
} | mmercan/sentinel | Sentinel.UI.Admin/src/app/shared/fullscreen/toggle-fullscreen.directive.ts | TypeScript |
FunctionDeclaration |
export async function checkExplorerForDefaultRegion(
profileName: string,
awsContext: AwsContext,
awsExplorer: AwsExplorer
): Promise<void> {
const profileRegion = awsContext.getCredentialDefaultRegion()
const explorerRegions = new Set(await awsContext.getExplorerRegions())
if (explorerRegions... | JadenSimon/aws-toolkit-vscode | src/awsexplorer/defaultRegion.ts | TypeScript |
ArrowFunction |
item => {
return {
label: item,
}
} | JadenSimon/aws-toolkit-vscode | src/awsexplorer/defaultRegion.ts | TypeScript |
ClassDeclaration |
class DefaultRegionMissingPromptItems {
public static readonly add: string = localizedText.yes
public static readonly alwaysAdd: string = localize(
'AWS.message.prompt.defaultRegionHidden.alwaysAdd',
"Yes, and don't ask again"
)
public static readonly ignore: string = localizedText.no
... | JadenSimon/aws-toolkit-vscode | src/awsexplorer/defaultRegion.ts | TypeScript |
EnumDeclaration | /**
* The actions that can be taken when we discover that a profile's default region is not
* showing in the Explorer.
*
* Keep this in sync with the onDefaultRegionMissing configuration defined in package.json.
*/
enum OnDefaultRegionMissingOperation {
/**
* Ask the user what they would like to happen
... | JadenSimon/aws-toolkit-vscode | src/awsexplorer/defaultRegion.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class Alumno extends GenericServicesService {
constructor(private http: HttpClient) {super(http); }
getAlumno(id): Observable<IAlumnos[]> {
return this.http.get<IAlumnos[]>(GenericServicesService.API_ENDPOINT + 'ProyectoAlumno/' + id, GenericServicesService.HEADERS);
}
} | EddyChavez/PAAE | src/app/views/residencias/maestros/alumno.ts | TypeScript |
MethodDeclaration |
getAlumno(id): Observable<IAlumnos[]> {
return this.http.get<IAlumnos[]>(GenericServicesService.API_ENDPOINT + 'ProyectoAlumno/' + id, GenericServicesService.HEADERS);
} | EddyChavez/PAAE | src/app/views/residencias/maestros/alumno.ts | TypeScript |
ArrowFunction |
(
callsiteError: Error,
opts: TestOptions,
callback?: TestCallback,
) => {
this.registerTest(callsiteError, opts, callback);
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ArrowFunction |
(frame, i) => {
if (
frame.typeName === 'global' &&
frame.methodName === undefined &&
frame.functionName === undefined
) {
// We are the global.<anonymous> frame
// Now check for Script.runInContext
const nextFrame = frames[i +... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ArrowFunction |
frame => {
return (
frame.filename !== undefined &&
frame.filename.includes('core/test-worker')
);
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ArrowFunction |
() => {
throw new Error("Promise wasn't created. Should be impossible.");
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
onTimeout = (time: number) => {
reject(new Error(`Test timeout - exceeded ${String(time)}ms`));
};
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ArrowFunction |
(time: number) => {
reject(new Error(`Test timeout - exceeded ${String(time)}ms`));
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ArrowFunction |
() => {
promises.delete(promise);
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration | // Global variables to expose to tests
getEnvironment(): UnknownObject {
const testOptions: GlobalTestOptions = {
dirname: this.file.real.getParent().join(),
register: (
callsiteError: Error,
opts: TestOptions,
callback?: TestCallback,
) => {
this.registerTest(call... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
async emitDiagnostic(diagnostic: PartialDiagnostic) {
await this.bridge.testError.call({
ref: undefined,
diagnostic,
});
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration | // execute the test file and discover tests
async discoverTests() {
const {code, sourceMap} = this.opts;
const res = await executeMain({
path: this.file.real,
code,
sourceMap,
globals: this.getEnvironment(),
});
if (res.syntaxError !== undefined) {
const message = `A bund... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
lockTests() {
this.locked = true;
} | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
registerTest(
callsiteError: Error,
options: TestOptions,
callback: undefined | TestCallback,
) {
if (this.locked) {
throw new Error("Test can't be added outside of init");
}
let testName = options.name;
if (Array.isArray(testName)) {
testName = testName.join(' > ');
}
... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
onError(
testName: undefined | string,
opts: {
error: Error;
firstAdvice: PartialDiagnosticAdvice;
lastAdvice: PartialDiagnosticAdvice;
},
) {
const filename = this.file.real.join();
let ref = undefined;
if (testName === undefined) {
testName = 'unknown';
} else {... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
cleanFrames(frames) {
// TODO we should actually get the frames before module init and do it that way
// Remove everything before the original module factory
let latestTestWorkerFrame = frames.find((frame, i) => {
if (
frame.typeName === 'global' &&
frame.meth... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
async teardownTest(testName: string, api: TestAPI) {
api.clearTimeout();
try {
await api.teardownEvent.callOptional();
} catch (err) {
this.onError(testName, {
error: err,
firstAdvice: [],
lastAdvice: [
{
type: 'log',
category: 'info',
... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
async runTest(testName: string, callback: TestCallback) {
let onTimeout: OnTimeout = () => {
throw new Error("Promise wasn't created. Should be impossible.");
};
const timeoutPromise = new Promise((resolve, reject) => {
onTimeout = (time: number) => {
reject(new Error(`Test timeout - e... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
async runTests(): Promise<void> {
const promises: Set<Promise<void>> = new Set();
// Execute all the tests
for (const [testName, {options, callback}] of this.foundTests) {
if (callback === undefined) {
continue;
}
this.bridge.testStart.send({
ref: {
filename: t... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
async emitFoundTests() {
const promises: Array<Promise<void>> = [];
for (const [testName, {callback, options}] of this.foundTests) {
let isSkipped = callback === undefined;
if (this.hasFocusedTest && options.only !== true) {
isSkipped = true;
}
promises.push(
this.brid... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
MethodDeclaration |
async run(): Promise<void> {
try {
// Setup
await this.snapshotManager.load();
await this.discoverTests();
await this.emitFoundTests();
// Execute
this.lockTests();
await this.runTests();
} catch (err) {
const diagnostics = getDiagnosticsFromError(err);
if... | I2olanD/rome | packages/@romejs/core/test-worker/TestWorkerRunner.ts | TypeScript |
ClassDeclaration |
export class DDPParticipantInformation {
constructor(public dob: string, public dateOfDiagnosis: string, public drawBloodConsent: number, public tissueSampleConsent: number,
public institutions: Array<DDPInstitutionInformation>) {
this.dob = dob;
this.dateOfDiagnosis = dateOfDiagnosis;
thi... | broadinstitute/ddp-study-manager-ui | src/app/participant-page/participant-page.model.ts | TypeScript |
ClassDeclaration |
export class DDPInstitutionInformation {
constructor(public type: string, public id: string, public physician: string,
public institution: string, public streetAddress: string, public city: string, public state: string) {
this.type = type;
this.id = id;
this.physician = physician;
this... | broadinstitute/ddp-study-manager-ui | src/app/participant-page/participant-page.model.ts | TypeScript |
MethodDeclaration |
static parse(json): DDPParticipantInformation {
return new DDPParticipantInformation(json.dob, json.dateOfDiagnosis, json.drawBloodConsent, json.tissueSampleConsent,
json.institutions);
} | broadinstitute/ddp-study-manager-ui | src/app/participant-page/participant-page.model.ts | TypeScript |
ClassDeclaration | /**
* Our custom product editor type
*/
@Serenity.Decorators.registerEditor()
export class ChangingLookupTextEditor extends Serenity.LookupEditorBase<Serenity.LookupEditorOptions, Northwind.ProductRow> {
constructor(container: JQuery, options: Serenity.LookupEditorOptions) {
sup... | pratikto/MultiTenancy | MultiTenancy/MultiTenancy.Web/Modules/BasicSamples/Editors/ChangingLookupText/ChangingLookupTextEditor.ts | TypeScript |
MethodDeclaration |
protected getLookupKey() {
return Northwind.ProductRow.lookupKey;
} | pratikto/MultiTenancy | MultiTenancy/MultiTenancy.Web/Modules/BasicSamples/Editors/ChangingLookupText/ChangingLookupTextEditor.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.