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


TypeScript lodash.merge函數代碼示例

本文整理匯總了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)));
 })
開發者ID:StudioProcess,項目名稱:angular-cli,代碼行數:6,代碼來源:route-utils.spec.ts

示例3: expect

 expect(() => nru.addPathToRoutes(routesFile, _.merge({route: 'about/details'}, options)))
開發者ID:StudioProcess,項目名稱:angular-cli,代碼行數:1,代碼來源:route-utils.spec.ts

示例4:

 PerusteProjektiService.mergeProjekti($scope.projekti, tuoPohja).then(function(peruste, projekti) {
     _.merge($scope.projekti, projekti);
     $scope.peruste = peruste;
 });
開發者ID:Opetushallitus,項目名稱:eperusteet,代碼行數:4,代碼來源:excel.ts

示例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,
  };
};
開發者ID:Canner,項目名稱:canner,代碼行數:89,代碼來源:factory.ts

示例6: fusePerfectScrollbarOptions

    // -----------------------------------------------------------------------------------------------------
    // @ Accessors
    // -----------------------------------------------------------------------------------------------------

    /**
     * Perfect Scrollbar options
     *
     * @param value
     */
    @Input()
    set fusePerfectScrollbarOptions(value)
    {
        // Merge the options
        this._options = _.merge({}, this._options, value);
    }
開發者ID:,項目名稱:,代碼行數:15,代碼來源:

示例7:

export function replace<T>(o: T): T {
    return _.merge(o, {__replace: true});
}
開發者ID:pzahoran,項目名稱:reactive-angular2,代碼行數:3,代碼來源:merge.ts

示例8:

export const setup = (changes) => {
    _.merge(config, changes);
};
開發者ID:thoughtspile,項目名稱:Grafar,代碼行數:3,代碼來源:grafar.ts

示例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
開發者ID:tic40,項目名稱:archives,代碼行數:31,代碼來源:preparation.ts


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