当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript map.default函数代码示例

本文整理汇总了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}`
            )
        };
    }
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:58,代码来源:fake-scheduler-server.ts

示例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);
}
开发者ID:bergquist,项目名称:grafana,代码行数:12,代码来源:colors.ts

示例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);
    }
}
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:15,代码来源:common-mappers.ts

示例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)));
    }
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:27,代码来源:activities-synschronizer.ts

示例5: mapTriggers

function mapTriggers(triggers): Trigger[] {
    if (!triggers) {
        return [];
    }

    return __map(triggers, mapSingleTrigger);
}
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:7,代码来源:common-mappers.ts

示例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 + "}}"
 })
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:7,代码来源:TestHelpers.ts

示例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
                        ];
                    }
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:9,代码来源:global-activities-synchronizer.ts

示例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)
    }));
}
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:11,代码来源:common-mappers.ts

示例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)
    }));
}
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:13,代码来源:common-mappers.ts

示例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]
        };
    });
}
开发者ID:guryanovev,项目名称:CrystalQuartz,代码行数:14,代码来源:common-mappers.ts


注:本文中的lodash/map.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。