type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
ngOnInit(): void {
this.phoneN = 'PHONE: ' + appSettings.getString('phoneN', 'ENTER PHONE NUMBER');
this.auto = appSettings.getBoolean('auto', false);
this.bgSource = appSettings.getBoolean('bgsource', false);
this.rangeText = "AUTO STOP AT BG VALUE: " + appSettings.getNumber('range', 80) + " MG/DL";
... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
getBGRange(){
dialogs.prompt({
title: "ENTER LIMIT BG VALUE TO SUSPEND PUMP",
message: "LIMIT BG VALUE IS:",
okButtonText: "OK",
cancelButtonText: "CANCEL",
inputType: dialogs.inputType.number
}).then(r => {
console.log("Dialog closed!" + r.result + ", A TO TEKST:" + r.text)... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
setPhoneNumber(){
dialogs.prompt({
title: "ENTER PHONE NUMBER",
message: "Enter parent or guardian phone number for remote SMS commands: START, STOP, BOLUS",
okButtonText: "OK",
cancelButtonText: "CANCEL",
inputType: dialogs.inputType.number
}).then(r => {
console.log("Dialo... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
sendLogs() {
const documents = fs.path.join(android.os.Environment.getExternalStorageDirectory().getAbsolutePath().toString());
const myFolder = fs.Folder.fromPath(documents);
const myFile = myFolder.getFile("my.txt");
const a = Runtime.getRuntime().exec('logcat -v time -f /sdcard/my.txt -d');
cons... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
Zapisz() {
console.log("aaaaaa" + this.nsUrl);
const sha1 = require("sha1");
this.databaseService.insertNS(this.nsUrl, sha1(this.nsKey), this.nsKey);
console.log("NS URL: " + this.nsUrl + " ddddddddddd " + this.nsKey);
this.sendDatatoNightscout6().then(() =>
console.log(this.slowo + "aRRRRRRR... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
onCheckedChangeAuto(args: EventData) {
const mySwitch = args.object as Switch;
const isChecked = mySwitch.checked; // boolean
if (isChecked === true) {
appSettings.setBoolean("auto", true);
this.auto = appSettings.getBoolean('auto');
}
else {
appSettings.setBoolean("auto", false)... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
onCheckedChangeSource(args: EventData) {
const mySwitch = args.object as Switch;
const isChecked = mySwitch.checked; // boolean
if (isChecked === true) {
appSettings.setBoolean("bgsource", true);
this.bgSource = appSettings.getBoolean('bgsource');
}
else {
appSettings.setBoolean("... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
sendDatatoNightscout6() {
return new Promise((resolve, reject) => {
this.getNSData().subscribe(g => {
g.map(bol => {
console.log(bol.http.toString() + "JJJJJJJ" + bol.secret.toString());
this.slowo =
this.slowo2 +
" " +
bol.http.toString() +
... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
sendDatatoNightscout7() {
return new Promise((resolve, reject) => {
this.getNSData().subscribe(g => {
g.map(bol => {
console.log(
bol.http.toString() + "66666666666" + bol.secret.toString()
);
this.nsUrl2 = bol.http.toString();
this.nsKey2 = bol.has... | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
setNS(arg) {
console.log("setttNS");
console.log(arg.text);
this.nsUrl = arg.text;
} | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
setNSurl(arg) {
console.log("setttNSUURRL");
console.log(arg.text);
this.nsKey = arg.text;
} | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
MethodDeclaration |
getNSData(): Observable<
Array<{ http: string; secret: string; hash: string }>
> {
return this.databaseService.NSconf().pipe(
map(rows => {
return rows.map(a => ({
http: a[0],
secret: a[1],
hash: a[2]
}));
})
);
} | dirceusemighini/Med-Link-User-EN | src/app/search/search.component.ts | TypeScript |
ArrowFunction |
() => {
const BGMUser = new BangumiUser('test', 'test');
const P = (<jest.Mock<BangumiApiRequest>>BangumiApiRequest).mock.instances[0];
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
///@ts-ignore
const mockGet = <jest.Mock>P.get;
it('getMeInfo(): 路径', async () => {
moc... | 1574242600/bgmtv-importer | src/bangumi/api/__test__/uesr.test.ts | TypeScript |
ArrowFunction |
async () => {
mockGet.mockResolvedValue({});
await BGMUser.getMeInfo();
expect(mockGet.mock.calls[0][0]).toBe('/v0/me');
} | 1574242600/bgmtv-importer | src/bangumi/api/__test__/uesr.test.ts | TypeScript |
ArrowFunction |
async () => {
mockGet.mockResolvedValue({});
await BGMUser.getUserInfo(1);
expect(mockGet.mock.calls[0][0]).toBe('/user/1');
} | 1574242600/bgmtv-importer | src/bangumi/api/__test__/uesr.test.ts | TypeScript |
ArrowFunction |
async () => {
mockGet.mockResolvedValue({});
await BGMUser.getUserCollectionsStatus(1);
expect(mockGet.mock.calls[0][0]).toBe('/user/1/collections/status');
} | 1574242600/bgmtv-importer | src/bangumi/api/__test__/uesr.test.ts | TypeScript |
ArrowFunction |
async () => {
mockGet.mockResolvedValue({});
await BGMUser.getUserCollectionProgress(1, 2);
expect(mockGet.mock.calls[0][0]).toBe('/user/1/progress?subject_id=2');
} | 1574242600/bgmtv-importer | src/bangumi/api/__test__/uesr.test.ts | TypeScript |
ArrowFunction |
() => {
jest.clearAllMocks();
} | 1574242600/bgmtv-importer | src/bangumi/api/__test__/uesr.test.ts | TypeScript |
ClassDeclaration |
@NgModule({
declarations: [
MyApp
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
AngularFireModule.initializeApp(FIREBASE_CONFIG),
AngularFireDatabaseModule,
],
bootstrap: [IonicApp],
entryComponents: [
MyApp
],
providers: [
StatusBar,
SplashScreen,
{provid... | priyamshah112/Ionic-Projects | IonicShoppingList/src/app/app.module.ts | TypeScript |
ArrowFunction |
() => {
it('should open and close the modal', async () => {
const Element = () => {
const { openModal } = useContext(ModalContext)
const handleOpen = () => openModal('modal title', 'modal message')
return (
<div>
<button type="button"... | Henriquepb22/pokemon-shop | src/contexts/ModalContext/index.test.tsx | TypeScript |
ArrowFunction |
async () => {
const Element = () => {
const { openModal } = useContext(ModalContext)
const handleOpen = () => openModal('modal title', 'modal message')
return (
<div>
<button type="button" onClick={handleOpen}>
ope... | Henriquepb22/pokemon-shop | src/contexts/ModalContext/index.test.tsx | TypeScript |
ArrowFunction |
() => {
const { openModal } = useContext(ModalContext)
const handleOpen = () => openModal('modal title', 'modal message')
return (
<div>
<button type="button" onClick={handleOpen}>
open modal
</button>
... | Henriquepb22/pokemon-shop | src/contexts/ModalContext/index.test.tsx | TypeScript |
ArrowFunction |
() => openModal('modal title', 'modal message') | Henriquepb22/pokemon-shop | src/contexts/ModalContext/index.test.tsx | TypeScript |
ArrowFunction |
() => {
expect(
screen.queryByRole('heading', { name: /modal title/i })
).toBeInTheDocument()
expect(screen.queryByText(/modal message/i)).toBeInTheDocument()
} | Henriquepb22/pokemon-shop | src/contexts/ModalContext/index.test.tsx | TypeScript |
ArrowFunction |
() => {
expect(
screen.queryByRole('heading', { name: /modal title/i })
).not.toBeInTheDocument()
expect(screen.queryByText(/modal message/i)).not.toBeInTheDocument()
} | Henriquepb22/pokemon-shop | src/contexts/ModalContext/index.test.tsx | TypeScript |
ClassDeclaration |
class Component extends Vue {} | ggkk0818/fan_controller | src/module.d.ts | TypeScript |
FunctionDeclaration |
function brushed() {
let selected = null;
selected = x2.domain()
.filter(function(d) {
return (brush.extent()[0] <= x2(d)) && (x2(d) <= brush.extent()[1]);
});
let start;
let end;
if (brush.extent()[0] != brush.... | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
FunctionDeclaration |
function updateScale(data) {
const tickScale = d3.scale.pow().range([data.length / 10, 0]).domain([data.length, 0]).exponent(.5);
let brushValue = brush.extent()[1] - brush.extent()[0];
if (brushValue === 0) {
brushValue = width;
}
const tickValueMultiplier = Mat... | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
FunctionDeclaration |
function update(data) {
x.domain(data.map(function(d) { return d.date; }));
y.domain([0, d3.max(data, function(d) { return d.price; })]);
const bars = focus.selectAll('.bar')
.data(data);
bars
.attr(
{
height: function (d, i)... | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
FunctionDeclaration |
function exit(data) {
const bars = focus.selectAll('.bar').data(data);
bars.exit().remove();
} | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
FunctionDeclaration |
function enter(data) {
x.domain(data.map(function(d) { return d.date; }));
y.domain([0, d3.max(data, function(d) { return d.price; })]);
const bars = focus.selectAll('.bar')
.data(data);
bars.enter().append('rect')
.classed('bar', true)
.a... | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-brushing-bar-graph',
templateUrl: './brushing-bar-graph.component.html',
styleUrls: ['./brushing-bar-graph.component.css']
})
export class BrushingBarGraphComponent implements OnInit {
constructor() { }
ngOnInit(): void {
this.loadGraph();
}
loadGraph() {
const data... | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.loadGraph();
} | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
MethodDeclaration |
loadGraph() {
const data = [];
for (let i = 0; i < 300; i++) {
const datum = {} as any;
datum.date = i;
datum.price = Math.floor(Math.random() * 600);
data.push(datum);
}
const margin = {top: 10, right: 10, bottom: 100, left: 40},
margin2 = {top: 430, right: 10, bottom... | klarjun/twitter-angular-template | src/app/graphs/brushing-bar-graph/brushing-bar-graph.component.ts | TypeScript |
ClassDeclaration | /*****************************************************************************
* A rectangular in 2D space.
*
* @author Christopher Stock
* @version 0.0.2
*****************************************************************************/
class LibRect2D extends LibShape2D
{
/***... | christopherstock/HTML5-TypeScript-WebGL-Demo | src_lib/de/mayflower/lib/math/geom2d/LibRect2D.ts | TypeScript |
MethodDeclaration | /*****************************************************************************
* Checks if this rect contains the given point.
*
* @param x The X coordinate of the point to check.
* @param y The Y coordinate of the point to check.
* @return <code>true</code> if the... | christopherstock/HTML5-TypeScript-WebGL-Demo | src_lib/de/mayflower/lib/math/geom2d/LibRect2D.ts | TypeScript |
MethodDeclaration | /*****************************************************************************
* Checks if the given rect intersects this rect.
*
* @param rect The rect to check for intersection.
* @return <code>true</code> if the rects collide.
* Otherwise <c... | christopherstock/HTML5-TypeScript-WebGL-Demo | src_lib/de/mayflower/lib/math/geom2d/LibRect2D.ts | TypeScript |
MethodDeclaration | /*****************************************************************************
* Checks if the given rect equals with this rect.
*
* @param rect The rect to check for equality.
* @return <code>true</code> if the rects equal.
* Otherwise <code>f... | christopherstock/HTML5-TypeScript-WebGL-Demo | src_lib/de/mayflower/lib/math/geom2d/LibRect2D.ts | TypeScript |
ArrowFunction |
(event: React.MouseEvent<HTMLAnchorElement>) => {
event.preventDefault()
if (this.props.disabled) {
return
}
const uri = this.props.uri
if (uri) {
shell.openExternal(uri)
}
const onClick = this.props.onClick
if (onClick) {
onClick()
}
} | 123kiril/desktop | app/src/ui/lib/link-button.tsx | TypeScript |
ClassDeclaration | /**
* A link component.
*
* Provide `children` elements for the title of the rendered hyperlink.
*/
export class LinkButton extends React.Component<ILinkButtonProps, {}> {
public render() {
const href = this.props.uri || ''
const className = classNames('link-button-component', this.props.className)
r... | 123kiril/desktop | app/src/ui/lib/link-button.tsx | TypeScript |
InterfaceDeclaration |
interface ILinkButtonProps {
/** A URI to open on click. */
readonly uri?: string
/** A function to call on click. */
readonly onClick?: () => void
/** CSS classes attached to the component */
readonly className?: string
/** The tab index of the anchor element. */
readonly tabIndex?: number
/** D... | 123kiril/desktop | app/src/ui/lib/link-button.tsx | TypeScript |
MethodDeclaration |
public render() {
const href = this.props.uri || ''
const className = classNames('link-button-component', this.props.className)
return (
<a
className={className}
href={href}
onClick={this.onClick}
title={this.props.title}
tabIndex={this.props.tabIndex}
>... | 123kiril/desktop | app/src/ui/lib/link-button.tsx | TypeScript |
ArrowFunction |
(asset: Asset): PoolFeeLD => {
// special case for RUNE
if (isRuneNativeAsset(asset)) {
return FP.pipe(
THOR.fees$(),
liveData.map((fees) => ({ amount: fees.fast, asset: AssetRuneNative }))
)
} else {
return FP.pipe(
gasRateByChain$(asset.chain),
liveData.map((gasRate) => getC... | SS-FS-58/asgardex-electron | src/renderer/services/chain/fees/common.ts | TypeScript |
ArrowFunction |
(fees) => ({ amount: fees.fast, asset: AssetRuneNative }) | SS-FS-58/asgardex-electron | src/renderer/services/chain/fees/common.ts | TypeScript |
ArrowFunction |
(gasRate) => getChainFeeByGasRate({ asset, gasRate }) | SS-FS-58/asgardex-electron | src/renderer/services/chain/fees/common.ts | TypeScript |
ArrowFunction |
() => Error(`Could not find fee for ${asset.chain} chain`) | SS-FS-58/asgardex-electron | src/renderer/services/chain/fees/common.ts | TypeScript |
ArrowFunction |
(sc:any) => {
sumAbs += Math.abs(sc.difference);
} | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
(a:any, b:any) => b.membership - a.membership | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
(element:any) => {
let spotResult = this._getSpotRatio(p.find((item:any) => item.id === element.id), q.find((item:any) => item.id === element.id));
sumSpotResults += spotResult;
j++;
if (j >= this._k){
aux = sumSpotResults / this._k
valaux = true;
}
} | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
(item:any) => item.id === element.id | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
(a:any, b:any) => (a.nonmembership > b.nonmembership) ? 1 : -1 | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
(p: any )=> {
colectiva.forEach((q:any) => {
if(p.id === q.id){
let spotc: any = {};
spotc['id'] = p.id
spotc['difference'] = (p.membership - q.membership) + this._alpha * (p.hesitation - q.hesitation);
spotComparisons.push(spotc);
}
}... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
(q:any) => {
if(p.id === q.id){
let spotc: any = {};
spotc['id'] = p.id
spotc['difference'] = (p.membership - q.membership) + this._alpha * (p.hesitation - q.hesitation);
spotComparisons.push(spotc);
}
} | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root'
})
export class SimilarityMeasureService {
_alpha = 0.5;
_k = -1
constructor() { }
public _getSimilarity(individual: any, colectivo: any, k: number) {
this._k = k;
let ret = 0;
if (this._k < 0) {
this._k = individual.length;
}
let _result = this._... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
MethodDeclaration |
public _getSimilarity(individual: any, colectivo: any, k: number) {
this._k = k;
let ret = 0;
if (this._k < 0) {
this._k = individual.length;
}
let _result = this._getSimilarityExtended(individual, colectivo);
ret = _result.level as number;
return ret;
} | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
MethodDeclaration |
private _getSimilarityExtended(individual: any, colectiva: any) {
let spotComparisons = this._getSpotComparisons(individual, colectiva);
let sumAbs = 0;
let n = spotComparisons.length;
spotComparisons.forEach((sc:any) => {
sumAbs += Math.abs(sc.difference);
});
let grossLevel = 1 - sumAb... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
MethodDeclaration |
private _approximateMembershipCDF(p: any, q: any){
let ret = 0;
let n = p.length;
let j = 0;
let sumSpotResults = 0;
let aux = 0;
let valaux = false;
if (n == 0){
return ret;
}
let sortedP = p.slice().sort((a:any, b:any) => b.membership - a.membership);
sortedP.forEach((elemen... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
MethodDeclaration |
private _getSpotRatio(a:any, b:any){
let r = 0.5; //default value
let a_mu = a.membership + this._alpha * a.hesitation;
let a_nu = a.nonmembership + (1 - this._alpha) * a.hesitation;
let b_mu = b.membership + this._alpha * b.hesitation;
let b_nu = b.nonmembership + (1 - this._alpha) * b.hesitation;
... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
MethodDeclaration |
private _approximateNonMembershipCDF(p: any, q:any){
let ret = 0;
let n = p.length;
let j = 0;
let sumSpotResults = 0;
let aux = 0;
let valaux = false;
if (n == 0){
return ret;
}
let sortedP = p.slice().sort((a:any, b:any) => (a.nonmembership > b.nonmembership) ? 1 : -1);
sort... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
MethodDeclaration |
private _getSpotComparisons(individual: any, colectiva: any)
{
let spotComparisons: any = []
individual.forEach((p: any )=> {
colectiva.forEach((q:any) => {
if(p.id === q.id){
let spotc: any = {};
spotc['id'] = p.id
spotc['difference'] = (p.membership - q.m... | appconsensus21/AppConsensus | src/app/services/similarity-measure.service.ts | TypeScript |
ArrowFunction |
() => this._isError | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this._isCompleted | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this._isPending | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this._isImporting | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this._isInProgress | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this._isUnknown | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
(): StatusMetadata =>
({
isError: this._isError,
isCompleted: this._isCompleted,
isPending: this._isPending,
isImporting: this._isImporting,
isInProgress: this._isInProgress,
isUnknown: this._isUnknown,
group: this.group,
} as any) | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this.label | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this.group | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => this.simpleLabel | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => {
return `${this.simpleLabel}${this.simpleLabel === this.toString() ? '' : this.toString()}`;
} | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ArrowFunction |
() => {
const result = this.label || super.toString();
return this.group && !this._isUnknown ? `${result} (${this.group.getVerboseName()})` : result;
} | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
ClassDeclaration |
export abstract class StatusEnum<SIMPLE_LABEL = StatusSimpleLabel> extends ObjectEnum<string> {
protected readonly _isError: boolean;
protected readonly _isCompleted: boolean;
protected readonly _isPending: boolean;
protected readonly _isImporting: boolean;
protected readonly _isInProgress: boolean;
protec... | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
InterfaceDeclaration |
export interface StatusMetadata {
isError?: boolean;
isCompleted?: boolean;
isPending?: boolean;
isImporting?: boolean;
isInProgress?: boolean;
isUnknown?: boolean;
group?: StatusGroup;
} | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
MethodDeclaration |
toString() {
const result = this.label || super.toString();
return this.group && !this._isUnknown ? `${result} (${this.group.toString()})` : result;
} | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
MethodDeclaration |
protected resolveSimpleLabel(): SIMPLE_LABEL | StatusSimpleLabel {
if (this._isError) {
return StatusSimpleLabel.Error;
}
if (this._isCompleted) {
return StatusSimpleLabel.Completed;
}
if (this._isPending) {
return StatusSimpleLabel.Pending;
}
if (this._isImporting) {
... | benjaminapetersen/console | frontend/packages/kubevirt-plugin/src/constants/status-enum.ts | TypeScript |
InterfaceDeclaration |
export interface BotSite {
name: string;
enabled: boolean;
url: string;
authorization: string;
body: string;
} | kennedy-steve/skylink-if | src/models/config-models.ts | TypeScript |
InterfaceDeclaration |
export interface BaseConfig {
client: {
ID: string;
TOKEN: string;
INTENTS: any[];
PARTIALS: PartialTypes[];
CACHES: {
[key: string]: number;
};
};
DEVELOPERS: string[];
infiniteFlight: {
API_KEY: string;
};
api: {
P... | kennedy-steve/skylink-if | src/models/config-models.ts | TypeScript |
FunctionDeclaration |
function _getImageSetProps(props: React.Props<{}>, markdownProps: IPageMarkdownProps): IPageImageSetProps | undefined {
let imageSet: IImageProps[] | undefined;
if (props && props.children) {
// tslint:disable-next-line:no-any
React.Children.forEach(props.children, (child: any) => {
if (child && chil... | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
ArrowFunction |
(child: any) => {
if (child && child.type === 'li') {
const textContent = child.props.children;
const { resources } = markdownProps;
if (typeof textContent === 'string' && textContent.indexOf('image:') === 0 && resources && resources.images) {
const imageProps = resources.image... | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
ArrowFunction |
(markdownProps: IPageMarkdownProps): IMarkdownProps => ({
options: {
overrides: {
h1: {
component: PageHeader
},
h2: {
component: PageHeader,
props: { as: 'h2' }
},
h3: {
component: PageHeader,
props: { as: 'h3' }
},
code: {
... | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
ArrowFunction |
(props: React.HTMLAttributes<HTMLElement>) => {
const { resources } = markdownProps;
const textContent = props.children;
if (typeof textContent === 'string' && resources) {
if (textContent.indexOf('image:') === 0 && resources.images) {
const imageProps = resourc... | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
ArrowFunction |
(props: React.HTMLAttributes<HTMLElement>) => {
let imageSetProps = _getImageSetProps(props, markdownProps);
if (imageSetProps) {
return <PageImageSet {...imageSetProps} />;
}
return <ul {...props} />;
} | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
ArrowFunction |
(props: IPageMarkdownProps) => <Markdown {...getMarkdownProps(props)}>{props.children}</Markdown>; | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
InterfaceDeclaration |
export interface IPageMarkdownResources {
images?: {
[key: string]: IImageProps;
};
} | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
InterfaceDeclaration |
export interface IPageMarkdownProps {
resources?: IPageMarkdownResources;
children: string;
} | CharlesgdHill/office-ui-fabric-react | packages/example-app-base/src/components/templates/PageMarkdown.tsx | TypeScript |
EnumDeclaration |
export enum FeedbackTypeEnum {
Bug = "Bug",
Improvement = "Improvement",
} | Tomashow/car-maintenance | src/app/shared/components/feedback-dialog/feedback-type.enum.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
imports: [NzInputNumberModule, FormsModule, ReactiveFormsModule],
declarations: [NzTestInputNumberBasicComponent, NzTestInputNumberFormComponent]
});
TestBed.compileComponents();
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(NzTestInputNumberBasicComponent);
fixture.detectChanges();
testComponent = fixture.debugElement.componentInstance;
inputNumber = fixture.debugElement.query(By.directive(NzInputNumberComponent));
inputElement = inputNumber.nativeElement.querySelect... | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(inputNumber.nativeElement.classList).toContain('ant-input-number');
expect(inputElement.getAttribute('placeholder')).toBe('placeholder');
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
expect(inputNumber.nativeElement.classList).toContain('ng-untouched');
dispatchFakeEvent(inputElement, 'focus');
fixture.detectChanges();
tick();
fixture.detectChanges();
expect(inputNumber.nativeElement.classList).toContain('ng-untouched');
... | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.size = 'large';
fixture.detectChanges();
expect(inputNumber.nativeElement.classList).toContain('ant-input-number-lg');
testComponent.size = 'small';
fixture.detectChanges();
expect(inputNumber.nativeElement.classList).toContain('ant-input-number-sm');
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
testComponent.autofocus = true;
testComponent.nzInputNumberComponent.nzAutoFocus = true;
testComponent.nzInputNumberComponent.ngAfterViewInit();
fixture.detectChanges();
expect(inputElement === document.activeElement).toBe(true);
expect(inputEl... | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture.detectChanges();
testComponent.nzInputNumberComponent.focus();
fixture.detectChanges();
expect(inputElement === document.activeElement).toBe(true);
testComponent.nzInputNumberComponent.blur();
fixture.detectChanges();
expect(inputElement === document.activeElem... | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.value = 5;
fixture.detectChanges();
flush();
expect(inputElement.value).toBe('5');
expect(testComponent.modelChange).toHaveBeenCalledTimes(0);
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.nzInputNumberComponent.onModelChange('');
fixture.detectChanges();
expect(testComponent.value).toBe('');
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.nzInputNumberComponent.onModelChange('NaN');
fixture.detectChanges();
expect(testComponent.value).toBe(undefined);
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
dispatchFakeEvent(upHandler, 'mousedown');
fixture.detectChanges();
expect(inputElement.value).toBe('1');
expect(testComponent.modelChange).toHaveBeenCalledTimes(1);
dispatchFakeEvent(downHandler, 'mousedown');
fixture.detectChanges();
expect(inputElement.value).toBe('... | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.nzInputNumberComponent.onModelChange('1.');
fixture.detectChanges();
expect(testComponent.value).toBe(undefined);
expect(inputElement.value).toBe('1.');
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
ArrowFunction |
() => {
testComponent.nzInputNumberComponent.onModelChange('1.');
fixture.detectChanges();
dispatchFakeEvent(upHandler, 'mousedown');
fixture.detectChanges();
expect(testComponent.value).toBe(1);
} | Anberm/ng-zorro-antd | components/input-number/input-number.spec.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.