type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
|---|---|---|---|---|
ClassDeclaration
|
export declare class MockViewResolver extends ViewResolver {
constructor();
/**
* Overrides the {@link ViewMetadata} for a component.
*
* @param {Type} component
* @param {ViewDefinition} view
*/
setView(component: Type, view: ViewMetadata): void;
/**
* Overrides the inline template for a component - other configuration remains unchanged.
*
* @param {Type} component
* @param {string} template
*/
setInlineTemplate(component: Type, template: string): void;
/**
* Overrides a directive from the component {@link ViewMetadata}.
*
* @param {Type} component
* @param {Type} from
* @param {Type} to
*/
overrideViewDirective(component: Type, from: Type, to: Type): void;
/**
* Returns the {@link ViewMetadata} for a component:
* - Set the {@link ViewMetadata} to the overridden view when it exists or fallback to the default
* `ViewResolver`,
* see `setView`.
* - Override the directives, see `overrideViewDirective`.
* - Override the @View definition, see `setInlineTemplate`.
*
* @param component
* @returns {ViewDefinition}
*/
resolve(component: Type): ViewMetadata;
}
|
AjitSutar7276/demo
|
node_modules/angular2/src/mock/view_resolver_mock.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Overrides the {@link ViewMetadata} for a component.
*
* @param {Type} component
* @param {ViewDefinition} view
*/
setView(component: Type, view: ViewMetadata): void;
|
AjitSutar7276/demo
|
node_modules/angular2/src/mock/view_resolver_mock.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Overrides the inline template for a component - other configuration remains unchanged.
*
* @param {Type} component
* @param {string} template
*/
setInlineTemplate(component: Type, template: string): void;
|
AjitSutar7276/demo
|
node_modules/angular2/src/mock/view_resolver_mock.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Overrides a directive from the component {@link ViewMetadata}.
*
* @param {Type} component
* @param {Type} from
* @param {Type} to
*/
overrideViewDirective(component: Type, from: Type, to: Type): void;
|
AjitSutar7276/demo
|
node_modules/angular2/src/mock/view_resolver_mock.d.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Returns the {@link ViewMetadata} for a component:
* - Set the {@link ViewMetadata} to the overridden view when it exists or fallback to the default
* `ViewResolver`,
* see `setView`.
* - Override the directives, see `overrideViewDirective`.
* - Override the @View definition, see `setInlineTemplate`.
*
* @param component
* @returns {ViewDefinition}
*/
resolve(component: Type): ViewMetadata;
|
AjitSutar7276/demo
|
node_modules/angular2/src/mock/view_resolver_mock.d.ts
|
TypeScript
|
ClassDeclaration
|
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent {
constructor() { }
}
|
AeonSw4n/identity
|
src/app/home/home.component.ts
|
TypeScript
|
ClassDeclaration
|
@Injectable()
export class ItemsService {
constructor(@InjectModel('Item') private readonly itemModel: Model<Item>) {}
async findAll(): Promise<Item[]> {
return await this.itemModel.find();
}
async findOne(id: string): Promise<Item> {
return await this.itemModel.findOne({ _id: id });
}
async create(item:Item):Promise<Item>{
const newItem = new this.itemModel(item)
return await newItem.save()
}
async delete(id: string):Promise<Item>{
return await this.itemModel.findByIdAndRemove(id)
}
async update(id: string, item:Item ):Promise<Item>{
return await this.itemModel.findByIdAndUpdate(id, item,{new:true})
}
}
|
kirnozss/tNestItems
|
src/items/items.service.ts
|
TypeScript
|
MethodDeclaration
|
async findAll(): Promise<Item[]> {
return await this.itemModel.find();
}
|
kirnozss/tNestItems
|
src/items/items.service.ts
|
TypeScript
|
MethodDeclaration
|
async findOne(id: string): Promise<Item> {
return await this.itemModel.findOne({ _id: id });
}
|
kirnozss/tNestItems
|
src/items/items.service.ts
|
TypeScript
|
MethodDeclaration
|
async create(item:Item):Promise<Item>{
const newItem = new this.itemModel(item)
return await newItem.save()
}
|
kirnozss/tNestItems
|
src/items/items.service.ts
|
TypeScript
|
MethodDeclaration
|
async delete(id: string):Promise<Item>{
return await this.itemModel.findByIdAndRemove(id)
}
|
kirnozss/tNestItems
|
src/items/items.service.ts
|
TypeScript
|
MethodDeclaration
|
async update(id: string, item:Item ):Promise<Item>{
return await this.itemModel.findByIdAndUpdate(id, item,{new:true})
}
|
kirnozss/tNestItems
|
src/items/items.service.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface IPropagationChartItem {
cumpercent: number;
cumulative: number;
dx: number;
frequency: number;
x: number;
y: number;
}
|
Alethio/explorer-core-plugins
|
src/app/eth-extended/module/dashboard/charts/data/IPropagationChartItem.ts
|
TypeScript
|
FunctionDeclaration
|
/**
* Keep track of the fact that we attempted to install a package into an interpreter.
* (don't care whether it was successful or not).
*/
export async function trackPackageInstalledIntoInterpreter(
memento: Memento,
product: Product,
interpreter: InterpreterUri
) {
if (isResource(interpreter)) {
return;
}
const key = `${getInterpreterHash(interpreter)}#${ProductNames.get(product)}`;
await memento.update(key, true);
}
|
C-SELLERS/vscode-jupyter
|
src/kernels/installer/productInstaller.ts
|
TypeScript
|
FunctionDeclaration
|
export async function clearInstalledIntoInterpreterMemento(memento: Memento, product: Product, interpreterPath: Uri) {
const key = `${getInterpreterHash({ uri: interpreterPath })}#${ProductNames.get(product)}`;
await memento.update(key, undefined);
}
|
C-SELLERS/vscode-jupyter
|
src/kernels/installer/productInstaller.ts
|
TypeScript
|
FunctionDeclaration
|
export function isModulePresentInEnvironmentCache(memento: Memento, product: Product, interpreter: PythonEnvironment) {
const key = `${getInterpreterHash(interpreter)}#${ProductNames.get(product)}`;
return memento.get<boolean>(key, false);
}
|
C-SELLERS/vscode-jupyter
|
src/kernels/installer/productInstaller.ts
|
TypeScript
|
InterfaceDeclaration
|
export interface Constants {
babe: {
[index: string]: Codec;
epochDuration: u64 & ConstantCodec;
expectedBlockTime: Moment & ConstantCodec;
};
timestamp: {
[index: string]: Codec;
minimumPeriod: Moment & ConstantCodec;
};
balances: {
[index: string]: Codec;
existentialDeposit: Balance & ConstantCodec;
transferFee: Balance & ConstantCodec;
creationFee: Balance & ConstantCodec;
};
transactionPayment: {
[index: string]: Codec;
transactionBaseFee: BalanceOf & ConstantCodec;
transactionByteFee: BalanceOf & ConstantCodec;
};
staking: {
[index: string]: Codec;
sessionsPerEra: SessionIndex & ConstantCodec;
bondingDuration: EraIndex & ConstantCodec;
};
session: {
[index: string]: Codec;
dedupKeyPrefix: Bytes & ConstantCodec;
};
democracy: {
[index: string]: Codec;
enactmentPeriod: BlockNumber & ConstantCodec;
launchPeriod: BlockNumber & ConstantCodec;
votingPeriod: BlockNumber & ConstantCodec;
minimumDeposit: BalanceOf & ConstantCodec;
emergencyVotingPeriod: BlockNumber & ConstantCodec;
cooloffPeriod: BlockNumber & ConstantCodec;
};
elections: {
[index: string]: Codec;
candidacyBond: BalanceOf & ConstantCodec;
votingBond: BalanceOf & ConstantCodec;
desiredMembers: u32 & ConstantCodec;
desiredRunnersUp: u32 & ConstantCodec;
termDuration: BlockNumber & ConstantCodec;
};
finalityTracker: {
[index: string]: Codec;
windowSize: BlockNumber & ConstantCodec;
reportLatency: BlockNumber & ConstantCodec;
};
treasury: {
[index: string]: Codec;
proposalBond: Permill & ConstantCodec;
proposalBondMinimum: BalanceOf & ConstantCodec;
spendPeriod: BlockNumber & ConstantCodec;
burn: Permill & ConstantCodec;
};
contracts: {
[index: string]: Codec;
signedClaimHandicap: BlockNumber & ConstantCodec;
tombstoneDeposit: BalanceOf & ConstantCodec;
storageSizeOffset: u32 & ConstantCodec;
rentByteFee: BalanceOf & ConstantCodec;
rentDepositOffset: BalanceOf & ConstantCodec;
surchargeReward: BalanceOf & ConstantCodec;
transferFee: BalanceOf & ConstantCodec;
creationFee: BalanceOf & ConstantCodec;
transactionBaseFee: BalanceOf & ConstantCodec;
transactionByteFee: BalanceOf & ConstantCodec;
contractFee: BalanceOf & ConstantCodec;
callBaseFee: Gas & ConstantCodec;
instantiateBaseFee: Gas & ConstantCodec;
maxDepth: u32 & ConstantCodec;
maxValueSize: u32 & ConstantCodec;
blockGasLimit: Gas & ConstantCodec;
};
nicks: {
[index: string]: Codec;
reservationFee: BalanceOf & ConstantCodec;
minLength: u32 & ConstantCodec;
maxLength: u32 & ConstantCodec;
};
}
|
mariopino/api
|
packages/api/src/consts.types.ts
|
TypeScript
|
ArrowFunction
|
() =>
originalRenderPage({
enhanceApp: (App: React.FC) => (props: unknown) =>
sheet.collectStyles(<App {...props} />),
})
|
flaranda/happy-birthday-rachel
|
src/pages/_document.tsx
|
TypeScript
|
ArrowFunction
|
(App: React.FC) => (props: unknown) =>
sheet.collectStyles(<App {...props} />)
|
flaranda/happy-birthday-rachel
|
src/pages/_document.tsx
|
TypeScript
|
ArrowFunction
|
(props: unknown) =>
sheet.collectStyles(<App {...props} />)
|
flaranda/happy-birthday-rachel
|
src/pages/_document.tsx
|
TypeScript
|
ClassDeclaration
|
export default class MyDocument extends Document {
static async getInitialProps(ctx: DocumentContext) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App: React.FC) => (props: unknown) =>
sheet.collectStyles(<App {...props} />),
});
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
),
};
}
|
flaranda/happy-birthday-rachel
|
src/pages/_document.tsx
|
TypeScript
|
MethodDeclaration
|
static async getInitialProps(ctx: DocumentContext) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App: React.FC) => (props: unknown) =>
sheet.collectStyles(<App {...props} />),
});
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
),
};
}
|
flaranda/happy-birthday-rachel
|
src/pages/_document.tsx
|
TypeScript
|
ArrowFunction
|
(data: Question[]) => {
return data;
}
|
CITO-Project/skills-checker-client-app
|
src/app/services/api-call/question.service.ts
|
TypeScript
|
ClassDeclaration
|
@Injectable({
providedIn: 'root'
})
export class QuestionService {
private CHALLENGING_ORDER = [
'literacy',
'numeracy',
'digital_skills'
];
constructor(private commonService: CommonService) { }
getQuestions(interestid: number, scenarioid: number): Observable<Question[]> {
if (interestid === undefined) {
interestid = -1;
} else if (scenarioid === undefined) {
scenarioid = -1;
} else {
const url = `/interests/${interestid}/scenarios/${scenarioid}/questions`;
return this.commonService.getAPICaller(url)
.pipe(map( (data: Question[]) => {
return data;
})
);
}
}
getQuestionsByCategory(categoryid: number, interestid: number, scenarioid: number): Observable<Question[]> {
if (categoryid === undefined) {
categoryid = -1;
} else if (interestid === undefined) {
interestid = -1;
} else if (scenarioid === undefined) {
scenarioid = -1;
} else {
const url = `/categories/${categoryid}/interests/${interestid}/scenarios/${scenarioid}/questions`;
return this.commonService.getAPICaller(url)
.pipe(map( (data: Question[]) => {
return data;
})
);
}
}
getChallengingOrder(): string[] {
return this.CHALLENGING_ORDER;
}
getQuestionInOrder(questions: Question[], questionindex: number, questionOrder: string[]): Question {
let r: Question = null;
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < questions.length; i++) {
if (questions[i].pedagogical_type === questionOrder[questionindex]) {
r = questions[i];
break;
}
}
return r;
}
}
|
CITO-Project/skills-checker-client-app
|
src/app/services/api-call/question.service.ts
|
TypeScript
|
MethodDeclaration
|
getQuestions(interestid: number, scenarioid: number): Observable<Question[]> {
if (interestid === undefined) {
interestid = -1;
} else if (scenarioid === undefined) {
scenarioid = -1;
} else {
const url = `/interests/${interestid}/scenarios/${scenarioid}/questions`;
return this.commonService.getAPICaller(url)
.pipe(map( (data: Question[]) => {
return data;
})
);
}
}
|
CITO-Project/skills-checker-client-app
|
src/app/services/api-call/question.service.ts
|
TypeScript
|
MethodDeclaration
|
getQuestionsByCategory(categoryid: number, interestid: number, scenarioid: number): Observable<Question[]> {
if (categoryid === undefined) {
categoryid = -1;
} else if (interestid === undefined) {
interestid = -1;
} else if (scenarioid === undefined) {
scenarioid = -1;
} else {
const url = `/categories/${categoryid}/interests/${interestid}/scenarios/${scenarioid}/questions`;
return this.commonService.getAPICaller(url)
.pipe(map( (data: Question[]) => {
return data;
})
);
}
}
|
CITO-Project/skills-checker-client-app
|
src/app/services/api-call/question.service.ts
|
TypeScript
|
MethodDeclaration
|
getChallengingOrder(): string[] {
return this.CHALLENGING_ORDER;
}
|
CITO-Project/skills-checker-client-app
|
src/app/services/api-call/question.service.ts
|
TypeScript
|
MethodDeclaration
|
getQuestionInOrder(questions: Question[], questionindex: number, questionOrder: string[]): Question {
let r: Question = null;
// tslint:disable-next-line:prefer-for-of
for (let i = 0; i < questions.length; i++) {
if (questions[i].pedagogical_type === questionOrder[questionindex]) {
r = questions[i];
break;
}
}
return r;
}
|
CITO-Project/skills-checker-client-app
|
src/app/services/api-call/question.service.ts
|
TypeScript
|
ArrowFunction
|
() => {
const menuProps = useConst<IContextualMenuProps>(() => ({
shouldFocusOnMount: true,
items: [
{
key: 'Later Today',
iconProps: { iconName: 'Clock' },
text: 'Later Today',
secondaryText: '7:00 PM',
},
{
key: 'Tomorrow',
iconProps: { iconName: 'Coffeescript' },
text: 'Tomorrow',
secondaryText: 'Thu. 8:00 AM',
},
{
key: 'This Weekend',
iconProps: { iconName: 'Vacation' },
text: 'This Weekend',
secondaryText: 'Sat. 10:00 AM',
},
{
key: 'Next Week',
iconProps: { iconName: 'Suitcase' },
text: 'Next Week',
secondaryText: 'Mon. 8:00 AM',
},
],
}));
return <DefaultButton text="Click for ContextualMenu" menuProps={menuProps} />;
}
|
LavaAdventures/fluentui
|
packages/react-examples/src/react/ContextualMenu/ContextualMenu.Icon.SecondaryText.Example.tsx
|
TypeScript
|
ArrowFunction
|
() => ({
shouldFocusOnMount: true,
items: [
{
key: 'Later Today',
iconProps: { iconName: 'Clock' },
text: 'Later Today',
secondaryText: '7:00 PM',
},
{
key: 'Tomorrow',
iconProps: { iconName: 'Coffeescript' },
text: 'Tomorrow',
secondaryText: 'Thu. 8:00 AM',
},
{
key: 'This Weekend',
iconProps: { iconName: 'Vacation' },
text: 'This Weekend',
secondaryText: 'Sat. 10:00 AM',
},
{
key: 'Next Week',
iconProps: { iconName: 'Suitcase' },
text: 'Next Week',
secondaryText: 'Mon. 8:00 AM',
},
],
})
|
LavaAdventures/fluentui
|
packages/react-examples/src/react/ContextualMenu/ContextualMenu.Icon.SecondaryText.Example.tsx
|
TypeScript
|
ArrowFunction
|
() => DaterangepickerDirective
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
ArrowFunction
|
(range: any) => {
this.rangeClicked.emit(range);
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
ArrowFunction
|
(range: any) => {
this.datesUpdated.emit(range);
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
ArrowFunction
|
(change: any) => {
if (change) {
const value = {};
value[this._startKey] = change.startDate;
value[this._endKey] = change.endDate;
this.value = value;
this.onChange.emit(value);
if (typeof change.chosenLabel === 'string') {
this._el.nativeElement.value = change.chosenLabel;
}
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
ArrowFunction
|
() => {
this.setPosition();
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
ngOnInit() {
this.picker.rangeClicked.asObservable().subscribe((range: any) => {
this.rangeClicked.emit(range);
});
this.picker.datesUpdated.asObservable().subscribe((range: any) => {
this.datesUpdated.emit(range);
});
this.picker.choosedDate.asObservable().subscribe((change: any) => {
if (change) {
const value = {};
value[this._startKey] = change.startDate;
value[this._endKey] = change.endDate;
this.value = value;
this.onChange.emit(value);
if (typeof change.chosenLabel === 'string') {
this._el.nativeElement.value = change.chosenLabel;
}
}
});
this.picker.firstMonthDayClass = this.firstMonthDayClass;
this.picker.lastMonthDayClass = this.lastMonthDayClass;
this.picker.emptyWeekRowClass = this.emptyWeekRowClass;
this.picker.firstDayOfNextMonthClass = this.firstDayOfNextMonthClass;
this.picker.lastDayOfPreviousMonthClass = this.lastDayOfPreviousMonthClass;
this.picker.drops = this.drops;
this.picker.opens = this.opens;
this.localeDiffer = this.differs.find(this.locale).create();
this.picker.closeOnAutoApply = this.closeOnAutoApply;
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
ngOnChanges(changes: SimpleChanges): void {
for (const change in changes) {
if (changes.hasOwnProperty(change)) {
if (this.notForChangesProperty.indexOf(change) === -1) {
this.picker[change] = changes[change].currentValue;
}
}
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
ngDoCheck() {
if (this.localeDiffer) {
const changes = this.localeDiffer.diff(this.locale);
if (changes) {
this.picker.updateLocale(this.locale);
}
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
onBlur() {
this._onTouched();
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
open(event?: any) {
this.picker.show(event);
setTimeout(() => {
this.setPosition();
});
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
hide(e?) {
this.picker.hide(e);
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
toggle(e?) {
if (this.picker.isShown) {
this.hide(e);
} else {
this.open(e);
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
clear() {
this.picker.clear();
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
writeValue(value) {
this.setValue(value);
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
registerOnChange(fn) {
this._onChange = fn;
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
registerOnTouched(fn) {
this._onTouched = fn;
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
private setValue(val: any) {
if (val) {
this.value = val;
if (val[this._startKey]) {
this.picker.setStartDate(val[this._startKey]);
}
if (val[this._endKey]) {
this.picker.setEndDate(val[this._endKey]);
}
this.picker.calculateChosenLabel();
if (this.picker.chosenLabel) {
this._el.nativeElement.value = this.picker.chosenLabel;
}
} else {
this.picker.clear();
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
/**
* Set position of the calendar
*/
setPosition() {
let style;
let containerTop;
const container = this.picker.pickerContainer.nativeElement;
const element = this._el.nativeElement;
if (this.drops && this.drops === 'up') {
containerTop = (element.offsetTop - container.clientHeight) + 'px';
} else {
containerTop = 'auto';
}
if (this.opens === 'left') {
style = {
top: containerTop,
left: (element.offsetLeft - container.clientWidth + element.clientWidth) + 'px',
right: 'auto'
};
} else if (this.opens === 'center') {
style = {
top: containerTop,
left: (element.offsetLeft + element.clientWidth / 2
- container.clientWidth / 2) + 'px',
right: 'auto'
};
} else if (this.opens === 'right') {
style = {
top: containerTop,
left: element.offsetLeft + 'px',
right: 'auto'
};
} else {
const position = element.offsetLeft + element.clientWidth / 2 - container.clientWidth / 2;
if (position < 0) {
style = {
top: containerTop,
left: element.offsetLeft + 'px',
right: 'auto'
};
}
else {
style = {
top: containerTop,
left: position + 'px',
right: 'auto'
};
}
}
if (style) {
this._renderer.setStyle(container, 'top', style.top);
this._renderer.setStyle(container, 'left', style.left);
this._renderer.setStyle(container, 'right', style.right);
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
inputChanged(e) {
if (e.target.tagName.toLowerCase() !== 'input') {
return;
}
if (!e.target.value.length) {
return;
}
const dateString = e.target.value.split(this.picker.locale.separator);
let start = null, end = null;
if (dateString.length === 2) {
start = moment(dateString[0], this.picker.locale.format);
end = moment(dateString[1], this.picker.locale.format);
}
if (this.singleDatePicker || start === null || end === null) {
start = moment(e.target.value, this.picker.locale.format);
end = start;
}
if (!start.isValid() || !end.isValid()) {
return;
}
this.picker.setStartDate(start);
this.picker.setEndDate(end);
this.picker.updateView();
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
MethodDeclaration
|
/**
* For click outside of the calendar's container
* @param event event object
*/
@HostListener('document:click', ['$event'])
outsideClick(event): void {
if (!event.target) {
return;
}
if (event.target.classList.contains('ngx-daterangepicker-action')) {
return;
}
if (!this.elementRef.nativeElement.contains(event.target)) {
this.hide();
}
}
|
Alirezazabetan/ngx-daterangepicker-material
|
src/daterangepicker/daterangepicker.directive.ts
|
TypeScript
|
ArrowFunction
|
() => ({
getOctokit: jest.fn(),
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(toMock: string[]) => {
const originalConsole = { ...console };
debugger;
toMock.forEach((mock) => {
(console as any)[mock] = jest.fn();
});
consoleMock = console as jest.Mocked<Console>;
return () => {
global.console = originalConsole;
};
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(mock) => {
(console as any)[mock] = jest.fn();
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
global.console = originalConsole;
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
it("returns empty array on empty string", () => {
const list = "";
const pkgArray = packageListToArray(list);
expect(pkgArray.length).toBe(0);
});
it("splits on comma", () => {
const list = "package1,package2,package3";
const pkgArray = packageListToArray(list);
expect(pkgArray[0]).toBe("package1");
expect(pkgArray[1]).toBe("package2");
expect(pkgArray[2]).toBe("package3");
});
it("considers a single package", () => {
const list = "package17";
const pkgArray = packageListToArray(list);
expect(pkgArray[0]).toBe("package17");
expect(pkgArray[1]).toBe(undefined);
});
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const list = "";
const pkgArray = packageListToArray(list);
expect(pkgArray.length).toBe(0);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const list = "package1,package2,package3";
const pkgArray = packageListToArray(list);
expect(pkgArray[0]).toBe("package1");
expect(pkgArray[1]).toBe("package2");
expect(pkgArray[2]).toBe("package3");
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
const list = "package17";
const pkgArray = packageListToArray(list);
expect(pkgArray[0]).toBe("package17");
expect(pkgArray[1]).toBe(undefined);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
it("mocks core getInput", () => {
jest
.spyOn(core, "getInput")
.mockImplementationOnce((arg) => `This returns ${arg}`);
const test = core.getInput("test");
expect(test).toBe("This returns test");
});
it("mocks github context", () => {
jest
.spyOn(github, "getOctokit")
//@ts-ignore
.mockImplementationOnce((arg) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
}));
const octokit = github.getOctokit("token");
expect(octokit).toEqual({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
});
});
it("mocks octokit createRelease", () => {
jest.spyOn(github, "getOctokit").mockImplementationOnce((arg) => ({
//@ts-ignore
repos: { createRelease: (obj) => obj },
}));
const octokit = github.getOctokit("token");
//@ts-ignore
const releaseResponse = octokit.repos.createRelease({ body: "text" });
expect(releaseResponse).toEqual({ body: "text" });
});
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
jest
.spyOn(core, "getInput")
.mockImplementationOnce((arg) => `This returns ${arg}`);
const test = core.getInput("test");
expect(test).toBe("This returns test");
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(arg) => `This returns ${arg}`
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
jest
.spyOn(github, "getOctokit")
//@ts-ignore
.mockImplementationOnce((arg) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
}));
const octokit = github.getOctokit("token");
expect(octokit).toEqual({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
});
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(arg) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
jest.spyOn(github, "getOctokit").mockImplementationOnce((arg) => ({
//@ts-ignore
repos: { createRelease: (obj) => obj },
}));
const octokit = github.getOctokit("token");
//@ts-ignore
const releaseResponse = octokit.repos.createRelease({ body: "text" });
expect(releaseResponse).toEqual({ body: "text" });
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(arg) => ({
//@ts-ignore
repos: { createRelease: (obj) => obj },
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(obj) => obj
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
restoreConsole = mockConsole(["log", "dir", "info", "error"]);
jest.clearAllMocks();
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
restoreConsole();
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
it("output", async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "status",
cwd: cwd,
createRelease: "false",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const covectoredAction = await run(covector());
expect(core.setOutput).toHaveBeenCalledWith("commandRan", "status");
expect(core.setOutput).toHaveBeenCalledWith("status", "No changes.");
});
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "status",
cwd: cwd,
createRelease: "false",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const covectoredAction = await run(covector());
expect(core.setOutput).toHaveBeenCalledWith("commandRan", "status");
expect(core.setOutput).toHaveBeenCalledWith("status", "No changes.");
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(arg) => input[arg]
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
() => {
it("output", async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "version",
cwd: cwd,
createRelease: "false",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const covectoredAction = await run(covector());
expect(core.setOutput).toHaveBeenCalledWith("status", "No changes.");
expect(core.setOutput).toHaveBeenCalledWith("commandRan", "version");
// to cover template pipe
expect(core.setOutput).toMatchSnapshot();
});
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "version",
cwd: cwd,
createRelease: "false",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const covectoredAction = await run(covector());
expect(core.setOutput).toHaveBeenCalledWith("status", "No changes.");
expect(core.setOutput).toHaveBeenCalledWith("commandRan", "version");
// to cover template pipe
expect(core.setOutput).toMatchSnapshot();
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [],
}),
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(input) => Promise.resolve({ data: input })
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "publish",
cwd: cwd,
createRelease: "true",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const covectoredAction = await run(covector());
expect({
consoleLog: consoleMock.log.mock.calls,
consoleDir: consoleMock.dir.mock.calls,
}).toMatchSnapshot();
expect(core.setOutput).toHaveBeenCalledWith(
"templatePipe",
expect.stringContaining("2.3.1")
);
expect(core.setOutput).toHaveBeenCalledWith(
"templatePipe",
expect.stringContaining("1.9.0")
);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "publish",
cwd: cwd,
createRelease: "false",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const covectoredAction = await run(covector());
expect(core.setOutput).toHaveBeenCalledWith("status", "No changes.");
expect(core.setOutput).toHaveBeenCalledWith("commandRan", "publish");
expect(core.setOutput).toHaveBeenCalledWith("successfulPublish", true);
expect(core.setOutput).toHaveBeenCalledWith(
"packagesPublished",
"package-one,package-two"
);
expect(core.setOutput).toHaveBeenCalledWith(
"templatePipe",
expect.stringContaining("2.3.1")
);
expect(core.setOutput).toHaveBeenCalledWith(
"templatePipe",
expect.stringContaining("1.9.0")
);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "publish",
cwd: cwd,
createRelease: "true",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const octokit = jest
.spyOn(github, "getOctokit")
// @ts-ignore
.mockImplementation((token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [
{
draft: true,
body: "some stuff",
id: 15,
tag_name: "package-one-v2.3.1",
},
{
draft: true,
body: "other stuff",
id: 22,
tag_name: "package-two-v1.9.0",
},
],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
}));
const covectoredAction = await run(covector());
expect(octokit).toHaveBeenCalledWith(input.token);
const {
listReleases,
createRelease,
updateRelease,
// @ts-ignore
} = github.getOctokit.mock.results[0].value.repos;
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(updateRelease).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
release_id: 15,
draft: false,
body:
"some stuff\n## \\[2.3.1]\n\n- Added some cool things.\n\npublish\n\n",
});
expect(updateRelease).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
release_id: 22,
draft: false,
body:
"other stuff\n## \\[1.9.0]\n\n- Added some even cooler things.\n\npublish\n\n",
});
expect(createRelease).toHaveBeenCalledTimes(0);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [
{
draft: true,
body: "some stuff",
id: 15,
tag_name: "package-one-v2.3.1",
},
{
draft: true,
body: "other stuff",
id: 22,
tag_name: "package-two-v1.9.0",
},
],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-complex-commands");
const input: { [k: string]: string } = {
command: "publish",
cwd: cwd,
createRelease: "true",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const octokit = jest
.spyOn(github, "getOctokit")
// @ts-ignore
.mockImplementation((token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [
{
draft: false,
body: "some stuff",
id: 15,
tag_name: "package-one-v2.3.0",
},
{
draft: false,
body: "other stuff",
id: 22,
tag_name: "package-two-v1.8.7",
},
],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
}));
const covectoredAction = await run(covector());
expect(octokit).toHaveBeenCalledWith(input.token);
const {
listReleases,
createRelease,
updateRelease,
// @ts-ignore
} = github.getOctokit.mock.results[0].value.repos;
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(createRelease).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
name: "package-one v2.3.1",
tag_name: "package-one-v2.3.1",
draft: false,
body: "## \\[2.3.1]\n\n- Added some cool things.\n\npublish\n\n",
});
expect(createRelease).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
name: "package-two v1.9.0",
tag_name: "package-two-v1.9.0",
draft: false,
body: "## \\[1.9.0]\n\n- Added some even cooler things.\n\npublish\n\n",
});
expect(updateRelease).toHaveBeenCalledTimes(0);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [
{
draft: false,
body: "some stuff",
id: 15,
tag_name: "package-one-v2.3.0",
},
{
draft: false,
body: "other stuff",
id: 22,
tag_name: "package-two-v1.8.7",
},
],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-single-github-release");
const input: { [k: string]: string } = {
command: "publish",
cwd: cwd,
createRelease: "true",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const octokit = jest
.spyOn(github, "getOctokit")
// @ts-ignore
.mockImplementation((token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [
{
draft: true,
body: "some stuff",
id: 15,
tag_name: "v2.3.1",
},
],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
}));
const covectoredAction = await run(covector());
expect(octokit).toHaveBeenCalledWith(input.token);
const {
listReleases,
createRelease,
updateRelease,
// @ts-ignore
} = github.getOctokit.mock.results[0].value.repos;
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(updateRelease).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
release_id: 15,
draft: false,
body:
"some stuff\n## \\[2.3.1]\n\n- Added some cool things.\n\npublish\n\n",
});
expect(updateRelease).toHaveBeenCalledTimes(1);
expect(createRelease).toHaveBeenCalledTimes(0);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [
{
draft: true,
body: "some stuff",
id: 15,
tag_name: "v2.3.1",
},
],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
async () => {
const cwd: string = f.copy("integration.js-with-single-github-release");
const input: { [k: string]: string } = {
command: "publish",
cwd: cwd,
createRelease: "true",
draftRelease: "false",
token: "randomsequenceofcharactersforsecurity",
};
jest.spyOn(core, "getInput").mockImplementation((arg) => input[arg]);
const octokit = jest
.spyOn(github, "getOctokit")
// @ts-ignore
.mockImplementation((token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
}));
const covectoredAction = await run(covector());
expect(octokit).toHaveBeenCalledWith(input.token);
const {
listReleases,
createRelease,
updateRelease,
// @ts-ignore
} = github.getOctokit.mock.results[0].value.repos;
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(listReleases).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
});
expect(createRelease).toHaveBeenCalledWith({
owner: "genericOwner",
repo: "genericRepo",
name: "package-one v2.3.1",
tag_name: "v2.3.1",
draft: false,
body: "## \\[2.3.1]\n\n- Added some cool things.\n\npublish\n\n",
});
expect(createRelease).toHaveBeenCalledTimes(1);
expect(updateRelease).toHaveBeenCalledTimes(0);
}
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ArrowFunction
|
(token: string) => ({
context: { repo: { owner: "genericOwner", repo: "genericRepo" } },
repos: {
listReleases: jest.fn().mockResolvedValue({
data: [],
}) as jest.MockedFunction<any>,
updateRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
createRelease: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
uploadReleaseAsset: jest
.fn()
.mockImplementation((input) => Promise.resolve({ data: input })),
},
})
|
JonasKruckenberg/covector
|
packages/action/index.test.ts
|
TypeScript
|
ClassDeclaration
|
/**
* <p>
* Returns the direct dependencies for a package version. The dependencies are returned as
* <a href="https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageDependency.html">
* <code>PackageDependency</code>
* </a>
* objects. CodeArtifact extracts the dependencies for a package version from the metadata file for the package
* format (for example, the <code>package.json</code> file for npm packages and the <code>pom.xml</code> file
* for Maven). Any package version dependencies that are not listed in the configuration file are not returned.
* </p>
*/
export class ListPackageVersionDependenciesCommand extends $Command<
ListPackageVersionDependenciesCommandInput,
ListPackageVersionDependenciesCommandOutput,
CodeartifactClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
constructor(readonly input: ListPackageVersionDependenciesCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}
/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: CodeartifactClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListPackageVersionDependenciesCommandInput, ListPackageVersionDependenciesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const clientName = "CodeartifactClient";
const commandName = "ListPackageVersionDependenciesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListPackageVersionDependenciesRequest.filterSensitiveLog,
outputFilterSensitiveLog: ListPackageVersionDependenciesResult.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}
private serialize(
input: ListPackageVersionDependenciesCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_restJson1ListPackageVersionDependenciesCommand(input, context);
}
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<ListPackageVersionDependenciesCommandOutput> {
return deserializeAws_restJson1ListPackageVersionDependenciesCommand(output, context);
}
// Start section: command_body_extra
// End section: command_body_extra
}
|
PaulThompson/aws-sdk-js-v3
|
clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type ListPackageVersionDependenciesCommandInput = ListPackageVersionDependenciesRequest;
|
PaulThompson/aws-sdk-js-v3
|
clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type ListPackageVersionDependenciesCommandOutput = ListPackageVersionDependenciesResult & __MetadataBearer;
|
PaulThompson/aws-sdk-js-v3
|
clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts
|
TypeScript
|
MethodDeclaration
|
/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: CodeartifactClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListPackageVersionDependenciesCommandInput, ListPackageVersionDependenciesCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const clientName = "CodeartifactClient";
const commandName = "ListPackageVersionDependenciesCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: ListPackageVersionDependenciesRequest.filterSensitiveLog,
outputFilterSensitiveLog: ListPackageVersionDependenciesResult.filterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}
|
PaulThompson/aws-sdk-js-v3
|
clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts
|
TypeScript
|
MethodDeclaration
|
private serialize(
input: ListPackageVersionDependenciesCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> {
return serializeAws_restJson1ListPackageVersionDependenciesCommand(input, context);
}
|
PaulThompson/aws-sdk-js-v3
|
clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts
|
TypeScript
|
MethodDeclaration
|
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<ListPackageVersionDependenciesCommandOutput> {
return deserializeAws_restJson1ListPackageVersionDependenciesCommand(output, context);
}
|
PaulThompson/aws-sdk-js-v3
|
clients/client-codeartifact/commands/ListPackageVersionDependenciesCommand.ts
|
TypeScript
|
ArrowFunction
|
<T>(parser: Parser<T>) => seq([inputStart, parser])
|
dnegstad/umbrella
|
packages/parse/src/combinators/boundary.ts
|
TypeScript
|
ArrowFunction
|
<T>(parser: Parser<T>) => seq([parser, inputEnd])
|
dnegstad/umbrella
|
packages/parse/src/combinators/boundary.ts
|
TypeScript
|
ArrowFunction
|
(parser: Parser<string>) =>
seq([lineStart, parser, lineEnd])
|
dnegstad/umbrella
|
packages/parse/src/combinators/boundary.ts
|
TypeScript
|
ArrowFunction
|
<T>(parser: Parser<T>) =>
seq([inputStart, parser, inputEnd])
|
dnegstad/umbrella
|
packages/parse/src/combinators/boundary.ts
|
TypeScript
|
ArrowFunction
|
(output: any) => output
|
justingrant/aws-sdk-js-v3
|
clients/client-kms/commands/TagResourceCommand.ts
|
TypeScript
|
ClassDeclaration
|
export class TagResourceCommand extends $Command<
TagResourceCommandInput,
TagResourceCommandOutput,
KMSClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties
constructor(readonly input: TagResourceCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: KMSClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<TagResourceCommandInput, TagResourceCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const handlerExecutionContext: HandlerExecutionContext = {
logger,
inputFilterSensitiveLog: TagResourceRequest.filterSensitiveLog,
outputFilterSensitiveLog: (output: any) => output,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}
private serialize(input: TagResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1TagResourceCommand(input, context);
}
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<TagResourceCommandOutput> {
return deserializeAws_json1_1TagResourceCommand(output, context);
}
// Start section: command_body_extra
// End section: command_body_extra
}
|
justingrant/aws-sdk-js-v3
|
clients/client-kms/commands/TagResourceCommand.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type TagResourceCommandInput = TagResourceRequest;
|
justingrant/aws-sdk-js-v3
|
clients/client-kms/commands/TagResourceCommand.ts
|
TypeScript
|
TypeAliasDeclaration
|
export type TagResourceCommandOutput = __MetadataBearer;
|
justingrant/aws-sdk-js-v3
|
clients/client-kms/commands/TagResourceCommand.ts
|
TypeScript
|
MethodDeclaration
|
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: KMSClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<TagResourceCommandInput, TagResourceCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
const stack = clientStack.concat(this.middlewareStack);
const { logger } = configuration;
const handlerExecutionContext: HandlerExecutionContext = {
logger,
inputFilterSensitiveLog: TagResourceRequest.filterSensitiveLog,
outputFilterSensitiveLog: (output: any) => output,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}
|
justingrant/aws-sdk-js-v3
|
clients/client-kms/commands/TagResourceCommand.ts
|
TypeScript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.