本文整理汇总了TypeScript中tslib.__assign函数的典型用法代码示例。如果您正苦于以下问题:TypeScript __assign函数的具体用法?TypeScript __assign怎么用?TypeScript __assign使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了__assign函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: buildRequestParams
function buildRequestParams(meta: JsonFeedMeta, range: DateRange, calendar: Calendar) {
const dateEnv = calendar.dateEnv
let startParam
let endParam
let timeZoneParam
let customRequestParams
let params = {}
startParam = meta.startParam
if (startParam == null) {
startParam = calendar.opt('startParam')
}
endParam = meta.endParam
if (endParam == null) {
endParam = calendar.opt('endParam')
}
timeZoneParam = meta.timeZoneParam
if (timeZoneParam == null) {
timeZoneParam = calendar.opt('timeZoneParam')
}
// retrieve any outbound GET/POST data from the options
if (typeof meta.extraParams === 'function') {
// supplied as a function that returns a key/value object
customRequestParams = meta.extraParams()
} else {
// probably supplied as a straight key/value object
customRequestParams = meta.extraParams || {}
}
__assign(params, customRequestParams)
params[startParam] = dateEnv.formatIso(range.start)
params[endParam] = dateEnv.formatIso(range.end)
if (dateEnv.timeZone !== 'local') {
params[timeZoneParam] = dateEnv.timeZone
}
return params
}
示例2: parseRecurring
export function parseRecurring(
eventInput: EventInput,
allDayDefault: boolean | null,
dateEnv: DateEnv,
recurringTypes: RecurringType[],
leftovers: any
) {
for (let i = 0; i < recurringTypes.length; i++) {
let localLeftovers = {} as any
let parsed = recurringTypes[i].parse(eventInput, localLeftovers, dateEnv) as ParsedRecurring
if (parsed) {
let allDay = localLeftovers.allDay
delete localLeftovers.allDay // remove from leftovers
if (allDay == null) {
allDay = allDayDefault
if (allDay == null) {
allDay = parsed.allDayGuess
if (allDay == null) {
allDay = false
}
}
}
__assign(leftovers, localLeftovers)
return {
allDay,
duration: parsed.duration,
typeData: parsed.typeData,
typeId: i
}
}
}
return null
}
示例3: parseEventDef
export function parseEventDef(raw: EventNonDateInput, sourceId: string, allDay: boolean, hasEnd: boolean, calendar: Calendar): EventDef {
let leftovers = {}
let def = pluckNonDateProps(raw, calendar, leftovers) as EventDef
def.defId = String(uid++)
def.sourceId = sourceId
def.allDay = allDay
def.hasEnd = hasEnd
for (let eventDefParser of calendar.pluginSystem.hooks.eventDefParsers) {
let newLeftovers = {}
eventDefParser(def, leftovers, newLeftovers)
leftovers = newLeftovers
}
def.extendedProps = __assign(leftovers, def.extendedProps || {})
// help out EventApi from having user modify props
Object.freeze(def.ui.classNames)
Object.freeze(def.extendedProps)
return def
}
示例4: addDynamic
addDynamic(props) {
__assign(this.dynamicOverrides, props)
this.compute()
}
示例5: add
add(props) {
__assign(this.overrides, props)
this.compute()
}
示例6: __assign
export function extend<T1, T2>(dest: T1, src: T2): T1 & T2 {
return __assign(dest, src)
}