本文整理汇总了TypeScript中lodash.merge函数的典型用法代码示例。如果您正苦于以下问题:TypeScript merge函数的具体用法?TypeScript merge怎么用?TypeScript merge使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了merge函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setAccountsData
function setAccountsData(state: any, action : IAccountsResponse) : any {
return _.merge({}, state, { data: action.response.data })
}
开发者ID:Emunoz88,项目名称:node-hapi-react-redux-sass-typescript-mongo-webpack-hmr-gulp,代码行数:3,代码来源:accounts.ts
示例2:
return editedFile.apply().then(() => {
options.dasherizedName = 'trap-queen';
options.component = 'TrapQueenComponent';
return nru.applyChanges(
nru.addPathToRoutes(routesFile, _.merge({route: 'home/trap-queen'}, options)));
})
示例3: expect
expect(() => nru.addPathToRoutes(routesFile, _.merge({route: 'about/details'}, options)))
示例4:
PerusteProjektiService.mergeProjekti($scope.projekti, tuoPohja).then(function(peruste, projekti) {
_.merge($scope.projekti, projekti);
$scope.peruste = peruste;
});
示例5: get
export const construct = (config: ServerConfig): {
rootAppConfig: RootAppConfig,
cmsConfig: CmsServerConfig,
graphqlConfig: GqlifyConfig,
authConfig: AuthConfig,
} => {
// merge common config with default config
const authMountPath = defaultConfig.authMountPath;
const hostname = get(config, 'common.hostname');
// cookieKeys will override auth & cms cookie config
const cookieKeys = defaultTo(get(config, 'common.cookieKeys'), defaultConfig.cookieKeys);
// Whether this cms is public access or not
const publicAuth = defaultTo(get(config, 'common.public'), defaultConfig.public);
// oidc clientId & clientSecret are shared between cms & auth services
const clientId = defaultTo(get(config, 'common.clientId'), defaultConfig.clientId);
const clientSecret = defaultTo(get(config, 'common.clientSecret'), defaultConfig.clientSecret);
// oidc issuer
const discoveryUrlFromHost = `${hostname}${authMountPath}/.well-known/openid-configuration`;
const discoveryUrl = defaultTo(get(config, 'common.discoveryUrl'), discoveryUrlFromHost);
const issuerConfig = get(config, 'common.issuerConfig');
// graphql endpoint
const graphqlEndpoint = `${hostname}/graphql`;
// construct config for cms service
const cmsConfig: CmsServerConfig = merge({
cookieKeys,
hostname,
oidc: {
discoveryUrl,
clientId,
clientSecret,
},
logger: jsonLogger,
}, config.cms);
// config for gqlify service
const graphqlConfig: GqlifyConfig = {
logger: jsonLogger,
oidc: {
discoveryUrl,
issuerConfig,
},
...config.graphql,
};
// config for auth service
let authConfig: AuthConfig = {
mountPath: defaultConfig.authMountPath,
issuer: hostname,
cookies: {
long: { signed: true, maxAge: (1 * 24 * 60 * 60) * 1000 }, // 1 day in ms
short: { signed: true },
keys: cookieKeys,
},
redirectUris: [`${hostname}/auth/callback`],
postLogoutRedirectUris: [`${hostname}/`],
clientId,
clientSecret,
logger: jsonLogger,
...config.auth,
};
const rootAppConfig = {
graphqlEndpoint,
cookieKeys,
};
// if publicAuth is true, we make this cms public
// mark cmsConfig.oidc as null to tell cmsServer we do not need oidc
// mark graphqlConfig.oidc as null to tell graphql server we do not need auth
// mark authConfig to null, so auth service won't start
if (publicAuth) {
cmsConfig.oidc = null;
graphqlConfig.oidc = null;
authConfig = null;
}
return {
rootAppConfig,
cmsConfig,
graphqlConfig,
authConfig,
};
};
示例6: fusePerfectScrollbarOptions
// -----------------------------------------------------------------------------------------------------
// @ Accessors
// -----------------------------------------------------------------------------------------------------
/**
* Perfect Scrollbar options
*
* @param value
*/
@Input()
set fusePerfectScrollbarOptions(value)
{
// Merge the options
this._options = _.merge({}, this._options, value);
}
示例7:
export function replace<T>(o: T): T {
return _.merge(o, {__replace: true});
}
示例8:
export const setup = (changes) => {
_.merge(config, changes);
};
示例9: setCanHearVideoSound
state.checkList[index].isPassed = payload.canWorkSoundMeter
},
setCanHearVideoSound (state, payload): void {
state.checkList[
Constants.ENV_CHECK_LIST_ID.CAN_HEAR_VIDEO_SOUND - 1
].isPassed =
payload.canHearVideoSound
},
setIsChecking (state, payload): void {
state.checkList[payload.index].isChecking = payload.isChecking
},
setIsLoading (state, payload): void {
state.checkList[payload.index].isLoading = payload.isLoading
},
setElements (state, payload): void {
state.elements = _.merge(state.elements, payload.elements)
},
setMicInputVolumeInterval (state, payload): void {
state.micInputVolumeInterval = payload.micInputVolumeInterval
},
clearMicInputVolumeInterval (state): void {
if (state.micInputVolumeInterval) {
clearInterval(state.micInputVolumeInterval)
}
},
setCurrentCheckId (state, payload): void {
state.currentCheckId = payload.currentCheckId
},
setDevicePermissions (state, payload): void {
state.devicePermissions.webcam = payload.devicePermissions.webcam
state.devicePermissions.mic = payload.devicePermissions.mic