type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
(workDir: string, resource: any): any => {
const resourceHash: any = {};
const data = resource.data.$text;
const accessTime = utils.getTimeStampMoment(resource);
const resourceFileProps = utils.getResourceFileProperties(workDir, resource);
let fileName = resourceFileProps.fileName;
// add tim... | akosbalasko/yarle | src/process-resources.ts | TypeScript |
ArrowFunction |
(
note: any,
content: string,
): string => {
if (content.indexOf('src="data:') < 0) {
return content; // no data urls
}
const {absoluteResourceWorkDir, relativeResourceWorkDir} = getResourceWorkDirs(note);
fsExtra.mkdirsSync(absoluteResourceWorkDir);
// src="data:image/svg+xml;base64,..." --> src="... | akosbalasko/yarle | src/process-resources.ts | TypeScript |
ArrowFunction |
(match, mediatype, encoding, data) => {
const fileName = createResourceFromData(mediatype, encoding === ';base64', data, absoluteResourceWorkDir, note);
const src = `${relativeResourceWorkDir}${yarleOptions.pathSeparator}${fileName}`;
return `src="${src}"`;
} | akosbalasko/yarle | src/process-resources.ts | TypeScript |
ArrowFunction |
(
mediatype: string,
base64: boolean,
data: string,
absoluteResourceWorkDir: string,
note: any,
): string => {
const baseName = 'embedded'; // data doesn't seem to include useful base filename
const extension = extensionForMimeType(mediatype) || '.dat';
const index = utils.getFileIndex(absoluteResource... | akosbalasko/yarle | src/process-resources.ts | TypeScript |
ArrowFunction |
(mediatype: string): string => {
// image/jpeg or image/svg+xml or audio/wav or ...
const subtype = mediatype.split('/').pop(); // jpeg or svg+xml or wav
return subtype.split('+')[0]; // jpeg or svg or wav
} | akosbalasko/yarle | src/process-resources.ts | TypeScript |
InterfaceDeclaration |
export interface ITag {
_id?: string;
name: string;
} | temujins/web-store-api | src/typings/tags/index.ts | TypeScript |
TypeAliasDeclaration |
export type ITagDocument = ITag & Document; | temujins/web-store-api | src/typings/tags/index.ts | TypeScript |
TypeAliasDeclaration |
export type ITagModel = Model<ITagDocument>; | temujins/web-store-api | src/typings/tags/index.ts | TypeScript |
ClassDeclaration |
@Module({
imports: [MathModule],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {} | BrunnoM7/test-nestjs | src/app.module.ts | TypeScript |
InterfaceDeclaration |
export interface ILoaderState {
active: boolean;
type: string;
} | ravi221/Test | src/app/core/interfaces/iLoaderState.ts | TypeScript |
FunctionDeclaration | // Get Current Window Width Breakpoint
function getWindowBreakpoints(): { width: string; height: string } {
const bps = { width: "unknown", height: "unknown" };
// sort bp's desc and use first bp > value
["width", "height"].forEach((dim) =>
Object.entries(
layoutConfig.breakpoints[dim] as { [... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
FunctionDeclaration | // grid layout coords to px
function coordToPx(val: number, dim: "w" | "h"): number {
return (
val *
((dim === "h" ? layoutHeight : width) /
(dim === "h" ? widgetConfig.maxH : widgetConfig.maxW))
);
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
FunctionDeclaration | // Save Layout
function saveLayout(cb: Layout[]) {
// copy static property and reset edges
layoutConfig.layouts[bpH][bpW] = cb.map((w, idx) => ({
staticHeight: layoutConfig.layouts[bpH][bpW][idx].staticHeight,
staticWidth: layoutConfig.layouts[bpH][bpW][idx].staticWidth,
// TODO: remove resize... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
FunctionDeclaration | // TODO: works better than expected
function getLongestOverlappingSide(w1, w2): "t" | "r" | "b" | "l" | "none" {
let side: "t" | "r" | "b" | "l" | "none" = "none";
const rectSelection = document
.getElementById(w1.i)
?.getBoundingClientRect();
const rect = document.getElementById(w2.i)?.getBoun... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
({
showToolbar,
data,
selectedData,
setSelectedData,
layoutConfig,
widgetConfig,
}: LayoutGridProps) => {
const [width, height] = useWindowSize({ leading: true });
const [showWidgetToolbars, setShowWidgetToolbars] = useState(showToolbar);
const [showWidgetResize, setShowWidgetResize] = useState(showT... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => getWindowBreakpoints().width | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => getWindowBreakpoints().height | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w) => w.staticHeight | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w) => w.staticWidth | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(dim) =>
Object.entries(
layoutConfig.breakpoints[dim] as { [key: string]: number }
).some((ele) =>
dim === "width"
? width > ele[1] && (bps.width = ele[0])
: height > ele[1] && (bps.height = ele[0])
) | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(ele) =>
dim === "width"
? width > ele[1] && (bps.width = ele[0])
: height > ele[1] && (bps.height = ele[0]) | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w, idx) => ({
staticHeight: layoutConfig.layouts[bpH][bpW][idx].staticHeight,
staticWidth: layoutConfig.layouts[bpH][bpW][idx].staticWidth,
// TODO: remove resize for static widgets
// isResizable: layoutConfig.layouts[bpH][bpW][idx].staticHeight,
edges: { t: [], r: [], b: [], l: [] },
... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w1) =>
widgets
.filter((w) => w1.i !== w.i)
.forEach((w2) => {
const side = getLongestOverlappingSide(w1, w2);
if (side !== "none") {
w1.edges[side].push(w2.i);
// remove duplicates
// TODO: needed? verify...
w1.edges[side] = ... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w) => w1.i !== w.i | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w2) => {
const side = getLongestOverlappingSide(w1, w2);
if (side !== "none") {
w1.edges[side].push(w2.i);
// remove duplicates
// TODO: needed? verify...
w1.edges[side] = w1.edges[side].filter(
(s, idx) => w1.edges[side].indexOf(s) =... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(s, idx) => w1.edges[side].indexOf(s) === idx | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => {
const widgets = layoutConfig.layouts[bpH][bpW];
// static widget coordinate height in pixels subtracted by static height
const calcTop = (names: string[]) => {
const staticWidgets = names
.filter((n) => widgets.find((w) => w.i === n)?.staticHeight)
.map((i) => widgets.find((w... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(names: string[]) => {
const staticWidgets = names
.filter((n) => widgets.find((w) => w.i === n)?.staticHeight)
.map((i) => widgets.find((w) => w.i === i));
return (
(coordToPx(staticWidgets[0]?.h, "h") - staticWidgets[0]?.staticHeight ||
0) * -1
);
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(n) => widgets.find((w) => w.i === n)?.staticHeight | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w) => w.i === n | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(i) => widgets.find((w) => w.i === i) | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w) => w.i === i | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(names: string[]) => {
const staticWidgets = names
.filter((n) => widgets.find((w) => w.i === n)?.staticWidth)
.map((i) => widgets.find((w) => w.i === i));
return (
(coordToPx(staticWidgets[0]?.w, "w") - staticWidgets[0]?.staticWidth ||
0) * -1
);
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(n) => widgets.find((w) => w.i === n)?.staticWidth | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w: any): string => {
if (w.staticHeight) {
return `${w.staticHeight}px`;
} // check widget connected at top edge and is static
else if (w.edges.t.length && calcTop(w.edges.t)) {
// h - offset
return `${coordToPx(w.h, "h") + calcTop(w.edges.t) * -1}px`;
}
return ""... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(w: any): string => {
if (w.staticWidth) {
return `${w.staticWidth}px`;
} // check widget connected at left edge and is static
else if (w.edges.l.length && calcLeft(w.edges.l)) {
// w - offset
return `${coordToPx(w.w, "w") + calcLeft(w.edges.l) * -1}px`;
}
return "... | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
(widget, idx) => (
<div
id={widget.i} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => {
if (refreshing) {
setTimeout(() => setRefreshing(false), 150);
}
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => setRefreshing(false) | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => {
setRefreshing(true);
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => {
!showWidgetToolbars && setSelectedWidget("");
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
ArrowFunction |
() => {
setRefreshing(true);
setbpH(getWindowBreakpoints().height);
} | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
TypeAliasDeclaration | // Component Data Props Type
export type DataProps = {
data?: any; // Core data object
selectedData?: any; // Selected data set
setSelectedData?: (val: any) => void; // Set selected data obj
}; | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
TypeAliasDeclaration | // Layout Grid Props Type
type LayoutGridProps = {
showToolbar: boolean;
layoutConfig: any;
widgetConfig: any;
} & DataProps; | tboie/ratking | src/components/layout/layout-grid.tsx | TypeScript |
TypeAliasDeclaration |
export type SendCallback = (error: (Error | null), result?: JsonRpcResponse) => void | ChainSafe/gsn | packages/common/src/dev/SendCallback.ts | TypeScript |
ArrowFunction |
(str: string) => hashSync(str) | awakelife93/node-api-template | src/models/User.ts | TypeScript |
ArrowFunction |
(str: string) => str | awakelife93/node-api-template | src/models/User.ts | TypeScript |
ClassDeclaration |
@Entity("user")
export class User extends CommonEntity {
@PrimaryGeneratedColumn({ name: "id", comment: "고유키" })
userId!: number;
@IsEmail()
@Column({ length: 50, unique: true, comment: "이메일" })
email!: string;
@Length(1, 10)
@IsString()
@Column({ length: 10, comment: "이름" })
name!: string;
@Len... | awakelife93/node-api-template | src/models/User.ts | TypeScript |
ArrowFunction |
() => {
let userDetailsEffect: fromUserDetailsEffect.UserDetailsEffects;
let userService: UserDetailsConnector;
let actions$: Observable<Action>;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
fromUserDetailsEffect.UserDetailsEffects,
{ provide: UserDetailsAdapter, ... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
providers: [
fromUserDetailsEffect.UserDetailsEffects,
{ provide: UserDetailsAdapter, useValue: {} },
provideMockActions(() => actions$),
],
});
userDetailsEffect = TestBed.get(fromUserDetailsEffect.UserDetailsEffects);
userS... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should load user details', () => {
spyOn(userService, 'get').and.returnValue(of(mockUserDetails));
const action = new fromUserDetailsAction.LoadUserDetails('mockName');
const completion = new fromUserDetailsAction.LoadUserDetailsSuccess(
mockUserDetails
);
action... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
spyOn(userService, 'get').and.returnValue(of(mockUserDetails));
const action = new fromUserDetailsAction.LoadUserDetails('mockName');
const completion = new fromUserDetailsAction.LoadUserDetailsSuccess(
mockUserDetails
);
actions$ = hot('-a', { a: action });
const ... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
it('should return UpdateUserDetailsSuccess ', () => {
spyOn(userService, 'update').and.returnValue(of({}));
const username = 'xxx';
const userDetails: User = {
title: 'mr',
};
const action = new fromUserDetailsAction.UpdateUserDetails({
username,
user... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
spyOn(userService, 'update').and.returnValue(of({}));
const username = 'xxx';
const userDetails: User = {
title: 'mr',
};
const action = new fromUserDetailsAction.UpdateUserDetails({
username,
userDetails,
});
const completion = new fromUserDe... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
const error = 'error';
spyOn(userService, 'update').and.returnValue(throwError(error));
const username = 'xxx';
const userDetails: User = {
title: 'mr',
};
const action = new fromUserDetailsAction.UpdateUserDetails({
username,
userDetails,
});... | WTPar/cloud-commerce-spartacus-storefront | projects/core/src/user/store/effects/user-details.effect.spec.ts | TypeScript |
ArrowFunction |
() => {
it('Converts logon results JSON object to CSV', async () => {
const logonLogs = new LogonLogs(logonAuditResponse.logonLog);
return jsonToCsv(logonLogs).then((csv) => {
expect(csv).toBe(
'"User Id","Email Address","Ip Address","Timestamp"\n' +
'"3748238","Mark.Taylor@company.com... | hmcts/lau-idam-frontend | src/test/unit/utils/csvHandler.test.ts | TypeScript |
ArrowFunction |
async () => {
const logonLogs = new LogonLogs(logonAuditResponse.logonLog);
return jsonToCsv(logonLogs).then((csv) => {
expect(csv).toBe(
'"User Id","Email Address","Ip Address","Timestamp"\n' +
'"3748238","Mark.Taylor@company.com","192.158.1.38","2021-06-23 22:20:05"\n' +
'"37482... | hmcts/lau-idam-frontend | src/test/unit/utils/csvHandler.test.ts | TypeScript |
ArrowFunction |
(csv) => {
expect(csv).toBe(
'"User Id","Email Address","Ip Address","Timestamp"\n' +
'"3748238","Mark.Taylor@company.com","192.158.1.38","2021-06-23 22:20:05"\n' +
'"3748239","Dan.Morgan@company.com","192.151.1.28","2020-02-02 08:16:27"',
);
} | hmcts/lau-idam-frontend | src/test/unit/utils/csvHandler.test.ts | TypeScript |
ArrowFunction |
() => {
let component: UserFormComponent;
let fixture: ComponentFixture<UserFormComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [UserFormComponent]
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UserFormComponent);
... | Mikearaya/safeway_hybrid_app | myworkspace/apps/ilo-admin/src/app/features/users/user-form/user-form.component.spec.ts | TypeScript |
ArrowFunction |
() => {
TestBed.configureTestingModule({
declarations: [UserFormComponent]
}).compileComponents();
} | Mikearaya/safeway_hybrid_app | myworkspace/apps/ilo-admin/src/app/features/users/user-form/user-form.component.spec.ts | TypeScript |
ArrowFunction |
() => {
fixture = TestBed.createComponent(UserFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
} | Mikearaya/safeway_hybrid_app | myworkspace/apps/ilo-admin/src/app/features/users/user-form/user-form.component.spec.ts | TypeScript |
ArrowFunction |
(storyContent) =>
`<div class="sprk-o-Box">
<form (submit)="onSubmit($event)" #sampleForm="ngForm">
${storyContent}
</form>
<div>` | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => ({
moduleMetadata: modules,
template: `
<sprk-input-container>
<div class="
sprk-b-InputContainer__icon-container
sprk-b-TextInputIconContainer--has-text-icon"
>
<label for="monetary" isMonetary="true" sprkLabel>
Payment
</label>
<input
... | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => ({
moduleMetadata: modules,
template: `
<sprk-input-container>
<div class="
sprk-b-InputContainer__icon-container
sprk-b-TextInputIconContainer--has-text-icon"
>
<label for="invalid-monetary" isMonetary="true" sprkLabel>
Payment
</label>
<inpu... | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => ({
moduleMetadata: modules,
template: `
<sprk-input-container>
<div class="
sprk-b-InputContainer__icon-container
sprk-b-TextInputIconContainer--has-text-icon"
>
<label for="disabled-monetary" isMonetary="true" isDisabled="true" sprkLabel>
Payment
</l... | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => ({
moduleMetadata: modules,
template: `
<sprk-icon-input-container
iconContainerClasses="sprk-b-TextInputIconContainer--has-text-icon"
>
<label for="legacy-monetary" class="sprk-b-Label--monetary" sprkLabel>
Payment
</label>
<input
id="legacy-monetary"
... | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => ({
moduleMetadata: modules,
template: `
<sprk-icon-input-container
iconContainerClasses="sprk-b-TextInputIconContainer--has-text-icon"
>
<label for="legacy-invalid-monetary" class="sprk-b-Label--monetary" sprkLabel>
Payment
</label>
<input
id="legacy-invalid-mo... | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => ({
moduleMetadata: modules,
template: `
<sprk-icon-input-container
iconContainerClasses="sprk-b-TextInputIconContainer--has-text-icon"
>
<label
for="legacy-disabled-monetary"
class="sprk-b-Label--monetary sprk-b-Label--disabled"
sprkLabel
>
Payment
... | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
MethodDeclaration |
onSubmit(event): void {
this.form_submitted = true;
} | PaulSDwyer/spark-design-system | angular/projects/spark-angular/src/lib/components/inputs/Monetary.stories.ts | TypeScript |
ArrowFunction |
() => {
let wrapperFactory: any
let correctionNameChoices: any
let store: any = getVuexStore()
beforeEach(() => {
wrapperFactory = (propsData: any) => {
return shallowMount(CorrectNameOptions, {
propsData: {
...propsData
},
store,
vuetify
})
}
})... | andrepestana-aot/business-edit-ui | tests/unit/CorrectNameOptions.spec.ts | TypeScript |
ArrowFunction |
() => {
wrapperFactory = (propsData: any) => {
return shallowMount(CorrectNameOptions, {
propsData: {
...propsData
},
store,
vuetify
})
}
} | andrepestana-aot/business-edit-ui | tests/unit/CorrectNameOptions.spec.ts | TypeScript |
ArrowFunction |
(propsData: any) => {
return shallowMount(CorrectNameOptions, {
propsData: {
...propsData
},
store,
vuetify
})
} | andrepestana-aot/business-edit-ui | tests/unit/CorrectNameOptions.spec.ts | TypeScript |
ArrowFunction |
async () => {
correctionNameChoices = ['correct-new-nr']
const wrapper = wrapperFactory({ correctionNameChoices })
expect(wrapper.findComponent(CorrectNameOptions).exists()).toBe(true)
} | andrepestana-aot/business-edit-ui | tests/unit/CorrectNameOptions.spec.ts | TypeScript |
ArrowFunction |
async () => {
correctionNameChoices = ['correct-new-nr']
const wrapper = wrapperFactory({ correctionNameChoices })
await Vue.nextTick()
// Verify correct sub components are mounted
expect(wrapper.findComponent(CorrectNameRequest).exists()).toBe(true)
expect(wrapper.findComponent(CorrectCompany... | andrepestana-aot/business-edit-ui | tests/unit/CorrectNameOptions.spec.ts | TypeScript |
ArrowFunction |
async () => {
correctionNameChoices = ['correct-name', 'correct-new-nr', 'correct-name-to-number']
const wrapper = wrapperFactory({ correctionNameChoices })
await Vue.nextTick()
// Verify correct sub components are mounted
expect(wrapper.findComponent(CorrectNameRequest).exists()).toBe(true)
e... | andrepestana-aot/business-edit-ui | tests/unit/CorrectNameOptions.spec.ts | TypeScript |
ArrowFunction |
(declaration: object, initialValue: any) => {
return function reducerFn(state = initialValue, action): any {
const reducer = declaration[action.type] || declaration[DefaultCase];
return reducer ? reducer(state, action.payload, action) : state;
};
} | DashBouquet/react-hipstaplate | app/utils/createReducer.ts | TypeScript |
ClassDeclaration |
@Container.injectable()
export class CommandWithoutDefinition extends Commands.Command {
public signature: string = "config:cli";
public description: string = "Update the CLI configuration.";
public async execute(): Promise<void> {
// Do nothing...
}
} | ArkEcosystem/core | __tests__/unit/core-cli/commands/__stubs__/command-without-definition.ts | TypeScript |
MethodDeclaration |
public async execute(): Promise<void> {
// Do nothing...
} | ArkEcosystem/core | __tests__/unit/core-cli/commands/__stubs__/command-without-definition.ts | TypeScript |
ArrowFunction |
() => this.reachedResolvedSize() | Wikia/AdEngine | platforms/shared/templates/handlers/slot/slot-decision-impact-to-resolved-handler.ts | TypeScript |
ArrowFunction |
([, viewedAndDelayed]) => {
const correction = this.scrollCorrector.usePositionCorrection();
if (viewedAndDelayed) {
this.adSlot.emitEvent(universalAdPackage.SLOT_STICKY_STATE_SKIPPED);
transition('transition').then(correction);
} else {
transition('sticky').then(correction);
}
... | Wikia/AdEngine | platforms/shared/templates/handlers/slot/slot-decision-impact-to-resolved-handler.ts | TypeScript |
ClassDeclaration |
@Injectable({ autobind: false })
export class SlotDecisionImpactToResolvedHandler implements TemplateStateHandler {
private unsubscribe$ = new Subject<void>();
constructor(
@Inject(TEMPLATE.SLOT) private adSlot: AdSlot,
private domListener: DomListener,
private scrollCorrector: ScrollCorrector,
private read... | Wikia/AdEngine | platforms/shared/templates/handlers/slot/slot-decision-impact-to-resolved-handler.ts | TypeScript |
MethodDeclaration |
async onEnter(transition: TemplateTransition<'sticky' | 'transition'>): Promise<void> {
this.domListener.scroll$
.pipe(
startWith({}),
withLatestFrom(this.timeout.isViewedAndDelayed()),
filter(() => this.reachedResolvedSize()),
tap(([, viewedAndDelayed]) => {
const correction = this.scrollCor... | Wikia/AdEngine | platforms/shared/templates/handlers/slot/slot-decision-impact-to-resolved-handler.ts | TypeScript |
MethodDeclaration |
private reachedResolvedSize(): boolean {
return this.reader.getProgressImpactToResolved() === 1;
} | Wikia/AdEngine | platforms/shared/templates/handlers/slot/slot-decision-impact-to-resolved-handler.ts | TypeScript |
MethodDeclaration |
async onLeave(): Promise<void> {
this.unsubscribe$.next();
} | Wikia/AdEngine | platforms/shared/templates/handlers/slot/slot-decision-impact-to-resolved-handler.ts | TypeScript |
FunctionDeclaration |
export function filterPresetsConfig(presetsConfig: PresetConfig[]): PresetConfig[] {
return presetsConfig.filter((preset) => {
const presetName = typeof preset === 'string' ? preset : preset.name;
return !/@storybook[\\\\/]preset-typescript/.test(presetName);
});
} | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
function resolvePresetFunction<T = any>(
input: T[] | Function,
presetOptions: any,
storybookOptions: InterPresetOptions
): T[] {
if (isFunction(input)) {
return input({ ...storybookOptions, ...presetOptions });
}
if (Array.isArray(input)) {
return input;
}
return [];
} | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
function interopRequireDefault(filePath: string) {
// eslint-disable-next-line global-require,import/no-dynamic-require
const result = require(filePath);
const isES6DefaultExported =
typeof result === 'object' && result !== null && typeof result.default !== 'undefined';
return isES6DefaultExported ? resu... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
function getContent(input: any) {
if (input.type === 'managerEntries') {
const { type, name, ...rest } = input;
return rest;
}
const name = input.name ? input.name : input;
return interopRequireDefault(name);
} | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
export function loadPreset(
input: PresetConfig,
level: number,
storybookOptions: InterPresetOptions
): LoadedPreset[] {
try {
// @ts-ignores
const name: string = input.name ? input.name : input;
// @ts-ignore
const presetOptions = input.options ? input.options : {};
let contents = getCont... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
function loadPresets(
presets: PresetConfig[],
level: number,
storybookOptions: InterPresetOptions
): LoadedPreset[] {
if (!presets || !Array.isArray(presets) || !presets.length) {
return [];
}
if (!level) {
logger.info('=> Loading presets');
}
return presets.reduce((acc, preset) => {
con... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
function applyPresets(
presets: LoadedPreset[],
extension: string,
config: any,
args: any,
storybookOptions: InterPresetOptions
): Promise<any> {
const presetResult = new Promise((resolve) => resolve(config));
if (!presets.length) {
return presetResult;
}
return presets.reduce((accumulationProm... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
export function getPresets(presets: PresetConfig[], storybookOptions: InterPresetOptions): Presets {
const loadedPresets: LoadedPreset[] = loadPresets(presets, 0, storybookOptions);
return {
apply: async (extension: string, config: any, args = {}) =>
applyPresets(loadedPresets, extension, config, args, ... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
FunctionDeclaration |
export function loadAllPresets(
options: CLIOptions &
LoadOptions &
BuilderOptions & {
corePresets: string[];
overridePresets: string[];
frameworkPresets: string[];
}
) {
const { corePresets = [], frameworkPresets = [], overridePresets = [], ...restOptions } = options;
const preset... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
(val: unknown): val is Record<string, any> =>
val != null && typeof val === 'object' && Array.isArray(val) === false | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
(val: unknown): val is Function => typeof val === 'function' | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
(preset) => {
const presetName = typeof preset === 'string' ? preset : preset.name;
return !/@storybook[\\\\/]preset-typescript/.test(presetName);
} | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
(configDir: string, name: string) => {
let path;
if (name.startsWith('.')) {
path = resolveFrom(configDir, name);
} else if (name.startsWith('/')) {
path = name;
} else if (name.match(/\/(preset|register(-panel)?)(\.(js|ts|tsx|jsx))?$/)) {
path = name;
}
// when user provides full path, we do... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
({ configDir }: InterPresetOptions) => (item: any) => {
try {
if (isObject(item)) {
const { name } = resolveAddonName(configDir, item.name);
return { ...item, name };
}
const { name, type } = resolveAddonName(configDir, item);
if (type === 'managerEntries') {
return {
name: ... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
(item: any) => {
try {
if (isObject(item)) {
const { name } = resolveAddonName(configDir, item.name);
return { ...item, name };
}
const { name, type } = resolveAddonName(configDir, item);
if (type === 'managerEntries') {
return {
name: `${name}_additionalManagerEntries`,
... | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
ArrowFunction |
(acc, preset) => {
const loaded = loadPreset(preset, level, storybookOptions);
return acc.concat(loaded);
} | Tellan/storybook | lib/core-common/src/presets.ts | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.