type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
async () => {
const template = (await readFile(path.join(getTemplatePath("msi"), "template.xml"), "utf8"))
.replace(/{{/g, "<%")
.replace(/}}/g, "%>")
.replace(/\${([^}]+)}/g, "<%=$1%>")
return ejs.compile(template)
} | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
ArrowFunction |
file => {
const packagePath = file.substring(appOutDir.length + 1)
const lastSlash = packagePath.lastIndexOf(path.sep)
const fileName = lastSlash > 0 ? packagePath.substring(lastSlash + 1) : packagePath
let directoryId: string | null = null
let dirName = ""
// Wix Directory.FileSou... | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
MethodDeclaration |
async build(appOutDir: string, arch: Arch) {
const packager = this.packager
const artifactName = packager.expandArtifactBeautyNamePattern(this.options, "msi", arch)
const artifactPath = path.join(this.outDir, artifactName)
await packager.info.callArtifactBuildStarted({
targetPresentableName: "MSI... | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
MethodDeclaration |
private async light(objectFiles: Array<string>, vm: VmManager, artifactPath: string, appOutDir: string, vendorPath: string, tempDir: string) {
// noinspection SpellCheckingInspection
const lightArgs = [
"-out", vm.toVmFile(artifactPath),
"-v",
// https://github.com/wixtoolset/issues/issues/51... | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
MethodDeclaration |
private getCommonWixArgs() {
const args: Array<string> = ["-pedantic"]
if (this.options.warningsAsErrors !== false) {
args.push("-wx")
}
return args
} | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
MethodDeclaration |
private async writeManifest(appOutDir: string, arch: Arch, commonOptions: FinalCommonWindowsInstallerOptions) {
const appInfo = this.packager.appInfo
const {files, dirs} = await this.computeFileDeclaration(appOutDir)
const companyName = appInfo.companyName
if (!companyName) {
log.warn(`Manufactu... | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
MethodDeclaration |
private async computeFileDeclaration(appOutDir: string) {
const appInfo = this.packager.appInfo
let isRootDirAddedToRemoveTable = false
const dirNames = new Set<string>()
const dirs: Array<string> = []
const fileSpace = " ".repeat(6)
const commonOptions = getEffectiveOptions(this.options, this.... | Eshva/electron-builder | packages/app-builder-lib/src/targets/MsiTarget.ts | TypeScript |
InterfaceDeclaration | /**
* The state of a pivot table section.
*/
export interface SectionState {
/**
* Indicates whether the section contents are currently being displayed.
*
* Otherwise only the total row is visible.
*/
open: boolean;
} | codestothestars/react-pivot-table | src/sections/SectionState.tsx | TypeScript |
ArrowFunction |
() => {
const CSV = `#group,false,false,true,true,false,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
,,0,2019-02-01T23:38:32.524234Z... | bonitoo-io/giraffe | giraffe/src/utils/fromFlux.test.ts | TypeScript |
ArrowFunction |
() => {
const CSV = `#group,false,false,true,true,true,true
#datatype,string,long,string,string,long,long
#default,_result,,,cpu,,6
,result,table,a,b,c,d
,,1,usage_guest,,4,
,,1,usage_guest,,5,`
const actual = fromFlux(CSV).table
expect(actual.getColumn('result')).toEqual(['_result', '_result'])
expe... | bonitoo-io/giraffe | giraffe/src/utils/fromFlux.test.ts | TypeScript |
ArrowFunction |
() => {
const CSV = `#group,true,false,false,true
#datatype,string,string,string,string
#default,,,,
,a,b,c,d
#group,false,false,true,false
#datatype,string,string,string,string
#default,,,,
,a,b,c,d`
const {fluxGroupKeyUnion} = fromFlux(CSV)
expect(fluxGroupKeyUnion).toEqual(['a', 'c', 'd'])
} | bonitoo-io/giraffe | giraffe/src/utils/fromFlux.test.ts | TypeScript |
ArrowFunction |
() => {
const CSV = `#group,false,false,true,true,false,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double,string,string,string,string
#default,_result,,,,,,,,,
,result,table,_start,_stop,_time,_value,_field,_measurement,cpu,host
,,0,2019-02-01T23:38:32.524234Z... | bonitoo-io/giraffe | giraffe/src/utils/fromFlux.test.ts | TypeScript |
ArrowFunction |
() => {
const CSV = `#group,false,false,false,false
#datatype,string,long,string,long
#default,_result,,,
,result,table,message,value
,,0,howdy,5
,,0,"hello
there",5
,,0,hi,6
#group,false,false,false,false
#datatype,string,long,string,long
#default,_result,,,
,result,table,message,value
,,1,howdy,5
,,1,"hello
t... | bonitoo-io/giraffe | giraffe/src/utils/fromFlux.test.ts | TypeScript |
ArrowFunction |
() => ({
id: { type: GraphQLString },
name: { type: GraphQLString },
last4: { type: GraphQLString },
data: { type: GraphQLJSONObject },
privateData: { type: GraphQLJSONObject },
provider: { type: VirtualCardProvider },
}) | WikiRik/opencollective-api | server/graphql/v2/input/VirtualCardInput.ts | TypeScript |
InterfaceDeclaration |
interface language | MaxiCoinDev/MaxiCoin | src/qt/locale/bitcoin_bg.ts | TypeScript |
InterfaceDeclaration |
interface and | MaxiCoinDev/MaxiCoin | src/qt/locale/bitcoin_bg.ts | TypeScript |
InterfaceDeclaration | /**
* Transaction details.
*/
export interface TransactionDetails {
/**
* the Transaction Id can be used as access-ID in the API, where more details on an transaction is offered. If this data attribute is provided this shows that the AIS can get access on more details about this transaction using the Get tr... | Guillerbr/open-banking-gateway | fintech-examples/fintech-ui/src/app/api/model/transactionDetails.ts | TypeScript |
ClassDeclaration |
@Injectable({
providedIn: 'root'
})
export class UserinfoService {
private usersUrl = 'https://localhost:8443/users';
private friendsUrl = 'https://localhost:8443/friends';
constructor(private http: HttpClient,private router: Router) { }
getUser(user: string): Observable<User>{
return this.http.get<Use... | LtVaios/My-LinkedIn | frontend/src/app/userinfo/userinfo.service.ts | TypeScript |
MethodDeclaration |
getUser(user: string): Observable<User>{
return this.http.get<User>(this.usersUrl+"/"+user);
} | LtVaios/My-LinkedIn | frontend/src/app/userinfo/userinfo.service.ts | TypeScript |
MethodDeclaration |
getUserByID(id:number): Observable<User> {
const url = this.usersUrl + '/getbyid/' + id;
return this.http.get<User>(url);
} | LtVaios/My-LinkedIn | frontend/src/app/userinfo/userinfo.service.ts | TypeScript |
MethodDeclaration |
getFriendsAndRequests(id:number): Observable<Friends[]> {
return this.http.get<Friends[]>(this.friendsUrl+ '/findall/' + id);
} | LtVaios/My-LinkedIn | frontend/src/app/userinfo/userinfo.service.ts | TypeScript |
MethodDeclaration |
sendFriendRequest(u1:number,u2:number): Observable<Friends>{
var friends:Friends;
friends=new Friends();
friends.user_one=u1;
friends.user_two=u2;
friends.state="pending";
return this.http.post<Friends>(this.friendsUrl,friends);
} | LtVaios/My-LinkedIn | frontend/src/app/userinfo/userinfo.service.ts | TypeScript |
MethodDeclaration |
getFriends(id:number): Observable<Friends[]> {
return this.http.get<Friends[]>(this.friendsUrl+ '/' + id);
} | LtVaios/My-LinkedIn | frontend/src/app/userinfo/userinfo.service.ts | TypeScript |
ClassDeclaration |
export default class Vote implements Model {
id: string;
decision: VOTE_DECISION;
event_minutes_item_ref: string;
event_minutes_item?: EventMinutesItem;
event_ref: string;
event?: Event;
external_source_id?: string;
in_majority?: boolean;
matter_ref: string;
matter?: Matter;
person_ref: string;
... | CouncilDataProject/cdp-instance | src/models/Vote.ts | TypeScript |
ArrowFunction |
role => member.roles.has(role.id) | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
c => c.id === channel.id | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
r => setTimeout(() => r(this.minify()), 50) | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
() => r(this.minify()) | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
c => `${c.get("userID")}` | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
r => [message.guild.id].includes(r.id) | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
(num, word) => (text.includes(word) ? num + 2 : num) | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
(num, word) => (text.includes(word) ? num + 1 : num) | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public static generateXp(level: number): number {
if (level >= 60) {
return level * 20;
}
if (level >= 35) {
return level * 10;
} else if (level >= 27) {
return Leveling.randomNum(110, 115);
} else {
return Leveling.randomNum(10, 15);
}
} | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public static randomNum(min: number, max: number): number {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
} | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public static checkEligibility(
member: GuildMember,
channel: TextChannel
): boolean {
const excludedRoles: Role[] = (member.guild as FoxGuild).leveling
.excludedRoles;
const excludedChannels: TextChannel[] = (member.guild as FoxGuild).leveling
.excludedChannels;
if (
excludedRo... | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public async _loadSettings(): Promise<void> {
const settings: FoxLeveling = await this.guild.client.mongo.leveling.findOne(
{
guildID: this.guild.id,
type: "settings"
}
);
if (!settings) {
const levelsettings: FoxLeveling = new this.guild.client.mongo.leveling({
gu... | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public minify(): Leveling {
// @ts-ignore
const current: Leveling = { ...this };
delete current.guild;
return current;
} | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public async set(key: string, value: any): Promise<boolean | Object> {
const settings: FoxLeveling = await this.guild.client.mongo.leveling.findOne(
{
guildID: this.guild.id,
type: "settings"
}
);
if (!settings) {
return false;
}
if (!this.hasOwnProperty(key)) {
... | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public async listen(message: FoxMessage): Promise<void> {
if (!message.guild) {
return;
}
if (message.content.startsWith(message.guild.config.prefix)) {
return;
}
if (!message.guild.packages.get("Leveling").enabled) {
return;
}
if (!Leveling.validate(message)) {
retu... | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public async rankOf(member: any): Promise<number> {
const data: FoxLeveling[] = await member.client.mongo.leveling
.sort("totalXP", "desc")
.find({ guildID: member.guild.id });
const mapped: string[] = data.map(c => `${c.get("userID")}`);
return mapped.indexOf(member.id) + 1;
} | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public async levelOf(member: any): Promise<number> {
const entry: FoxLeveling = await member.client.mongo.leveling.findOne({
guildID: member.guild.id,
userID: member.id
});
if (!entry) {
return undefined;
}
return entry.get("level");
} | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
MethodDeclaration |
public static validate(message: FoxMessage): boolean | number {
const text: string = message.content.toLowerCase();
const mentions: MessageMentions = message.mentions;
const substantialWords: string[] = [
"js",
"javascript",
"node",
"nodejs",
"code",
"pars",
"scri... | Texlo-Dev/fox-legacy | src/util/leveling/LevelSettings.ts | TypeScript |
ArrowFunction |
invitation => {
this.invitation = invitation;
if (this.invitation.status != "pending") {
// If the invitation is valid but its status is not "pending", throw a 404 error
this.error({
status: 404,
statusText: "Invitation Not... | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
ArrowFunction |
error => {
console.error("[ApiAcceptPageComponent] Error getting API");
this.error(error);
} | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
ArrowFunction |
() => {
let link: string[] = [ "/apis", this.invitation.designId ];
console.info("[ApiAcceptPageComponent] Navigating to: %o", link);
this.router.navigate(link);
} | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
ArrowFunction |
error => {
this.error(error);
} | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
ClassDeclaration |
@Component({
moduleId: module.id,
selector: "api-accept-page",
templateUrl: "api-accept.page.html",
styleUrls: ["api-accept.page.css"]
})
export class ApiAcceptPageComponent extends AbstractPageComponent {
public invitation: Invitation;
public _accepting: boolean = false;
/**
* Const... | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
MethodDeclaration | /**
* Called to kick off loading the page's async data.
* @param params
*/
public loadAsyncPageData(params: any): void {
console.info("[ApiAcceptPageComponent] Loading async page data");
let apiId: string = params["apiId"];
let inviteId: string = params["inviteId"];
this.... | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
MethodDeclaration | /**
* Called to accept the invite.
*/
public acceptInvitation(): void {
this._accepting = true;
this.apis.acceptInvitation(this.invitation.designId, this.invitation.inviteId).then( () => {
let link: string[] = [ "/apis", this.invitation.designId ];
console.info("[ApiAcc... | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
MethodDeclaration | /**
* Called to reject the invite.
*/
public rejectInvitation(): void {
// this.apis.rejectInvitation(this.invitation.designId, this.invitation.inviteId);
let link: string[] = [ "/" ];
this.router.navigate(link);
} | orimarti/apicurio-studio | front-end/studio/src/app/pages/apis/{apiId}/collaboration/accept/api-accept.page.ts | TypeScript |
ArrowFunction |
(source: Id<Source>, limit: number) => {
for (let op of Memory.respawnManager.remoteMiningOperations) {
if (op.id === source) {
op.limit = limit;
return;
}
}
Memory.respawnManager.remoteMiningOperations.push({ id: source, limit: limit });
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(source: Id<Source>, limit: number) => {
for (let op of Memory.respawnManager.remoteBuildingOperations) {
if (op.id === source) {
op.limit = limit;
return;
}
}
Memory.respawnManager.remoteBuildingOperations.push({ id: source, limit: limit });
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(room: string, limit: number) => {
for (let op of Memory.respawnManager.remoteRaidOperations) {
if (op.room === room) {
op.limit = limit;
return;
}
}
Memory.respawnManager.remoteRaidOperations.push({ room: room, limit: limit });
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(room: string) => {
for (let op of Memory.respawnManager.scoutOperations) {
if (op.room === room) {
return;
}
}
Memory.respawnManager.scoutOperations.push({ room: room });
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(room: string) => {
for (let i = 0; i < Memory.respawnManager.scoutOperations.length; i++) {
if (Memory.respawnManager.scoutOperations[i].room === room) {
Memory.respawnManager.scoutOperations.splice(i, 1);
return;
}
}
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(room: string, ownership: DesiredOwnership) => {
if (!Memory.rooms[room]) {
Memory.rooms[room] = {};
}
Memory.rooms[room].respawnManager = { desiredOwnership: ownership, ...Memory.rooms[room].respawnManager };
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(room: string, chunk: string) => {
if (!Memory.chunks) {
Memory.chunks = {};
}
if (!Memory.chunks[chunk]) {
Memory.chunks[chunk] = { rooms: [room] };
return;
}
if (Memory.chunks[chunk].rooms.includes(room)) return;
Memory.chunks[chunk] = { rooms: [room, ...Memory.chun... | HappyCerberus/screeps | src/globals.ts | TypeScript |
ArrowFunction |
(room: string, chunk: string) => {
if (!Memory.chunks || !Memory.chunks[chunk]) {
return;
}
const rooms = Memory.chunks[chunk].rooms;
for (let i = 0; i < rooms.length; i++) {
if (rooms[i] === room) {
rooms.splice(i, 1);
return;
}
}
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ClassDeclaration |
export class Job {
constructor(public type: string,
public target?: AnyStructure | ConstructionSite | Resource<ResourceConstant>) { }
} | HappyCerberus/screeps | src/globals.ts | TypeScript |
ClassDeclaration | /**
* This is a wrapper class around the API client for your Cog. An instance of
* this class is passed to the constructor of each of your steps, and can be
* accessed on each step as this.client.
*/
export class ClientWrapper {
/**
* This is an array of field definitions, each corresponding to a field that
... | amcpanaligan/cog-pardot | src/client/client-wrapper.ts | TypeScript |
FunctionDeclaration |
export default function Cart(props: SvgProps) {
return (
<Svg viewBox="0 0 16 16" height="25" width="25" fill="currentColor" {...props}>
<Path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .49.598l-1 5a.5.5 0 0 1-.465.401l-9.397.472L4.415 11H13a.5.5 0 0 1 0 1H4a.5.5 0 0 1-.491-.408... | Growth-UI/Growth-UI-Native | packages/growth-ui-native/src/atoms/Icon/Cart.tsx | TypeScript |
ArrowFunction |
(_get, set, _data) => {
return set(checkoutAtom, defaultCheckout);
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).billing_address | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: Address) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, billing_address: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).shipping_address | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: Address) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, shipping_address: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).delivery_time | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: DeliveryTime) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, delivery_time: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).payment_gateway | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: PaymentMethodName) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, payment_gateway: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).token | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: string) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, token: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).customer_contact | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: string) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, customer_contact: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).verified_response | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: VerifiedResponse | null) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, verified_response: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).coupon | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: Coupon | null) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, coupon: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).coupon?.amount | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).use_wallet | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, use_wallet: !prev.use_wallet });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get) => get(checkoutAtom).payable_amount | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
ArrowFunction |
(get, set, data: number) => {
const prev = get(checkoutAtom);
return set(checkoutAtom, { ...prev, payable_amount: data });
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
InterfaceDeclaration |
interface DeliveryTime {
id: string;
title: string;
description: string;
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
InterfaceDeclaration |
interface VerifiedResponse {
total_tax: number;
shipping_charge: number;
unavailable_products: any[];
wallet_amount: number;
wallet_currency: number;
} | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
InterfaceDeclaration |
interface CheckoutState {
billing_address: Address | null;
shipping_address: Address | null;
payment_gateway: PaymentMethodName;
delivery_time: DeliveryTime | null;
customer_contact: string;
verified_response: VerifiedResponse | null;
coupon: Coupon | null;
payable_amount: number;
use_wallet: boolean... | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
TypeAliasDeclaration |
export type PaymentMethodName = 'CASH_ON_DELIVERY' | 'STRIPE'; | lazynerd-studios/Grrenline-cart | shop/src/store/checkout.ts | TypeScript |
FunctionDeclaration |
export default function (params) {
if (!params) return
if (Object.keys(params).length === 0) return
const fields = {}
for (const key of Object.keys(params)) {
try {
const type = getField(params[key].type)
fields[key] = {type}
} catch (error) {
throw new Error(`Error creating GraphQL... | ConsueloHerrera/orionjs | packages/graphql/src/buildSchema/getArgs/index.ts | TypeScript |
FunctionDeclaration |
export function resetPluginBackgroundStatsDelta() {
pluginBackgroundStats.forEach(stat => {
stat.cpuTimeDelta = 0;
stat.messageCountDelta = 0;
});
} | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
export function getPluginBackgroundStats(): {
cpuTime: number; // amount of ms cpu used since the last stats (typically every minute)
byPlugin: {[plugin: string]: StatEntry};
} {
let cpuTime: number = 0;
const byPlugin = Array.from(pluginBackgroundStats.entries()).reduce(
(aggregated, [pluginName, data]) =... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
function addBackgroundStat(plugin: string, cpuTime: number) {
if (!pluginBackgroundStats.has(plugin)) {
pluginBackgroundStats.set(plugin, {
cpuTimeDelta: 0,
cpuTimeTotal: 0,
messageCountDelta: 0,
messageCountTotal: 0,
maxTime: 0,
});
}
const stat = pluginBackgroundStats.get(... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
function processMessage(
state: State,
pluginKey: string,
plugin: {
id: string;
persistedStateReducer: PersistedStateReducer | null;
},
message: {method: string; params?: any},
): State {
const statName = `${plugin.id}.${message.method}`;
const reducerStartTime = Date.now();
flipperRecorderAddE... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
export function processMessageImmediately(
store: MiddlewareAPI,
pluginKey: string,
plugin: {
defaultPersistedState: any;
id: string;
persistedStateReducer: PersistedStateReducer | null;
},
message: {method: string; params?: any},
) {
const persistedState = getCurrentPluginState(store, plugin, ... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
export function processMessageLater(
store: MiddlewareAPI,
pluginKey: string,
plugin: {
defaultPersistedState: any;
id: string;
persistedStateReducer: PersistedStateReducer | null;
maxQueueSize?: number;
},
message: {method: string; params?: any},
) {
const isSelected =
pluginKey === ge... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
export async function processMessageQueue(
plugin: {
defaultPersistedState: any;
id: string;
persistedStateReducer: PersistedStateReducer | null;
},
pluginKey: string,
store: MiddlewareAPI,
progressCallback?: (progress: {current: number; total: number}) => void,
idler: BaseIdler = new Idler(),
... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
function getPendingMessages(
store: MiddlewareAPI,
pluginKey: string,
): Message[] {
return store.getState().pluginMessageQueue[pluginKey] || [];
} | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
FunctionDeclaration |
function getCurrentPluginState(
store: MiddlewareAPI,
plugin: {defaultPersistedState: any},
pluginKey: string,
) {
// possible optimization: don't spread default state here by put proper default state when initializing clients
return {
...plugin.defaultPersistedState,
...store.getState().pluginStates... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
ArrowFunction |
stat => {
stat.cpuTimeDelta = 0;
stat.messageCountDelta = 0;
} | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
ArrowFunction |
(aggregated, [pluginName, data]) => {
cpuTime += data.cpuTimeDelta;
aggregated[pluginName] = data;
return aggregated;
} | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
ArrowFunction |
() => {
console.table(
Array.from(pluginBackgroundStats.entries()).map(
([
plugin,
{
cpuTimeDelta,
cpuTimeTotal,
messageCountDelta,
messageCountTotal,
maxTime,
},
]) => ({
plugin,
cpu... | PalDeshpande/flipper | src/utils/messageQueue.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.