type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
override async roomMemberRawPayload (roomId: string, contactId: string) : Promise<any> { return { contactId, roomId } as any } | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration |
override async roomMemberRawPayloadParser (rawPayload: any) : Promise<PUPPET.payloads.RoomMember> { return rawPayload } | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration | /**
* expose to public for internal methods:
*/
override messageQueryFilterFactory (
query: PUPPET.filters.Message,
): MessagePayloadFilterFunction {
return super.messageQueryFilterFactory(query)
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration |
override roomQueryFilterFactory (
query: PUPPET.filters.Room,
): RoomPayloadFilterFunction {
return super.roomQueryFilterFactory(query)
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration |
override contactQueryFilterFactory (
query: PUPPET.filters.Contact,
): ContactPayloadFilterFunction {
return super.contactQueryFilterFactory(query)
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration | /**
* Posts
*/
override async postRawPayload (postId: string): Promise<any> {
return { postId } as any
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration |
override async postRawPayloadParser (rawPayload: any) : Promise<PUPPET.payloads.Post> {
return { rawPayload } as any
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration |
override postSearch (
query : PUPPET.filters.Post,
pagination? : PUPPET.filters.PaginationRequest,
): Promise<PUPPET.filters.PaginationResponse<string[]>> {
return { pagination, query } as any
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration |
override postPublish (payload: PUPPET.payloads.Post): Promise<void | string> {
return { payload } as any
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration | /**
* Tap
*/
override tap (
postId : string,
type? : PUPPET.types.Tap,
tap? : boolean,
): Promise<void | boolean> {
return { postid: postId, tap, type } as any
} | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
MethodDeclaration | /**
* Search for taps for a post
*
* @param query
* @param pagination
*/
override tapSearch (
postId : string,
query? : PUPPET.filters.Tap,
pagination? : PUPPET.filters.PaginationRequest,
): Promise<PUPPET.filters.PaginationResponse<PUPPET.payloads.Tap>> {
return { pagination,... | hcfw007/puppet | tests/fixtures/puppet-test/puppet-test.ts | TypeScript |
FunctionDeclaration |
export default function OmniContainer() {
const showOmni = useRef<boolean>();
const modalRef = useRef<HTMLDivElement>(null);
const [showModal, setShowModal] = useState(false);
const handleLogEvent = (show: boolean) =>
logEvent(LOG_ACTIONS_OMNIBAR_TRIGGERED, {
show_omni: show,
});
const handleCl... | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
FunctionDeclaration |
function handleKeydown(event: KeyboardEvent) {
if (!isFeatureEnabled(FeatureFlag.OMNIBAR)) return;
const controlOrCommand = event.ctrlKey || event.metaKey;
const isOk = ['KeyK'].includes(event.code);
const isEsc = event.key === 'Escape';
if (isEsc && showOmni.current) {
handleClo... | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
FunctionDeclaration |
function handleClickOutside(event: MouseEvent) {
if (
modalRef.current &&
!modalRef.current.contains(event.target as Node)
) {
handleClose();
}
} | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
ArrowFunction |
(show: boolean) =>
logEvent(LOG_ACTIONS_OMNIBAR_TRIGGERED, {
show_omni: show,
}) | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
ArrowFunction |
() => {
showOmni.current = false;
setShowModal(false);
handleLogEvent(false);
} | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
ArrowFunction |
() => {
showOmni.current = false;
function handleKeydown(event: KeyboardEvent) {
if (!isFeatureEnabled(FeatureFlag.OMNIBAR)) return;
const controlOrCommand = event.ctrlKey || event.metaKey;
const isOk = ['KeyK'].includes(event.code);
const isEsc = event.key === 'Escape';
if (isE... | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
ArrowFunction |
() => {
document.removeEventListener('keydown', handleKeydown);
document.removeEventListener('mousedown', handleClickOutside);
} | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
MethodDeclaration |
t('Search all dashboards') | choice-form/superset | superset-frontend/src/components/OmniContainer/index.tsx | TypeScript |
ArrowFunction |
(props: IconProps) => (
<svg viewBox="0 0 448 512" | rkonings/react-ui | src/Icon/DrawPolygon.tsx | TypeScript |
InterfaceDeclaration |
export interface AppState {
authentication: AuthenticationState
cart: CartState
http: HttpState
orders: OrdersState
products: ProductsState
} | PeterAsenov22/Pizza-Lab-Angular | pizza-lab-angular-app/src/app/core/store/app.state.ts | TypeScript |
FunctionDeclaration |
export async function asset(entry: AlbumEntry): Promise<string> {
if (isVideo(entry)) {
// Send the video pack as-is
const path = join(imagesRoot, entry.album.key, entry.name);
return path;
}
const picasa = await readPicasaIni(entry.album);
const options = picasa[entry.name] || {};
const contex... | turpault/my-picasa | server/rpc/routes/asset.ts | TypeScript |
ArrowFunction |
({ className, children }) => <div className | Martin0809/Zeus | src/grid/col.tsx | TypeScript |
ArrowFunction |
props => (props.gutter ? px(props.gutter) : '') | Martin0809/Zeus | src/grid/col.tsx | TypeScript |
ArrowFunction |
props => (props.gutter ? '0 ' + px(props.gutter / 2) : '') | Martin0809/Zeus | src/grid/col.tsx | TypeScript |
ArrowFunction |
props => (props.span ? (props.span / 24) * 100 + '%' : '100%') | Martin0809/Zeus | src/grid/col.tsx | TypeScript |
ArrowFunction |
props => {
return (
<GridContext.Consumer>
{context | Martin0809/Zeus | src/grid/col.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
gutter?: number
span?: number
className?: string
} | Martin0809/Zeus | src/grid/col.tsx | TypeScript |
ArrowFunction |
(img: Blob, base64Img?: boolean) =>
new Promise<string>((resolve, reject) => {
if (!base64Img) {
return resolve(URL.createObjectURL(img))
}
const reader = new FileReader()
reader.onerror = reject
reader.onload = () => resolve(reader.r... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
if (!base64Img) {
return resolve(URL.createObjectURL(img))
}
const reader = new FileReader()
reader.onerror = reject
reader.onload = () => resolve(reader.result as string)
reader.readAsDataURL(img)
} | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
() => resolve(reader.result as string) | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(bm) => bookmarks.add(bm.url) | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(pk) => {
const [name, url] = pk as [string, string]
let key: number | string
if (isSocialSearch) {
const { postId } = derivePostUrlIdProps({ url })
key = postId
} else {
key = url
}
const current ... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
({ postId }) => {
const page = socialMap.get(postId)
socialMap.set(postId, { ...page, hasBookmark: true })
} | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(url) => {
let key: number | string
if (isSocialSearch) {
const { postId } = derivePostUrlIdProps({ url })
key = postId
} else {
key = url
}
const count = countMap.get(key) || 0
countMap.set(key, c... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(annot) => annot.url | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
([name, url]: [string, string]) => {
const prev = annotTagMap.get(url) ?? []
annotTagMap.set(url, [...prev, name])
} | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
([id, url]: [number, string]) => {
const prev = annotListIdMap.get(url) ?? []
annotListIdMap.set(url, [...prev, id])
relevantListIds.add(id)
} | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
({ annotation, privacyLevel }: AnnotationPrivacyLevel) => {
if (
[
AnnotationPrivacyLevels.PROTECTED,
AnnotationPrivacyLevels.SHARED_PROTECTED,
].includes(privacyLevel)
) {
protec... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(annot) => {
const prev = annotMap.get(annot.pageUrl) ?? []
annotMap.set(annot.pageUrl, [
...prev,
{
...annot,
tags: annotTagMap.get(annot.url) ?? [],
lists: annotListIdMap.get(annot.url) ?? [],
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(page) => page.hostname | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(url, i) => {
const page = pageMap.get(url)
// Data integrity issue; no matching page in the DB. Fail nicely
if (!page || !page.url) {
return null
}
return {
...page,
favIcon: f... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(page) => page != null | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(postId) => {
const { url } = buildPostUrlId({ postId })
return url
} | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(page) => page.userId | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(id, i) => {
const socialPage = socialMap.get(id)
// Data integrity issue; no matching page in the DB. Fail nicely
if (!socialPage) {
return null
}
const user = userMap.get(socialPage.userId)
const { u... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
(page) => page !== null | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
install(backend: DexieStorageBackend) {
super.install(backend)
backend.registerOperation(
PageUrlMapperPlugin.MAP_OP_ID,
this.findMatchingPages.bind(this),
)
backend.registerOperation(
PageUrlMapperPlugin.MAP_OP_SOCIAL_ID,
this.findMatch... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupPages(
pageUrls: string[],
pageMap: Map<string, Page>,
base64Img?: boolean,
) {
const pages = await this.backend.dexieInstance
.table('pages')
.where('url')
.anyOf(pageUrls)
.limit(pageUrls.length)
.toAr... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupFavIcons(
hostnames: string[],
favIconMap: Map<string, string>,
base64Img?: boolean,
) {
// Find all assoc. fav-icons and create object URLs pointing to the Blobs
const favIcons = await this.backend.dexieInstance
.table('favIcons')
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupUsers(
userIds: number[],
userMap: Map<number, User>,
base64Img?: boolean,
) {
const users = await this.backend.dexieInstance
.table(USERS_COLL)
.where('id')
.anyOf(userIds)
.limit(userIds.length)
.toArr... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupLists(
pageUrls: string[],
listMap: Map<string, number[]>,
) {
const listEntries = (await this.backend.dexieInstance
.table('pageListEntries')
.where('pageUrl')
.anyOf(pageUrls)
.primaryKeys()) as Array<[number, string]>
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupTags(
pageUrls: string[],
tagMap: Map<number | string, string[]>,
isSocialSearch?: boolean,
) {
const tags = await this.backend.dexieInstance
.table('tags')
.where('url')
.anyOf(pageUrls)
.primaryKeys()
tag... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupSocialBookmarks(
postIds: number[],
socialMap: Map<number, SocialPage>,
) {
return this.backend.dexieInstance
.table(BMS_COLL)
.where('postId')
.anyOf(postIds)
.limit(postIds.length)
.each(({ postId }) => {
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupAnnotsCounts(
pageUrls: string[],
countMap: Map<number | string, number>,
isSocialSearch?: boolean,
) {
const annotUrls = (await this.backend.dexieInstance
.table('annotations')
.where('pageUrl')
.anyOf(pageUrls)
.k... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupAnnots(
pageUrls: string[],
annotMap: Map<string, Annotation[]>,
) {
const annotTagMap = new Map<string, string[]>()
const annotListIdMap = new Map<string, number[]>()
let relevantListIds = new Set<number>()
const protectedAnnotUrlsSet = new Set<s... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
private async lookupLatestTimes(
pageUrls: string[],
timeMap: Map<string, number>,
pageMap: Map<string, Page>,
upperTimeBound: number,
) {
const visitQueryP = this.backend.dexieInstance
.table('visits')
.where('url')
.anyOf(pageUrls)
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration | /**
* Goes through given input, finding all matching pages from the DB.
* Then does further lookups to determine whether each matching page
* has an associated bookmark and fav-icon.
*/
async findMatchingPages(
pageUrls: string[],
{
base64Img,
upperTimeBound,
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
MethodDeclaration |
async findMatchingSocialPages(
socialMap: Map<number, SocialPage>,
{
base64Img,
upperTimeBound,
latestTimes,
}: {
base64Img?: boolean
upperTimeBound?: number
latestTimes?: number[]
},
): Promise<SocialPage[]> {
... | WorldBrain/WorldBrain-Webmemex | src/search/background/page-url-mapper.ts | TypeScript |
ArrowFunction |
v => v.show(run) | Biological-Computation/crn-engine | HTML5SharedGUI/InferenceViewer/Scripts/CompositeViewer.ts | TypeScript |
ClassDeclaration | // Represents a collection of IInferenceViewer as single IInferenceViewer
export class Viewer implements Inference.IInferenceViewer {
constructor(private viewers: Inference.IInferenceViewer[]) { }
show(run: Inference.IInferenceRun) {
this.viewers.forEach(v => v.show(run));
}
} | Biological-Computation/crn-engine | HTML5SharedGUI/InferenceViewer/Scripts/CompositeViewer.ts | TypeScript |
MethodDeclaration |
show(run: Inference.IInferenceRun) {
this.viewers.forEach(v => v.show(run));
} | Biological-Computation/crn-engine | HTML5SharedGUI/InferenceViewer/Scripts/CompositeViewer.ts | TypeScript |
InterfaceDeclaration |
export interface TypeConfig {
/**
* Allows you to map the value if used as an input type for mutations
*
* Some values might not convert 1:1 if returned from the query and used as an input
*/
queryValueToInputValue?: (value: any) => any
/**
* Allows you to exclude certain fields, either by passing... | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface TypeConfigMap {
[type: string]: TypeConfig
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface ProviderOptions {
typeMap: TypeConfigMap
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface Query {
args: Array<IntrospectionInputValue>
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface QueryMap {
[query: string]: Query
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface TypeMap {
[type: string]: IntrospectionType
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface Response {
data: any
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface Filter {
[key: string]: {
[operator: string]: any
}
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
InterfaceDeclaration |
export interface FilterMap {
and: Filter[]
} | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
TypeAliasDeclaration |
export type FetchQueryType =
| typeof GET_MANY
| typeof GET_LIST
| typeof GET_ONE
| typeof GET_MANY_REFERENCE
| typeof DELETE
| typeof UPDATE
| typeof CREATE | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
TypeAliasDeclaration |
export type SortDirection = 'ASC' | 'DESC' | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
TypeAliasDeclaration | // Most operators are from https://github.com/graphile-contrib/postgraphile-plugin-connection-filter/blob/master/src/PgConnectionArgFilterOperatorsPlugin.js#L42-L277
export type Operator =
// Standard Operators
| 'isNull'
| 'equalTo'
| 'notEqualTo'
| 'distinctFrom'
| 'notDistinctFrom'
| 'in'
| 'notIn'
... | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
TypeAliasDeclaration |
export type FilterSpec =
| {
operator: Operator
/** optional key, that will be taken instead of the filters input name */
key?: string
value?: any
}
| {
operator?: Operator
/** optional key, that will be taken instead of the filters input name */
key?: string
val... | nhkhanh/ra-postgraphile | src/types.ts | TypeScript |
ClassDeclaration |
export class FieldEvaluationResultImpl implements FieldEvaluationResult {
/**
* @param {ContextFieldInfo} contextFieldInfo Context data instance, on which rules were evaluated
* @param {RuleEvaluationResultImpl} ruleResults List of {@link RuleEvaluationResult}s, containing entry for each
* ... | eisgroup/kraken-rules | javascript/packages/engine/src/dto/FieldEvaluationResult.ts | TypeScript |
ClassDeclaration |
export class FieldEvaluationResultUtils {
static targetId(r: FieldEvaluationResultImpl): string {
return `${r.contextFieldInfo.contextName}:${r.contextFieldInfo.contextId}:${r.contextFieldInfo.fieldPath}`;
}
} | eisgroup/kraken-rules | javascript/packages/engine/src/dto/FieldEvaluationResult.ts | TypeScript |
InterfaceDeclaration | /**
* Contains all rule results for field
*/
export interface FieldEvaluationResult {
contextFieldInfo: ContextFieldInfo;
ruleResults: RuleEvaluationResult[];
} | eisgroup/kraken-rules | javascript/packages/engine/src/dto/FieldEvaluationResult.ts | TypeScript |
MethodDeclaration |
static targetId(r: FieldEvaluationResultImpl): string {
return `${r.contextFieldInfo.contextName}:${r.contextFieldInfo.contextId}:${r.contextFieldInfo.fieldPath}`;
} | eisgroup/kraken-rules | javascript/packages/engine/src/dto/FieldEvaluationResult.ts | TypeScript |
FunctionDeclaration |
async function addThreeMoreCommitsOntoFeatureBranch(repository: Repository) {
await switchTo(repository, featureBranchName)
const featureBranchCommitTwo = {
commitMessage: 'Cherry Picked Feature! Number Two',
entries: [
{
path: 'THING_TWO.md',
contents: '# HELLO WORLD! \nTHINGS GO HE... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
// This will create a repository with a feature branch with one commit to
// cherry pick and will check out the target branch.
repository = await createRepository(featureBranchName, targetBranchName)
// branch with tip as commit to cherry pick
featureBranch = await getBranchOrError(r... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
const cherryPickedCommit = await getCommit(
repository,
featureBranch.tip.sha
)
const commits = await getCommits(repository, targetBranch.ref, 3)
expect(commits.length).toBe(2)
expect(commits[0].summary).toB... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
// add a commit with no message
await switchTo(repository, featureBranchName)
const filePath = Path.join(repository.path, 'EMPTY_MESSAGE.md')
await FSE.writeFile(filePath, '# HELLO WORLD! \nTHINGS GO HERE\n')
await GitProcess.exec(['add', filePath], repository.path)
await GitProce... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
// keep reference to the first commit in cherry pick range
const firstCommitSha = featureBranch.tip.sha
await addThreeMoreCommitsOntoFeatureBranch(repository)
featureBranch = await getBranchOrError(repository, featureBranchName)
await switchTo(repository, targetBranchName)
const... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = null
try {
result = await cherryPick(repository, 'no such revision')
} catch (error) {
expect(error.toString()).toContain('Bad revision')
}
expect(result).toBe(null)
} | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
await FSE.writeFile(
Path.join(repository.path, 'THING.md'),
'# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n'
)
// This error is not one of the parsed dugite errors
// https://github.com/desktop/dugite/blob/master/lib/errors.ts
// TODO: add to dugite error so w... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
//create new branch off of default to merge into feature branch
await switchTo(repository, 'main')
const mergeBranchName = 'branch-to-merge'
await createBranch(repository, mergeBranchName, 'HEAD')
await switchTo(repository, mergeBranchName)
const mergeCommit = {
commitMessag... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
// add empty commit to feature branch
await switchTo(repository, featureBranchName)
await GitProcess.exec(
['commit', '--allow-empty', '-m', 'Empty Commit'],
repository.path
)
featureBranch = await getBranchOrError(repository, featureBranchName)
await switchTo(reposit... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
const firstCommitSha = featureBranch.tip.sha
// add empty commit to feature branch
await switchTo(repository, featureBranchName)
await GitProcess.exec(
['commit', '--allow-empty', '-m', 'Empty Commit'],
repository.path
)
// add another commit so empty commit will be ... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
expect(result).toBe(CherryPickResult.CompletedWithoutError)
result = null
try {
result = await cherryPick(repository, featureBranch.tip.sha)
} catch (error) {
expect(error.toString()).toContain('There are no cha... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
() => {
beforeEach(async () => {
// In the 'git/cherry-pick' `beforeEach`, we call `createRepository` which
// adds a commit to the feature branch with a file called THING.md. In
// order to make a conflict, we will add the same file to the target
// branch.
const conflictingCommit = ... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
// In the 'git/cherry-pick' `beforeEach`, we call `createRepository` which
// adds a commit to the feature branch with a file called THING.md. In
// order to make a conflict, we will add the same file to the target
// branch.
const conflictingCommit = {
commitMessage... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
expect(result).toBe(CherryPickResult.ConflictsEncountered)
const status = await getStatusOrThrow(repository)
const conflictedFiles = status.workingDirectory.files.filter(
f => f.status.kind === AppFileStatusKind... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
f => f.status.kind === AppFileStatusKind.Conflicted | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
expect(result).toBe(CherryPickResult.ConflictsEncountered)
const statusAfterCherryPick = await getStatusOrThrow(repository)
const { files } = statusAfterCherryPick.workingDirectory
// git diff --check warns if co... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
expect(result).toBe(CherryPickResult.ConflictsEncountered)
result = await continueCherryPick(repository, [])
expect(result).toBe(CherryPickResult.OutstandingFilesNotStaged)
const status = await getStatusOrThrow(r... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
expect(result).toBe(CherryPickResult.ConflictsEncountered)
// resolve conflicts by writing files to disk
await FSE.writeFile(
Path.join(repository.path, 'THING.md'),
'# HELLO WORLD! \nTHINGS GO HERE\nFEA... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
async () => {
result = await cherryPick(repository, featureBranch.tip.sha)
expect(result).toBe(CherryPickResult.ConflictsEncountered)
// files from cherry pick exist in conflicted state
const statusAfterConflict = await getStatusOrThrow(repository)
expect(statusAfterConflict.workingDirec... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
() => {
let progress = new Array<ICherryPickProgress>()
beforeEach(() => {
progress = []
})
it('errors when given invalid revision range', async () => {
const progress = new Array<ICherryPickProgress>()
result = await cherryPick(repository, 'INVALID REF', p =>
progress.push(p... | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
ArrowFunction |
() => {
progress = []
} | BlackyYen/desktop | app/test/unit/git/cherry-pick-test.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.