How to use shvl - 3 common examples

To help you get started, we’ve selected a few shvl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iamcco / vim-language-server / src / index.ts View on Github external
suggest: ISuggest
    indexes: IIndexes,
  } = initializationOptions;

  const runtimepaths = runtimepath ? runtimepath.split(",") : [];

  // config by user's initializationOptions
  const conf: IConfig = {
    iskeyword: iskeyword || "",
    runtimepath: runtimepaths,
    vimruntime: (vimruntime || "").trim(),
    diagnostic: {
      enable: true,
      ...(diagnostic || {}),
    },
    snippetSupport: shvl.get(param, "capabilities.textDocument.completion.completionItem.snippetSupport"),
    suggest: {
      fromRuntimepath: false,
      fromVimruntime: true,
      ...(suggest || {}),
    },
    indexes: {
      runtimepath: true,
      gap: 100,
      count: 1,
      projectRootPatterns,
      ...(indexes || {}),
    },
  };

  // init config
  config.init(conf);
github robinvdvleuten / vuex-persistedstate / index.js View on Github external
: paths.reduce(function(substate, path) {
          return shvl.set(substate, path, shvl.get(state, path));
        }, {});
  }

  function subscriber(store) {
    return function(handler) {
      return store.subscribe(handler);
    };
  }

  if (!canWriteStorage(storage)) {
    throw new Error("Invalid storage instance given");
  }

  const savedState = shvl.get(options, "getState", getState)(key, storage);

  return function(store) {
    if (typeof savedState === "object" && savedState !== null) {
      store.replaceState(
        merge(store.state, savedState, {
          arrayMerge:
            options.arrayMerger ||
            function(store, saved) {
              return saved;
            },
          clone: false
        })
      );
      (options.rehydrated || function() {})(store);
    }
github robinvdvleuten / vuex-persistedstate / index.js View on Github external
: paths.reduce(function(substate, path) {
          return shvl.set(substate, path, shvl.get(state, path));
        }, {});
  }

shvl

Get and set dot-notated properties within an object

MIT
Latest version published 3 years ago

Package Health Score

53 / 100
Full package analysis

Popular shvl functions