type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
()=>{
this.navCtrl.setRoot(HomePage);
} | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
ArrowFunction |
error=>{
this.loading.dismiss().then(()=>{
const alert : Alert = this.alertCtrl.create({
message:error.message,
buttons:[{text:'OK',role:'cancel'}]
});
alert.present();
});
} | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
ArrowFunction |
()=>{
const alert : Alert = this.alertCtrl.create({
message:error.message,
buttons:[{text:'OK',role:'cancel'}]
});
alert.present();
} | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
ClassDeclaration |
@IonicPage()
@Component({
selector: 'page-login',
templateUrl: 'login.html',
})
export class LoginPage {
public loginForm : FormGroup;
public loading : Loading;
constructor(public navCtrl: NavController, public navParams: NavParams, public loadingCtrl:LoadingController, public alertCtrl:AlertController,publi... | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
MethodDeclaration |
goToSignup():void{
this.navCtrl.push('SignupPage');
} | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
MethodDeclaration |
goToResetPassword():void{
this.navCtrl.push('PasswordRestartPage');
} | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
MethodDeclaration |
loginUser():void{
if(!this.loginForm.valid){
console.log('Not Valid');
}else{
const email = this.loginForm.value.email;
const pass = this.loginForm.value.password;
this.authProvider.loginUser(email,pass).then(authData=>{
this.loading.dismiss().then(()=>{
this.navCtrl.s... | fkurtulus/IonicFirebaseApp | src/pages/login/login.ts | TypeScript |
ArrowFunction |
(data: string[]) =>
data.map(option => {
return {
key: option,
selected: false,
};
}) | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
option => {
return {
key: option,
selected: false,
};
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
key => key === id | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
() => {
const { options, question } = this.props;
return !!options ? options : emptyList(question.options);
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
(id: string) => {
const { dispatch, question } = this.props;
const inclusiveOption = question.inclusiveOption;
const dataItem = this._getData().find(
(option: Option) => option.key === id
);
if (!!dataItem) {
const toggled = !dataItem.selected;
let data = this._isExclusive(id)
... | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
(option: Option) => option.key === id | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
(option: Option) => {
if (inclusiveOption === id && !this._isExclusive(option.key)) {
return {
key: option.key,
selected: true,
};
}
if (this._isExclusive(option.key) && !this._isExclusive(id)) {
return {
key: option.key,
... | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
(option: Option) => (
<OptionItem
highlighted={highlighted} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
(state: StoreState, props: Props) => ({
options: getAnswer(state, props.question),
}) | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ArrowFunction |
() => {
this.props.onPressItem(this.props.id);
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ClassDeclaration |
class OptionList extends React.PureComponent<Props> {
_isExclusive(id: string): boolean {
return (this.props.question.exclusiveOptions || []).some(key => key === id);
}
_getData = () => {
const { options, question } = this.props;
return !!options ? options : emptyList(question.options);
};
_onP... | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
ClassDeclaration |
class Item extends React.Component<ItemProps & WithNamespaces> {
shouldComponentUpdate(props: ItemProps & WithNamespaces) {
return (
this.props.highlighted != props.highlighted ||
this.props.selected != props.selected ||
this.props.style != props.style ||
this.props.id != props.id
);
... | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
InterfaceDeclaration |
interface Props {
question: OptionQuestion;
highlighted?: boolean;
options?: Option[];
dispatch(action: Action): void;
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
InterfaceDeclaration |
interface ItemProps {
highlighted?: boolean;
id: string;
selected: boolean;
style?: StyleProp<ViewStyle>;
onPressItem(id: string): void;
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
MethodDeclaration |
_isExclusive(id: string): boolean {
return (this.props.question.exclusiveOptions || []).some(key => key === id);
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
MethodDeclaration |
render() {
const { highlighted, question } = this.props;
const options = question.options;
return (
<View style={styles.container}>
{this._getData().map((option: Option) => (
<OptionItem
highlighted={highlighted}
id={option.key}
key={option.key}
... | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
MethodDeclaration |
shouldComponentUpdate(props: ItemProps & WithNamespaces) {
return (
this.props.highlighted != props.highlighted ||
this.props.selected != props.selected ||
this.props.style != props.style ||
this.props.id != props.id
);
} | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
MethodDeclaration |
render() {
const { highlighted, id, selected, t } = this.props;
return (
<TouchableOpacity
style={[styles.item, this.props.style]}
onPress={this._onPress}
>
<View
style={[
styles.checkbox,
selected && styles.checkboxSelected,
!!... | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
MethodDeclaration |
t(`surveyOption:${id | rgatkinson/audere | FluStudy_us/src/ui/components/OptionList.tsx | TypeScript |
FunctionDeclaration | /**
* Virtual Network resource.
*/
export function getVirtualNetwork(args: GetVirtualNetworkArgs, opts?: pulumi.InvokeOptions): Promise<GetVirtualNetworkResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("a... | pulumi/pulumi-azure-nextgen | sdk/nodejs/network/v20200501/getVirtualNetwork.ts | TypeScript |
InterfaceDeclaration |
export interface GetVirtualNetworkArgs {
/**
* Expands referenced resources.
*/
readonly expand?: string;
/**
* The name of the resource group.
*/
readonly resourceGroupName: string;
/**
* The name of the virtual network.
*/
readonly virtualNetworkName: string;
} | pulumi/pulumi-azure-nextgen | sdk/nodejs/network/v20200501/getVirtualNetwork.ts | TypeScript |
InterfaceDeclaration | /**
* Virtual Network resource.
*/
export interface GetVirtualNetworkResult {
/**
* The AddressSpace that contains an array of IP address ranges that can be used by subnets.
*/
readonly addressSpace?: outputs.network.v20200501.AddressSpaceResponse;
/**
* Bgp Communities sent over ExpressRou... | pulumi/pulumi-azure-nextgen | sdk/nodejs/network/v20200501/getVirtualNetwork.ts | TypeScript |
ClassDeclaration | /**
* PersistencePromise<> is essentially a re-implementation of Promise<> except
* it has a .next() method instead of .then() and .next() and .catch() callbacks
* are executed synchronously when a PersistencePromise resolves rather than
* asynchronously (Promise<> implementations use setImmediate() or similar)... | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
TypeAliasDeclaration | /**
* @license
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
TypeAliasDeclaration |
export declare type RejectedHandler<R> = ((reason: Error) => R | PersistencePromise<R>) | null; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
TypeAliasDeclaration |
export declare type Resolver<T> = (value?: T) => void; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
TypeAliasDeclaration |
export declare type Rejector = (error: Error) => void; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
catch<R>(fn: (error: Error) => R | PersistencePromise<R>): PersistencePromise<R>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
next<R>(nextFn?: FulfilledHandler<T, R>, catchFn?: RejectedHandler<R>): PersistencePromise<R>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
toPromise(): Promise<T>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
static resolve(): PersistencePromise<void>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
static resolve<R>(result: R): PersistencePromise<R>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
static reject<R>(error: Error): PersistencePromise<R>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
static waitFor(all: {
forEach: (cb: (el: PersistencePromise<any>) => void) => void;
}): PersistencePromise<void>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration | /**
* Given an array of predicate functions that asynchronously evaluate to a
* boolean, implements a short-circuiting `or` between the results. Predicates
* will be evaluated until one of them returns `true`, then stop. The final
* result will be whether any of them returned `true`.
*/
st... | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration | /**
* Given an iterable, call the given function on each element in the
* collection and wait for all of the resulting concurrent PersistencePromises
* to resolve.
*/
static forEach<R, S>(collection: {
forEach: (cb: (r: R, s: S) => void) => void;
}, f: ((r: R, s: S) => PersistenceP... | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
MethodDeclaration |
static forEach<R>(collection: {
forEach: (cb: (r: R) => void) => void;
}, f: (r: R) => PersistencePromise<void>): PersistencePromise<void>; | Akshayy99/Battleship-dAPP | node_modules/@firebase/firestore/dist/src/local/persistence_promise.d.ts | TypeScript |
ClassDeclaration |
export class UsersEntity {
id: number;
name: string;
email: string;
password: string;
} | plankton07/study-nest2 | src/users/entity/users.entity.ts | TypeScript |
ArrowFunction |
() => expect(stack) | alex-berger/aws-cdk | packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts | TypeScript |
MethodDeclaration |
'creates CloudFormation Custom Resource'(test: Test) {
const stack = new Stack();
const exampleDotComZone = new PublicHostedZone(stack, 'ExampleDotCom', {
zoneName: 'example.com'
});
new DnsValidatedCertificate(stack, 'Certificate', {
domainName: 'test.example.com',
hostedZone: exam... | alex-berger/aws-cdk | packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts | TypeScript |
MethodDeclaration |
'export and import'(test: Test) {
const stack = new Stack();
const helloDotComZone = new PublicHostedZone(stack, 'HelloDotCom', {
zoneName: 'hello.com'
});
const refProps = new DnsValidatedCertificate(stack, 'Cert', {
domainName: 'hello.com',
hostedZone: helloDotComZone,
}).expo... | alex-berger/aws-cdk | packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts | TypeScript |
MethodDeclaration |
'adds validation error on domain mismatch'(test: Test) {
const stack = new Stack();
const helloDotComZone = new PublicHostedZone(stack, 'HelloDotCom', {
zoneName: 'hello.com'
});
new DnsValidatedCertificate(stack, 'Cert', {
domainName: 'example.com',
hostedZone: helloDotComZone,
... | alex-berger/aws-cdk | packages/@aws-cdk/aws-certificatemanager/test/test.dns-validated-certificate.ts | TypeScript |
ArrowFunction |
async (
app: JupyterFrontEnd,
palette: ICommandPalette,
editorServices: IEditorServices,
status: ILabStatus,
themeManager: IThemeManager | null
) => {
console.log('Elyra - metadata extension is activated!');
const openMetadataEditor = (args: {
schema: string;
namespace: strin... | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(args: {
schema: string;
namespace: string;
name?: string;
onSave: () => void;
}): void => {
let widgetLabel: string;
if (args.name) {
widgetLabel = args.name;
} else {
widgetLabel = `New ${args.schema}`;
}
const widgetId = `${METADATA_EDITOR_ID... | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(widget: Widget, index: number) => {
return widget.id == widgetId;
} | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(args: any) => {
openMetadataEditor(args);
} | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(): void => {
const isLight =
themeManager.theme && themeManager.isLight(themeManager.theme);
document
.querySelectorAll(`.${METADATA_EDITOR_ID}`)
.forEach((element: any) => {
if (isLight) {
element.className = element.className
.replace(new RegEx... | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(element: any) => {
if (isLight) {
element.className = element.className
.replace(new RegExp(`${BP_DARK_THEME_CLASS}`, 'gi'), '')
.trim();
} else {
element.className += ` ${BP_DARK_THEME_CLASS}`;
}
} | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(args: {
display_name: string;
namespace: string;
schema: string;
icon: string;
}): void => {
const labIcon = LabIcon.resolve({ icon: args.icon });
const widgetId = `${METADATA_WIDGET_ID}:${args.namespace}:${args.schema}`;
const metadataWidget = new MetadataWidget({
... | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
value => value.id === widgetId | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(args: any) => args['label'] | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(args: any) => {
// Rank has been chosen somewhat arbitrarily to give priority
// to the running sessions widget in the sidebar.
openMetadataWidget(args);
} | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
args => {
const contextNode: HTMLElement | undefined = app.contextMenuHitTest(
node => !!node.dataset.id
);
if (contextNode) {
const id = contextNode.dataset['id']!;
const widget = find(
app.shell.widgets('left'),
(widget: Widget, index: num... | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
node => !!node.dataset.id | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ArrowFunction |
(widget: Widget, index: number) => {
return widget.id === id;
} | chinhuang007/elyra | packages/metadata/src/index.ts | TypeScript |
ClassDeclaration |
@Module({
imports: [
TransactionsModule,
TypeOrmModule.forRoot({
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'learn',
password: 'plokij121',
database: 'learn',
entities: [__dirname + '/**/*.entity{.ts,.js}'],
synchronize: true,
}),
],
contro... | nagyll92/mfa_back | src/app.module.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [
CommonModule
],
exports: [
BasicContent
],
declarations: [
BasicContent
],
providers: [
ContentStore
]
})
export class BasicContentModule { } | awadyn/ng2-webpack | src/app/dashboard/tiles/basic-content/basic-content.module.ts | TypeScript |
FunctionDeclaration | /**
* This sample demonstrates how to Creates or updates the storage account credential
*
* @summary Creates or updates the storage account credential
* x-ms-original-file: specification/storSimple1200Series/resource-manager/Microsoft.StorSimple/stable/2016-10-01/examples/StorageAccountCredentialsCreateOrUpdate.jso... | AikoBB/azure-sdk-for-js | sdk/storsimple1200series/arm-storsimple1200series/samples-dev/storageAccountCredentialsCreateOrUpdateSample.ts | TypeScript |
InterfaceDeclaration | /**
* @ignore
*/
export default interface Functor<A, B, M> {
map: (f: (a: A) => B) => M;
} | astuanax/fun-monad | dist/types/Functor.d.ts | TypeScript |
FunctionDeclaration |
export function modifyH5WebpackChain (ctx: IPluginContext, chain) {
setStyleLoader(ctx, chain)
setVueLoader(chain)
setLoader(chain)
setTaroApiLoader(chain)
} | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
FunctionDeclaration |
function setStyleLoader (ctx: IPluginContext, chain) {
const config = ctx.initialConfig.h5 || {}
const { styleLoaderOption = {} } = config
chain.module
.rule('customStyle')
.merge({
use: [{
loader: 'style-loader',
options: styleLoaderOption
}]
})
} | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
FunctionDeclaration |
function setVueLoader (chain) {
const vueLoaderPath = getVueLoaderPath()
// plugin
const { VueLoaderPlugin } = require(vueLoaderPath)
chain
.plugin('vueLoaderPlugin')
.use(VueLoaderPlugin)
// loader
const vueLoaderOption = {
transformAssetUrls: {
video: ['src', 'poster'],
'live-pl... | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
FunctionDeclaration |
function setLoader (chain) {
chain.plugin('mainPlugin')
.tap(args => {
args[0].loaderMeta = getLoaderMeta()
return args
})
} | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
FunctionDeclaration |
function setTaroApiLoader (chain) {
chain.merge({
module: {
rule: {
'process-import-taro': {
test: /taro-h5[\\/]dist[\\/]index/,
loader: require.resolve('./api-loader')
}
}
}
})
} | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
ArrowFunction |
(node: RootNode | TemplateChildNode) => {
if (node.type === 1 /* ELEMENT */) {
node = node as ElementNode
const nodeName = node.tag
if (DEFAULT_Components.has(nodeName)) {
node.tag = `taro-${nodeName}`
node.tagType = 1 /* 0: ELEMENT, 1: COMPONENT */
... | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
ArrowFunction |
args => {
args[0].loaderMeta = getLoaderMeta()
return args
} | Banlangenn/taro | packages/taro-plugin-vue3/src/webpack.h5.ts | TypeScript |
FunctionDeclaration |
export function addSmartEditFeatures(options: SpartacusSmartEditOptions): Rule {
return (tree: Tree, _context: SchematicContext) => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
return chain([addSmartEditFeature(options)]);
};
} | boli-sap/spartacus | feature-libs/smartedit/schematics/add-smartedit/index.ts | TypeScript |
FunctionDeclaration |
function addSmartEditFeature(options: SpartacusSmartEditOptions): Rule {
return addLibraryFeature(options, {
folderName: SMARTEDIT_FOLDER_NAME,
name: SMARTEDIT_FEATURE_NAME,
featureModule: {
name: SMARTEDIT_MODULE,
importPath: SPARTACUS_SMARTEDIT,
},
rootModule: {
name: SMARTEDI... | boli-sap/spartacus | feature-libs/smartedit/schematics/add-smartedit/index.ts | TypeScript |
ArrowFunction |
(tree: Tree, _context: SchematicContext) => {
const packageJson = readPackageJson(tree);
validateSpartacusInstallation(packageJson);
return chain([addSmartEditFeature(options)]);
} | boli-sap/spartacus | feature-libs/smartedit/schematics/add-smartedit/index.ts | TypeScript |
ArrowFunction |
(): PackageInfo => {
const pkgPath = dirname(fileURLToPath(import.meta.url))
try {
const pkg = readFileSync(resolve(pkgPath, "../package.json"), "utf8")
const { description, version } = JSON.parse(pkg) as {
description: string
version: string
}
return { description, version }
} catc... | citycide/tablemark-cli | src/cli.ts | TypeScript |
ArrowFunction |
part => {
if (part === "") {
return "left"
}
if (!Object.keys(alignmentOptions).includes(part.toLowerCase())) {
throw new Error(`Expected an Alignment, got "${part}"`)
}
return part as Alignment
} | citycide/tablemark-cli | src/cli.ts | TypeScript |
ArrowFunction |
() => "\n" | citycide/tablemark-cli | src/cli.ts | TypeScript |
ArrowFunction |
() => Infinity | citycide/tablemark-cli | src/cli.ts | TypeScript |
ArrowFunction |
args => {
const options: TablemarkOptions = Object.assign({}, args, {
caseHeaders: !args.noCaseHeaders,
columns: []
})
for (const [name, align] of zip(args.column, args.align)) {
options.columns!.push({ name, align })
}
// write results to stdout
process.stdout.write(convert... | citycide/tablemark-cli | src/cli.ts | TypeScript |
InterfaceDeclaration |
interface PackageInfo {
description: string
version: string
} | citycide/tablemark-cli | src/cli.ts | TypeScript |
MethodDeclaration |
async from(input) {
return input.map(part => {
if (part === "") {
return "left"
}
if (!Object.keys(alignmentOptions).includes(part.toLowerCase())) {
throw new Error(`Expected an Alignment, got "${part}"`)
}
return part as Alignment
})
} | citycide/tablemark-cli | src/cli.ts | TypeScript |
MethodDeclaration |
async from(input) {
const content = input === "-" ? await getStdin() : read(input)
if (content === "" && process.stdin.isTTY) {
return []
}
return parse(content)
} | citycide/tablemark-cli | src/cli.ts | TypeScript |
FunctionDeclaration |
export default function installAsJQueryPlugin($: any): void {
if (!$)
throw new Error(
'Filterizr as a jQuery plugin, requires jQuery to work. If you would prefer to use the vanilla JS version, please use the correct bundle file.'
);
// Add filterizr method on jQuery prototype
$.fn.filterizr = fun... | 125126dxr/LAB | node_modules/filterizr/src/Filterizr/installAsJQueryPlugin.ts | TypeScript |
ArrowFunction |
(image: HTMLImageElement): HTMLCanvasElement => {
const { canvas, context } = createCanvas(image.naturalWidth, image.naturalHeight)
if (context) {
context.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight)
}
return canvas
} | jeetiss/image-fns | src/from-image.ts | TypeScript |
ArrowFunction |
(params: Params) => this.heroService.getHero(+params['id']) | teving/angular-tour-of-heroes | app/hero-detail.component.ts | TypeScript |
ArrowFunction |
hero => this.hero = hero | teving/angular-tour-of-heroes | app/hero-detail.component.ts | TypeScript |
ClassDeclaration |
@Component({
moduleId: module.id,
selector: 'my-hero-detail',
templateUrl: 'hero-detail.component.html',
styleUrls: ['hero-detail.component.css']
})
export class HeroDetailComponent implements OnInit {
@Input()
hero: Hero;
constructor(
private heroService: HeroService,
p... | teving/angular-tour-of-heroes | app/hero-detail.component.ts | TypeScript |
MethodDeclaration |
ngOnInit(): void {
this.route.params
.switchMap((params: Params) => this.heroService.getHero(+params['id']))
.subscribe(hero => this.hero = hero);
} | teving/angular-tour-of-heroes | app/hero-detail.component.ts | TypeScript |
MethodDeclaration |
goBack(): void {
this.location.back();
} | teving/angular-tour-of-heroes | app/hero-detail.component.ts | TypeScript |
MethodDeclaration |
save(): void{
this.heroService.update(this.hero)
.then(() => this.goBack());
} | teving/angular-tour-of-heroes | app/hero-detail.component.ts | TypeScript |
ArrowFunction |
({
children,
}: {
children?: string;
}): JSX.Element => {
const [open, setOpen] = useState(true);
return (
<Dialog open={open} fullWidth>
<AppBar position="relative">
<Toolbar>
<Stack width="100%" justifyContent="center" alignItems="center">
<Typography>エラー</Typography>... | okomeworld/dadamore | src/features/Analyzer/components/ErrorDialog.tsx | TypeScript |
ArrowFunction |
email => email.uid === uid | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
ArrowFunction |
(email) => email.status == status | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
ClassDeclaration |
export default class EmailModel {
emailList: Array<Email>;
constructor() {
this.emailList = [{ uid: '123', to: 'tharkana.infor@gmail.com', body: "test", subject: "yellow", status: 'SENT' },
{ uid: '213', to: 'tharkana.infor@gmail.com', body: "test", subject: "yellow", status: 'QUEUED' }
... | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
InterfaceDeclaration |
export interface Email {
uid?: string;
to: string;
body: string;
subject: string;
status: string;
createdDate?: number;
modifiedDate?: number;
} | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
MethodDeclaration |
create(email: Email) {
const newEmail: Email = {
uid: uuid.v4(),
to: email.to,
body: email.body,
subject: email.subject,
status: email.status,
createdDate: moment.now(),
modifiedDate: moment.now()
};
this.emailL... | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
MethodDeclaration |
findOne(uid: string) {
return this.emailList.find(email => email.uid === uid);
} | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
MethodDeclaration |
findAll() {
return this.emailList;
} | tharkana/node-email-api | src/model/emailModel.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.