當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript assign.default函數代碼示例

本文整理匯總了TypeScript中lodash/assign.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: buildSharedQuery

  buildSharedQuery(query){
    let queryStr = this.state.getValue()
    if(queryStr){
      let queryBuilder  = this.options.queryBuilder || SimpleQueryString
      let simpleQuery = queryBuilder(
        queryStr, assign(
          {fields:this.options.queryFields},
          this.options.queryOptions
        )
      )

      let queries:Array<any> = [simpleQuery]

      if (this.options.prefixQueryFields) {
        let terms = String(queryStr).match(/\S+/g)
        let prefixQueries:Array<any> = [MultiMatchQuery(terms.pop(), assign(
          this.options.prefixQueryOptions, {
            type:"phrase_prefix",
            fields:this.options.prefixQueryFields,
          })
        )]
        forEach(terms, function(q) {
          prefixQueries.push(MultiMatchQuery(q, assign(
            this.options.prefixQueryOptions, {
              type:"phrase",
              fields:this.options.prefixQueryFields,
            })
          )) 
        }.bind(this))
        queries.push(BoolMust(prefixQueries))
      }
      query = query.addQuery(BoolShould(queries))

      if (this.options.addToFilters){
        query = query.addSelectedFilter({
          name: this.options.title,
          value: queryStr,
          id: this.key,
          remove: () => this.state = this.state.clear()
        })
      } else {
        query = query.setQueryString(queryStr)
      }

      return query
    }
    return query

  }
開發者ID:teisman,項目名稱:searchkit,代碼行數:49,代碼來源:QueryAccessor.ts

示例2: assign

      .then(function(commandOptions: ServeTaskOptions) {
        commandOptions = assign({}, commandOptions, {
          baseURL: this.project.config(commandOptions.environment).baseURL || '/'
        });

        if (commandOptions.proxy) {
          if (!commandOptions.proxy.match(/^(http:|https:)/)) {
            var message = 'You need to include a protocol with the proxy URL.' + EOL + 'Try --proxy http://' + commandOptions.proxy;

            return Promise.reject(new SilentError(message));
          }
        }

        const ServeWebpackTask = (require('../tasks/serve-webpack.ts'))

        var serve = new ServeWebpackTask({
          ui: this.ui,
          analytics: this.analytics,
          project: this.project,
        });

        return win.checkWindowsElevation(this.ui).then(function() {
          return serve.run(commandOptions);
        });
      }.bind(this));
開發者ID:TheLarkInn,項目名稱:angular-cli,代碼行數:25,代碼來源:serve.ts

示例3: HasChildQuery

export function HasChildQuery(type, query, options={}){
  return {
    has_child:assign({
      type, query
    }, pick(options, allowedOptions))
  }
}
開發者ID:Nostres,項目名稱:searchkit-redux,代碼行數:7,代碼來源:HasChildQuery.ts

示例4: bootstrap

export const __reload = (m: {dev: typeof dev}) => {
  // Bootstrap a second time with recovered if the state dev module was reloaded
  if (dev.currentState !== m.dev.currentState) {
    dev.currentState = m.dev.currentState;
    bootstrap(App, [PROVIDERS, provideStore(reducers, assign({}, initialStates, dev.currentState))]);
  }
};
開發者ID:rasenplanscher,項目名稱:ng2-jspm-template,代碼行數:7,代碼來源:main.dev.ts

示例5: buildSharedQuery

  buildSharedQuery(query){
    let queryStr = this.state.getValue()
    if(queryStr){

      let simpleQuery = SimpleQueryString(
        queryStr, assign(
          {fields:this.options.queryFields},
          this.options.queryOptions
        )
      )

      let queries:Array<any> = [simpleQuery]

      if (this.options.prefixQueryFields) {
        queries.push(MultiMatchQuery(queryStr, {
          type:"phrase_prefix",
          fields:this.options.prefixQueryFields
        }))
      }
      return query.addQuery(BoolShould(queries))
        .setQueryString(queryStr)
    }
    return query

  }
開發者ID:Baltox,項目名稱:searchkit,代碼行數:25,代碼來源:QueryAccessor.ts

示例6: HasParentQuery

export function HasParentQuery(parent_type, query, options={}){
  return {
    has_parent:assign({
      parent_type, query
    }, pick(options, allowedOptions))
  }
}
開發者ID:Nostres,項目名稱:searchkit-redux,代碼行數:7,代碼來源:HasParentQuery.ts

示例7: NestedQuery

export function NestedQuery(path, filter, options={}){
  return {
    nested:assign({
      path, filter
    }, pick(options, allowedOptions))
  }
}
開發者ID:Nostres,項目名稱:searchkit-redux,代碼行數:7,代碼來源:NestedQuery.ts

示例8: QueryString

export function QueryString(query, options:QueryStringOptions={}){
  if(!query){
    return
  }
  return {
    "query_string":assign({query}, options)
  }
}
開發者ID:Eric013,項目名稱:searchkit,代碼行數:8,代碼來源:QueryString.ts

示例9: SimpleQueryString

export function SimpleQueryString(query, options={}){
  if(!query){
    return
  }
  return {
    "simple_query_string":assign({query}, options)
  }
}
開發者ID:Baltox,項目名稱:searchkit,代碼行數:8,代碼來源:SimpleQueryString.ts

示例10: forEach

 forEach(terms, function(q) {
   prefixQueries.push(MultiMatchQuery(q, assign(
     this.options.prefixQueryOptions, {
       type:"phrase",
       fields:this.options.prefixQueryFields,
     })
   )) 
 }.bind(this))
開發者ID:teisman,項目名稱:searchkit,代碼行數:8,代碼來源:QueryAccessor.ts


注:本文中的lodash/assign.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。