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


TypeScript lodash.keysIn函数代码示例

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


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

示例1: it

        it("delete Widget", function () {
            const store = Store.createEmpty({log: false});

            store.dispatch(Widgets.addWidget("my-widget-type", {foo: "bar"}, 1, 2, 3, 4));
            assert.equal(_.keysIn(store.getState().widgets).length, 1);

            _.valuesIn(store.getState().widgets).forEach((widget: Widgets.IWidgetState) => {
                store.dispatch(Widgets.deleteWidget(widget.id));
            });
            assert.equal(_.keysIn(store.getState().widgets).length, 0);


        });
开发者ID:Niondir,项目名称:iot-dashboard,代码行数:13,代码来源:widgets.test.ts

示例2: RegExp

          return this._gnocchi_request(resource_search_req).then((result) => {
            var re = new RegExp(metric_regex);
            var metrics = {};

            _.forEach(result, (resource) => {
              _.forOwn(resource["metrics"], (id, name) => {
                if (re.test(name)) {
                  metrics[id] = this._compute_label(user_label, resource, name, target.aggregator);
                }
              });
            });

            if (target.queryMode === "resource_search"){
                /* RESOURCE SEARCH */
                return this.$q.all(_.map(metrics, (label, id) => {
                  var measures_req = _.merge({}, default_measures_req);
                  measures_req.url = 'v1/metric/' + id + '/measures';
                  return this._retrieve_measures(label, measures_req,
                                                 target.draw_missing_datapoint_as_zero);
                }));
            } else {
              /* RESOURCE AGGREGATION */
              var measures_req = _.merge({}, default_measures_req);
              measures_req.url = 'v1/aggregation/metric';
              measures_req.params.metric = _.keysIn(metrics);
              this.ReqAddAggregationOptions(measures_req, target);
              // We don't pass draw_missing_datapoint_as_zero, this is done by fill
              return this._retrieve_measures(user_label || "unlabeled", measures_req, false);
            }
          });
开发者ID:sileht,项目名称:grafana-gnocchi-datasource,代码行数:30,代码来源:datasource.ts

示例3: RegExp

 return value.filter((obj)=>{
     let keys = _.keysIn(obj);
     let objString = JSON.stringify(obj).toLowerCase();
     _.each(keys,(k)=>{
         let re = new RegExp('"'+k.toLowerCase()+'"',"g");
         objString = objString.replace(re,'');
     });
     return objString.indexOf(args.toLowerCase()) !== -1;
 });
开发者ID:dalechao,项目名称:dcm4chee-arc-light,代码行数:9,代码来源:search.pipe.ts

示例4: fieldMap

export function insertQuery<F> (v: Model<F> | IResourceObject) {
  const id = v.id
  if (!id) {
    throw ErrIDRequired
  }
  const map = fieldMap(v, { id })
  return SqlString.format(
    `INSERT INTO ?? (??) VALUES (?);`,
    [ tableName(v), _.keysIn(map), _.valuesIn(map) ]
  )
}
开发者ID:perpengt,项目名称:jsonapi,代码行数:11,代码来源:query.ts

示例5: process

    public process(object: Object, propertyDescriptors?: Map<string, Object>): Object {
        if (_.isEmpty(object)) {
            return null;
        }
        let processed = new Map<string, any>(),
            keys = _.keysIn(object),
            value;
        for (let property of keys) {
            value = object[property];
            let cleanupResult = this.cleanupValue(value);
            var cleanedValue = cleanupResult.cleanedValue;
            var hasValue = cleanupResult.hasValue;
            if (hasValue) {
                processed.set(property, cleanedValue);
            }

        }
        return processed.size > 0 ? immutable.Map(processed).toJS() : null;
    }
开发者ID:mactanxin,项目名称:gui,代码行数:19,代码来源:null.ts


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