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


TypeScript lodash.isUndefined函数代码示例

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


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

示例1: Promise

 var savePromise = new Promise(function (resolve, reject) {
     var nodeId = _.isUndefined(params.id) ? params.parent_id : params.id;
     nestSet.getNodeInfo(nodeId).then(function (result) {
         if (_.isEmpty(result)) {
             reject();
         } else {
             resolve(helper.getFirstItemArray(result));
         }
     }).catch(function (err) {
         reject();
     });
 });
开发者ID:ttlpta,项目名称:nodejs-ecomerce,代码行数:12,代码来源:categoriesModel.ts

示例2: function

User.prototype.getUser = function (select, where, first) {
    if (_.isUndefined(first)) first = false;
    return new Promise(function (resolve, reject) {
        var sql = helper.buildQuery.select(select).from('apt_user').where(where).render();
        connection.query(sql, function (err, rows) {
            if (err) { reject(err); }
            else {
                resolve((first) ? helper.getFirstItemArray(rows) : rows);
            }
        });
    });
};
开发者ID:ttlpta,项目名称:nodejs-ecomerce,代码行数:12,代码来源:userModel.ts

示例3: convertXAxisRotateName

  /**
   * x축 가로/세로에 따라 축명 위치변경
   * @param chartOption
   * @param uiOption
   * @param axisType
   */
  public static convertXAxisRotateName(chartOption: BaseOption, uiOption: UIOption, fieldInfo: PivotTableInfo): BaseOption {

    // type이 없는경우 return
    if (!uiOption || _.isUndefined(uiOption['align'])) return chartOption;

    const axisList = _.compact(_.concat(uiOption.xAxis, uiOption.yAxis, uiOption.subAxis));
    const type = uiOption['align'];

    const yAxis = axisList.filter((item) => {
      return _.eq(item.mode, AxisLabelType.COLUMN) || _.eq(item.mode, AxisLabelType.SUBCOLUMN);
    });

    // 앞에서 category / value위치를 변경하였으므로 변경된 type에 따라서 위치변경
    let copiedOption = _.cloneDeep(chartOption);

    let yAxisType: AxisType;

    // default일때(세로모드, x축 category, y축 value)에는 변경하지않음
    if (_.eq(type, UIOrient.VERTICAL) && copiedOption.yAxis[0].type == AxisType.VALUE && copiedOption.xAxis[0].type == AxisType.CATEGORY) return chartOption;

    // 세로모드일때
    if (_.eq(type, UIOrient.VERTICAL)) {

      // y축이 value이면 => y축 값을 x축으로 넣기
      yAxisType = AxisType.VALUE;

    // 가로모드일때
    } else {
      // y축이 category이면 => y축 값을 x축으로 넣기
      yAxisType = AxisType.CATEGORY;
    }

    // Y축 명칭
    const yName = uiOption.yAxis.customName ? uiOption.yAxis.customName : _.join(fieldInfo.aggs, CHART_STRING_DELIMITER);
    const yAxisName = _.join(fieldInfo.aggs, CHART_STRING_DELIMITER);

    // y축이 yAxisType이면 => y축 값을 x축으로 넣기
    copiedOption.yAxis.forEach((axis, axisIndex) => {
      chartOption.xAxis.forEach((item, index) => {

        if (axis.type == yAxisType && copiedOption.yAxis[index].axisName) {
          item.axisName = yAxisName;

          // customName이 없을때
          if (!yAxis[axisIndex].customName && copiedOption.yAxis[index].name) {
            item.name = yName;
          }
        }
      });
    })

    return chartOption;
  }
开发者ID:bchin22,项目名称:metatron-discovery,代码行数:59,代码来源:common-option-converter.ts

示例4: observableUnwrap

  observableUnwrap(e: any) {
    if(e.flash) {
      this.doFlash(e.flash);
      return e.data;
    }

    if(!_.isUndefined(e.data)) {
      return e.data;
    }

    return e;
  }
开发者ID:Linko91,项目名称:posys,代码行数:12,代码来源:logger.service.ts

示例5: getOrdersAsync

 /**
  * Retrieve orders from the API
  * @param   requestOpts     Options specifying orders to retrieve and page information, defaults to { page: 1, perPage: 100 }
  * @return  The resulting SignedOrders that match the request
  */
 public async getOrdersAsync(requestOpts?: OrdersRequestOpts & PagedRequestOpts): Promise<SignedOrder[]> {
     if (!_.isUndefined(requestOpts)) {
         assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.ordersRequestOptsSchema);
         assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema);
     }
     const httpRequestOpts = {
         params: _.defaults({}, requestOpts, DEFAULT_PAGED_REQUEST_OPTS),
     };
     const responseJson = await this._requestAsync(`/orders`, HttpRequestType.Get, httpRequestOpts);
     const orders = relayerResponseJsonParsers.parseOrdersJson(responseJson);
     return orders;
 }
开发者ID:ewingrj,项目名称:0x-monorepo,代码行数:17,代码来源:http_client.ts

示例6:

 onOrderStateChangeCallback: (err: Error | null, orderState?: OrderState) => {
     if (!_.isUndefined(err)) {
         utils.log(err);
     } else {
         const state = orderState as OrderState;
         if (!state.isValid) {
             shadowedOrders.set(state.orderHash, Date.now());
         } else {
             shadowedOrders.delete(state.orderHash);
         }
     }
 },
开发者ID:YuitoSato,项目名称:0x-launch-kit,代码行数:12,代码来源:orderbook.ts

示例7: _getTokenRegistryContractAsync

 private async _getTokenRegistryContractAsync(): Promise<TokenRegistryContract> {
     if (!_.isUndefined(this._tokenRegistryContractIfExists)) {
         return this._tokenRegistryContractIfExists;
     }
     const [abi, address] = await this._getContractAbiAndAddressFromArtifactsAsync(
         artifacts.TokenRegistryArtifact,
         this._contractAddressIfExists,
     );
     const contractInstance = new TokenRegistryContract(this._web3Wrapper, abi, address);
     this._tokenRegistryContractIfExists = contractInstance;
     return this._tokenRegistryContractIfExists;
 }
开发者ID:ewingrj,项目名称:0x-monorepo,代码行数:12,代码来源:token_registry_wrapper.ts

示例8: getTokenPairsAsync

 /**
  * Retrieve token pair info from the API
  * @param   requestOpts     Options specifying token information to retrieve and page information, defaults to { page: 1, perPage: 100 }
  * @return  The resulting TokenPairsItems that match the request
  */
 public async getTokenPairsAsync(requestOpts?: TokenPairsRequestOpts & PagedRequestOpts): Promise<TokenPairsItem[]> {
     if (!_.isUndefined(requestOpts)) {
         assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.tokenPairsRequestOptsSchema);
         assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema);
     }
     const httpRequestOpts = {
         params: _.defaults({}, requestOpts, DEFAULT_PAGED_REQUEST_OPTS),
     };
     const responseJson = await this._requestAsync('/token_pairs', HttpRequestType.Get, httpRequestOpts);
     const tokenPairs = relayerResponseJsonParsers.parseTokenPairsJson(responseJson);
     return tokenPairs;
 }
开发者ID:ewingrj,项目名称:0x-monorepo,代码行数:17,代码来源:http_client.ts

示例9: getLocationByOffset

export const collectCoverageEntries = (contractSource: string) => {
    const sourceHash = ethUtil.sha3(contractSource).toString('hex');
    if (_.isUndefined(coverageEntriesBySourceHash[sourceHash])) {
        const ast = parser.parse(contractSource, { range: true });
        const locationByOffset = getLocationByOffset(contractSource);
        const visitor = new ASTVisitor(locationByOffset);
        parser.visit(ast, visitor);
        coverageEntriesBySourceHash[sourceHash] = visitor.getCollectedCoverageEntries();
    }
    const coverageEntriesDescription = coverageEntriesBySourceHash[sourceHash];
    return coverageEntriesDescription;
};
开发者ID:ewingrj,项目名称:0x-monorepo,代码行数:12,代码来源:collect_coverage_entries.ts

示例10: createMetricLabel

 createMetricLabel(labelData, options) {
   let label = '';
   if (_.isUndefined(options) || _.isEmpty(options.legendFormat)) {
     label = this.getOriginalMetricName(labelData);
   } else {
     label = this.renderTemplate(this.templateSrv.replace(options.legendFormat), labelData);
   }
   if (!label || label === '{}') {
     label = options.query;
   }
   return label;
 }
开发者ID:fangjianfeng,项目名称:grafana,代码行数:12,代码来源:result_transformer.ts


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