type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
MethodDeclaration |
public setScrollsVisible(params: SetScrollsVisibleParams): void {
const atLeastOneDifferent =
this.horizontalScrollShowing !== params.horizontalScrollShowing ||
this.verticalScrollShowing !== params.verticalScrollShowing;
if (atLeastOneDifferent) {
this.horizontalSc... | Bakino/ag-grid | community-modules/core/src/ts/gridBodyComp/scrollVisibleService.ts | TypeScript |
MethodDeclaration | // used by pagination service - to know page height
public isHorizontalScrollShowing(): boolean {
return this.horizontalScrollShowing;
} | Bakino/ag-grid | community-modules/core/src/ts/gridBodyComp/scrollVisibleService.ts | TypeScript |
MethodDeclaration | // used by header container
public isVerticalScrollShowing(): boolean {
return this.verticalScrollShowing;
} | Bakino/ag-grid | community-modules/core/src/ts/gridBodyComp/scrollVisibleService.ts | TypeScript |
ClassDeclaration | /**
* BitBucket repository using {@link repository-custom-resource#BitBucketRepoCustomResource | BitBucketRepoCustomResource}
*/
export class BitBucketRepo extends cdk.Construct {
constructor(scope: cdk.Construct, id: string, props: BitBucketRepoProps) {
super(scope, id);
new cdk.CustomResource(this, `${id... | pgarbe/cdk-bitbucket-server | src/repository.ts | TypeScript |
InterfaceDeclaration | /**
* Props of BitBucketRepo.
*/
export interface BitBucketRepoProps {
/**
* Token returned by {@link repository-custom-resource#BitBucketRepoCustomResource | BitBucketRepoCustomResource}
*/
readonly serviceToken: string;
/**
* Name of the project.
*/
readonly projectName: string;
/**
* Slug ... | pgarbe/cdk-bitbucket-server | src/repository.ts | TypeScript |
ArrowFunction |
async (req: any, res, next) => {
try {
const file = req.file;
const extension = file.originalname.split('.').pop();
const data: IFileDescriptor = {
real_id: file.id,
adapter: file.adapter,
originalna... | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
ArrowFunction |
async (req: any, res, next) => {
const uuid = req.params.uuid;
const fd = await FileDescriptor.find(uuid);
if (fd) {
const stream = await this.adapter.read(fd.real_id);
res.writeHead(200, {
'Content-Type': fd.mimetype.toString(),
... | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
ClassDeclaration |
export class AndesDrive {
private static adapter = null;
private static multer = null;
static setup(params) {
const adapterName = params.adapter || 'file';
const options = params.options || {};
switch (adapterName) {
case 'file':
this.adapter = new FileA... | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
MethodDeclaration |
static setup(params) {
const adapterName = params.adapter || 'file';
const options = params.options || {};
switch (adapterName) {
case 'file':
this.adapter = new FileAdapter({ folder: options.folder || './' });
break;
case 'mongo':
... | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
MethodDeclaration |
public static install(router) {
router.post('/', this.multer.single('file'), async (req: any, res, next) => {
try {
const file = req.file;
const extension = file.originalname.split('.').pop();
const data: IFileDescriptor = {
real_i... | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
MethodDeclaration |
public static async find(id) {
return FileDescriptor.find(id);
} | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
MethodDeclaration |
public static async read(file: IFileDescriptor) {
return await this.adapter.read(file.real_id);
} | mspsanjuan/sd | api/packages/drive/drive.ts | TypeScript |
ClassDeclaration |
export declare class FakeActor {
options: DocumentConstructionContext<ActorPF2e>;
_data: ActorSourcePF2e;
items: FakeCollection<ItemPF2e>;
effects: FakeCollection<ActiveEffectPF2e>;
_itemGuid: number;
constructor(data: ActorSourcePF2e, options?: DocumentConstructionContext<ActorPF2e>);
get ... | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
prepareData(): void; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
static fromToken(token: Token): ActorPF2e | null; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
static createTokenActor(baseActor: ActorPF2e, token: Token): ActorPF2e; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
update(changes: Record<string, any>): void; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
static updateDocuments(updates?: DocumentUpdateData<ActorPF2e>[], _context?: DocumentModificationContext): Promise<ActorPF2e[]>; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
updateEmbeddedDocuments(type: string, data: any[]): Promise<void>; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
createEmbeddedDocuments(type: string, data: any[], _context: DocumentModificationContext): Promise<void>; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
deleteEmbeddedDocuments(type: string, data: string[]): Promise<void>; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
MethodDeclaration |
toObject(source?: boolean): import("@actor/data").CharacterSource | import("@actor/data").NPCSource | import("@actor/data").FamiliarSource | import("@actor/data").HazardSource | import("@actor/data").LootSource | import("@actor/data").VehicleSource; | xdy/xdy-pf2e-workbench | types/tests/fakes/fake-actor.d.ts | TypeScript |
ArrowFunction |
() => JoinRequestPosition | dokolyski/skating-app | backend/src/api/requests/session-participant.dto.ts | TypeScript |
ClassDeclaration |
export class JoinRequestPosition {
@IsNotEmpty({message: "REQUIRED"})
@IsNumber({}, {message:"MUST_BE_NUMBER"})
session_id: number;
@IsNotEmpty({message: "REQUIRED"})
@IsNumber({}, {message:"MUST_BE_NUMBER"})
profile_id: number;
} | dokolyski/skating-app | backend/src/api/requests/session-participant.dto.ts | TypeScript |
ClassDeclaration |
export class JoinRequest {
@ValidateNested({each: true})
@Type(() => JoinRequestPosition)
positions: JoinRequestPosition[]
@IsNotEmpty({message: "REQUIRED"})
@IsString({message: "MUST_BE_STRING"})
@IsIn(['POINTS', 'CASH'])
type: string;
} | dokolyski/skating-app | backend/src/api/requests/session-participant.dto.ts | TypeScript |
ClassDeclaration |
export class DisjoinRequest {
@IsNotEmpty({message: "REQUIRED"})
@IsNumber({}, {message:"MUST_BE_NUMBER"})
session_id: number;
@IsNotEmpty({message: "REQUIRED"})
@IsNumber({}, {
each: true
})
profiles_ids: number[];
} | dokolyski/skating-app | backend/src/api/requests/session-participant.dto.ts | TypeScript |
ClassDeclaration |
export class EditPresenceRequest {
@IsNotEmpty({message: "REQUIRED"})
@IsNumber({}, {message:"MUST_BE_NUMBER"})
id: number;
@IsNotEmpty({message: "REQUIRED"})
@IsBoolean()
present: boolean;
} | dokolyski/skating-app | backend/src/api/requests/session-participant.dto.ts | TypeScript |
InterfaceDeclaration | /**
* {@docCategory Pivot}
*/
export interface IPivot {
/**
* Sets focus to the first pivot tab.
*/
focus(): void;
} | lathroplabs/VizLaboratoryAddin | node_modules/office-ui-fabric-react/lib/components/Pivot/Pivot.types.d.ts | TypeScript |
InterfaceDeclaration | /**
* {@docCategory Pivot}
*/
export interface IPivotProps extends React.ClassAttributes<PivotBase>, React.HTMLAttributes<HTMLDivElement> {
/**
* Optional callback to access the IPivot interface. Use this instead of ref for accessing
* the public methods and properties of the component.
*/
comp... | lathroplabs/VizLaboratoryAddin | node_modules/office-ui-fabric-react/lib/components/Pivot/Pivot.types.d.ts | TypeScript |
InterfaceDeclaration | /**
* {@docCategory Pivot}
*/
export interface IPivotStyles {
/**
* Style for the root element.
*/
root: IStyle;
link: IStyle;
linkContent: IStyle;
linkIsSelected: IStyle;
text: IStyle;
count: IStyle;
icon: IStyle;
itemContainer?: IStyle;
} | lathroplabs/VizLaboratoryAddin | node_modules/office-ui-fabric-react/lib/components/Pivot/Pivot.types.d.ts | TypeScript |
EnumDeclaration | /**
* {@docCategory Pivot}
*/
export declare enum PivotLinkFormat {
/**
* Display Pivot Links as links
*/
links = 0,
/**
* Display Pivot Links as Tabs
*/
tabs = 1
} | lathroplabs/VizLaboratoryAddin | node_modules/office-ui-fabric-react/lib/components/Pivot/Pivot.types.d.ts | TypeScript |
EnumDeclaration | /**
* {@docCategory Pivot}
*/
export declare enum PivotLinkSize {
/**
* Display Link using normal font size
*/
normal = 0,
/**
* Display links using large font size
*/
large = 1
} | lathroplabs/VizLaboratoryAddin | node_modules/office-ui-fabric-react/lib/components/Pivot/Pivot.types.d.ts | TypeScript |
TypeAliasDeclaration | /**
* {@docCategory Pivot}
*/
export declare type IPivotStyleProps = Required<Pick<IPivotProps, 'theme'>> & Pick<IPivotProps, 'className'> & {
/** Indicates whether Pivot has large format. */
rootIsLarge?: boolean;
/** Indicates whether Pivot has tabbed format. */
rootIsTabs?: boolean;
/**
* ... | lathroplabs/VizLaboratoryAddin | node_modules/office-ui-fabric-react/lib/components/Pivot/Pivot.types.d.ts | TypeScript |
ArrowFunction |
(eventState: EventState): Colors => {
/* eslint-disable default-case */
switch (eventState) {
case EventState.Active:
return Colors.Active
case EventState.Paused:
return Colors.Inactive
case EventState.Finished:
return Colors.Finished
case EventState.Survey:
return Colors.Fi... | Simspace/monorail | src/helpers/eventState.ts | TypeScript |
EnumDeclaration |
export enum EventState {
// Enrolled (Event status: 'inactive')
Scheduled = 'scheduled',
// Past reservationStart time, but waiting on backend to start event
// (Event status: 'inactive')
Starting = 'starting',
// In Progress
Active = 'active',
// Canceled
Canceled = 'canceled',
// Complete
Finis... | Simspace/monorail | src/helpers/eventState.ts | TypeScript |
FunctionDeclaration |
export function useLocalStorageState(key: string, defaultState?: string) {
const [state, setState] = useState(() => {
// NOTE: Not sure if this is ok
const storedState = localStorage.getItem(key)
if (storedState) {
return JSON.parse(storedState)
}
return defaultState
})
const setLocalS... | vecheslav/metaplex-js-second | packages/react/src/utils/index.ts | TypeScript |
ArrowFunction |
() => {
// NOTE: Not sure if this is ok
const storedState = localStorage.getItem(key)
if (storedState) {
return JSON.parse(storedState)
}
return defaultState
} | vecheslav/metaplex-js-second | packages/react/src/utils/index.ts | TypeScript |
ArrowFunction |
(newState) => {
const changed = state !== newState
if (!changed) {
return
}
setState(newState)
if (newState === null) {
localStorage.removeItem(key)
} else {
try {
localStorage.setItem(key, JSON.stringify(newState))
} catch {
// ig... | vecheslav/metaplex-js-second | packages/react/src/utils/index.ts | TypeScript |
TypeAliasDeclaration |
export type FormType = TypesDocument.IDocumentFormType | myestorm/pkm | src/store/modules/document/types.ts | TypeScript |
TypeAliasDeclaration |
export type DocumentState = {
directory: string[],
list: TypesDocument.IDocumentPageListItemType[],
keyword: string,
id: string,
fileFormVisible: boolean,
fileFormType: FileFormType,
fileFormInitValue: TypesDocument.IDocumentFormType
} | myestorm/pkm | src/store/modules/document/types.ts | TypeScript |
FunctionDeclaration |
export function parseJsx(jsx: string): JSXLiteComponent {
const output = babel.transform(jsx, {
presets: [[tsPreset, { isTSX: true, allExtensions: true }]],
plugins: [
jsxPlugin,
() => ({
visitor: {
Program(path: babel.NodePath<babel.types.Program>, context: Context) {
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(array: JSONOrNode[]) => {
return types.arrayExpression(array.map((item) => jsonToAst(item)) as any);
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) => jsonToAst(item) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(json: JSONOrNode): babel.Node => {
if (types.isNode(json as any)) {
if (types.isJSXText(json as any)) {
return types.stringLiteral((json as any).value);
}
return json as babel.Node;
}
switch (typeof json) {
case 'undefined':
return types.identifier('undefined');
case 'string':
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(
json: JSONOrNodeObject,
): babel.types.ObjectExpression => {
if (!json) {
return json;
}
const properties: babel.types.ObjectProperty[] = [];
for (const key in json) {
const value = json[key];
if (value === undefined) {
continue;
}
const keyAst = types.stringLiteral(key);
cons... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(str: string) => {
return types.templateLiteral([types.templateElement({ raw: str })], []);
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(node: babel.types.Node) => {
return types.stringLiteral(`${functionLiteralPrefix}${generate(node).code}`);
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(
key: babel.types.Expression,
node: babel.types.Node,
) => {
return types.objectProperty(key, createFunctionStringLiteral(node));
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(
node: babel.types.FunctionDeclaration,
context: Context,
): JSONOrNode => {
let state = {};
for (const item of node.body.body) {
if (types.isVariableDeclaration(item)) {
const init = item.declarations[0].init;
if (types.isCallExpression(init)) {
const firstArg = init.arguments[0];
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) => {
if (types.isObjectProperty(item)) {
if (
types.isFunctionExpression(item.value) ||
types.isArrowFunctionExpression(item.value)
) {
return createFunctionStringLiteralObjectProperty(
item.key,
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) =>
types.isReturnStatement(item) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(
node:
| babel.types.JSXElement
| babel.types.JSXText
| babel.types.JSXExpressionContainer,
): JSXLiteNode => {
if (types.isJSXText(node)) {
return createJSXLiteNode({
properties: {
_text: node.value,
},
});
}
if (types.isJSXExpressionContainer(node)) {
return creat... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) => types.isJSXAttribute(item) && item.name.name === 'when' | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) =>
jsxElementToJson(item as any) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) =>
types.isJSXExpressionContainer(item) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(memo, item) => {
if (types.isJSXAttribute(item)) {
const key = item.name.name as string;
const value = item.value;
if (types.isStringLiteral(value)) {
memo[key] = value;
return memo;
}
}
return memo;
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(memo, item) => {
if (types.isJSXAttribute(item)) {
const key = item.name.name as string;
const value = item.value;
if (types.isJSXExpressionContainer(value)) {
const { expression } = value;
if (types.isArrowFunctionExpression(expression)) {
memo[key] = ge... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(item) => jsxElementToJson(item as any) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
() => ({
visitor: {
Program(path: babel.NodePath<babel.types.Program>, context: Context) {
if (context.builder) {
return;
}
context.builder = {
component: createJSXLiteComponent(),
};
const isImportOrDefaultExpor... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(node: babel.Node) =>
types.isExportDefaultDeclaration(node) ||
types.isImportDeclaration(node) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(statement) =>
isImportOrDefaultExport(statement) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(statement) => !isImportOrDefaultExport(statement) | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
TypeAliasDeclaration |
type Context = {
// Babel has other context
builder: {
component: JSXLiteComponent;
};
}; | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
MethodDeclaration |
Program(path: babel.NodePath<babel.types.Program>, context: Context) {
if (context.builder) {
return;
}
context.builder = {
component: createJSXLiteComponent(),
};
const isImportOrDefaultExport = (node: babel.Node) =>
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
MethodDeclaration |
FunctionDeclaration(
path: babel.NodePath<babel.types.FunctionDeclaration>,
context: Context,
) {
const { node } = path;
if (types.isIdentifier(node.id)) {
const name = node.id.name;
if (name[0].toUpperCase() === name[0]) {
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
MethodDeclaration |
ImportDeclaration(
path: babel.NodePath<babel.types.ImportDeclaration>,
context: Context,
) {
// @jsx-lite/core imports compile away. yeehaw
if (path.node.source.value == '@jsx-lite/core') {
path.remove();
return;
}
... | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
MethodDeclaration |
ExportDefaultDeclaration(
path: babel.NodePath<babel.types.ExportDefaultDeclaration>,
) {
path.replaceWith(path.node.declaration);
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
MethodDeclaration |
JSXElement(path: babel.NodePath<babel.types.JSXElement>) {
const { node } = path;
path.replaceWith(jsonToAst(jsxElementToJson(node)));
} | mrkoreye/jsx-lite | packages/core/src/parsers/jsx.ts | TypeScript |
ArrowFunction |
(key, value, success, reject?) => {
this.storage.get('userForm').then(userFormStrng => {
let userForm: any;
try {
userForm = JSON.parse(userFormStrng);
userForm[key] = value;
this.storage.set('userForm', JSON.stringify(userForm))
... | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
userFormStrng => {
let userForm: any;
try {
userForm = JSON.parse(userFormStrng);
userForm[key] = value;
this.storage.set('userForm', JSON.stringify(userForm))
.then(res => {
this.setCacheUser(JSON.parse... | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
res => {
this.setCacheUser(JSON.parse(res));
success(this._cache_user);
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
() => {
console.log('store cleared');
this.storage.set('userForm', JSON.stringify({ [key]: value }))
.then(res => success(res))
.catch(error => reject(error));
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
res => success(res) | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
err => {
this.generateEmptyUserForm((res) => success(res), null, { [key]: value });
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(res) => success(res) | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(success, reject?) => {
try {
this.storage.get('userForm').then(res => {
let data = JSON.parse(res);
if (data && data.type) success(data.type);
}).catch(err => {
reject(false)
})
} catch (e) {
reject(false)
... | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
res => {
let data = JSON.parse(res);
if (data && data.type) success(data.type);
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
err => {
reject(false)
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(cb) => {
this.storage.clear().then(res => {
this.storage.keys().then((keys) => {
cb(keys);
});
});
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
res => {
this.storage.keys().then((keys) => {
cb(keys);
});
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(keys) => {
cb(keys);
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(success, reject?, initData?) => {
let err: any;
let data: any;
(initData) ? data = initData : data = {};
this.storage.set('userForm', JSON.stringify(data)).then(res => success(res)).catch(error => err = error);
if (reject) reject(err);
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
error => err = error | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(userObj: Object) => {
console.log('cache user ', this._cache_user);
this._cache_user = userObj;
console.log('cache user ', this._cache_user);
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ClassDeclaration |
@Injectable()
export class Localstorage {
private _cache_user: any;
user = "nothing";
constructor(private storage: Storage) { }
saveUsertype(User) {
localStorage.setItem(this.user, User);
}
public addItemToUserForm = (key, value, success, reject?) => {
this.storage.get('userF... | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
MethodDeclaration |
saveUsertype(User) {
localStorage.setItem(this.user, User);
} | Ahmedesayed/bunch | src/_helpers/localstorage.controller.ts | TypeScript |
ArrowFunction |
(value: string) => {
let isSpecialArryString = false;
const typeOfValue = typeof value;
if (typeOfValue === 'string' && value[0] == '[' && value[value.length - 1] == ']') {
const convertedValue = parseArray(value);
if (Array.isArray(convertedValue)) {
convertedValue.forEach((item: any) => {
... | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
ArrowFunction |
(item: any) => {
if (!isNaN(Number(item)) && typeof item === 'string' && item.includes('.')) {
const spl = item.split('.');
if (spl.length > 1) {
//Also, making sure that we don't touch if the values are ["0.12"]
if (spl[0].length > 1 && Number(spl[0]) === 0) {
... | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
ArrowFunction |
(value: any, allowedValues?: string[]): CapiVariableTypes => {
if (allowedValues) {
if (allowedValues.every((v) => typeof v === 'string')) {
return CapiVariableTypes.ENUM;
}
}
if (typeof value === 'boolean' || value === 'true' || value === 'false') {
return CapiVariableTypes.BOOLEAN;
}
if (... | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
ArrowFunction |
(v) => typeof v === 'string' | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
ArrowFunction |
(
value: any,
capiType: CapiVariableTypes,
allowedValues?: string[] | null,
shouldConvertNumbers?: boolean,
) => {
switch (capiType) {
case CapiVariableTypes.NUMBER:
if (!isNaN(parseFloat(value))) {
return `${parseFloat(value)}`;
}
break;
case CapiVariableTypes.STRING:
c... | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
ArrowFunction |
(capiVar: CapiVariable): any => {
switch (capiVar.type) {
case CapiVariableTypes.BOOLEAN:
return parseBoolean(capiVar.value);
case CapiVariableTypes.NUMBER:
if (!isNaN(parseFloat(capiVar.value))) {
return parseFloat(capiVar.value);
}
return capiVar.value;
case CapiVariable... | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
ClassDeclaration |
export class CapiVariable {
public key: string;
public type: CapiVariableTypes;
public value: any;
public readonly: boolean;
public writeonly: boolean;
public allowedValues: string[] | null;
public bindTo: string | null;
public shouldConvertNumbers?: boolean;
constructor(options: ICapiVariableOptions... | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
InterfaceDeclaration |
export interface ICapiVariableOptions {
key: string;
type?: CapiVariableTypes;
value?: any;
readonly?: boolean;
writeonly?: boolean;
allowedValues?: string[];
bindTo?: string;
shouldConvertNumbers?: boolean;
} | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
InterfaceDeclaration |
export interface JanusConditionProperties extends ConditionProperties {
id: string;
type?: CapiVariableTypes;
} | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
EnumDeclaration |
export enum CapiVariableTypes {
NUMBER = 1,
STRING = 2,
ARRAY = 3,
BOOLEAN = 4,
ENUM = 5,
MATH_EXPR = 6,
ARRAY_POINT = 7,
// TODO: Add OBJECT (janus-script can support)
UNKNOWN = 99,
} | argos-education/oli-torus | assets/src/adaptivity/capi.ts | TypeScript |
FunctionDeclaration |
function createWindow() {
const electronScreen = screen;
const size = electronScreen.getPrimaryDisplay().workAreaSize;
// Create the browser window.
win = new BrowserWindow({
x: 0,
y: 0,
width: size.width,
height: size.height,
webPreferences: {
nodeIntegration: true,
},
});
... | stixx200/collage-maker-ui | src/main/main.ts | TypeScript |
ArrowFunction |
() => {
// Dereference the window object, usually you would store window
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null;
deinit();
} | stixx200/collage-maker-ui | src/main/main.ts | TypeScript |
ArrowFunction |
(type: 'red' | 'green' | 'blue') => {
switch (type) {
case 'red':
return styles.typedBackgroundRed
case 'green':
return styles.typedBackgroundGreen
case 'blue':
return styles.typedBackgroundBlue
default:
Flow.ifFlowComplainsAboutThisFunctionYouHaventHandledAllCasesInASwitch(ty... | SerenadeX/client-2 | shared/profile/user/index.tsx | TypeScript |
ArrowFunction |
p => (
<Kb.Box2 direction="vertical" | SerenadeX/client-2 | shared/profile/user/index.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.