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


TypeScript lodash.cloneDeepWith函数代码示例

本文整理汇总了TypeScript中lodash.cloneDeepWith函数的典型用法代码示例。如果您正苦于以下问题:TypeScript cloneDeepWith函数的具体用法?TypeScript cloneDeepWith怎么用?TypeScript cloneDeepWith使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cloneDeepWith函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

_.omitDeep = function(collection: Array<any>, excludeKeys: Array<string>) {
  function omitFn(value: any) {
    if (value && typeof value === 'object') {
      excludeKeys.forEach(key => {
        delete value[key];
      });
    }
  }

  return _.cloneDeepWith(collection, omitFn);
};
开发者ID:agneta,项目名称:platform,代码行数:11,代码来源:start.ts

示例2: write

  write (eligibility: Eligibility, req: express.Request, res: express.Response): void {
    const excludeDisplayValue = (value: any): any | undefined => {
      const property = 'displayValue'

      if (value && typeof value === 'object' && Object.getOwnPropertyDescriptor(value, property)) {
        return _.omit(value, property)
      }
      return undefined
    }
    res.cookie(cookieName, _.cloneDeepWith(eligibility, excludeDisplayValue), { httpOnly: true, secure: true, maxAge: cookieTimeToLiveInMinutes })
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:11,代码来源:store.ts

示例3:

  public $onInit(): void {
    const copy = cloneDeepWith<IPipeline>(this.pipeline, (value: any) => {
      if (value && value.$$hashKey) {
        delete value.$$hashKey;
      }
      return undefined; // required for clone operation and typescript happiness
    });
    this.removeImmutableFields(copy);

    this.isStrategy = this.pipeline.strategy || false;
    this.command = {
      pipelineJSON: this.jsonUtilityService.makeSortedStringFromObject(copy),
      locked: copy.locked
    };
  }
开发者ID:brujoand,项目名称:deck,代码行数:15,代码来源:editPipelineJsonModal.controller.ts

示例4: patchNLS

export function patchNLS(manifest: Manifest, translations: ITranslations): Manifest {
	return cloneDeepWith(manifest, patcher(translations)) as Manifest;
}
开发者ID:rlugojr,项目名称:vscode-vsce,代码行数:3,代码来源:nls.ts


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