type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
---|---|---|---|---|
ArrowFunction |
async connection => {
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
await connection.manager.save(category2);
const post1 = new Post();
post1.title = "About BMW";
post1.categoryWithOptions = category1;
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Boeing";
post2.categoryWithOptions = category2;
await connection.manager.save(post2);
const loadedPosts = await connection.manager
.createQueryBuilder(Post, "post")
.leftJoinAndSelect("post.categoryWithOptions", "category")
.orderBy("post.id")
.getMany();
expect(loadedPosts[0].categoryWithOptions).to.not.be.empty;
expect(loadedPosts[0].categoryWithOptions.name).to.be.equal("cars");
expect(loadedPosts[0].categoryWithOptions.type).to.be.equal("common-category");
expect(loadedPosts[1].categoryWithOptions).to.not.be.empty;
expect(loadedPosts[1].categoryWithOptions.name).to.be.equal("airplanes");
expect(loadedPosts[1].categoryWithOptions.type).to.be.equal("common-category");
const loadedPost = await connection.manager
.createQueryBuilder(Post, "post")
.leftJoinAndSelect("post.categoryWithOptions", "category")
.where("post.id = :id", {id: 1})
.getOne();
expect(loadedPost!.categoryWithOptions).to.not.be.empty;
expect(loadedPost!.categoryWithOptions.name).to.be.equal("cars");
expect(loadedPost!.categoryWithOptions.type).to.be.equal("common-category");
} | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
() => Promise.all(connections.map(async connection => {
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.description = "category about cars";
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.description = "category about airplanes";
await connection.manager.save(category2);
const post1 = new Post();
post1.title = "About BMW";
post1.categoryWithNonPrimaryColumns = category1;
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Boeing";
post2.categoryWithNonPrimaryColumns = category2;
await connection.manager.save(post2);
const loadedPosts = await connection.manager
.createQueryBuilder(Post, "post")
.leftJoinAndSelect("post.categoryWithNonPrimaryColumns", "category")
.orderBy("post.id")
.getMany();
expect(loadedPosts[0].categoryWithNonPrimaryColumns).to.not.be.empty;
expect(loadedPosts[0].categoryWithNonPrimaryColumns.code).to.be.equal(1);
expect(loadedPosts[0].categoryWithNonPrimaryColumns.version).to.be.equal(1);
expect(loadedPosts[0].categoryWithNonPrimaryColumns.description).to.be.equal("category about cars");
expect(loadedPosts[1].categoryWithNonPrimaryColumns).to.not.be.empty;
expect(loadedPosts[1].categoryWithNonPrimaryColumns.code).to.be.equal(2);
expect(loadedPosts[1].categoryWithNonPrimaryColumns.version).to.be.equal(1);
const loadedPost = await connection.manager
.createQueryBuilder(Post, "post")
.leftJoinAndSelect("post.categoryWithNonPrimaryColumns", "category")
.where("post.id = :id", {id: 1})
.getOne();
expect(loadedPost!.categoryWithNonPrimaryColumns).to.not.be.empty;
expect(loadedPost!.categoryWithNonPrimaryColumns.code).to.be.equal(1);
expect(loadedPost!.categoryWithNonPrimaryColumns.version).to.be.equal(1);
expect(loadedPost!.categoryWithNonPrimaryColumns.description).to.be.equal("category about cars");
})) | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
async connection => {
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.description = "category about cars";
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.description = "category about airplanes";
await connection.manager.save(category2);
const post1 = new Post();
post1.title = "About BMW";
post1.categoryWithNonPrimaryColumns = category1;
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Boeing";
post2.categoryWithNonPrimaryColumns = category2;
await connection.manager.save(post2);
const loadedPosts = await connection.manager
.createQueryBuilder(Post, "post")
.leftJoinAndSelect("post.categoryWithNonPrimaryColumns", "category")
.orderBy("post.id")
.getMany();
expect(loadedPosts[0].categoryWithNonPrimaryColumns).to.not.be.empty;
expect(loadedPosts[0].categoryWithNonPrimaryColumns.code).to.be.equal(1);
expect(loadedPosts[0].categoryWithNonPrimaryColumns.version).to.be.equal(1);
expect(loadedPosts[0].categoryWithNonPrimaryColumns.description).to.be.equal("category about cars");
expect(loadedPosts[1].categoryWithNonPrimaryColumns).to.not.be.empty;
expect(loadedPosts[1].categoryWithNonPrimaryColumns.code).to.be.equal(2);
expect(loadedPosts[1].categoryWithNonPrimaryColumns.version).to.be.equal(1);
const loadedPost = await connection.manager
.createQueryBuilder(Post, "post")
.leftJoinAndSelect("post.categoryWithNonPrimaryColumns", "category")
.where("post.id = :id", {id: 1})
.getOne();
expect(loadedPost!.categoryWithNonPrimaryColumns).to.not.be.empty;
expect(loadedPost!.categoryWithNonPrimaryColumns.code).to.be.equal(1);
expect(loadedPost!.categoryWithNonPrimaryColumns.version).to.be.equal(1);
expect(loadedPost!.categoryWithNonPrimaryColumns.description).to.be.equal("category about cars");
} | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
() => Promise.all(connections.map(async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.posts = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.posts = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.posts", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].posts).to.not.be.empty;
expect(loadedCategories[0].posts[0].id).to.be.equal(1);
expect(loadedCategories[0].posts[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].posts[1].id).to.be.equal(2);
expect(loadedCategories[0].posts[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].posts).to.not.be.empty;
expect(loadedCategories[1].posts[0].id).to.be.equal(3);
expect(loadedCategories[1].posts[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.posts", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.posts).to.not.be.empty;
expect(loadedCategory!.posts[0].id).to.be.equal(1);
expect(loadedCategory!.posts[0].title).to.be.equal("About BMW");
expect(loadedCategory!.posts[1].id).to.be.equal(2);
expect(loadedCategory!.posts[1].title).to.be.equal("About Audi");
})) | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.posts = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.posts = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.posts", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].posts).to.not.be.empty;
expect(loadedCategories[0].posts[0].id).to.be.equal(1);
expect(loadedCategories[0].posts[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].posts[1].id).to.be.equal(2);
expect(loadedCategories[0].posts[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].posts).to.not.be.empty;
expect(loadedCategories[1].posts[0].id).to.be.equal(3);
expect(loadedCategories[1].posts[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.posts", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.posts).to.not.be.empty;
expect(loadedCategory!.posts[0].id).to.be.equal(1);
expect(loadedCategory!.posts[0].title).to.be.equal("About BMW");
expect(loadedCategory!.posts[1].id).to.be.equal(2);
expect(loadedCategory!.posts[1].title).to.be.equal("About Audi");
} | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
() => Promise.all(connections.map(async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.postsWithEmptyJoinColumn = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.postsWithEmptyJoinColumn = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithEmptyJoinColumn", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].postsWithEmptyJoinColumn).to.not.be.empty;
expect(loadedCategories[0].postsWithEmptyJoinColumn[0].id).to.be.equal(1);
expect(loadedCategories[0].postsWithEmptyJoinColumn[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].postsWithEmptyJoinColumn[1].id).to.be.equal(2);
expect(loadedCategories[0].postsWithEmptyJoinColumn[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].postsWithEmptyJoinColumn).to.not.be.empty;
expect(loadedCategories[1].postsWithEmptyJoinColumn[0].id).to.be.equal(3);
expect(loadedCategories[1].postsWithEmptyJoinColumn[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithEmptyJoinColumn", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.postsWithEmptyJoinColumn).to.not.be.empty;
expect(loadedCategory!.postsWithEmptyJoinColumn[0].id).to.be.equal(1);
expect(loadedCategory!.postsWithEmptyJoinColumn[0].title).to.be.equal("About BMW");
expect(loadedCategory!.postsWithEmptyJoinColumn[1].id).to.be.equal(2);
expect(loadedCategory!.postsWithEmptyJoinColumn[1].title).to.be.equal("About Audi");
})) | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.postsWithEmptyJoinColumn = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.postsWithEmptyJoinColumn = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithEmptyJoinColumn", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].postsWithEmptyJoinColumn).to.not.be.empty;
expect(loadedCategories[0].postsWithEmptyJoinColumn[0].id).to.be.equal(1);
expect(loadedCategories[0].postsWithEmptyJoinColumn[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].postsWithEmptyJoinColumn[1].id).to.be.equal(2);
expect(loadedCategories[0].postsWithEmptyJoinColumn[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].postsWithEmptyJoinColumn).to.not.be.empty;
expect(loadedCategories[1].postsWithEmptyJoinColumn[0].id).to.be.equal(3);
expect(loadedCategories[1].postsWithEmptyJoinColumn[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithEmptyJoinColumn", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.postsWithEmptyJoinColumn).to.not.be.empty;
expect(loadedCategory!.postsWithEmptyJoinColumn[0].id).to.be.equal(1);
expect(loadedCategory!.postsWithEmptyJoinColumn[0].title).to.be.equal("About BMW");
expect(loadedCategory!.postsWithEmptyJoinColumn[1].id).to.be.equal(2);
expect(loadedCategory!.postsWithEmptyJoinColumn[1].title).to.be.equal("About Audi");
} | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
() => Promise.all(connections.map(async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.postsWithOptions = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.postsWithOptions = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithOptions", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].postsWithOptions).to.not.be.empty;
expect(loadedCategories[0].postsWithOptions[0].id).to.be.equal(1);
expect(loadedCategories[0].postsWithOptions[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].postsWithOptions[1].id).to.be.equal(2);
expect(loadedCategories[0].postsWithOptions[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].postsWithOptions).to.not.be.empty;
expect(loadedCategories[1].postsWithOptions[0].id).to.be.equal(3);
expect(loadedCategories[1].postsWithOptions[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithOptions", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.postsWithOptions).to.not.be.empty;
expect(loadedCategory!.postsWithOptions[0].id).to.be.equal(1);
expect(loadedCategory!.postsWithOptions[0].title).to.be.equal("About BMW");
expect(loadedCategory!.postsWithOptions[1].id).to.be.equal(2);
expect(loadedCategory!.postsWithOptions[1].title).to.be.equal("About Audi");
})) | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.postsWithOptions = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.postsWithOptions = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithOptions", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].postsWithOptions).to.not.be.empty;
expect(loadedCategories[0].postsWithOptions[0].id).to.be.equal(1);
expect(loadedCategories[0].postsWithOptions[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].postsWithOptions[1].id).to.be.equal(2);
expect(loadedCategories[0].postsWithOptions[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].postsWithOptions).to.not.be.empty;
expect(loadedCategories[1].postsWithOptions[0].id).to.be.equal(3);
expect(loadedCategories[1].postsWithOptions[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithOptions", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.postsWithOptions).to.not.be.empty;
expect(loadedCategory!.postsWithOptions[0].id).to.be.equal(1);
expect(loadedCategory!.postsWithOptions[0].title).to.be.equal("About BMW");
expect(loadedCategory!.postsWithOptions[1].id).to.be.equal(2);
expect(loadedCategory!.postsWithOptions[1].title).to.be.equal("About Audi");
} | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
() => Promise.all(connections.map(async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.description = "category of cars";
category1.postsWithNonPrimaryColumns = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.description = "category of airplanes";
category2.postsWithNonPrimaryColumns = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithNonPrimaryColumns", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].postsWithNonPrimaryColumns).to.not.be.empty;
expect(loadedCategories[0].postsWithNonPrimaryColumns[0].id).to.be.equal(1);
expect(loadedCategories[0].postsWithNonPrimaryColumns[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].postsWithNonPrimaryColumns[1].id).to.be.equal(2);
expect(loadedCategories[0].postsWithNonPrimaryColumns[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].postsWithNonPrimaryColumns).to.not.be.empty;
expect(loadedCategories[1].postsWithNonPrimaryColumns[0].id).to.be.equal(3);
expect(loadedCategories[1].postsWithNonPrimaryColumns[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithNonPrimaryColumns", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.postsWithNonPrimaryColumns).to.not.be.empty;
expect(loadedCategory!.postsWithNonPrimaryColumns[0].id).to.be.equal(1);
expect(loadedCategory!.postsWithNonPrimaryColumns[0].title).to.be.equal("About BMW");
expect(loadedCategory!.postsWithNonPrimaryColumns[1].id).to.be.equal(2);
expect(loadedCategory!.postsWithNonPrimaryColumns[1].title).to.be.equal("About Audi");
})) | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ArrowFunction |
async connection => {
const post1 = new Post();
post1.title = "About BMW";
await connection.manager.save(post1);
const post2 = new Post();
post2.title = "About Audi";
await connection.manager.save(post2);
const post3 = new Post();
post3.title = "About Boeing";
await connection.manager.save(post3);
const category1 = new Category();
category1.name = "cars";
category1.type = "common-category";
category1.code = 1;
category1.version = 1;
category1.description = "category of cars";
category1.postsWithNonPrimaryColumns = [post1, post2];
await connection.manager.save(category1);
const category2 = new Category();
category2.name = "airplanes";
category2.type = "common-category";
category2.code = 2;
category2.version = 1;
category2.description = "category of airplanes";
category2.postsWithNonPrimaryColumns = [post3];
await connection.manager.save(category2);
const loadedCategories = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithNonPrimaryColumns", "posts")
.orderBy("category.code, posts.id")
.getMany();
expect(loadedCategories[0].postsWithNonPrimaryColumns).to.not.be.empty;
expect(loadedCategories[0].postsWithNonPrimaryColumns[0].id).to.be.equal(1);
expect(loadedCategories[0].postsWithNonPrimaryColumns[0].title).to.be.equal("About BMW");
expect(loadedCategories[0].postsWithNonPrimaryColumns[1].id).to.be.equal(2);
expect(loadedCategories[0].postsWithNonPrimaryColumns[1].title).to.be.equal("About Audi");
expect(loadedCategories[1].postsWithNonPrimaryColumns).to.not.be.empty;
expect(loadedCategories[1].postsWithNonPrimaryColumns[0].id).to.be.equal(3);
expect(loadedCategories[1].postsWithNonPrimaryColumns[0].title).to.be.equal("About Boeing");
const loadedCategory = await connection.manager
.createQueryBuilder(Category, "category")
.leftJoinAndSelect("category.postsWithNonPrimaryColumns", "posts")
.orderBy("posts.id")
.where("category.code = :code", {code: 1})
.getOne();
expect(loadedCategory!.postsWithNonPrimaryColumns).to.not.be.empty;
expect(loadedCategory!.postsWithNonPrimaryColumns[0].id).to.be.equal(1);
expect(loadedCategory!.postsWithNonPrimaryColumns[0].title).to.be.equal("About BMW");
expect(loadedCategory!.postsWithNonPrimaryColumns[1].id).to.be.equal(2);
expect(loadedCategory!.postsWithNonPrimaryColumns[1].title).to.be.equal("About Audi");
} | hisamu/typeorm | test/functional/relations/multiple-primary-keys/multiple-primary-keys-many-to-one/multiple-primary-keys-many-to-one.ts | TypeScript |
ClassDeclaration |
export default class Utils {
static api = axios;
private static props: UtilsProps;
constructor(props: UtilsProps) {
}
static setNotice(options:NoticeOptions, onCloseCallback: ToastCallback) {
toast.custom("<div class='infobox'>Hello World</div>");
}
static clearNotice() {
toast.dismiss();
}
static sprintFormat(arrayArguments:Array<string>)
{
let baseUrl = this.props.smfVars.scriptUrl +
'?action={0};' + this.props.smfVars.session.var +'='+ this.props.smfVars.session.id + ';sa={1}';
let i = arrayArguments.length
while (i--) {
baseUrl = baseUrl.replace(new RegExp('\\{' + i + '\\}', 'gm'), arrayArguments[i]);
}
return baseUrl;
}
private static canUseLocalStorage()
{
let storage = window['localStorage']
try {
let x = 'breeze_storage_test';
storage.setItem(x, x);
storage.removeItem(x);
return true;
}
catch(e) {
return e instanceof DOMException && (
e.code === 22 ||
e.code === 1014 ||
e.name === 'QuotaExceededError' ||
e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
storage && storage.length !== 0;
}
}
setLocalObject(keyName:string, objectToStore:object)
{
if (!Utils.canUseLocalStorage()) {
return false;
}
localStorage.setItem(keyName, JSON.stringify(objectToStore));
return true;
}
getLocalObject(keyName:string)
{
if (!Utils.canUseLocalStorage()) {
return false;
}
let objectStored = JSON.parse(<string>localStorage.getItem(keyName));
if (objectStored !== null){
return objectStored;
} else {
return false;
}
}
decode(html:string)
{
let decoder = document.createElement('div');
decoder.innerHTML = html;
return decoder.textContent;
}
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
static setNotice(options:NoticeOptions, onCloseCallback: ToastCallback) {
toast.custom("<div class='infobox'>Hello World</div>");
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
static clearNotice() {
toast.dismiss();
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
static sprintFormat(arrayArguments:Array<string>)
{
let baseUrl = this.props.smfVars.scriptUrl +
'?action={0};' + this.props.smfVars.session.var +'='+ this.props.smfVars.session.id + ';sa={1}';
let i = arrayArguments.length
while (i--) {
baseUrl = baseUrl.replace(new RegExp('\\{' + i + '\\}', 'gm'), arrayArguments[i]);
}
return baseUrl;
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
private static canUseLocalStorage()
{
let storage = window['localStorage']
try {
let x = 'breeze_storage_test';
storage.setItem(x, x);
storage.removeItem(x);
return true;
}
catch(e) {
return e instanceof DOMException && (
e.code === 22 ||
e.code === 1014 ||
e.name === 'QuotaExceededError' ||
e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
storage && storage.length !== 0;
}
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
setLocalObject(keyName:string, objectToStore:object)
{
if (!Utils.canUseLocalStorage()) {
return false;
}
localStorage.setItem(keyName, JSON.stringify(objectToStore));
return true;
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
getLocalObject(keyName:string)
{
if (!Utils.canUseLocalStorage()) {
return false;
}
let objectStored = JSON.parse(<string>localStorage.getItem(keyName));
if (objectStored !== null){
return objectStored;
} else {
return false;
}
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
MethodDeclaration |
decode(html:string)
{
let decoder = document.createElement('div');
decoder.innerHTML = html;
return decoder.textContent;
} | MissAllSunday/Breeze | src/Utils.ts | TypeScript |
ArrowFunction |
({ value, status }: Props) => {
const classes = classnames(
'w-10 h-10 border-solid border-2 flex items-center justify-center mx-0.5 text-lg font-bold rounded dark:text-white',
{
'bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-600':
!status,
'border-black dark:border-slate-100': value && !status,
'bg-slate-400 dark:bg-slate-700 text-white border-slate-400 dark:border-slate-700':
status === 'absent',
'bg-green-500 text-white border-green-500': status === 'correct',
'bg-orange-500 dark:bg-orange-700 text-white border-orange-500 dark:border-orange-700':
status === 'present',
'cell-animation': !!value,
}
)
return <div className={classes}>{value}</div>
} | ivandesh/word-guessing-game | src/components/grid/Cell.tsx | TypeScript |
TypeAliasDeclaration |
type Props = {
value?: string
status?: CharStatus
} | ivandesh/word-guessing-game | src/components/grid/Cell.tsx | TypeScript |
FunctionDeclaration |
export function RequestPopup(props: RequestPopupProps) {
function handleDecline(){ props.handleOption(PopupPermission.Declined) }
function handleProceed(){ props.handleOption(PopupPermission.Proceed) }
return (
<Modal isOpen={props.isOpen} size={'lg'} onClose={handleDecline}>
<ModalOverlay />
<ModalContent>
<ModalHeader>Please click proceed to allow signing popup</ModalHeader>
<ModalCloseButton />
<ModalBody>
<HStack>
<Button onClick={handleDecline} style={{ margin: "" }} | scottbolasevich/aphnft.com | src/RequestPopup.tsx | TypeScript |
FunctionDeclaration |
function handleDecline(){ props.handleOption(PopupPermission.Declined) } | scottbolasevich/aphnft.com | src/RequestPopup.tsx | TypeScript |
FunctionDeclaration |
function handleProceed(){ props.handleOption(PopupPermission.Proceed) } | scottbolasevich/aphnft.com | src/RequestPopup.tsx | TypeScript |
ArrowFunction |
(PopupPermission): void => {} | scottbolasevich/aphnft.com | src/RequestPopup.tsx | TypeScript |
EnumDeclaration |
export enum PopupPermission {
Proceed=1,
Declined=2,
Undecided=3
} | scottbolasevich/aphnft.com | src/RequestPopup.tsx | TypeScript |
TypeAliasDeclaration |
export type RequestPopupProps = {
isOpen: boolean
handleOption(PopupPermission)
}; | scottbolasevich/aphnft.com | src/RequestPopup.tsx | TypeScript |
ArrowFunction |
() => {
const exporter = new Exporter({
rootPath: path.resolve(__dirname, '.temp'),
})
beforeAll(async () => {
setupJoplinConfig()
await remove(exporter.config.rootPath)
await mkdirp(exporter.config.rootPath)
})
it('测试 folder', async () => {
const folderList = await exporter.listFolder()
console.log('folderList: ', folderList)
await exporter.writeFolder(folderList)
})
it('测试 notes', async () => {
const folderList = await exporter.listFolder()
const noteList = await exporter.listNote(folderList)
console.log(
'noteList: ',
noteList.map((item) => item.filePath),
)
await exporter.writeNote(noteList)
})
it('测试 resource', async () => {
const resourceList = await exporter.listResource()
console.log('resourceList: ', resourceList)
await exporter.writeResource(resourceList)
})
it('测试 tag', async () => {
const { tagList, noteTagRelationList } = await exporter.tag()
console.log('tagList: ', tagList, noteTagRelationList)
})
it('测试 export', async () => {
await exporter.export()
})
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
async () => {
setupJoplinConfig()
await remove(exporter.config.rootPath)
await mkdirp(exporter.config.rootPath)
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
async () => {
const folderList = await exporter.listFolder()
console.log('folderList: ', folderList)
await exporter.writeFolder(folderList)
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
async () => {
const folderList = await exporter.listFolder()
const noteList = await exporter.listNote(folderList)
console.log(
'noteList: ',
noteList.map((item) => item.filePath),
)
await exporter.writeNote(noteList)
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
(item) => item.filePath | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
async () => {
const resourceList = await exporter.listResource()
console.log('resourceList: ', resourceList)
await exporter.writeResource(resourceList)
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
async () => {
const { tagList, noteTagRelationList } = await exporter.tag()
console.log('tagList: ', tagList, noteTagRelationList)
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
async () => {
await exporter.export()
} | Daeraxa/joplin-utils | apps/joplin-plugin-backup-prettier/src/core/__tests__/Exporter.test.ts | TypeScript |
ArrowFunction |
(
chat: Chat,
overWriteInfos: string[],
useOverWriteArray: boolean,
c: string,
infos: string[],
custom: boolean
) => {
let master = "";
console.log(infos, useOverWriteArray, overWriteInfos);
if (useOverWriteArray && overWriteInfos.length) {
overWriteInfos.forEach((v, idx) => {
if (chat.classes.length > 1 && !chat.classes.includes("BMTL21a")) {
master +=
v +
"[" +
c +
"]" +
(idx < overWriteInfos.length - 1 ? "\n----------\n" : "");
} else {
master += v + (idx < overWriteInfos.length - 1 ? "\n----------\n" : "");
}
});
sendMessage(chat.chat, master);
} else {
if (infos.length) {
infos.forEach((v, idx) => {
if (chat.classes.length > 1 && !chat.classes.includes("BMTL21a")) {
master +=
v +
"[" +
c +
"]" +
(idx < infos.length - 1 ? "\n----------\n" : "");
} else {
master += v + (idx < infos.length - 1 ? "\n----------\n" : "");
}
});
sendMessage(chat.chat, master);
} else if (custom) {
sendMessage(chat.chat, "no lessons, enjoy your free time");
}
}
} | janic0/BZWUTimetable | src/helpers/sendInfos.ts | TypeScript |
ArrowFunction |
(v, idx) => {
if (chat.classes.length > 1 && !chat.classes.includes("BMTL21a")) {
master +=
v +
"[" +
c +
"]" +
(idx < overWriteInfos.length - 1 ? "\n----------\n" : "");
} else {
master += v + (idx < overWriteInfos.length - 1 ? "\n----------\n" : "");
}
} | janic0/BZWUTimetable | src/helpers/sendInfos.ts | TypeScript |
ArrowFunction |
(v, idx) => {
if (chat.classes.length > 1 && !chat.classes.includes("BMTL21a")) {
master +=
v +
"[" +
c +
"]" +
(idx < infos.length - 1 ? "\n----------\n" : "");
} else {
master += v + (idx < infos.length - 1 ? "\n----------\n" : "");
}
} | janic0/BZWUTimetable | src/helpers/sendInfos.ts | TypeScript |
FunctionDeclaration |
function CardTestUser() {
return (
<Link href="/test-usuario">
<section className="section-test-user">
<div className="content-line-text">
<h2 className="subtitle-test-user">Test para Usuarios</h2>
<span className="line-test-user"></span>
</div>
<img className="image-test-user" src={ImageTestUser} alt="" />
<p className="description-test-user-card">
Haz el test para usuarios, así podrás empezar a tener match con
distintos proyectos, contesta con honestidad para asegurar un mejor
resultado con respecto a tus gustos.
</p>
</section>
</Link>
)
} | AstralCam/FaztCommunityMatch | src/components/molecules/tests/CardTestUser.tsx | TypeScript |
FunctionDeclaration |
async function emulateLocale(session: CRSession, locale: string) {
try {
await session.send('Emulation.setLocaleOverride', { locale });
} catch (exception) {
// All pages in the same renderer share locale. All such pages belong to the same
// context and if locale is overridden for one of them its value is the same as
// we are trying to set so it's not a problem.
if (exception.message.includes('Another locale override is already in effect'))
return;
throw exception;
}
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
FunctionDeclaration |
async function emulateTimezone(session: CRSession, timezoneId: string) {
try {
await session.send('Emulation.setTimezoneOverride', { timezoneId: timezoneId });
} catch (exception) {
if (exception.message.includes('Timezone override is already in effect'))
return;
if (exception.message.includes('Invalid timezone'))
throw new Error(`Invalid timezone ID: ${timezoneId}`);
throw exception;
}
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
() => this._page._didDisconnect() | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
async r => {
await this._page.initOpener(this._opener);
return r;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
async e => {
await this._page.initOpener(this._opener);
throw e;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
() => {
this._initializedPage = this._page;
this._reportAsNew();
return this._page;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
e => {
this._reportAsNew(e);
return e;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frameSession => {
if (frameSession._isMainFrame())
return cb(frameSession);
return cb(frameSession).catch(e => {
// Broadcasting a message to the closed iframe shoule be a noop.
if (e.message && (e.message.includes('Target closed.') || e.message.includes('Session closed.')))
return;
throw e;
});
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
e => {
// Broadcasting a message to the closed iframe shoule be a noop.
if (e.message && (e.message.includes('Target closed.') || e.message.includes('Session closed.')))
return;
throw e;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._initBinding(binding) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame.evaluateExpression(binding.source, false, {}).catch(e => {}) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
e => {} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._removeExposedBindings() | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateExtraHTTPHeaders(false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateGeolocation(false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateOffline(false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateHttpCredentials(false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateEmulateMedia(false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateRequestInterception() | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._updateFileChooserInterception(false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._evaluateOnNewDocument(source, world) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
frame => frame._removeEvaluatesOnNewDocument() | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
([injected, node, files]) =>
injected.setInputFiles(node, files) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
e => {
if (e instanceof Error && e.message.includes('Frame with the given id was not found.'))
rewriteErrorMessage(e, 'Frame has been detached.');
throw e;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
(e: Error) => {} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
(f, r) => {
this._firstNonInitialNavigationCommittedFulfill = f;
this._firstNonInitialNavigationCommittedReject = r;
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
() => {
this._firstNonInitialNavigationCommittedReject(new Error('Page closed'));
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onLogEntryAdded(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFileChooserOpened(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFrameAttached(event.frameId, event.parentFrameId) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFrameDetached(event.frameId, event.reason) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFrameNavigated(event.frame, false) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFrameRequestedNavigation(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFrameStoppedLoading(event.frameId) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onDialog(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onFrameNavigatedWithinDocument(event.frameId, event.url) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onBindingCalled(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onConsoleAPI(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
exception => this._handleException(exception.exceptionDetails) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onExecutionContextCreated(event.context) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onExecutionContextDestroyed(event.executionContextId) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onExecutionContextsCleared() | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onAttachedToTarget(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onDetachedFromTarget(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onTargetCrashed() | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onScreencastFrame(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onWindowOpen(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
p => {
if (p instanceof Error)
this._stopVideoRecording().catch(() => {});
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
({ frameTree }) => {
if (this._isMainFrame()) {
this._handleFrameTree(frameTree);
this._addRendererListeners();
}
const localFrames = this._isMainFrame() ? this._page.frames() : [ this._page._frameManager.frame(this._targetId)! ];
for (const frame of localFrames) {
// Note: frames might be removed before we send these.
this._client._sendMayFail('Page.createIsolatedWorld', {
frameId: frame._id,
grantUniveralAccess: true,
worldName: UTILITY_WORLD_NAME,
});
for (const binding of this._crPage._browserContext._pageBindings.values())
frame.evaluateExpression(binding.source, false, undefined).catch(e => {});
for (const source of this._crPage._browserContext.initScripts)
frame.evaluateExpression(source, false, undefined, 'main').catch(e => {});
}
const isInitialEmptyPage = this._isMainFrame() && this._page.mainFrame().url() === ':';
if (isInitialEmptyPage) {
// Ignore lifecycle events for the initial empty page. It is never the final page
// hence we are going to get more lifecycle updates after the actual navigation has
// started (even if the target url is about:blank).
lifecycleEventsEnabled.catch(e => {}).then(() => {
this._eventListeners.push(eventsHelper.addEventListener(this._client, 'Page.lifecycleEvent', event => this._onLifecycleEvent(event)));
});
} else {
this._firstNonInitialNavigationCommittedFulfill();
this._eventListeners.push(eventsHelper.addEventListener(this._client, 'Page.lifecycleEvent', event => this._onLifecycleEvent(event)));
}
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
() => {
this._eventListeners.push(eventsHelper.addEventListener(this._client, 'Page.lifecycleEvent', event => this._onLifecycleEvent(event)));
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => this._onLifecycleEvent(event) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
() => {
this._client._sendMayFail('Target.detachFromTarget', { sessionId: event.sessionId });
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
async event => {
worker._createExecutionContext(new CRExecutionContext(session, event.context));
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
event => {
const args = event.args.map(o => worker._existingExecutionContext!.createHandle(o));
this._page._addConsoleMessage(event.type, args, toConsoleMessageLocation(event.stackTrace));
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
o => worker._existingExecutionContext!.createHandle(o) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
exception => this._page.emit(Page.Events.PageError, exceptionToError(exception.exceptionDetails)) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
e => null | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
() => {
// Child was not swapped in - that means frameAttached did not happen and
// this is remote detach rather than remote -> local swap.
if (!childFrameSession._swappedIn)
this._page._frameManager.frameDetached(event.targetId!);
childFrameSession.dispose();
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
arg => context.createHandle(arg) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
name => this._client.send('Runtime.removeBinding', { name }) | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
ArrowFunction |
async (accept: boolean, promptText?: string) => {
await this._client.send('Page.handleJavaScriptDialog', { accept, promptText });
} | kisscelia/playwright | packages/playwright-core/src/server/chromium/crPage.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.