本文整理汇总了TypeScript中lodash/map.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: mapCommonData
private mapCommonData(args) {
const
scheduler = this._scheduler,
data = scheduler.getData();
return {
_ok: 1,
sim: scheduler.startedAt,
rs: scheduler.startedAt,
n: data.name,
st: scheduler.status.code,
je: scheduler.jobsExecuted,
jt: data.jobsCount,
ip: __map(scheduler.inProgress, ip => ip.fireInstanceId + '|' + ip.trigger.name),
jg: __map(data.groups, g => ({
n: g.name,
s: g.getStatus().value,
jb: __map(g.jobs, j => ({
n: j.name,
s: j.getStatus().value,
gn: g.name,
_: g.name + '_' + j.name,
tr: __map(j.triggers, t => ({
'_': t.name,
n: t.name,
s: t.getStatus().value,
sd: t.startDate,
ed: t.endDate,
nfd: t.nextFireDate,
pfd: t.previousFireDate,
tc: 'simple',
tb: (t.repeatCount === null ? '-1' : t.repeatCount.toString()) + '|' + t.repeatInterval + '|' + t.executedCount
}))
}))
})),
ev: __map(
scheduler.findEvents(+args.minEventId),
ev => {
const result: any = {
'_': `${ev.id}|${ev.date}|${ev.eventType}|${ev.scope}`,
k: ev.itemKey,
fid: ev.fireInstanceId
};
if (ev.faulted) {
result['_err'] = ev.errors ?
__map(ev.errors, er => ({ "_": er.text, l: er.level })) :
1
}
return result;
}
//`${ev.id}|${ev.date}|${ev.eventType}|${ev.scope}|${ev.fireInstanceId}|${ev.itemKey}`
)
};
}
示例2: sortColorsByHue
function sortColorsByHue(hexColors: string[]) {
const hslColors = map(hexColors, hexToHsl);
const sortedHSLColors = sortBy(hslColors, ['h']);
const chunkedHSLColors = chunk(sortedHSLColors, PALETTE_ROWS);
const sortedChunkedHSLColors = map(chunkedHSLColors, chunk => {
return sortBy(chunk, 'l');
});
const flattenedZippedSortedChunkedHSLColors = flattenDeep(zip(...sortedChunkedHSLColors));
return map(flattenedZippedSortedChunkedHSLColors, hslToHex);
}
示例3: mapProperties
function mapProperties(typeCode: string, data: any): Property[] {
if (!data) {
return null;
}
if (typeCode === 'enumerable') {
return __map(data, (item, index) => new Property('[' + index + ']', mapPropertyValue(item)));
} else if (typeCode === "object") {
return __map(
__keys(data),
key => new Property(key, mapPropertyValue(data[key])));
} else {
throw new Error('Unknown type code ' + typeCode);
}
}
示例4: sync
sync(activities: TActivity[]) {
const
existingActivities: TActivityViewModel[] = this.list.getValue(),
deletedActivities = __filter(
existingActivities,
viewModel => __every(activities, activity => this.areNotEqual(activity, viewModel))),
addedActivities = __filter(
activities,
activity => __every(existingActivities, viewModel => this.areNotEqual(activity, viewModel))),
updatedActivities = __filter(
existingActivities,
viewModel => __some<TActivity>(activities, activity => this.areEqual(activity, viewModel))),
addedViewModels = __map(addedActivities, this.mapper),
finder = (viewModel: TActivityViewModel) => __find(activities, activity => this.areEqual(activity, viewModel));
__each(deletedActivities, viewModel => this.list.remove(viewModel));
__each(addedViewModels, viewModel => {
viewModel.updateFrom(finder(viewModel));
this.list.add(viewModel);
});
__each(updatedActivities, viewModel => viewModel.updateFrom(finder(viewModel)));
}
示例5: mapTriggers
function mapTriggers(triggers): Trigger[] {
if (!triggers) {
return [];
}
return __map(triggers, mapSingleTrigger);
}
示例6: map
.replace(/style="([^"]+)"+/g, (match, style)=> {
let reactStyle = map(compact(style.split(";")), (keyvalue)=> {
let [key, value] = keyvalue.split(":")
return `${key}:"${value}"`
}).join(",")
return "style={{" + reactStyle + "}}"
})
示例7:
(job: Job) => {
const flattenTriggers = __map(job.Triggers,
(t:Trigger) => ({ scope: SchedulerEventScope.Trigger, key: this.makeSlotKey(SchedulerEventScope.Trigger, t.UniqueTriggerKey), size: 1 }));
return [
{ scope: SchedulerEventScope.Job, key: this.makeSlotKey(SchedulerEventScope.Job, jobGroup.Name) + '.' + job.Name, size: flattenTriggers.length + 1 }, // todo: fix key concatenation logic
...flattenTriggers
];
}
示例8: mapJobGroups
function mapJobGroups(groups): JobGroup[] {
if (!groups) {
return [];
}
return __map(groups, (dto: any) => ({
Name: dto.n,
Status: ActivityStatus.findBy(parseInt(dto.s, 10)),
Jobs: mapJobs(dto.jb)
}));
}
示例9: mapJobs
function mapJobs(jobs): Job[] {
if (!jobs) {
return [];
}
return __map(jobs, (dto: any) => ({
Name: dto.n,
Status: ActivityStatus.findBy(parseInt(dto.s, 10)),
GroupName: dto.gn,
UniqueName: dto['_'],
Triggers: mapTriggers(dto.tr)
}));
}
示例10: mapInProgress
function mapInProgress(inProgress): RunningJob[] {
if (!inProgress) {
return [];
}
return __map(inProgress, (dto: any) => {
const parts = parseJoined(dto, 2);
return {
FireInstanceId: parts[0],
UniqueTriggerKey: parts[1]
};
});
}