type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
// Depth should handle malformed HTML correctly. Below <b> and <c> are not
// closed in the proper order, but since <d> is nested within both in the
// context of <a>, <d> is still at depth 3.
scrapeTest(
'<a><b><c><d>1</d></b></c></a>',
E.right(['1']),
... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a><b><c>1</c><a><b><c></c></b></a></b></a>',
E.right([]),
pipe(
Select.tag('a'),
Select.nested(pipe(Select.tag('b'), Select.atDepth(2))),
Select.nested(Select.tag('c')),
Scrape.html,
Serial.seekNext,... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
// However, from the context of <b>, <d> is only at depth 1 because there is
// no closing <c> tag within the <b> tag so the <c> tag is assumed to be
// self-closing.
// scrapeTest(
// '<a><b><c><d>2</d></b></c></a>',
// E.right(['2']),
// S... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
// scrapeTest(
// '<a><b><c><d>2</d></c></a></b>',
// E.right(['2']),
// Scrape.texts(
// pipe(Select.tag('a'), Select.nested(pipe(Select.tag('d'), Select.atDepth(2))))
// )
// )
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should match the deepest node', () => {
scrapeTest(
'<a><b><c>foo</c></b></a>',
E.right(['<c>foo</c>']),
Scrape.htmls(
pipe(Select.tag('a'), Select.nested(Select.tag('b')), Select.nested(Select.tag('c')))
)
)
})
it('shou... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a><b><c>foo</c></b></a>',
E.right(['<c>foo</c>']),
Scrape.htmls(
pipe(Select.tag('a'), Select.nested(Select.tag('b')), Select.nested(Select.tag('c')))
)
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<c><a><b>foo</b></a></c><c><a><d><b>bar</b></d></a></c><b>baz</b>',
E.right(['<b>foo</b>', '<b>bar</b>']),
Scrape.htmls(pipe(Select.tag('a'), Select.nested(Select.tag('b'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<div id="outer"><div id="inner">inner text</div></div>',
E.right(['inner']),
Scrape.attrs('id', pipe(Select.tag('div'), Select.nested(Select.tag('div'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<div id="a"><div id="b"><div id="c"></div></div></div>',
E.right(['b', 'c']),
Scrape.attrs('id', pipe(Select.tag('div'), Select.nested(Select.tag('div'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a><b><c><d>2</d></b></c></a>',
E.right(['2']),
Scrape.texts(pipe(Select.tag('b'), Select.nested(Select.tag('d'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<b><c><d>2</d></b></c>',
E.right(['2']),
Scrape.texts(pipe(Select.tag('b'), Select.nested(Select.tag('d'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<b><c><d>2</d></b></c>',
E.right(['2']),
Scrape.texts(pipe(Select.tag('c'), Select.nested(Select.tag('d'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should match tags with multiple classes', () => {
scrapeTest(
'<a class="a b">foo</a>',
E.right(['<a class="a b">foo</a>']),
Scrape.htmls(Select.withAttributes('a', [Select.hasClass('a')]))
)
})
it('should not match tags that do not contain t... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a class="a b">foo</a>',
E.right(['<a class="a b">foo</a>']),
Scrape.htmls(Select.withAttributes('a', [Select.hasClass('a')]))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a class="a b">foo</a>',
E.right([]),
Scrape.htmls(Select.withAttributes('a', [Select.hasClass('c')]))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should negate an attribute predicate', () => {
scrapeTest(
'<a>foo</a><a class="a b">bar</a><a class="b">baz</a>',
E.right(['foo', 'baz']),
Scrape.texts(Select.withAttributes('a', [Select.notP(Select.hasClass('a'))]))
)
})
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a>foo</a><a class="a b">bar</a><a class="b">baz</a>',
E.right(['foo', 'baz']),
Scrape.texts(Select.withAttributes('a', [Select.notP(Select.hasClass('a'))]))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should allow for custom attribute predicates', () => {
scrapeTest(
'<a foo="bar">1</a><a foo="foo">2</a><a bar="bar">3</a>',
E.right(['<a foo="foo">2</a>', '<a bar="bar">3</a>']),
Scrape.htmls(Select.anyWithAttributes([Select.match(Eq.eqString.equals)]))
... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a foo="bar">1</a><a foo="foo">2</a><a bar="bar">3</a>',
E.right(['<a foo="foo">2</a>', '<a bar="bar">3</a>']),
Scrape.htmls(Select.anyWithAttributes([Select.match(Eq.eqString.equals)]))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
describe('checkSettings', () => {
it('should return MatchOk on empty current hierarchy', () => {
const tags = T.parse('')
const curr = TS.tagsToSpec(tags)
const root = TS.tagsToSpec(tags)
assert.strictEqual(
Select.checkSettings(Select.SelectSettings(O.some(... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should return MatchOk on empty current hierarchy', () => {
const tags = T.parse('')
const curr = TS.tagsToSpec(tags)
const root = TS.tagsToSpec(tags)
assert.strictEqual(
Select.checkSettings(Select.SelectSettings(O.some(1)), curr, root),
MR.MatchOk... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
const tags = T.parse('')
const curr = TS.tagsToSpec(tags)
const root = TS.tagsToSpec(tags)
assert.strictEqual(
Select.checkSettings(Select.SelectSettings(O.some(1)), curr, root),
MR.MatchOk
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should return an empty array if no valid siblings are found within the parent node', () => {
const tagForest: TagForest = [Tree.make(TF.TagSpan(4, 10), [])]
assert.deepStrictEqual(Select.liftSiblings([])(3, 9)(tagForest), RA.empty)
})
it('should lift valid siblings out of... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
const tagForest: TagForest = [Tree.make(TF.TagSpan(4, 10), [])]
assert.deepStrictEqual(Select.liftSiblings([])(3, 9)(tagForest), RA.empty)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
const tagForest: TagForest = [Tree.make(TF.TagSpan(5, 6), [])]
assert.deepStrictEqual(Select.liftSiblings([])(3, 9)(tagForest), [
Tree.make(TF.TagSpan(5, 6))
])
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
const tagForest: TagForest = [
Tree.make(TF.TagSpan(4, 10), [Tree.make(TF.TagSpan(5, 6)), Tree.make(TF.TagSpan(7, 8))])
]
assert.deepStrictEqual(Select.liftSiblings([])(3, 9)(tagForest), [
Tree.make(TF.TagSpan(5, 6)),
Tree.make(TF.TagSpan(7, 8))
])... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
it('should traverse selectors in a depth first manner (1)', () => {
scrapeTest(
'<div><p>p1</p><p>p2</p><blockquote><p>p3</p></blockquote><p>p4</p>',
E.right(['p1', 'p2', 'p3', 'p4']),
Scrape.texts(Select.tag('p'))
)
})
it('should traverse selectors in a depth f... | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<div><p>p1</p><p>p2</p><blockquote><p>p3</p></blockquote><p>p4</p>',
E.right(['p1', 'p2', 'p3', 'p4']),
Scrape.texts(Select.tag('p'))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a><b>1</b></a><a><b>2</b></a><a><b>3</b></a>',
E.right(['1', '2', '3']),
Scrape.texts(Select.tag('a'))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a><b>1</b></a><a><b>2</b></a><a><b>3</b></a>',
E.right(['1', '2', '3']),
Scrape.texts(pipe(Select.tag('a'), Select.nested(Select.tag('b'))))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ArrowFunction |
() => {
scrapeTest(
'<a><b>1</b></a><a><b>2</b></a><a><b>3</b></a>',
E.right(['1', '2', '3']),
Scrape.texts(Select.tag('b'))
)
} | IMax153/scalpel-ts | test/Select.test.ts | TypeScript |
ClassDeclaration |
@NgModule({
imports: [
CommonModule,
ThemeModule,
FormWizardModule,
Ng2SmartTableModule,
TranslateModule.forChild(),
NbSpinnerModule,
],
declarations: [WarehouseMainInfoViewComponent],
exports: [WarehouseMainInfoViewComponent],
})
export class WarehouseMainInfoViewModule {} | 0xflotus/ever | packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/warehouse-main-info/warehouse-main-info.module.ts | TypeScript |
ArrowFunction |
variables => predefinedProps => ({
variables: mergeComponentVariables(variables, predefinedProps.variables),
}) | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ArrowFunction |
predefinedProps => ({
variables: mergeComponentVariables(variables, predefinedProps.variables),
}) | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ArrowFunction |
(row: TableRowProps, index: number) => {
const props = {
compact,
onClick: (e, props) => {
_.invoke(row, 'onClick', e, props)
},
} as TableRowProps
const overrideProps = handleVariablesOverrides(variables)
return TableRow.create(row, {
defaultProps: () ... | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ArrowFunction |
(e, props) => {
_.invoke(row, 'onClick', e, props)
} | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ArrowFunction |
() => ({
...props,
accessibility: accessibility.childBehaviors
? accessibility.childBehaviors.row
: undefined,
}) | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ArrowFunction |
() => ({
...headerRowProps,
accessibility: accessibility.childBehaviors ? accessibility.childBehaviors.row : undefined,
}) | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ClassDeclaration |
class Table extends UIComponent<WithAsProp<TableProps>> {
static displayName = 'Table'
static className = 'ui-table'
static Cell = TableCell
static Row = TableRow
static slotClassNames: TableSlotClassNames = {
header: `${Table.className}__header`,
}
static propTypes = {
...commonPropTypes.crea... | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
InterfaceDeclaration |
export interface TableSlotClassNames {
header: string
} | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
InterfaceDeclaration |
export interface TableProps extends UIComponentProps, ChildrenComponentProps {
/**
* Accessibility behavior if overridden by the user.
* */
accessibility?: Accessibility
/** The columns of the Table with a space-separated list of values.
*/
header?: ShorthandValue<TableRowProps>
/** The rows of th... | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
MethodDeclaration |
renderRows(accessibility: ReactAccessibilityBehavior, variables: ComponentVariablesObject) {
const { rows, compact } = this.props
return _.map(rows, (row: TableRowProps, index: number) => {
const props = {
compact,
onClick: (e, props) => {
_.invoke(row, 'onClick', e, props)
... | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
MethodDeclaration |
renderHeader(accessibility: ReactAccessibilityBehavior, variables: ComponentVariablesObject) {
const { header, compact } = this.props
if (!header) {
return null
}
const headerRowProps = {
header: true,
compact,
className: Table.slotClassNames.header,
} as TableRowProps
... | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
MethodDeclaration |
renderComponent({
accessibility,
ElementType,
classes,
variables,
unhandledProps,
}: RenderResultConfig<any>): React.ReactNode {
const { children } = this.props
const hasChildren = childrenExist(children)
return (
<ElementType
className={classes.root}
{...access... | AnastasiyaSarmant/fluent-ui-react | packages/react/src/components/Table/Table.tsx | TypeScript |
ArrowFunction |
c => c !== this | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
ArrowFunction |
() => {
if (this.service.isOpen) {
this._element.nativeElement.focus();
}
} | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
ArrowFunction |
() => this.childrenUpdated() | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
ArrowFunction |
c => c.service | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
ArrowFunction |
s => this.service.registerChild(s) | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
ClassDeclaration |
@Directive({
selector: "[suiDropdown]"
})
export class SuiDropdown implements AfterContentInit {
public service:DropdownService;
@ContentChild(SuiDropdownMenu)
private _menu:SuiDropdownMenu;
@ContentChildren(SuiDropdown, { descendants: true })
private _children:QueryList<SuiDropdown>;
pu... | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
MethodDeclaration |
public ngAfterContentInit():void {
if (!this._menu) {
throw new Error("You must set [suiDropdownMenu] on the menu element.");
}
this._menu.service = this.service;
this.childrenUpdated();
this._children.changes
.subscribe(() => this.childrenUpdated());
... | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
MethodDeclaration |
private childrenUpdated():void {
// Reregister child dropdowns each time the menu content changes.
this.children
.map(c => c.service)
.forEach(s => this.service.registerChild(s));
} | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
MethodDeclaration |
@HostListener("click", ["$event"])
public onClick(e:HandledEvent):void {
if (!e.eventHandled) {
e.eventHandled = true;
this.service.toggleOpenState();
}
} | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
MethodDeclaration |
@HostListener("focusout", ["$event"])
private onFocusOut(e:IFocusEvent):void {
if (!this._element.nativeElement.contains(e.relatedTarget)) {
this.externallyClose();
}
} | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
MethodDeclaration |
@HostListener("keypress", ["$event"])
public onKeypress(e:HandledEvent & KeyboardEvent):void {
// Block the keyboard event from being fired on parent dropdowns.
if (!e.eventHandled) {
if (e.keyCode === KeyCode.Enter) {
e.eventHandled = true;
this.servic... | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
MethodDeclaration |
private externallyClose():void {
if (this.service.autoCloseMode === DropdownAutoCloseType.ItemClick ||
this.service.autoCloseMode === DropdownAutoCloseType.OutsideClick) {
// No need to reflect in parent since they are also bound to document.
this.service.setOpenStat... | atretyak1985/sui-tags-input | src/modules/dropdown/directives/dropdown.ts | TypeScript |
ClassDeclaration |
@Component({
selector: 'app-model-result',
templateUrl: './model-result.component.html',
styleUrls: ['./model-result.component.css'],
})
export class ModelResultComponent {
@Input() name: string;
@Input() model: ResultModelModel;
} | jdkandersson/OpenAlchemyEditor | web/src/app/components/model/model-result/model-result.component.ts | TypeScript |
ClassDeclaration |
@customElement('app-card')
export class CardComponent extends LitElement {
@property() details: Details;
static styles = css`${unsafeCSS(cardCss)}`;
protected render():TemplateResult {
const { details } = this;
return html`
<div class="container as-card">
<div class="row">
<!--... | Analog-Studios/www.analogstudios.net | src/components/card/card.ts | TypeScript |
MethodDeclaration |
protected render():TemplateResult {
const { details } = this;
return html`
<div class="container as-card">
<div class="row">
<!-- why doesn't col-xs-12 work here -->
<div class="col-xs-12">
<a href="${details.link}" title="Visit ${details.headingText}">
... | Analog-Studios/www.analogstudios.net | src/components/card/card.ts | TypeScript |
FunctionDeclaration | // Deep object merge taken from this post:
// URL: https://stackoverflow.com/questions/27936772/how-to-deep-merge-instead-of-shallow-merge
function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item));
} | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function mergeDeep(target, ...sources) {
if (!sources.length) return target;
const source = sources.shift();
if (isObject(target) && isObject(source)) {
for (const key in source) {
if (isObject(source[key])) {
if (!target[key]) Object.assign(target, { [key]: {} });
merg... | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function prepareReplaceString(replaceString: string) {
let pluginPath = __dirname;
pluginPath = JSON.stringify(pluginPath);
pluginPath = pluginPath.substring(1, pluginPath.length - 1);
replaceString = replaceString.replace("[plugin_path]", pluginPath);
return replaceString;
} | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function applyPatches(patches: any[], content: string) {
for(let patch of patches) {
let replace = prepareReplaceString(patch.replace);
if(patch.isFindRegExp) {
let findRegExp = new RegExp(patch.find, path.findRegExpFlags);
content = content.replace(findRegExp, replace);
... | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function shouldBeRuleApplied(testPattern: string, filename: string) {
let testRegExp = new RegExp(testPattern);
return testRegExp.test(filename)
} | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function transformContentForRule(rule: any, filename: string, content: string) {
if(shouldBeRuleApplied(rule.test, filename)) {
return applyPatches(rule.patches, content);
} else {
return content;
}
} | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function transformContent(options: any, filename: string, content: string) {
for(let ruleName in options) {
content = transformContentForRule(options[ruleName], filename, content);
}
return content;
} | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function loadDefaultOptions() {
const modulePath = path.dirname(require.resolve(loaderPackageName));
const filePath = path.join(modulePath, defaultOptionFile);
if(fs.existsSync(filePath) == false) {
console.log("Warning: default options file was not found.");
return {};
}
let option... | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function loadOptionsFromFile(filePath: string) {
if(fs.existsSync(filePath) == false) {
console.log(`File "${filePath}" containing options was not found.`);
return {};
}
let options = fs.readFileSync(filePath).toString();
return JSON.parse(options);
} | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
function loadOptionsFromFiles(files: string[]) {
// To prevent loading options from files again and again
if(optionsLoadedFlag)
return;
// load and merge options
for(let file of files) {
let options = loadOptionsFromFile(file);
let targetOptions = {};
mergeDeep(targetOpt... | evonox/electron-native-patch-loader | index.ts | TypeScript |
FunctionDeclaration |
export default function(source) {
// get options and set defaults
let options = getOptions(this);
options = options || {};
options.files = options.files || [];
options.custom = options.custom || {};
validate({name: "ElectronNativePatchLoader", schema: optionsSchema, target: options});
... | evonox/electron-native-patch-loader | index.ts | TypeScript |
ArrowFunction |
() => {
it("renders", async () => {
const page = await newSpecPage({
components: [BerserkerComponent],
html: `<ms-berserker></ms-berserker>`,
includeAnnotations: true,
});
expect(page.root).toHaveClass("hydrated");
});
} | bodinaren/maplestory | src/components/charts/berserker/berserker.e2e.ts | TypeScript |
ArrowFunction |
async () => {
const page = await newSpecPage({
components: [BerserkerComponent],
html: `<ms-berserker></ms-berserker>`,
includeAnnotations: true,
});
expect(page.root).toHaveClass("hydrated");
} | bodinaren/maplestory | src/components/charts/berserker/berserker.e2e.ts | TypeScript |
ArrowFunction |
() => {
test('Working', () => {
const $ = { find: ((selector: string) => ({ attr: (attr: string) => '/index.php?page=post&s=view&id=3548989' })) } as Cheerio;
expect(getID($)).toBe(3548989);
});
} | npm-fapingalot/api2-rule34-xxx | src/list/parser.spec.ts | TypeScript |
ArrowFunction |
() => {
const $ = { find: ((selector: string) => ({ attr: (attr: string) => '/index.php?page=post&s=view&id=3548989' })) } as Cheerio;
expect(getID($)).toBe(3548989);
} | npm-fapingalot/api2-rule34-xxx | src/list/parser.spec.ts | TypeScript |
ArrowFunction |
(selector: string) => ({ attr: (attr: string) => '/index.php?page=post&s=view&id=3548989' }) | npm-fapingalot/api2-rule34-xxx | src/list/parser.spec.ts | TypeScript |
ArrowFunction |
(attr: string) => '/index.php?page=post&s=view&id=3548989' | npm-fapingalot/api2-rule34-xxx | src/list/parser.spec.ts | TypeScript |
ArrowFunction |
() => (<></>); | Marr11317/language-tools | packages/svelte2tsx/test/svelte2tsx/samples/ast-offset-none/expected.tsx | TypeScript |
ClassDeclaration |
export default class Input__SvelteComponent_ extends __sveltets_1_createSvelte2TsxComponent(__sveltets_1_partial(__sveltets_1_with_any_event(render()))) {
} | Marr11317/language-tools | packages/svelte2tsx/test/svelte2tsx/samples/ast-offset-none/expected.tsx | TypeScript |
InterfaceDeclaration |
export interface MANOprovider {
apiEndpoint?: string;
authorizationBasicHeader?: string;
description?: string;
enabledForONBOARDING?: boolean;
id?: number;
name?: string;
password?: string;
supportedMANOplatform?: MANOplatform;
username?: string;
} | openslice/io.openslice.tmf.web | src/app/openApis/PortalRepositoryAPI/models/manoprovider.ts | TypeScript |
ClassDeclaration |
@EventSubscriber()
export class DetailSubscriber implements EntitySubscriberInterface<Details> {
listenTo() {
return Details;
}
async afterInsert(event: InsertEvent<Details>) {
const { quantity, product } = event.entity;
const newStock = product.stock - quantity;
await getR... | Exodiel/produmax-nestjs | src/order/subscriber/DetailSubscriber.ts | TypeScript |
MethodDeclaration |
listenTo() {
return Details;
} | Exodiel/produmax-nestjs | src/order/subscriber/DetailSubscriber.ts | TypeScript |
MethodDeclaration |
async afterInsert(event: InsertEvent<Details>) {
const { quantity, product } = event.entity;
const newStock = product.stock - quantity;
await getRepository(Product)
.createQueryBuilder()
.update(Product)
.set({ stock: newStock})
.where('id = :id'... | Exodiel/produmax-nestjs | src/order/subscriber/DetailSubscriber.ts | TypeScript |
MethodDeclaration |
async beforeRemove(event: RemoveEvent<Details>) {
const { product, quantity } = event.entity;
const updatedStock = product.stock + quantity;
await getRepository(Product)
.createQueryBuilder('product')
.update(Product)
.set({ stock: updatedStock})
... | Exodiel/produmax-nestjs | src/order/subscriber/DetailSubscriber.ts | TypeScript |
InterfaceDeclaration |
export interface SofarValue {
timestamp: string;
value: number;
} | khattakdev/aqualink-app | packages/api/src/utils/sofar.types.ts | TypeScript |
InterfaceDeclaration |
export interface SofarDailyData {
reef: { id: number };
date: Date;
dailyAlertLevel?: number;
weeklyAlertLevel?: number;
minBottomTemperature?: number;
maxBottomTemperature?: number;
avgBottomTemperature?: number;
surfaceTemperature?: number;
satelliteTemperature?: number;
degreeHeatingDays?: numbe... | khattakdev/aqualink-app | packages/api/src/utils/sofar.types.ts | TypeScript |
InterfaceDeclaration |
export interface SofarLiveData {
reef: { id: number };
dailyAlertLevel?: number;
weeklyAlertLevel?: number;
bottomTemperature?: SofarValue;
surfaceTemperature?: SofarValue;
satelliteTemperature?: SofarValue;
degreeHeatingDays?: SofarValue;
waveHeight?: SofarValue;
waveDirection?: SofarValue;
wavePe... | khattakdev/aqualink-app | packages/api/src/utils/sofar.types.ts | TypeScript |
InterfaceDeclaration |
export interface SpotterData {
surfaceTemperature: SofarValue[];
bottomTemperature: SofarValue[];
significantWaveHeight: SofarValue[];
wavePeakPeriod: SofarValue[];
waveMeanDirection: SofarValue[];
latitude?: SofarValue[];
longitude?: SofarValue[];
} | khattakdev/aqualink-app | packages/api/src/utils/sofar.types.ts | TypeScript |
ArrowFunction |
({ match }) => (
<Layout>
<Layout.Content style={ | BezzubovEgor/react-router-navigation-confirm | example/src/demo/components/Demo/Demo.tsx | TypeScript |
ArrowFunction |
({ path, component }) => component && <Route path | BezzubovEgor/react-router-navigation-confirm | example/src/demo/components/Demo/Demo.tsx | TypeScript |
FunctionDeclaration |
export default function ExpandedIcon(
props: Props
): React.ReactElement<React.ComponentProps<any>, any> {
return (
<Icon {...props}>
<path d="M8.23823905,10.6097108 L11.207376,14.4695888 C11.54411,14.907343 12.1719566,14.989236 12.6097108,14.652502 C12.6783439,14.5997073 12.7398293,14.538222 12.792624,1... | Akord-com/outline-icons | src/components/ExpandedIcon.tsx | TypeScript |
ClassDeclaration |
@Module({
imports: [TypeOrmModule.forFeature([SurveyDiscRepository])],
controllers: [SurveyDiscController],
providers: [SurveyDiscService],
})
export class SurveyDiscModule {} | MarcioBittencourt/plumb-api | src/survey-disc/survey-disc.module.ts | TypeScript |
ArrowFunction |
(req, file, cb) => {
cb(null, path.join(__dirname, '../../uploads'));
} | architect254/api | src/user/user.controller.ts | TypeScript |
ArrowFunction |
(req, file, cb) => {
let fileExt = path.extname(file.originalname);
cb(null, 'user-' + Date.now() + fileExt);
} | architect254/api | src/user/user.controller.ts | TypeScript |
ClassDeclaration |
@UseGuards(AuthGuard('jwt'))
@Controller('users')
export class UserController {
constructor(private userService: UserService) {}
@Post()
@UseInterceptors(FileInterceptor('profileImage', storage))
async createUser(
@UploadedFile() file: Express.Multer.File,
@Body() payload: UserDto,
@GetUser() curr... | architect254/api | src/user/user.controller.ts | TypeScript |
MethodDeclaration |
@Post()
@UseInterceptors(FileInterceptor('profileImage', storage))
async createUser(
@UploadedFile() file: Express.Multer.File,
@Body() payload: UserDto,
@GetUser() currentUser: User,
) {
const payLoadWithProfileImage = { ...payload, profileImage: file.filename };
return await this.userServic... | architect254/api | src/user/user.controller.ts | TypeScript |
MethodDeclaration |
@Get('/:id')
async getUser(@Param('id') id) {
return await this.userService.read(id);
} | architect254/api | src/user/user.controller.ts | TypeScript |
MethodDeclaration |
@Get()
async getAllUsers(
@Query('page') page: number,
@Query('pageSize') pageSize: number,
) {
return await this.userService.readAll(page, pageSize);
} | architect254/api | src/user/user.controller.ts | TypeScript |
MethodDeclaration |
@Put('/:id')
async updateUser(
@Param('id') id,
@Body() payload: UserDto,
@GetUser() currentUser: User,
) {
return await this.userService.update(id, payload, currentUser);
} | architect254/api | src/user/user.controller.ts | TypeScript |
MethodDeclaration |
@Delete('/:id')
async deleteUser(@Param('id') id) {
await this.userService.drop(id);
} | architect254/api | src/user/user.controller.ts | TypeScript |
TypeAliasDeclaration |
export type TNativePannerNodeFactory = (nativeContext: TNativeContext, options: IPannerOptions) => TNativePannerNode; | Magicianred/rApartmentReact | node_modules/standardized-audio-context/src/types/native-panner-node-factory.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.