type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(selectionId: SelectionId) => dotSelectionData.identity === selectionId | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
ArrowFunction |
(tooltipEvent: TooltipEvent) =>
(<DotPlotDataPoint>tooltipEvent.data).tooltipInfo | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
ClassDeclaration |
class VisualLayout {
private marginValue: IMargin;
private viewportValue: IViewport;
private viewportInValue: IViewport;
public defaultMargin: IMargin;
public defaultViewport: IViewport;
constructor(defaultViewport?: IViewport, defaultMargin?: IMargin) {
th... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
InterfaceDeclaration |
export interface DotPlotConstructorOptions {
animator?: IGenericAnimator;
svg?: D3.Selection;
margin?: IMargin;
radius?: number;
strokeWidth?: number;
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
InterfaceDeclaration |
export interface DotPlotDataPoint {
x: number;
y: number;
color?: string;
value?: number;
label?: string;
identity: SelectionId;
tooltipInfo?: TooltipDataItem[];
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
InterfaceDeclaration |
export interface DotPlotData {
dataPoints: DotPlotDataPoint[];
legendData: LegendData;
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private update(): void {
this.viewportInValue = VisualLayout.restrictToMinMax({
width: this.viewport.width - (this.margin.left + this.margin.right),
height: this.viewport.height - (this.margin.top + this.margin.bottom)
});
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private static restrictToMinMax<T>(value: T): T {
var result = $.extend({}, value);
d3.keys(value).forEach(x => result[x] = Math.max(0, value[x]));
return result;
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private static round10(value: number, digits: number = 2) {
var scale = Math.pow(10, digits);
return (Math.round(scale * value) / scale);
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private static getTooltipData(value: number): TooltipDataItem[] {
return [{
displayName: DotPlot.FrequencyText,
value: value.toString()
}];
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
public static converter(dataView: DataView, maxDots: number, colors: IDataColorPalette, host: IVisualHostServices): DotPlotData {
var dataPoints: DotPlotDataPoint[] = [];
var legendData: LegendData = {
dataPoints: [],
};
if (!dataView ||
... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
public init(options: VisualInitOptions): void {
var element = options.element;
this.selectionManager = new SelectionManager({ hostServices: options.host });
this.hostService = options.host;
if (!this.svg) {
this.svg = d3.select(element.get(0)).append('sv... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
public update(options: VisualUpdateOptions): void {
if (!options.dataViews || !options.dataViews[0]) return;
this.durationAnimations = getAnimationDuration(this.animator, options.suppressAnimations);
var dataView = this.dataView = options.dataViews[0];
this.layout.view... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private drawDotPlot(data: DotPlotDataPoint[], xScale: D3.Scale.OrdinalScale, yScale: D3.Scale.LinearScale): void {
var selection = this.dotPlot.selectAll(DotPlot.Dot.selector).data(data);
selection
.enter()
.append('circle')
.classed(DotPlot.Dot.c... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private setSelectHandler(dotSelection: D3.UpdateSelection): void {
this.setSelection(dotSelection);
dotSelection.on("click", (data: DotPlotDataPoint) => {
this.selectionManager
.select(data.identity, d3.event.ctrlKey)
.then((selectionIds:... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private setSelection(selection: D3.UpdateSelection, selectionIds?: SelectionId[]): void {
selection.transition()
.duration(this.durationAnimations)
.style("fill-opacity", this.MaxOpacity);
if (!selectionIds || !selectionIds.length) {
return;
... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private renderTooltip(selection: D3.UpdateSelection): void {
TooltipManager.addTooltip(selection, (tooltipEvent: TooltipEvent) =>
(<DotPlotDataPoint>tooltipEvent.data).tooltipInfo);
} | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private drawAxis(values: any[], xScale: D3.Scale.OrdinalScale, translateY: number) {
var xAxis = d3.svg.axis()
.scale(xScale)
.orient("bottom")
.tickValues(values);
this.axis.attr("class", "x axis")
.attr('transform', SVGUtil.tran... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private relaxTicks(values: any[]) {
var xAxisWidth = this.axis.node().getBoundingClientRect().width;
if (values.length !== this.itemsLength) {
var self = this;
this.itemsWidth = 0;
this.itemsLength = values.length;
this.axis.select... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private toggleRotateTicks(state) {
if (state) {
this.axis.selectAll("text")
.attr("dx", ".8em")
.attr("dy", ".15em")
.attr("transform", "rotate(65)")
.style("text-anchor", "start")
.text(func... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
MethodDeclaration |
private toggleHideTicks(state) {
if (state) {
this.axis.selectAll("text").each(function(d, i) {
if (i % 2) {
d3.select(this).attr('fill', 'transparent');
}
});
return;
}
t... | M1Les/PowerBI-visuals | src/Clients/CustomVisuals/visuals/dotPlot/dotPlot.ts | TypeScript |
ArrowFunction |
() => {
let component: StatusChangeComponent;
let fixture: ComponentFixture<StatusChangeComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ StatusChangeComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent... | LRANUL/UOP_SE_Y3S2-PUSL3111_API_SOFTWARE_DEVELOPMENT | programs/workspace/cov-track_management-system-client-side-application/cov-track-manager/src/app/health-inspection/citizen-view/status-change/status-change.component.spec.ts | TypeScript |
ArrowFunction |
async () => {
await TestBed.configureTestingModule({
declarations: [ StatusChangeComponent ]
})
.compileComponents();
} | LRANUL/UOP_SE_Y3S2-PUSL3111_API_SOFTWARE_DEVELOPMENT | programs/workspace/cov-track_management-system-client-side-application/cov-track-manager/src/app/health-inspection/citizen-view/status-change/status-change.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(StatusChangeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | LRANUL/UOP_SE_Y3S2-PUSL3111_API_SOFTWARE_DEVELOPMENT | programs/workspace/cov-track_management-system-client-side-application/cov-track-manager/src/app/health-inspection/citizen-view/status-change/status-change.component.spec.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy) {
constructor() {
super({
jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
ignoreExpiration: false,
secretOrKey: 'secretKey',
});
}
async validate(payload: any) {
return { userId: payload.sub, userna... | kien1872000/music-player-server | src/auth/jwt.strategy.ts | TypeScript |
MethodDeclaration |
async validate(payload: any) {
return { userId: payload.sub, username: payload.username };
} | kien1872000/music-player-server | src/auth/jwt.strategy.ts | TypeScript |
EnumDeclaration |
export enum UserStatus {
ACTIVE = 'active',
AWAY = 'away',
} | rili-live/rili-app | rili-servers/websocket-service/src/constants/index.ts | TypeScript |
FunctionDeclaration |
function apisAnalyticsRouterConfig($stateProvider) {
'ngInject';
$stateProvider
.state('management.apis.detail.analytics', {
template: require("./apis.analytics.route.html")
})
.state('management.apis.detail.analytics.overview', {
url: '/analytics?from&to&q',
template: require('./over... | nicolashenry/gravitee-management-webui | src/management/api/analytics/apis.analytics.route.ts | TypeScript |
ArrowFunction |
($stateParams: StateParams, ApiService: ApiService) =>
ApiService.getApiPlans($stateParams['apiId']) | nicolashenry/gravitee-management-webui | src/management/api/analytics/apis.analytics.route.ts | TypeScript |
ArrowFunction |
($stateParams: StateParams, ApiService: ApiService) =>
ApiService.getSubscribers($stateParams['apiId']) | nicolashenry/gravitee-management-webui | src/management/api/analytics/apis.analytics.route.ts | TypeScript |
ArrowFunction |
(TenantService: TenantService) => TenantService.list() | nicolashenry/gravitee-management-webui | src/management/api/analytics/apis.analytics.route.ts | TypeScript |
ArrowFunction |
($stateParams: StateParams, ApiService: ApiService) =>
ApiService.getLog($stateParams['apiId'], $stateParams['logId'], $stateParams['timestamp']).then(response => response.data) | nicolashenry/gravitee-management-webui | src/management/api/analytics/apis.analytics.route.ts | TypeScript |
ArrowFunction |
response => response.data | nicolashenry/gravitee-management-webui | src/management/api/analytics/apis.analytics.route.ts | TypeScript |
InterfaceDeclaration |
interface Order {
id: string;
user: User;
items: Product[];
subTotalCost: number;
shipCost: number;
totalCost: number;
date: number;
address: string;
note: string;
firstName: string;
lastName: string;
} | beebapcay/estore-app | src/models/order.ts | TypeScript |
ClassDeclaration |
export default class MdZoomIn extends React.Component<IconBaseProps, any> { } | DiogenesPolanco/DefinitelyTyped | react-icons/md/zoom-in.d.ts | TypeScript |
ArrowFunction |
({ data }) => {
const { title, link, githubLink } = data
return (
<Container>
<Title>{title}</Title>
<LinkWrapper>
{link && (
<OverlayLink href={link} target="_blank">
visit website
</OverlayLink> | eadehemingway/portfolio | src/components/Overlay.tsx | TypeScript |
ArrowFunction |
(request, file, cb) => {
const fileName = `${Date.now()}-${file.originalname}`;
cb(null, fileName);
} | AdrianoRodrigues/nlw03 | backend/src/config/upload.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-marble-diagram',
templateUrl: './marble-diagram.component.html',
styleUrls: ['./marble-diagram.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MarbleDiagramComponent {
@Input() operatorName: string;
@Input() useInteractiveMarbles: boolean;
@In... | isabella232/rxjs-docs | src/app/operators/components/marble-diagram/marble-diagram.component.ts | TypeScript |
InterfaceDeclaration |
export interface DefaultLogFields {
hash: string;
date: string;
message: string;
refs: string;
body: string;
author_name: string;
author_email: string;
} | Mayank-Khurmai/Modify-Github-Date-Hack | node_modules/simple-git/src/lib/tasks/log.d.ts | TypeScript |
TypeAliasDeclaration |
export declare type LogOptions<T = DefaultLogFields> = Options | {
format?: T;
file?: string;
from?: string;
multiLine?: boolean;
symmetric?: boolean;
strictDate?: boolean;
to?: string;
}; | Mayank-Khurmai/Modify-Github-Date-Hack | node_modules/simple-git/src/lib/tasks/log.d.ts | TypeScript |
InterfaceDeclaration |
export interface IProxyCall<T> {
id: string;
setupExpression: common.IAction1<T>;
setupCall: ICallContext;
isVerifiable: boolean;
isInSequence: boolean;
expectedCallCount: api.Times;
isInvoked: boolean;
callCount: number;
setVerifiable(
times?: api.Times,
... | oshigoto46/discord-clone-go-ts | test-dir/node_modules/typemoq/src/Proxy/IProxyCall.ts | TypeScript |
FunctionDeclaration | /**
* Backend details.
*/
export function getBackend(args: GetBackendArgs, opts?: pulumi.InvokeOptions): Promise<GetBackendResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("azure-native:apimanagement/v201... | pulumi-bot/pulumi-azure-native | sdk/nodejs/apimanagement/v20180101/getBackend.ts | TypeScript |
InterfaceDeclaration |
export interface GetBackendArgs {
/**
* Identifier of the Backend entity. Must be unique in the current API Management service instance.
*/
readonly backendid: string;
/**
* The name of the resource group.
*/
readonly resourceGroupName: string;
/**
* The name of the API Man... | pulumi-bot/pulumi-azure-native | sdk/nodejs/apimanagement/v20180101/getBackend.ts | TypeScript |
InterfaceDeclaration | /**
* Backend details.
*/
export interface GetBackendResult {
/**
* Backend Credentials Contract Properties
*/
readonly credentials?: outputs.apimanagement.v20180101.BackendCredentialsContractResponse;
/**
* Backend Description.
*/
readonly description?: string;
/**
* Reso... | pulumi-bot/pulumi-azure-native | sdk/nodejs/apimanagement/v20180101/getBackend.ts | TypeScript |
FunctionDeclaration |
function evil() {
const evilstuff = [
"demonic",
"vile",
"evil",
"merciless",
"greedy",
"ambitious",
"giant",
"mecha",
"divine",
"almighty",
"godly",
"corrupt",
"angelic",
];
return getRandom(evilstuff);
} | NekoOfTheAbyss/lala | functions/generator/story/romcom.ts | TypeScript |
ArrowFunction |
(name: string): string => {
const ml = person();
const fl = person();
const goodcreature = getRandom(
creatures.filter((x) => x.affiliation === 1 || x.affiliation === 0),
);
const evilcreature = getRandom(
creatures.filter((x) => x.affiliation === -1 || x.affiliation === 0),
);
const evilcreature... | NekoOfTheAbyss/lala | functions/generator/story/romcom.ts | TypeScript |
ArrowFunction |
(x) => x.affiliation === 1 || x.affiliation === 0 | NekoOfTheAbyss/lala | functions/generator/story/romcom.ts | TypeScript |
ArrowFunction |
(x) => x.affiliation === -1 || x.affiliation === 0 | NekoOfTheAbyss/lala | functions/generator/story/romcom.ts | TypeScript |
ArrowFunction |
(x) =>
(x.affiliation === -1 || x.affiliation === 0) && x !== evilcreature | NekoOfTheAbyss/lala | functions/generator/story/romcom.ts | TypeScript |
ArrowFunction |
async ( member ) => {
if ( member.user.bot ) { return; }
const dbchannel = await bot.db.collection( 'logs' ).findOne( { guild: member.guild.id } );
if ( !dbchannel ) { return; }
await member.guild.channels.fetch();
const channel = await member.guild.channels.cache.get( dbchannel.channel );
const embed = new Mes... | ENAPM/Azuna | src/events/guildMemberRemove.logs.ts | TypeScript |
FunctionDeclaration |
export declare function handleReward(event: SubstrateEvent): Promise<void>; | Maxkos941/Module-4 | dist/mappings/mappingHandlers.d.ts | TypeScript |
FunctionDeclaration |
export default function FarmOverviewHero() {
const history = useHistory();
const openDialog = useOpenDialog();
function handleAddPlot() {
history.push('/dashboard/plot/add');
}
function handleAddPlotDirectory() {
openDialog(<PlotAddDirectoryDialog />);
}
return (
<Grid container>
<Gr... | Tony4467/littlelambocoin-blockchain | littlelambocoin-blockchain-gui/src/components/farm/overview/FarmOverviewHero.tsx | TypeScript |
FunctionDeclaration |
function handleAddPlot() {
history.push('/dashboard/plot/add');
} | Tony4467/littlelambocoin-blockchain | littlelambocoin-blockchain-gui/src/components/farm/overview/FarmOverviewHero.tsx | TypeScript |
FunctionDeclaration |
function handleAddPlotDirectory() {
openDialog(<PlotAddDirectoryDialog />);
} | Tony4467/littlelambocoin-blockchain | littlelambocoin-blockchain-gui/src/components/farm/overview/FarmOverviewHero.tsx | TypeScript |
ArrowFunction |
() => {
it('should render correctly', () => {
expect(
render(
<Typography.H3 alignment="left" mode="single-line">
This is H3
</Typography.H3>
).asFragment()
).toMatchSnapshot()
})
it('should render correctly with `... | marsblkm/sourcegraph | client/wildcard/src/components/Typography/Heading/H3.test.tsx | TypeScript |
ArrowFunction |
() => {
expect(
render(
<Typography.H3 alignment="left" mode="single-line">
This is H3
</Typography.H3>
).asFragment()
).toMatchSnapshot()
} | marsblkm/sourcegraph | client/wildcard/src/components/Typography/Heading/H3.test.tsx | TypeScript |
ArrowFunction |
() => {
expect(
render(
<Typography.H3 alignment="left" mode="single-line" as="p">
This is a p
</Typography.H3>
).asFragment()
).toMatchSnapshot()
} | marsblkm/sourcegraph | client/wildcard/src/components/Typography/Heading/H3.test.tsx | TypeScript |
FunctionDeclaration |
function Test() {
return (
<div>
<p>테스트 값d</p>
<p>12</p>
</div>
);
} | sunginHwang/react-starter-with-redux-toolkit | src/components/Test.tsx | TypeScript |
ArrowFunction |
() => SkyraUser | Darqam/skyra | src/lib/extensions/SkyraUser.ts | TypeScript |
ClassDeclaration |
export class SkyraUser extends Structures.get('User') {
// Remove when https://github.com/discordjs/discord.js/pull/4932 lands.
// @ts-expect-error: Setter-Getter combo to make the property never be set.
public set locale(_: string | null) {
// noop
}
public get locale() {
return null;
}
// @ts-expect-err... | Darqam/skyra | src/lib/extensions/SkyraUser.ts | TypeScript |
InterfaceDeclaration |
export interface User {
fetchRank(): Promise<number>;
} | Darqam/skyra | src/lib/extensions/SkyraUser.ts | TypeScript |
MethodDeclaration |
public async fetchRank() {
const list = await this.client.leaderboard.fetch();
const rank = list.get(this.id);
if (!rank) return list.size;
if (!rank.name) rank.name = this.username;
return rank.position;
} | Darqam/skyra | src/lib/extensions/SkyraUser.ts | TypeScript |
ArrowFunction |
(error: any) => {
let unwrapError = this.unwrapHttpError(error);
this.errorsSubject.next(unwrapError);
return Observable.throw(unwrapError);
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
ArrowFunction |
() => {
this.waitingSpinner.stopLoading$.next('');
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
ArrowFunction |
(data) => {
searchParams.append(key, data)
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
ClassDeclaration |
export class ApiGatewayOptions {
method: RequestMethod;
url: string;
headers = {};
params = {};
data = {};
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class ApiGateway {
// Define the internal Subject we'll use to push errors
private errorsSubject = new Subject<any>();
// Provide the *public* Observable that clients can subscribe to
errors$: Observable<any>;
// Define the internal Subject we'll use to push the command count
privat... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
get(url, params?) {
let requestParameters: RequestOptionsArgs = {};
let headers = new Headers();
if (!!params) {
requestParameters.search = this.buildUrlSearchParams(params);
}
this.createAuthorizationHeader(headers);
requestParameters.headers = headers;
this.waitingSpinner.startLo... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
post(url, data) {
let headers = new Headers();
this.createAuthorizationHeader(headers);
this.waitingSpinner.startLoading$.next('');
return this.http.post(url, data, {
headers: headers
})
.map(this.unwrapHttpValue)
.catch((error: any) => {
let unwrapError = this.unwra... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
put(url, data) {
let headers = new Headers();
this.createAuthorizationHeader(headers);
this.waitingSpinner.startLoading$.next('');
return this.http.put(url, data, {
headers: headers
}).map(this.unwrapHttpValue)
.catch((error: any) => {
let unwrapError = this.unwrapHttpError(e... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
delete(url) {
let headers = new Headers();
this.createAuthorizationHeader(headers);
this.waitingSpinner.startLoading$.next('');
return this.http.delete(url, {
headers: headers
}).map(this.unwrapHttpValue)
.catch((error: any) => {
let unwrapError = this.unwrapHttpError(error);... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private addToken(options: ApiGatewayOptions) {
var userId = this.getTokenFromLocalStorage();
if(!!userId) {
options.headers['access_token'] = userId;
}
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private getTokenFromLocalStorage(): string {
var matches = localStorage.getItem('bc.token');
if(!!matches) {
let object = JSON.parse(matches);
let dateString = moment(object.timestamp);
let now = moment();
let diff = now.diff(dateString, 'hours');
let validHours = 15;
if (d... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private createAuthorizationHeader(headers: Headers) {
var token = this.getTokenFromLocalStorage();
if(!!token) {
headers.append('access_token', token);
}
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private getXsrfCookie(): string {
var matches = document.cookie.match(/\bXSRF-TOKEN=([^\s;]+)/);
try {
return (matches && decodeURIComponent(matches[1]));
} catch (decodeError) {
return ("");
}
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private getEvryClientCookie(): string {
var matches = document.cookie.match(/\bsid=([^\s;]+)/);
try {
return (matches && decodeURIComponent(matches[1]));
} catch (decodeError) {
return ("");
}
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private buildUrlSearchParams(params: any): URLSearchParams {
var searchParams = new URLSearchParams();
for (var key in params) {
if(Array.isArray(params[key])) {
params[key].forEach((data) => {
searchParams.append(key, data)
});
} else {
if (this.isJsObject(params[... | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private isJsObject(o) {
return o !== null && (typeof o === 'function' || typeof o === 'object');
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private unwrapHttpError(error: any): any {
try {
return (error.json());
} catch (jsonError) {
return ({
code: -1,
message: "An unexpected error occurred."
});
}
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
MethodDeclaration |
private unwrapHttpValue(value: Response): any {
return !!value.text() ? value.json() : "";
} | evry-blockchain/sls-loan-front | client/src/app/api-gateway.service.ts | TypeScript |
ClassDeclaration |
export class LocalStorage {
static get<T>(identifier: string) : T | null {
const itemStr = localStorage.getItem(identifier);
if (itemStr === null) return null;
return JSON.parse(itemStr);
}
static set(identifier: string, value: any) {
localStorage.setItem(identifier, JSON.s... | MattCarothers/cont3xt | src/Util/LocalStorage.ts | TypeScript |
MethodDeclaration |
static get<T>(identifier: string) : T | null {
const itemStr = localStorage.getItem(identifier);
if (itemStr === null) return null;
return JSON.parse(itemStr);
} | MattCarothers/cont3xt | src/Util/LocalStorage.ts | TypeScript |
MethodDeclaration |
static set(identifier: string, value: any) {
localStorage.setItem(identifier, JSON.stringify(value));
} | MattCarothers/cont3xt | src/Util/LocalStorage.ts | TypeScript |
MethodDeclaration |
static getOrDefault<T>(identifier: string, defaultVal: T) : T {
const getRes = LocalStorage.get<T>(identifier);
if (getRes !== null) return getRes;
return defaultVal;
} | MattCarothers/cont3xt | src/Util/LocalStorage.ts | TypeScript |
FunctionDeclaration |
export async function mutation<T, K>(url: string, payload: T, method: string = 'POST'): Promise<K | null> {
const response = await fetch(url, {
method,
body: JSON.stringify(payload),
headers: {
'Content-Type': 'application/json',
},
});
const responseJSON = await response.json();
... | BizzareEcho/mvp-match-assignment | lib/mutation.ts | TypeScript |
ArrowFunction |
() => {
sprites.forEach(sprite => {
sprite.rotation += 0.01;
});
} | Mattykins/dev | examples/src/textures/change sprites with texture.ts | TypeScript |
ArrowFunction |
sprite => {
sprite.rotation += 0.01;
} | Mattykins/dev | examples/src/textures/change sprites with texture.ts | TypeScript |
ArrowFunction |
() => {
RemoveTexture('floppy', 'golem');
} | Mattykins/dev | examples/src/textures/change sprites with texture.ts | TypeScript |
ClassDeclaration |
class Demo extends Scene
{
constructor ()
{
super();
this.create();
}
async create ()
{
const loader = new Loader();
loader.add(
ImageFile('disk', 'assets/items/disk1.png'),
ImageFile('floppy', 'assets/items/floppy2.png'),
Image... | Mattykins/dev | examples/src/textures/change sprites with texture.ts | TypeScript |
MethodDeclaration |
async create ()
{
const loader = new Loader();
loader.add(
ImageFile('disk', 'assets/items/disk1.png'),
ImageFile('floppy', 'assets/items/floppy2.png'),
ImageFile('tape', 'assets/items/tape3.png'),
ImageFile('golem', 'assets/golem.png')
);
... | Mattykins/dev | examples/src/textures/change sprites with texture.ts | TypeScript |
ClassDeclaration | /**
* Azure Firewall resource
*/
export class AzureFirewall extends pulumi.CustomResource {
/**
* Get an existing AzureFirewall resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
... | test-wiz-sec/pulumi-azure-nextgen | sdk/nodejs/network/v20180701/azureFirewall.ts | TypeScript |
InterfaceDeclaration | /**
* The set of arguments for constructing a AzureFirewall resource.
*/
export interface AzureFirewallArgs {
/**
* Collection of application rule collections used by a Azure Firewall.
*/
readonly applicationRuleCollections?: pulumi.Input<pulumi.Input<inputs.network.v20180701.AzureFirewallApplicatio... | test-wiz-sec/pulumi-azure-nextgen | sdk/nodejs/network/v20180701/azureFirewall.ts | TypeScript |
MethodDeclaration | /**
* Get an existing AzureFirewall resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param opts Optional sett... | test-wiz-sec/pulumi-azure-nextgen | sdk/nodejs/network/v20180701/azureFirewall.ts | TypeScript |
MethodDeclaration | /**
* Returns true if the given object is an instance of AzureFirewall. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is AzureFirewall {
if (obj === undefined || obj === null) {
... | test-wiz-sec/pulumi-azure-nextgen | sdk/nodejs/network/v20180701/azureFirewall.ts | TypeScript |
FunctionDeclaration | // deno-lint-ignore no-explicit-any
function createIterResult(value: any, done: boolean): IteratorResult<any> {
return { value, done };
} | 0xe/swc | crates/swc_bundler/tests/.cache/deno/f3fc479f331dd963cd2b96063df6bf047890f887.ts | TypeScript |
FunctionDeclaration | // deno-lint-ignore no-explicit-any
function eventHandler(...args: any[]): void {
const promise = unconsumedPromises.shift();
if (promise) {
promise.resolve(createIterResult(args, false));
} else {
unconsumedEventValues.push(args);
}
} | 0xe/swc | crates/swc_bundler/tests/.cache/deno/f3fc479f331dd963cd2b96063df6bf047890f887.ts | TypeScript |
FunctionDeclaration | // deno-lint-ignore no-explicit-any
function errorHandler(err: any): void {
finished = true;
const toError = unconsumedPromises.shift();
if (toError) {
toError.reject(err);
} else {
// The next time we call next()
error = err;
}
iterator.return();
} | 0xe/swc | crates/swc_bundler/tests/.cache/deno/f3fc479f331dd963cd2b96063df6bf047890f887.ts | TypeScript |
ArrowFunction |
(value: string | symbol) => {
this.removeAllListeners(value);
} | 0xe/swc | crates/swc_bundler/tests/.cache/deno/f3fc479f331dd963cd2b96063df6bf047890f887.ts | TypeScript |
ArrowFunction |
(resolve, reject) => {
if (emitter instanceof EventTarget) {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen to `error` events here.
emitter.addEventListener(
name,
(...args) => {
resolve(args);
},... | 0xe/swc | crates/swc_bundler/tests/.cache/deno/f3fc479f331dd963cd2b96063df6bf047890f887.ts | TypeScript |
ArrowFunction |
(...args) => {
resolve(args);
} | 0xe/swc | crates/swc_bundler/tests/.cache/deno/f3fc479f331dd963cd2b96063df6bf047890f887.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.