How to use get-value - 10 common examples

To help you get started, we’ve selected a few get-value 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 probot / smee.io / src / components / App.js View on Github external
filtered = log.filter(l => {
        if (filter && filter.includes(':')) {
          let [searchString, value] = filter.split(':')
          if (!searchString.startsWith('body')) searchString = `body.${searchString}`
          console.log(l, searchString, value)
          return get(l, searchString) === value
        }
        return true
      })
    }
github GladysAssistant / Gladys / front / src / components / boxs / room-temperature / RoomTemperature.jsx View on Github external
render(props, {}) {
    const boxData = get(props, `${DASHBOARD_BOX_DATA_KEY}TemperatureInRoom.${props.x}_${props.y}`);
    const boxStatus = get(props, `${DASHBOARD_BOX_STATUS_KEY}TemperatureInRoom.${props.x}_${props.y}`);
    const temperature = get(boxData, 'room.temperature.temperature');
    const unit = get(boxData, 'room.temperature.unit');
    const roomName = get(boxData, 'room.name');
    return (
      
    );
  }
}
github GladysAssistant / Gladys / front / src / routes / integration / all / zwave / node-page / Device.jsx View on Github external
refreshDeviceProperty = () => {
    if (!this.props.device.features) {
      return null;
    }
    const batteryLevelDeviceFeature = this.props.device.features.find(
      deviceFeature => deviceFeature.category === DEVICE_FEATURE_CATEGORIES.BATTERY
    );
    const batteryLevel = get(batteryLevelDeviceFeature, 'last_value');
    this.setState({
      batteryLevel
    });
  };
  saveDevice = async () => {
github GladysAssistant / Gladys / front / src / components / user / profile.jsx View on Github external
)}
        
      )}
      <div class="form-group">
        <label class="form-label">
          </label>
        
          <input id="profile.passwordPlaceholder" placeholder="{<Text" value="{props.newUser.password}" class="{cx('form-control'," type="password">}
          /&gt;
        
        <div class="invalid-feedback">
          </div>
      </div>
      <div class="form-group">
        <label class="form-label">
          </label>
        </div>
github VitorLuizC / valite / src / index.ts View on Github external
const resolutions = keys(schema).map((key): Promise =&gt; (
    validate(get(object, key), schema[key]).then((message) =&gt; {
      errors[key] = message;
    })
  ));
  return Promise.all(resolutions).then(() =&gt; errors);
github GladysAssistant / Gladys / front / src / routes / integration / all / zwave / settings-page / SettingsTab.jsx View on Github external
<div class="page-options d-flex">
        <button class="btn btn-info">
          </button>
      </div>
    
    <div class="card-body">
      <div class="{cx('dimmer',">
        <div class="loader">
        <div class="dimmer-content">
          {get(props, 'zwaveStatus.ready') &amp;&amp; (
            <div class="alert alert-success">
              </div>
          )}
          {!get(props, 'zwaveStatus.ready') &amp;&amp; (
            <div class="alert alert-warning">
              </div>
          )}
          {props.zwaveConnectionInProgress &amp;&amp; (
            <div class="alert alert-info">
              </div>
          )}
          {props.zwaveDriverFailed &amp;&amp; (
            <div class="alert alert-danger"></div></div></div></div></div>
github GladysAssistant / Gladys / front / src / actions / dashboard / index.js View on Github external
async getBoxes(state) {
      store.setState({
        DashboardGetBoxesStatus: RequestStatus.Getting
      });
      try {
        const homeDashboard = await state.httpClient.get('/api/v1/dashboard/home');
        store.setState({
          gatewayInstanceNotFound: false,
          homeDashboard,
          DashboardGetBoxesStatus: RequestStatus.Success
        });
      } catch (e) {
        const status = get(e, 'response.status');
        const errorMessage = get(e, 'response.error_message');
        if (status === 404 && errorMessage === 'NO_INSTANCE_FOUND') {
          store.setState({
            gatewayInstanceNotFound: true
          });
        } else if (status === 404) {
          store.setState({
            dashboardNotConfigured: true,
            homeDashboard: EMPTY_DASHBOARD
          });
        } else {
          store.setState({
            DashboardGetBoxesStatus: RequestStatus.Error
          });
        }
      }
github GladysAssistant / Gladys / front / src / actions / dashboard / boxes / devicesInRoom.js View on Github external
deviceFeatureWebsocketEvent(state, x, y, payload) {
      const data = boxActions.getBoxData(state, BOX_KEY, x, y);
      const devices = get(data, 'room.devices');
      if (devices) {
        let found = false;
        let currentDeviceIndex = 0;
        let currentFeatureIndex = 0;
        while (!found &amp;&amp; currentDeviceIndex &lt; devices.length) {
          while (!found &amp;&amp; currentFeatureIndex &lt; devices[currentDeviceIndex].features.length) {
            if (
              devices[currentDeviceIndex].features[currentFeatureIndex].selector === payload.device_feature_selector
            ) {
              found = true;
              const newData = update(data, {
                room: {
                  devices: {
                    [currentDeviceIndex]: {
                      features: {
                        [currentFeatureIndex]: {
github GladysAssistant / Gladys / front / src / components / boxs / camera / Camera.jsx View on Github external
render(props, {}) {
    const boxData = get(props, `${DASHBOARD_BOX_DATA_KEY}Camera.${props.x}_${props.y}`);
    const boxStatus = get(props, `${DASHBOARD_BOX_STATUS_KEY}Camera.${props.x}_${props.y}`);
    const image = get(boxData, 'image');
    const error = boxStatus === RequestStatus.Error;
    return ;
  }
}

get-value

Use property paths like 'a.b.c' to get a nested value from an object. Even works when keys have dots in them (no other dot-prop library can do this!).

MIT
Latest version published 7 years ago

Package Health Score

71 / 100
Full package analysis

Popular get-value functions