type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration
|
toObject() {
const data: {
otp_parameters?: ReturnType<typeof MigrationPayload.OtpParameters.prototype.toObject>[];
version?: number;
batch_size?: number;
batch_index?: number;
batch_id?: number;
} = {};
if (this.otp_parameters != null) {
data.otp_parameters = this.otp_parameters.map((item: MigrationPayload.OtpParameters) => item.toObject());
}
if (this.version != null) {
data.version = this.version;
}
if (this.batch_size != null) {
data.batch_size = this.batch_size;
}
if (this.batch_index != null) {
data.batch_index = this.batch_index;
}
if (this.batch_id != null) {
data.batch_id = this.batch_id;
}
return data;
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
serialize(): Uint8Array;
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
serialize(w: pb_1.BinaryWriter): void;
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.otp_parameters !== undefined)
writer.writeRepeatedMessage(1, this.otp_parameters, (item: MigrationPayload.OtpParameters) =>
item.serialize(writer)
);
if (this.version !== undefined) writer.writeInt32(2, this.version);
if (this.batch_size !== undefined) writer.writeInt32(3, this.batch_size);
if (this.batch_index !== undefined) writer.writeInt32(4, this.batch_index);
if (this.batch_id !== undefined) writer.writeInt32(5, this.batch_id);
if (!w) return writer.getResultBuffer();
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MigrationPayload {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes),
message = new MigrationPayload();
while (reader.nextField()) {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
reader.readMessage(message.otp_parameters, () =>
pb_1.Message.addToRepeatedWrapperField(
message,
1,
MigrationPayload.OtpParameters.deserialize(reader),
MigrationPayload.OtpParameters
)
);
break;
case 2:
message.version = reader.readInt32();
break;
case 3:
message.batch_size = reader.readInt32();
break;
case 4:
message.batch_index = reader.readInt32();
break;
case 5:
message.batch_id = reader.readInt32();
break;
default:
reader.skipField();
}
}
return message;
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
serializeBinary(): Uint8Array {
return this.serialize();
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
static deserializeBinary(bytes: Uint8Array): MigrationPayload {
return MigrationPayload.deserialize(bytes);
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
static fromObject(data: {
secret?: Uint8Array;
name?: string;
issuer?: string;
algorithm?: MigrationPayload.Algorithm;
digits?: MigrationPayload.DigitCount;
type?: MigrationPayload.OtpType;
counter?: number;
}) {
const message = new OtpParameters({});
if (data.secret != null) {
message.secret = data.secret;
}
if (data.name != null) {
message.name = data.name;
}
if (data.issuer != null) {
message.issuer = data.issuer;
}
if (data.algorithm != null) {
message.algorithm = data.algorithm;
}
if (data.digits != null) {
message.digits = data.digits;
}
if (data.type != null) {
message.type = data.type;
}
if (data.counter != null) {
message.counter = data.counter;
}
return message;
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
toObject() {
const data: {
secret?: Uint8Array;
name?: string;
issuer?: string;
algorithm?: MigrationPayload.Algorithm;
digits?: MigrationPayload.DigitCount;
type?: MigrationPayload.OtpType;
counter?: number;
} = {};
if (this.secret != null) {
data.secret = this.secret;
}
if (this.name != null) {
data.name = this.name;
}
if (this.issuer != null) {
data.issuer = this.issuer;
}
if (this.algorithm != null) {
data.algorithm = this.algorithm;
}
if (this.digits != null) {
data.digits = this.digits;
}
if (this.type != null) {
data.type = this.type;
}
if (this.counter != null) {
data.counter = this.counter;
}
return data;
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.secret !== undefined) writer.writeBytes(1, this.secret);
if (typeof this.name === "string" && this.name.length) writer.writeString(2, this.name);
if (typeof this.issuer === "string" && this.issuer.length) writer.writeString(3, this.issuer);
if (this.algorithm !== undefined) writer.writeEnum(4, this.algorithm);
if (this.digits !== undefined) writer.writeEnum(5, this.digits);
if (this.type !== undefined) writer.writeEnum(6, this.type);
if (this.counter !== undefined) writer.writeInt64(7, this.counter);
if (!w) return writer.getResultBuffer();
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OtpParameters {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes),
message = new OtpParameters();
while (reader.nextField()) {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
message.secret = reader.readBytes();
break;
case 2:
message.name = reader.readString();
break;
case 3:
message.issuer = reader.readString();
break;
case 4:
message.algorithm = reader.readEnum();
break;
case 5:
message.digits = reader.readEnum();
break;
case 6:
message.type = reader.readEnum();
break;
case 7:
message.counter = reader.readInt64();
break;
default:
reader.skipField();
}
}
return message;
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
serializeBinary(): Uint8Array {
return this.serialize();
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
MethodDeclaration
|
static deserializeBinary(bytes: Uint8Array): OtpParameters {
return OtpParameters.deserialize(bytes);
}
|
rm-hull/zaup2
|
src/proto/migration_payload.ts
|
TypeScript
|
TypeAliasDeclaration
|
type FormFieldMessageOwnProps = {
variant?: FormMessageType
children?: React.ReactNode
}
|
Brailor/instructure-ui
|
packages/ui-form-field/src/FormFieldMessage/props.ts
|
TypeScript
|
TypeAliasDeclaration
|
type PropKeys = keyof FormFieldMessageOwnProps
|
Brailor/instructure-ui
|
packages/ui-form-field/src/FormFieldMessage/props.ts
|
TypeScript
|
TypeAliasDeclaration
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
Brailor/instructure-ui
|
packages/ui-form-field/src/FormFieldMessage/props.ts
|
TypeScript
|
TypeAliasDeclaration
|
type FormFieldMessageProps = FormFieldMessageOwnProps &
WithStyleProps<FormFieldMessageTheme, FormFieldMessageStyle>
|
Brailor/instructure-ui
|
packages/ui-form-field/src/FormFieldMessage/props.ts
|
TypeScript
|
TypeAliasDeclaration
|
type FormFieldMessageStyle = ComponentStyle<'formFieldMessage'>
|
Brailor/instructure-ui
|
packages/ui-form-field/src/FormFieldMessage/props.ts
|
TypeScript
|
ClassDeclaration
|
@NgModule({
declarations: [
EventComponent,
CalendrierComponent,
FilterPipe,
SingleComponent,
SlugifyPipe
],
imports: [
CommonModule,
EventRoutingModule,
FormsModule,
ReactiveFormsModule,
LightgalleryModule,
NgxPaginationModule,
YouTubePlayerModule
]
})
export class EventModule { }
|
Bz-Carter/ads
|
src/app/pages/event/event.module.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const blockFilePath = path.resolve(__dirname, 'stubs/text-block.vue')
const blockMeta = await blocksMetaLoader.getMetaFromFile(blockFilePath)
expect(blockMeta).toMatchSnapshot()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const blockFilePath = path.resolve(__dirname, 'stubs/feature-block.js')
const blockMeta = await blocksMetaLoader.getMetaFromFile(blockFilePath)
expect(blockMeta).toMatchSnapshot()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const blockFilePath = path.resolve(__dirname, 'stubs/wrong-file-path.vue')
expect(blocksMetaLoader.getMetaFromFile(blockFilePath)).rejects.toThrow()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
// @ts-ignore
expect(blocksMetaLoader.getMetaFromFile(123)).rejects.toThrow()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const blockMeta = await blocksMetaLoader.getMetaFromFile([
path.resolve(__dirname, 'stubs/text-block.vue'),
path.resolve(__dirname, 'stubs/feature-block.js'),
])
expect(blockMeta).toMatchSnapshot()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const blocksPath = path.resolve(__dirname, 'stubs')
const blockMeta = await blocksMetaLoader.getMetaFromDirectory(blocksPath)
expect(blockMeta).toMatchSnapshot()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const blocksPath = path.resolve(__dirname, 'wrong-path')
expect(blocksMetaLoader.getMetaFromDirectory(blocksPath)).rejects.toThrow()
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const blocksPath = path.resolve(__dirname, 'stubs/hero-block.vue')
const meta = await blocksMetaLoader.getMetaFromFile(blocksPath)
expect(meta).toHaveProperty('name', 'HeroBlock')
expect(meta).toHaveProperty('title', 'Hero Block')
expect(meta).toHaveProperty('group', 'general')
expect(meta).toHaveProperty('props', {})
expect(meta).toHaveProperty('path', 'hero-block')
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const blocksPath = path.resolve(__dirname, 'stubs/block-template-only.vue')
const meta = await blocksMetaLoader.getMetaFromFile(blocksPath)
expect(meta).toHaveProperty('name', 'BlockTemplateOnly')
expect(meta).toHaveProperty('group', 'general')
expect(meta).toHaveProperty('props', {})
expect(meta).toHaveProperty('path', 'block-template-only')
}
|
sedona-cms/blocks-meta-loader
|
__tests__/blocks-meta-loader.test.ts
|
TypeScript
|
FunctionDeclaration
|
export function getBluemixCredentials(classid: string, service: TrainingTypes.BluemixServiceType) {
if (service === 'conv'){
return new Promise((resolve) => resolve([ creds ]));
}
else if (service === 'visrec') {
return new Promise((resolve) => resolve([ credsForVisRec ]));
}
return new Promise((resolve) => resolve([ ]));
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getBluemixCredentialsById(id: string) {
return new Promise((resolve, reject) => {
if (id === '123') {
return resolve(creds);
}
else if (id === '456') {
return resolve(credsForVisRec);
}
else {
return reject(new Error('Unexpected response when retrieving service credentials'));
}
});
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function countTrainingByLabel(project: DbTypes.Project): Promise<{}> {
if (project.id === 'projectbob' || project.id === 'existingprojectid') {
return new Promise((resolve) => resolve(NUM_TRAINING_PER_LABEL));
}
else if (project.id === 'projectbobvis' || project.id === 'projectbobvislim') {
return new Promise((resolve) => resolve(NUM_IMAGES_TRAINING_PER_LABEL));
}
else if (project.id === 'tinyvis') {
return new Promise((resolve) => resolve(NUM_IMAGES_TRAINING_TINY));
}
else if (project.id === 'massivevis') {
return new Promise((resolve) => resolve(NUM_IMAGES_TRAINING_MASSIVE));
}
else {
return new Promise((resolve) => resolve({}));
}
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getUniqueTrainingTextsByLabel(projectid: string, label: string, options: DbTypes.PagingOptions) {
const start = options.start;
const limit = options.limit;
const end = Math.min(start + limit, NUM_TRAINING_PER_LABEL[label]);
const training: string[] = [];
for (let idx = start; idx < end; idx++) {
training.push('sample text ' + idx);
}
return new Promise((resolve) => resolve(training));
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getImageTrainingByLabel(projectid: string, label: string, options: DbTypes.PagingOptions) {
const start = options.start;
const limit = options.limit;
let end: number;
if (projectid === 'projectbobvis' || projectid === 'projectbobvislim') {
end = Math.min(start + limit, NUM_IMAGES_TRAINING_PER_LABEL[label]);
}
else if (projectid === 'tinyvis') {
end = Math.min(start + limit, NUM_IMAGES_TRAINING_TINY[label]);
}
else if (projectid === 'massivevis') {
end = Math.min(start + limit, NUM_IMAGES_TRAINING_MASSIVE[label]);
}
else {
throw new Error('Unexpected project id');
}
const training: Array<{ [imageurl: string]: string }> = [];
for (let idx = start; idx < end; idx++) {
training.push({ imageurl : 'http://some-website.com/' + label + '-' + idx + '.jpg' });
}
return new Promise((resolve) => resolve(training));
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function storeConversationWorkspace(
credentials: TrainingTypes.BluemixCredentials,
project: DbTypes.Project,
classifier: TrainingTypes.ConversationWorkspace,
): Promise<TrainingTypes.ConversationWorkspace>
{
return new Promise((resolve) => resolve(
DbObjects.getWorkspaceFromDbRow(
DbObjects.createConversationWorkspace(
classifier, credentials, project,
),
),
));
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function storeImageClassifier(
credentials: TrainingTypes.BluemixCredentials,
project: DbTypes.Project,
classifier: TrainingTypes.VisualClassifier,
): Promise<TrainingTypes.VisualClassifier>
{
return new Promise((resolve) => resolve(
DbObjects.createVisualClassifier(
classifier, credentials, project,
),
));
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function updateConversationWorkspaceExpiry()
{
return Promise.resolve();
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getConversationWorkspaces(projectid: string)
{
return new Promise((resolve) => {
if (projectid === 'existingprojectid') {
return resolve([
{
id : 'existingworkspacedbid',
workspace_id : 'existing-classifier',
credentialsid : '123',
url : 'http://conversation.service/v1/workspaces/existing-classifier',
name : 'existing',
language : 'de',
created : new Date(),
expiry : new Date(),
},
]);
}
resolve([]);
});
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getImageClassifiers()
{
return Promise.resolve([]);
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function deleteConversationWorkspace()
{
return Promise.resolve();
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function deleteImageClassifier()
{
return Promise.resolve();
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function storeOrUpdateScratchKey()
{
return Promise.resolve();
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function updateScratchKeyTimestamp()
{
return Promise.resolve();
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function resetExpiredScratchKey()
{
return Promise.resolve();
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getClassTenant(classid: string)
{
return new Promise((resolve) => resolve({
id : classid,
supportedProjectTypes : [ 'text', 'images' ],
maxUsers : 8,
maxProjectsPerUser : 3,
textClassifierExpiry : 2,
imageClassifierExpiry : 3,
}));
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
FunctionDeclaration
|
export function getProject(projectid: string): Promise<DbTypes.Project>
{
if (projectid === 'projectbob') {
return new Promise((resolve) => resolve({
id : projectid,
name : 'projectname',
userid : 'userid',
classid : 'classid',
type : 'text',
language : 'en',
labels : ['temperature', 'conditions'],
numfields : 0,
isCrowdSourced : false,
}));
}
else if (projectid === 'projectbobvis' ||
projectid === 'projectbobvislim' ||
projectid === 'tinyvis' ||
projectid === 'massivevis')
{
return new Promise((resolve) => resolve({
id : projectid,
name : 'projectname',
userid : 'userid',
classid : 'classid',
type : 'images',
language : 'en',
labels : ['rock', 'paper'],
numfields : 0,
isCrowdSourced : false,
}));
}
else if (projectid === 'existingprojectid') {
return new Promise((resolve) => resolve({
id : projectid,
name : 'existing',
userid : 'userid',
classid : 'classid',
type : 'text',
language : 'de',
labels : ['temperature', 'conditions'],
numfields : 0,
isCrowdSourced : false,
}));
}
throw new Error('Unexpected project id');
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve([ creds ])
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve([ credsForVisRec ])
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve([ ])
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve, reject) => {
if (id === '123') {
return resolve(creds);
}
else if (id === '456') {
return resolve(credsForVisRec);
}
else {
return reject(new Error('Unexpected response when retrieving service credentials'));
}
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(NUM_TRAINING_PER_LABEL)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(NUM_IMAGES_TRAINING_PER_LABEL)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(NUM_IMAGES_TRAINING_TINY)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(NUM_IMAGES_TRAINING_MASSIVE)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve({})
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(training)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(
DbObjects.getWorkspaceFromDbRow(
DbObjects.createConversationWorkspace(
classifier, credentials, project,
),
),
)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve(
DbObjects.createVisualClassifier(
classifier, credentials, project,
),
)
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => {
if (projectid === 'existingprojectid') {
return resolve([
{
id : 'existingworkspacedbid',
workspace_id : 'existing-classifier',
credentialsid : '123',
url : 'http://conversation.service/v1/workspaces/existing-classifier',
name : 'existing',
language : 'de',
created : new Date(),
expiry : new Date(),
},
]);
}
resolve([]);
}
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve({
id : classid,
supportedProjectTypes : [ 'text', 'images' ],
maxUsers : 8,
maxProjectsPerUser : 3,
textClassifierExpiry : 2,
imageClassifierExpiry : 3,
})
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve({
id : projectid,
name : 'projectname',
userid : 'userid',
classid : 'classid',
type : 'text',
language : 'en',
labels : ['temperature', 'conditions'],
numfields : 0,
isCrowdSourced : false,
})
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve({
id : projectid,
name : 'projectname',
userid : 'userid',
classid : 'classid',
type : 'images',
language : 'en',
labels : ['rock', 'paper'],
numfields : 0,
isCrowdSourced : false,
})
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(resolve) => resolve({
id : projectid,
name : 'existing',
userid : 'userid',
classid : 'classid',
type : 'text',
language : 'de',
labels : ['temperature', 'conditions'],
numfields : 0,
isCrowdSourced : false,
})
|
DGraveling/taxinomitis
|
src/tests/training/mockstore.ts
|
TypeScript
|
ArrowFunction
|
(name: string): any => fixtures.create(name)
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
let host: string;
beforeAll(() => {
const response = fixture("IApiResponse");
http.context = jest.fn(() => ({
requestForgeryToken: response.requestForgeryToken,
}));
const fake = fixture("IConfiguration");
const config = Configuration.bind(fake);
host = config.getApiAddress();
});
describe(":getUrl()", () => {
it("Should be cancel url", () => {
const orderRef = fixture("IBankIdCancelRequest").orderRef;
var url = getUrl(orderRef);
expect(url).toEqual(`${host}/bankid/cancel/${orderRef}`);
});
});
describe(":cancel()", () => {
beforeAll(() => {
http.raw = jest.fn();
});
it("Should call http.raw with defined parameters", () => {
const request = fixture("IBankIdCancelRequest");
cancel(request);
expect(http.raw.mock.calls[0][0]).toBeTruthy();
expect(http.raw.mock.calls[0][1]).toBeTruthy();
});
afterAll(() => {
http.raw.mockRestore();
});
});
afterAll(() => {
http.context.mockRestore();
});
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
const response = fixture("IApiResponse");
http.context = jest.fn(() => ({
requestForgeryToken: response.requestForgeryToken,
}));
const fake = fixture("IConfiguration");
const config = Configuration.bind(fake);
host = config.getApiAddress();
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => ({
requestForgeryToken: response.requestForgeryToken,
})
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
it("Should be cancel url", () => {
const orderRef = fixture("IBankIdCancelRequest").orderRef;
var url = getUrl(orderRef);
expect(url).toEqual(`${host}/bankid/cancel/${orderRef}`);
});
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
const orderRef = fixture("IBankIdCancelRequest").orderRef;
var url = getUrl(orderRef);
expect(url).toEqual(`${host}/bankid/cancel/${orderRef}`);
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
beforeAll(() => {
http.raw = jest.fn();
});
it("Should call http.raw with defined parameters", () => {
const request = fixture("IBankIdCancelRequest");
cancel(request);
expect(http.raw.mock.calls[0][0]).toBeTruthy();
expect(http.raw.mock.calls[0][1]).toBeTruthy();
});
afterAll(() => {
http.raw.mockRestore();
});
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
http.raw = jest.fn();
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
const request = fixture("IBankIdCancelRequest");
cancel(request);
expect(http.raw.mock.calls[0][0]).toBeTruthy();
expect(http.raw.mock.calls[0][1]).toBeTruthy();
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
http.raw.mockRestore();
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
http.context.mockRestore();
}
|
wayke-se/wayke-ecom-js
|
src/http/apis/bankid/cancel.spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
const [checked, setChecked] = useState(false);
const preset = select('theme-preset', presetsKeys, 'default');
const view = select('view', ['default'], 'default') as any;
const size = select('size', ['s', 'm', 'l'], 'm') as any;
const labelBefore = text('labelBefore', '');
const labelAfter = text('labelAfter', '');
const disabled = boolean('disabled', false);
return (
<div className={cnTheme(presets[preset])}>
<Tumbler
size={size}
disabled={disabled}
view={view}
checked={checked}
onChange={()
|
geralexgit/yandex-ui
|
src/Tumbler/Tumbler.examples/desktop/playground.examples.tsx
|
TypeScript
|
MethodDeclaration
|
cnTheme(presets[preset])
|
geralexgit/yandex-ui
|
src/Tumbler/Tumbler.examples/desktop/playground.examples.tsx
|
TypeScript
|
InterfaceDeclaration
|
export interface IFlight extends Document {
pilot: string;
airplane: string;
destinationCity: string;
flightDate: Date;
passenger: IPassenger[];
}
|
Rodrigosik/CursoNestJs
|
src/common/interfaces/flight.interface.ts
|
TypeScript
|
ArrowFunction
|
({ nav, linkLabel, rrLink, rrCategory, rightAlignIcon }) => {
const url = nav.readerRevenueLinks[rrLink][rrCategory];
if (url === '') {
return null;
}
const isAmpHeader = rrLink === 'ampHeader';
return (
<div css={isAmpHeader ? supportHeaderStyles : supportFooterStyles}>
<a css={supportLinkStyles} href={url}>
{linkLabel}
<span css={!!rightAlignIcon && rightAlignedIcon}
|
guardian/dotcom-rendering
|
dotcom-rendering/src/amp/components/ReaderRevenueButton.tsx
|
TypeScript
|
ClassDeclaration
|
export declare class TaskListImpl extends React.PureComponent<Partial<TaskListProps> & ThemeProps, TaskListState> {
constructor(props: TaskListProps);
static getDerivedStateFromProps(nextProps: TaskListProps, prevState: TaskListState): {
selectedTaskSid?: string;
compareFunction?: (a: ITask, b: ITask) => number;
staticFilter?: AppConfig.TaskFilterCallback;
filters?: AppConfig.TaskFilter[];
onFilterChange?: (filter: AppConfig.TaskFilter) => void;
onTaskSelected?: (sid: string) => void;
tasks?: Map<string, ITask>;
selectedFilter?: AppConfig.TaskFilter;
};
private _isFilterChanging;
private handleFilterChange;
render(): JSX.Element;
private createTaskListItem;
}
|
falabella-labs/flex-ui
|
src/components/TaskList/TaskListImpl.d.ts
|
TypeScript
|
MethodDeclaration
|
static getDerivedStateFromProps(nextProps: TaskListProps, prevState: TaskListState): {
selectedTaskSid?: string;
compareFunction?: (a: ITask, b: ITask) => number;
staticFilter?: AppConfig.TaskFilterCallback;
filters?: AppConfig.TaskFilter[];
onFilterChange?: (filter: AppConfig.TaskFilter) => void;
onTaskSelected?: (sid: string) => void;
tasks?: Map<string, ITask>;
selectedFilter?: AppConfig.TaskFilter;
};
|
falabella-labs/flex-ui
|
src/components/TaskList/TaskListImpl.d.ts
|
TypeScript
|
ClassDeclaration
|
export class Posts extends Model {
public static readonly tableName: string = 'posts';
public id: number;
public title: string;
public body: string;
public userId: number;
public createdAt: Date;
public updatedAt: Date;
setTags: any;
public static prepareInit(sequelize: Sequelize) {
this.init(
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
autoIncrement: true,
},
title: {
type: DataTypes.TEXT(),
allowNull: false,
},
body: {
type: DataTypes.TEXT(),
allowNull: false,
},
userId: {
type: DataTypes.INTEGER(),
allowNull: false,
},
},
{
sequelize,
tableName: this.tableName,
}
);
}
}
|
adarshaacharya/CsOverflow
|
server/modules/posts/posts.model.ts
|
TypeScript
|
MethodDeclaration
|
public static prepareInit(sequelize: Sequelize) {
this.init(
{
id: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
autoIncrement: true,
},
title: {
type: DataTypes.TEXT(),
allowNull: false,
},
body: {
type: DataTypes.TEXT(),
allowNull: false,
},
userId: {
type: DataTypes.INTEGER(),
allowNull: false,
},
},
{
sequelize,
tableName: this.tableName,
}
);
}
|
adarshaacharya/CsOverflow
|
server/modules/posts/posts.model.ts
|
TypeScript
|
FunctionDeclaration
|
export default function adjustWindowsNetworkingActivityQuery(state: any) {
const shippedQuery = {
id: "3",
name: "Windows Networking Activity",
value: "_path=~smb* OR _path=dce_rpc",
description:
"Filters and displays smb_files, smb_mapping and DCE_RPC activity",
tags: ["windows", "smb", "malware"]
}
for (const s of getAllStates(state)) {
if (!s.queries) continue
// @ts-ignore
const targetQuery = Object.values(s.queries.items).find(({id}) => {
return id === "3"
})
if (targetQuery && isEqual(targetQuery, shippedQuery)) {
// @ts-ignore
targetQuery.value = "_path=smb* OR _path=dce_rpc"
}
}
return state
}
|
brimdata/brim
|
src/js/state/migrations/202103011928_adjustWindowsNetworkingActivityQuery.ts
|
TypeScript
|
ArrowFunction
|
({id}) => {
return id === "3"
}
|
brimdata/brim
|
src/js/state/migrations/202103011928_adjustWindowsNetworkingActivityQuery.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* TODO: 消息首页
*/
export function getMessageIndex() {
return {
option: {
method: POST,
url: "/message/index",
},
};
}
|
PlutoCA/taro-template
|
src/chili_req/api/message.ts
|
TypeScript
|
FunctionDeclaration
|
export function getMessageList(data: {
type: string
}) {
return {
option: {
method: GET,
url: "/message/list",
data,
},
};
}
|
PlutoCA/taro-template
|
src/chili_req/api/message.ts
|
TypeScript
|
ArrowFunction
|
() => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
});
}
|
cebartling/nfl-draft-firebase
|
e2e/app.e2e-spec.ts
|
TypeScript
|
ArrowFunction
|
() => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
}
|
cebartling/nfl-draft-firebase
|
e2e/app.e2e-spec.ts
|
TypeScript
|
FunctionDeclaration
|
/* tslint:disable */
/* eslint-disable */
/**
* @param {Uint8Array} data
* @returns {DecodeFrames}
*/
export function decode(data: Uint8Array): DecodeFrames;
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* @param {number} width
* @param {number} height
* @param {Uint8Array} frames
* @param {Uint16Array} delays
* @param {Uint8Array} global_palette
* @param {number} mode
* @param {number | undefined} times
* @returns {Uint8Array}
*/
export function encode(width: number, height: number, frames: Uint8Array, delays: Uint16Array, global_palette: Uint8Array, mode: number, times?: number): Uint8Array;
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {InitInput | Promise<InitInput>} module_or_path
*
* @returns {Promise<InitOutput>}
*/
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
ClassDeclaration
|
/**
*/
export class DecodeFrames {
free(): void;
/**
* @returns {Uint8Array}
*/
readonly data: Uint8Array;
/**
* @returns {Uint16Array}
*/
readonly delays: Uint16Array;
/**
*/
frameCount: number;
/**
*/
height: number;
/**
* @returns {Uint8Array}
*/
readonly palette: Uint8Array;
/**
*/
width: number;
}
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly __wbg_decodeframes_free: (a: number) => void;
readonly __wbg_get_decodeframes_width: (a: number) => number;
readonly __wbg_set_decodeframes_width: (a: number, b: number) => void;
readonly __wbg_get_decodeframes_height: (a: number) => number;
readonly __wbg_set_decodeframes_height: (a: number, b: number) => void;
readonly __wbg_get_decodeframes_frameCount: (a: number) => number;
readonly __wbg_set_decodeframes_frameCount: (a: number, b: number) => void;
readonly decodeframes_data: (a: number, b: number) => void;
readonly decodeframes_delays: (a: number, b: number) => void;
readonly decodeframes_palette: (a: number, b: number) => void;
readonly decode: (a: number, b: number) => number;
readonly encode: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
readonly __wbindgen_free: (a: number, b: number) => void;
readonly __wbindgen_malloc: (a: number) => number;
}
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
EnumDeclaration
|
/**
*/
export enum GifPlayMode {
REPEAT,
SINGLE,
}
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
MethodDeclaration
|
free(): void;
|
WenheLI/wasm-gif
|
pkg/wasm_gif.d.ts
|
TypeScript
|
FunctionDeclaration
|
function pause(ms: number): void {}
|
ASDAlexander77/TypeScriptCompiler
|
docs/bugs/bug5.ts
|
TypeScript
|
FunctionDeclaration
|
function throwVal(n: number) {
print("throw", n);
pause(1)
if (n > 0)
throw n
pause(1)
}
|
ASDAlexander77/TypeScriptCompiler
|
docs/bugs/bug5.ts
|
TypeScript
|
FunctionDeclaration
|
function callingThrowVal(k: number) {
print("calling throw");
try {
pause(1)
throwVal(k)
pause(1)
glb1++
} catch (e:number) {
print("caught", e, k);
assert(e == k)
glb1 += 10
if (k >= 10) {
print("rethrow", e, k);
throw e
}
} finally {
print("finally", e, k);
x += glb1
}
}
|
ASDAlexander77/TypeScriptCompiler
|
docs/bugs/bug5.ts
|
TypeScript
|
FunctionDeclaration
|
function nested() {
print("nested");
try {
try {
callingThrowVal(10)
} catch (e:number) {
print("nested caught", e);
assert(glb1 == 10 && x == 10)
glb1++
print("throw again", e);
throw e
}
} catch (ee:number) {
assert(glb1 == 11)
}
}
|
ASDAlexander77/TypeScriptCompiler
|
docs/bugs/bug5.ts
|
TypeScript
|
FunctionDeclaration
|
function test4(fn: () => void) {
try {
fn()
return 10
} catch {
return 20
}
}
|
ASDAlexander77/TypeScriptCompiler
|
docs/bugs/bug5.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.