How to use the dottie.get function in dottie

To help you get started, we’ve selected a few dottie 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 iotexproject / iotex-explorer / src / shared / wallet / unlock-by-private-key.tsx View on Github external
public handleInputChange = (e: React.FormEvent) => {
    const name: string = get(e, "target.name");
    const value = get(e, "target.value");
    // @ts-ignore
    this.setState({
      [name]: value
    });
  };
github LINKIWI / orion-web / src / app / react / containers / control-panel / data-source.js View on Github external
const DataSourceContainer = ({
  userDevices: { err, data = [] },
  user,
  timestamp,
  handleUserChange,
  handleDeviceChange,
  handleTimestampStartChange,
  handleTimestampEndChange,
}) => {
  const users = data.map((entry) => entry.user);
  const devices = dottie.get(data.find((entry) => entry.user === user), 'devices', []);

  return (
    <div>
      {err &amp;&amp; (
        
          
        
      )}

      
        </div>
github contentful-labs / gitify-dependencies / lib / gitify.js View on Github external
function processDependencies (dir, shrinkwrapFile, shrinkwrapPath) {
  let shrinkwrapContent = require(shrinkwrapFile);
  let dependenciesPath  = _.compact(_.flatten([shrinkwrapPath].concat('dependencies')));
  let dependencies      = dottie.get(shrinkwrapContent, dependenciesPath);
  let depNames          = Object.keys(dependencies || {});

  return Bluebird.mapSeries(depNames, function (depName) {
    let depDir            = dir + '/node_modules/' + depName;
    let depShrinkwrapPath = dependenciesPath.concat(depName);

    return processDependency(depDir, shrinkwrapFile, depShrinkwrapPath, depName);
  });
}
github iotexproject / iotex-explorer / src / shared / address-details / action-table.tsx View on Github external
export function getAddress(record: ActionInfo): string {
  const addr: string =
    get(record, "action.core.transfer.recipient") ||
    get(record, "action.core.execution.contract") ||
    get(record, "action.core.createDeposit.recipient") ||
    get(record, "action.core.settleDeposit.recipient") ||
    get(record, "action.core.plumCreateDeposit.recipient") ||
    get(record, "action.core.plumTransfer.recipient") ||
    get(record, "action.core.createPlumChain.contract") ||
    "";
  if (!addr) {
    return "-";
  }
  return addr;
}
github iotexproject / iotex-explorer / src / shared / pages / action-list-page.tsx View on Github external
render(_: string, record: ActionInfo, __: number): string {
      const amount: string =
        get(record, "action.core.execution.amount") ||
        get(record, "action.core.grantReward.amount") ||
        get(record, "action.core.transfer.amount") ||
        get(record, "action.core.createDeposit.amount") ||
        get(record, "action.core.settleDeposit.amount") ||
        get(record, "action.core.createPlumChain.amount") ||
        get(record, "action.core.plumCreateDeposit.amount") ||
        "";
      if (!amount) {
        return "-";
      }
      return `${fromRau(amount, "IOTX")} IOTX`;
    }
  },
github iotexproject / iotex-explorer / src / shared / block / block-detail.tsx View on Github external
const dataSource = fields.map(field => ({
              key: field,
              value: get(blockMeta, field),
              url
            }));
github LINKIWI / linkr / frontend / app / components / pages / alias / alias-human-verification.js View on Github external
render() {
    const {isLoading, params, user} = this.props;
    const {data} = this.state;
    const details = dottie.get(data, 'details', {});

    return (
      <div>
        
        {isLoading &amp;&amp; }
        <header>

        
          {data.failure &amp;&amp; data.failure === 'failure_incorrect_link_password' &amp;&amp; (
            
          )}
</header></div>
github iotexproject / iotex-explorer / src / shared / address-details / action-table.tsx View on Github external
export function getAddress(record: ActionInfo): string {
  const addr: string =
    get(record, "action.core.transfer.recipient") ||
    get(record, "action.core.execution.contract") ||
    get(record, "action.core.createDeposit.recipient") ||
    get(record, "action.core.settleDeposit.recipient") ||
    get(record, "action.core.plumCreateDeposit.recipient") ||
    get(record, "action.core.plumTransfer.recipient") ||
    get(record, "action.core.createPlumChain.contract") ||
    "";
  if (!addr) {
    return "-";
  }
  return addr;
}
github iotexproject / iotex-explorer / src / shared / pages / action-list-page.tsx View on Github external
{({
              data,
              loading,
              error
            }: QueryResult&lt;{ chainMetaData: GetChainMetaResponse }&gt;) =&gt; {
              if (error) {
                notification.error({
                  message: `failed to query chain meta in ActionListPage: ${error}`
                });
              }
              if (!data || loading) {
                return null;
              }
              const numActions = parseInt(
                get(data, "chainMeta.numActions"),
                10
              );
              return ;
            }}
github iotexproject / iotex-explorer / src / shared / pages / address-details-page.tsx View on Github external
const parseAddressDetails = (data: { getAccount: GetAccountResponse }) => {
  const {
    address = "",
    balance = "0",
    nonce = 0,
    pendingNonce = 0,
    numActions = 0
  } = get(data || {}, "getAccount.accountMeta") || {};

  return {
    balance: {
      address,
      balance
    },
    nametag: address,
    nonce,
    pendingNonce,
    numActions: Number(numActions).toLocaleString()
  };
};

dottie

Fast and safe nested object access and manipulation in JavaScript

MIT
Latest version published 12 months ago

Package Health Score

74 / 100
Full package analysis

Popular dottie functions

Similar packages