type
stringclasses
7 values
content
stringlengths
4
9.55k
repo
stringlengths
7
96
path
stringlengths
4
178
language
stringclasses
1 value
TypeAliasDeclaration
export type ColumnCount = number;
AylaAsia-zhaopan/ant-design-vue
components/list/index.tsx
TypeScript
TypeAliasDeclaration
export type ListSize = 'small' | 'default' | 'large';
AylaAsia-zhaopan/ant-design-vue
components/list/index.tsx
TypeScript
TypeAliasDeclaration
export type ListItemLayout = 'horizontal' | 'vertical';
AylaAsia-zhaopan/ant-design-vue
components/list/index.tsx
TypeScript
TypeAliasDeclaration
export type ListProps = Partial<ExtractPropTypes<ReturnType<typeof listProps>>>;
AylaAsia-zhaopan/ant-design-vue
components/list/index.tsx
TypeScript
MethodDeclaration
setup(props, { slots }) { provide(ListContextKey, { grid: toRef(props, 'grid'), itemLayout: toRef(props, 'itemLayout'), }); const defaultPaginationProps = { current: 1, total: 0, }; const { prefixCls, direction, renderEmpty } = useConfigInject('list', props); const pagin...
AylaAsia-zhaopan/ant-design-vue
components/list/index.tsx
TypeScript
FunctionDeclaration
export function initRunner() { clvm_tools.initialize(); }
greimela/chialisp-playground
src/runner.ts
TypeScript
FunctionDeclaration
export function run(source: string, args = ''): string { if (source.startsWith('(mod')) { const compiled = goAndReturn('run', source); if (compiled.startsWith('FAIL')) { return compiled; } return goAndReturn('brun', compiled, args); } else { if (args) { return goAndReturn('run', so...
greimela/chialisp-playground
src/runner.ts
TypeScript
FunctionDeclaration
export function goAndReturn( operation: 'run' | 'brun', sourceString: string, argumentString: string = '', ): string { let result = ''; clvm_tools.setPrintFunction((...messages: any[]) => (result = messages.join(' '))); try { clvm_tools.go(operation, sourceString, argumentString); } catch (error) { ...
greimela/chialisp-playground
src/runner.ts
TypeScript
ArrowFunction
(fn: Function, ms = 300) => { let timeoutId: ReturnType<typeof setTimeout>; return function (this: any, ...args: any[]) { clearTimeout(timeoutId); timeoutId = setTimeout(() => fn.apply(this, args), ms); }; }
greimela/chialisp-playground
src/runner.ts
TypeScript
ArrowFunction
() => fn.apply(this, args)
greimela/chialisp-playground
src/runner.ts
TypeScript
ArrowFunction
(...messages: any[]) => (result = messages.join(' '))
greimela/chialisp-playground
src/runner.ts
TypeScript
ArrowFunction
r =>r.data.children.map(c=>this.toEntry(c.data))
simonljus/ngreddit
src/app/services/feed.service.ts
TypeScript
ArrowFunction
c=>this.toEntry(c.data)
simonljus/ngreddit
src/app/services/feed.service.ts
TypeScript
ClassDeclaration
@Injectable({ providedIn: 'root' }) export class FeedService { constructor(private apiService: ApiService){} getPosts$(args: {limit:number, before?:string,after?:string}):Observable<Array<IEntry>>{ return this.apiService.get<RootObject>({url:'reddit/r/sweden.json',params:args}).pipe(map(r =>r.data.children....
simonljus/ngreddit
src/app/services/feed.service.ts
TypeScript
MethodDeclaration
getPosts$(args: {limit:number, before?:string,after?:string}):Observable<Array<IEntry>>{ return this.apiService.get<RootObject>({url:'reddit/r/sweden.json',params:args}).pipe(map(r =>r.data.children.map(c=>this.toEntry(c.data)))) }
simonljus/ngreddit
src/app/services/feed.service.ts
TypeScript
MethodDeclaration
toEntry(entryDTO: Data2):IEntry{ return Object.assign({}, entryDTO, {thumbnail: entryDTO.thumbnail === 'self' || entryDTO.thumbnail === 'default' ? null : entryDTO.thumbnail, numComments:entryDTO.num_comments,created:entryDTO.created*1000,thumbnailHeight:entryDTO.thumbnail_height as number ,thumbnailWidth:entryDTO...
simonljus/ngreddit
src/app/services/feed.service.ts
TypeScript
ArrowFunction
() => { let wrapper: ShallowWrapper; beforeEach(() => { wrapper = shallow(<ClusterServiceVersionHeader />); }); it('renders `ListHeader`', () => { expect(wrapper.find(ListHeader).exists()).toBe(true); }); it('renders column header for app name and logo', () => { expect(wrapper.find(ColHead)....
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = shallow(<ClusterServiceVersionHeader />); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { expect(wrapper.find(ListHeader).exists()).toBe(true); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { expect(wrapper.find(ColHead).at(0).childAt(0).text()).toEqual('Name'); expect(wrapper.find(ColHead).at(0).props().sortField).toEqual('metadata.name'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { expect(wrapper.find(ColHead).at(1).childAt(0).text()).toEqual('Namespace'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { expect(wrapper.find(ColHead).at(2).childAt(0).text()).toEqual('Deployment'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { expect(wrapper.find(ColHead).at(3).childAt(0).text()).toEqual('Status'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let wrapper: ShallowWrapper<ClusterServiceVersionRowProps>; beforeEach(() => { wrapper = shallow(<ClusterServiceVersionRow obj={testClusterServiceVersion} />).childAt(0).shallow(); }); it('renders a component wrapped in an `ErrorBoundary', () => { wrapper = shallow(<ClusterServiceVersionRow o...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = shallow(<ClusterServiceVersionRow obj={testClusterServiceVersion} />).childAt(0).shallow(); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = shallow(<ClusterServiceVersionRow obj={testClusterServiceVersion} />); expect(wrapper.find(ErrorBoundary).exists()).toBe(true); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const col = wrapper.find('.row').childAt(0); expect(col.find(ResourceCog).props().resource).toEqual(testClusterServiceVersion); expect(col.find(ResourceCog).props().kind).toEqual(referenceForModel(ClusterServiceVersionModel)); expect(col.find(ResourceCog).props().actions.length).toEqual(2); ...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const col = wrapper.find('.row').childAt(0); expect(col.find(Link).props().to).toEqual(`/k8s/ns/${testClusterServiceVersion.metadata.namespace}/${ClusterServiceVersionModel.plural}/${testClusterServiceVersion.metadata.name}`); expect(col.find(Link).find(ClusterServiceVersionLogo).exists()).toBe(tr...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const link = wrapper.find('.row').childAt(1).find(ResourceLink); expect(link.props().kind).toEqual('Namespace'); expect(link.props().title).toEqual(testClusterServiceVersion.metadata.namespace); expect(link.props().name).toEqual(testClusterServiceVersion.metadata.namespace); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const col = wrapper.find('.row').childAt(2); expect(col.find(ResourceLink).props().kind).toEqual('Deployment'); expect(col.find(ResourceLink).props().name).toEqual(testClusterServiceVersion.spec.install.spec.deployments[0].name); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const col = wrapper.find('.row').childAt(3); expect(col.childAt(0).text()).toEqual('Enabled'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = wrapper.setProps({obj: _.cloneDeepWith(testClusterServiceVersion, (v, k) => k === 'metadata' ? {...v, deletionTimestamp: Date.now()} : undefined)}); const col = wrapper.find('.row').childAt(3); expect(col.childAt(0).text()).toEqual('Disabling'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
(v, k) => k === 'metadata' ? {...v, deletionTimestamp: Date.now()} : undefined
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const col = wrapper.find('.row').childAt(4); expect(col.find(Link).childAt(0).text()).toEqual('View instances'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let wrapper: ReactWrapper<ClusterServiceVersionLogoProps>; beforeEach(() => { const {provider, icon, displayName} = testClusterServiceVersion.spec; wrapper = mount(<ClusterServiceVersionLogo icon={icon} displayName={displayName} provider={provider} />); }); it('renders logo image from given b...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const {provider, icon, displayName} = testClusterServiceVersion.spec; wrapper = mount(<ClusterServiceVersionLogo icon={icon} displayName={displayName} provider={provider} />); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const image: ReactWrapper<React.ImgHTMLAttributes<any>> = wrapper.find('img'); expect(image.props().height).toEqual('40'); expect(image.props().width).toEqual('40'); expect(image.props().src).toEqual(`data:${testClusterServiceVersion.spec.icon.mediatype};base64,${testClusterServiceVersion.spec...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper.setProps({icon: null}); const fallbackImg: ReactWrapper<React.ImgHTMLAttributes<any>> = wrapper.find('img'); expect(fallbackImg.props().src).toEqual(operatorLogo); expect(fallbackImg.props().height).toEqual('40'); expect(fallbackImg.props().width).toEqual('40'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { expect(wrapper.text()).toContain(testClusterServiceVersion.spec.displayName); expect(wrapper.text()).toContain(`by ${testClusterServiceVersion.spec.provider.name}`); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { it('renders `List` with correct props', () => { const wrapper = shallow<ClusterServiceVersionListProps>(<ClusterServiceVersionList data={[]} loaded={true} />); expect(wrapper.find(List).props().Row).toEqual(ClusterServiceVersionRow); expect(wrapper.find(List).props().Header).toEqual(ClusterServ...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const wrapper = shallow<ClusterServiceVersionListProps>(<ClusterServiceVersionList data={[]} loaded={true} />); expect(wrapper.find(List).props().Row).toEqual(ClusterServiceVersionRow); expect(wrapper.find(List).props().Header).toEqual(ClusterServiceVersionHeader); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let wrapper: ShallowWrapper<ClusterServiceVersionsPageProps>; beforeEach(() => { wrapper = shallow(<ClusterServiceVersionsPage.WrappedComponent kind={referenceForModel(ClusterServiceVersionModel)} namespaceEnabled={true} resourceDescriptions={[]} match={{params: {ns: 'foo'}, isExact: true, path: '', u...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = shallow(<ClusterServiceVersionsPage.WrappedComponent kind={referenceForModel(ClusterServiceVersionModel)} namespaceEnabled={true} resourceDescriptions={[]} match={{params: {ns: 'foo'}, isExact: true, path: '', url: ''}}
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const listPage = wrapper.find(ListPage); expect(listPage.props().kind).toEqual(referenceForModel(ClusterServiceVersionModel)); expect(listPage.props().ListComponent).toEqual(ClusterServiceVersionList); expect(listPage.props().filterLabel).toEqual('Cluster Service Versions by name'); expect...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = wrapper.setProps({namespaceEnabled: false}); const msgBox = wrapper.find(MsgBox); const listPage = wrapper.find(ListPage); expect(listPage.exists()).toBe(false); expect(msgBox.exists()).toBe(true); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = wrapper.setProps({namespaceEnabled: false, loading: true}); const msgBox = wrapper.find(MsgBox); const listPage = wrapper.find(ListPage); expect(listPage.exists()).toBe(false); expect(msgBox.exists()).toBe(false); expect(wrapper.find(LoadingBox).exists()).toBe(true); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let wrapper: ShallowWrapper<ClusterServiceVersionDetailsProps>; beforeEach(() => { wrapper = shallow(<ClusterServiceVersionDetails obj={_.cloneDeep(testClusterServiceVersion)} />); }); it('renders info section for ClusterServiceVersion', () => { const section = wrapper.find('.co-clusterservic...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = shallow(<ClusterServiceVersionDetails obj={_.cloneDeep(testClusterServiceVersion)} />); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const section = wrapper.find('.co-clusterserviceversion-details__section--info'); expect(section.exists()).toBe(true); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const createButton = wrapper.find('.btn-primary'); expect(createButton.type()).toEqual(Link); expect(createButton.props().to).toEqual(`/k8s/ns/default/${ClusterServiceVersionModel.plural}/testapp/${referenceForCRDDesc(testClusterServiceVersion.spec.customresourcedefinitions.owned[0])}/new`); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let obj = _.cloneDeep(testClusterServiceVersion); obj.spec.customresourcedefinitions.owned.push({name: 'foobars.testapp.coreos.com', displayName: 'Foo Bars', version: 'v1', kind: 'FooBars'}); wrapper.setProps({obj}); const createButton: ShallowWrapper<any> = wrapper.find('Dropdown'); expec...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const section = wrapper.find('.co-clusterserviceversion-details__section--description'); expect(section.find('h1').text()).toEqual('Description'); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { // MEMO : 미실행 코드인데 timestamp를 withTranslation으로 감싼 후 build할 때 에러발생해서 제거함 // expect(wrapper.find(Timestamp).props().timestamp).toEqual(testClusterServiceVersion.metadata.creationTimestamp); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const maintainers = wrapper.findWhere(node => node.equals(<dt>Maintainers</dt>)).parents().at(0).find('dd'); expect(maintainers.length).toEqual(testClusterServiceVersion.spec.maintainers.length); testClusterServiceVersion.spec.maintainers.forEach((maintainer, i) => { expect(maintainers.at(i...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
node => node.equals(<dt>Maintainers</dt>)).parents().at(0).find('dd'); expect(maintainers.length).toEqual(testClusterServiceVersion.spec.maintainers.length)
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
(maintainer, i) => { expect(maintainers.at(i).text()).toContain(maintainer.name); expect(maintainers.at(i).find(OverflowLink).props().value).toEqual(maintainer.email); expect(maintainers.at(i).find(OverflowLink).props().href).toEqual(`mailto:${maintainer.email}`); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const links = wrapper.findWhere(node => node.equals(<dt>Links</dt>)).parents().at(0).find('dd'); expect(links.length).toEqual(testClusterServiceVersion.spec.links.length); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
node => node.equals(<dt>Links</dt>)).parents().at(0).find('dd'); expect(links.length).toEqual(testClusterServiceVersion.spec.links.length)
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let emptyClusterServiceVersion: ClusterServiceVersionKind = _.cloneDeep(testClusterServiceVersion); emptyClusterServiceVersion.spec.description = ''; emptyClusterServiceVersion.spec.provider = undefined; emptyClusterServiceVersion.spec.links = []; emptyClusterServiceVersion.spec.maintainers...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
node => node.equals(<dt>Provider</dt>)).parents().at(0).find('dd').at(0);
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
node => node.equals(<dt>Links</dt>)).parents().at(0).find('dd');
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
node => node.equals(<dt>Maintainers</dt>)).parents().at(0).find('dd'); expect(provider.text()).toEqual('Not available')
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { let wrapper: ShallowWrapper<ClusterServiceVersionsDetailsPageProps>; const name = 'example'; const ns = 'default'; beforeEach(() => { wrapper = shallow(<ClusterServiceVersionsDetailsPage match={{params: {ns, name}, isExact: true, url: '', path: ''}} />); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { wrapper = shallow(<ClusterServiceVersionsDetailsPage match={{params: {ns, name}, isExact: true, url: '', path: ''}}
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const detailsPage = wrapper.find(DetailsPage); expect(detailsPage.props().namespace).toEqual(ns); expect(detailsPage.props().name).toEqual(name); expect(detailsPage.props().kind).toEqual(referenceForModel(ClusterServiceVersionModel)); }
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ArrowFunction
() => { const detailsPage = wrapper.find(DetailsPage); expect(detailsPage.props().pages[0].name).toEqual('Overview'); expect(detailsPage.props().pages[0].href).toEqual(''); expect(detailsPage.props().pages[0].component).toEqual(ClusterServiceVersionDetails); expect(detailsPage.props().pages[1].nam...
tmax-cloud/HyperCloud4.1
frontend/__tests__/components/cloud-services/clusterserviceversion.spec.tsx
TypeScript
ClassDeclaration
export class TelemetryUtils { static ctx: PluginContext; public static init(ctx: PluginContext) { TelemetryUtils.ctx = ctx; } public static sendEvent( eventName: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number } ) { if (!properties) { propert...
henzhang-ms/TeamsFx
packages/fx-core/src/plugins/resource/simpleauth/utils/telemetry.ts
TypeScript
MethodDeclaration
public static init(ctx: PluginContext) { TelemetryUtils.ctx = ctx; }
henzhang-ms/TeamsFx
packages/fx-core/src/plugins/resource/simpleauth/utils/telemetry.ts
TypeScript
MethodDeclaration
public static sendEvent( eventName: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number } ) { if (!properties) { properties = {}; } properties[Telemetry.isSuccess] = Telemetry.success; properties[Telemetry.component] = Constants.SimpleAuthPlugin.id...
henzhang-ms/TeamsFx
packages/fx-core/src/plugins/resource/simpleauth/utils/telemetry.ts
TypeScript
MethodDeclaration
public static sendErrorEvent( eventName: string, errorName: string, errorType: string, errorMessage: string, properties?: { [key: string]: string }, measurements?: { [key: string]: number } ) { if (!properties) { properties = {}; } properties[Telemetry.isSuccess] = Telemetry...
henzhang-ms/TeamsFx
packages/fx-core/src/plugins/resource/simpleauth/utils/telemetry.ts
TypeScript
ArrowFunction
({ componentId }) => { const { count, increment, decrement } = useCounterStore(); // OR useContext(CounterStoreContext) const navigateToNextScreen = () => { Navigation.push(componentId, { component: { name: 'NextScreen' } }) } return ( <Root> <Text>{`Clicked ${count} tim...
3luyka/react-native-navigation
website/docs/docs/third-party-mobx/counter-screen.tsx
TypeScript
ArrowFunction
() => { Navigation.push(componentId, { component: { name: 'NextScreen' } }) }
3luyka/react-native-navigation
website/docs/docs/third-party-mobx/counter-screen.tsx
TypeScript
FunctionDeclaration
function resizeCanvasToDisplaySize() { const canvas = renderer.domElement const width = canvas.clientWidth const height = canvas.clientHeight if (canvas.width !== width || canvas.height !== height) { renderer.setSize(width, height, false) camera.aspect = width / height camera.updateP...
grantmontgomery/grantcreates2.0
src/components/HammerAndAnvil/HammerAndAnvil.tsx
TypeScript
ArrowFunction
() => { const scene = new THREE.Scene() ///Camera const camera = new THREE.PerspectiveCamera(75, 0.45, 1, 1000) camera.position.z = 4.5 camera.position.y = 4 camera.position.x = 0 ///Renderer const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }) function resizeCanvasToDisp...
grantmontgomery/grantcreates2.0
src/components/HammerAndAnvil/HammerAndAnvil.tsx
TypeScript
ArrowFunction
child => { switch (child.type) { case "Object3D": child.castShadow = true child.receiveShadow = true case "Mesh": const isCircleOrPath = child.name.includes("Circle_-_baked") || child.name.includes("Path_-_baked") ...
grantmontgomery/grantcreates2.0
src/components/HammerAndAnvil/HammerAndAnvil.tsx
TypeScript
ArrowFunction
({ hammerAnvilRef }) => { React.useEffect(() => { HammerAndAnvil() }, []) return ( <div className={css.hammerAnvil} ref={hammerAnvilRef} id="hammerandanvil"> <div className={css.dragBar}></div> <div className={css.dragBar}></div> </div>
grantmontgomery/grantcreates2.0
src/components/HammerAndAnvil/HammerAndAnvil.tsx
TypeScript
ArrowFunction
() => { HammerAndAnvil() }
grantmontgomery/grantcreates2.0
src/components/HammerAndAnvil/HammerAndAnvil.tsx
TypeScript
TypeAliasDeclaration
type Props = { hammerAnvilRef: React.Ref<HTMLDivElement> }
grantmontgomery/grantcreates2.0
src/components/HammerAndAnvil/HammerAndAnvil.tsx
TypeScript
ClassDeclaration
/** Мод "DummyTree". Страницы. Начало. Сервис. */ @Injectable({ providedIn: 'root' }) export class AppModDummyTreePageIndexService { /** * Настройки. * @type {AppModDummyTreePageIndexSettings} */ settings = new AppModDummyTreePageIndexSettings(); }
maxim-kuzmin/Makc2020
typescript/makc2020-angular-redux/src/app/mods/dummy-tree/pages/index/mod-dummy-tree-page-index.service.ts
TypeScript
FunctionDeclaration
export async function query<T extends Polar>( x: T, q: string | Predicate, opts?: QueryOpts ): Promise<Result[]> { const results = []; for await (const result of x.query(q, opts)) { results.push(result); } return results; }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export async function queryRule<T extends Polar>( x: T, name: string, ...args: unknown[] ): Promise<Result[]> { const results = []; for await (const result of x.queryRule(name, ...args)) { results.push(result); } return results; }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export async function qvar<T extends Polar>( x: T, q: string | Predicate, prop: string, one?: boolean ): Promise<unknown> { const results = await query(x, q); return one ? results[0]?.get(prop) : results.map(r => r.get(prop)); }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export function pred(name: string, ...args: unknown[]): Predicate { return new Predicate(name, args); }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export function map(obj?: obj): Map<string, unknown> { return new Map(Object.entries(obj || {})); }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export function tempFile(contents: string, name?: string): Promise<string> { return write(contents, name); }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export function tempFileFx(): Promise<string> { return tempFile('f(1);f(2);f(3);', 'f.polar'); }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
FunctionDeclaration
export function tempFileGx(): Promise<string> { return tempFile('g(1);g(2);g(3);', 'g.polar'); }
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
ArrowFunction
r => r.get(prop)
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
TypeAliasDeclaration
type Result = Map<string, unknown>;
SeanLossef/oso
languages/js/test/helpers.ts
TypeScript
ArrowFunction
() => this.doWriteConfiguration(resource, value, save)
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
ArrowFunction
reference => this.writeToBuffer(reference.object.textEditorModel, value) .then(() => reference.dispose())
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
ArrowFunction
() => reference.dispose()
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
ArrowFunction
reference => { const model = reference.object.textEditorModel; if (this.hasParseErrors(model)) { return this.reject<IReference<IResolvedTextEditorModel>>(JSONEditingErrorCode.ERROR_INVALID_FILE); } // Target cannot be dirty if not writing into buffer if (checkDirty && this.textFileService.is...
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
ClassDeclaration
export class JSONEditingService implements IJSONEditingService { public _serviceBrand: any; private queue: Queue<void>; constructor( @IFileService private readonly fileService: IFileService, @ITextModelService private readonly textModelResolverService: ITextModelService, @ITextFileService private readonly ...
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
MethodDeclaration
write(resource: URI, value: IJSONValue, save: boolean): Promise<void> { return Promise.resolve(this.queue.queue(() => this.doWriteConfiguration(resource, value, save))); // queue up writes to prevent race conditions }
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
MethodDeclaration
private doWriteConfiguration(resource: URI, value: IJSONValue, save: boolean): Promise<void> { return this.resolveAndValidate(resource, save) .then(reference => this.writeToBuffer(reference.object.textEditorModel, value) .then(() => reference.dispose())); }
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
MethodDeclaration
private async writeToBuffer(model: ITextModel, value: IJSONValue): Promise<any> { const edit = this.getEdits(model, value)[0]; if (this.applyEditsToBuffer(edit, model)) { return this.textFileService.save(model.uri); } }
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
MethodDeclaration
private applyEditsToBuffer(edit: Edit, model: ITextModel): boolean { const startPosition = model.getPositionAt(edit.offset); const endPosition = model.getPositionAt(edit.offset + edit.length); const range = new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); l...
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
MethodDeclaration
private getEdits(model: ITextModel, configurationValue: IJSONValue): Edit[] { const { tabSize, insertSpaces } = model.getOptions(); const eol = model.getEOL(); const { key, value } = configurationValue; // Without key, the entire settings file is being replaced, so we just use JSON.stringify if (!key) { ...
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript
MethodDeclaration
private async resolveModelReference(resource: URI): Promise<IReference<IResolvedTextEditorModel>> { const exists = await this.fileService.exists(resource); if (!exists) { await this.textFileService.write(resource, '{}'); } return this.textModelResolverService.createModelReference(resource); }
Al-khwarizmi1/vscode
src/vs/workbench/services/configuration/common/jsonEditingService.ts
TypeScript