本文整理汇总了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
}
示例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));
示例3: HasChildQuery
export function HasChildQuery(type, query, options={}){
return {
has_child:assign({
type, query
}, pick(options, allowedOptions))
}
}
示例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))]);
}
};
示例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
}
示例6: HasParentQuery
export function HasParentQuery(parent_type, query, options={}){
return {
has_parent:assign({
parent_type, query
}, pick(options, allowedOptions))
}
}
示例7: NestedQuery
export function NestedQuery(path, filter, options={}){
return {
nested:assign({
path, filter
}, pick(options, allowedOptions))
}
}
示例8: QueryString
export function QueryString(query, options:QueryStringOptions={}){
if(!query){
return
}
return {
"query_string":assign({query}, options)
}
}
示例9: SimpleQueryString
export function SimpleQueryString(query, options={}){
if(!query){
return
}
return {
"simple_query_string":assign({query}, options)
}
}
示例10: forEach
forEach(terms, function(q) {
prefixQueries.push(MultiMatchQuery(q, assign(
this.options.prefixQueryOptions, {
type:"phrase",
fields:this.options.prefixQueryFields,
})
))
}.bind(this))