當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。