How to use the object-path.get function in object-path

To help you get started, we’ve selected a few object-path 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 iuap-design / bee.tinper.org / tinper-bee / bee-table / src / TableCell.js View on Github external
render() {
    const { record, indentSize, clsPrefix, indent,
            index, expandIcon, column ,fixed,showSum, bodyDisplayInRow,lazyStartIndex,lazyEndIndex} = this.props;
    const { dataIndex, render, fieldType, linkConfig, fontColor, bgColor } = column;
    let {className = ''} = column;

    let text = objectPath.get(record, dataIndex);
    let tdProps;
    let colSpan;
    let rowSpan,title;

    if (render && !showSum) {
      text = render(text, record, index);
      if (this.isInvalidRenderCellText(text)) {
        tdProps = text.props || {};
        rowSpan = (tdProps.rowSpan>lazyEndIndex && lazyEndIndex>5)?lazyEndIndex-index:tdProps.rowSpan;
        colSpan = tdProps.colSpan;
        text = text.children;
      }
    }

    let colMenu = this.renderColumnMenu(column.cellMenu, text, record, index);
    // 根据 fieldType 来渲染数据
github Atomic-Reactor / Reactium / .core / .cli / commands / reactium / component / index.js View on Github external
});

    if (output.redux === false) {
        Object.entries(input).forEach(([key, val]) => {
            switch (String(key).toLowerCase()) {
                case 'actions':
                case 'actiontypes':
                case 'reducers':
                case 'services':
                    output[key] = false;
                    break;
            }
        });
    }

    output.ID = op.get(output, 'ID', output.name);
    output.ID = decamelize(output.ID).toUpperCase();

    const dir = path.basename(output.destination).toLowerCase();
    if (dir !== output.name.toLowerCase()) {
        output.destination = path.join(output.destination, output.name);
    }

    // Set the style import statement
    if (output.stylesheet === true) {
        const stylesheetFile = path.normalize(
            path.join(output.destination, '_style.scss'),
        );

        const importString = output.inject.map(filepath =>
            path
                .relative(filepath, stylesheetFile)
github ggoodman / plunker-run-plugin / app.js View on Github external
opsInterval: 1000 * 30,
      reporters: [{
        reporter: require('good-console'),
        args:[{ log: '*', request: '*', error: '*', ops: '*' }]
      }],
    }
  }, {
    register: require("./index"),
    options: { config: config },
  }
];

server.connection({
  host: Lookup.get(config, "services.run.public.host", "localhost"),
  address: "0.0.0.0",
  port: Lookup.get(config, "services.run.local.port", 8080),
  labels: ["run"], 
});

server.register(plugins, function (err) {
  if (err) {
    server.log("error", "Error registering plugins: " + err.message, err);
    process.exit(1);
  }
  
  server.start(function (err) {
    if (err) {
      server.log("error", "Error starting server: " + err.message, err);
      process.exit(1);
    }
    
    server.log("info", "Server running at: " + server.info.uri);
github GerkinDev / vuejs-datatable / src / classes / column.js View on Github external
getRepresentation(row) {
		if (this.representedAs && typeof this.representedAs === 'function'){
			return this.representedAs(row);
		}

		return get(row, this.field);
	}
github ibi-group / datatools-ui / src / main / client / manager / components / UserHomePage.js View on Github external
componentWillReceiveProps (nextProps) {
    const nextId = objectPath.get(nextProps, 'project.id')
    const id = objectPath.get(this.props, 'project.id')
    if (nextId && nextId !== id && !nextProps.project.feedSources) {
      this.props.fetchProjectFeeds(nextProps.project.id)
    }
  }
  componentWillUnmount () {
github atayahmet / storage-based-queue / src / console.js View on Github external
export function queueStoppingLog([type]: any[]) {
  log(
    `%c${String.fromCharCode(8226)} (${type}) -> ${obj.get(logEvents, 'queue.stopping')}`,
    'color: #ff7f94;font-weight: bold;',
  );
}
github Atomic-Reactor / Reactium / .core / .cli / commands / reactium / plugin / module / index.js View on Github external
.catch(err => {
            prompt.stop();
            message(op.get(err, 'message', CANCELED));
        });
};
github RocketChat / Rocket.Chat / app / models / server / models / _Base.js View on Github external
result = result.sort((a, b) => {
					let r = 0;
					for (const field in options.sort) {
						if (options.sort.hasOwnProperty(field)) {
							const direction = options.sort[field];
							let valueA;
							let valueB;
							if (field.indexOf('.') > -1) {
								valueA = objectPath.get(a, field);
								valueB = objectPath.get(b, field);
							} else {
								valueA = a[field];
								valueB = b[field];
							}
							if (valueA > valueB) {
								r = direction;
								break;
							}
							if (valueA < valueB) {
								r = -direction;
								break;
							}
						}
					}
					return r;
github speedtracker / speedtracker-api / lib / utils.js View on Github external
traverseObject(newObj, (obj, path) => {
    let joinedPath = path.join('.')
    let baseValue = objectPath.get(base, joinedPath)

    if (typeof baseValue === 'undefined') {
      objectPath.set(base, joinedPath, [])

      baseValue = objectPath.get(base, joinedPath)
    }

    baseValue.push(obj)
  })
}
github shunjikonishi / api-first-spec / lib / httpClient.js View on Github external
options.url = true;
        }
        if (runDefaults) {
          var invalidTypeValue = p.generateInvalidTypeValue();
          if (invalidTypeValue) {
            processValue(fullName + " - invalid datatype(" + invalidTypeValue + ")", 
              fullName, invalidTypeValue);
          }
          p.rules.forEach(function(r) {
            var data = r.generateBadRequest(fullName, params, options);
            if (data) {
              doIt(fullName + " - " + r.name + "(" + objectPath.get(data, fullName) + ")", data);
            }
          });
        }
        var optionValue = objectPath.get(optionParams, fullName);
        if (optionValue) {
          if (util.isArray(optionValue)) {
            optionValue.forEach(function(v) {
              processValue(fullName + " - " + v, fullName, v);
            });
          } else {
            processValue(fullName + " - " + optionValue, fullName, optionValue);
          }
        }
        process(fullName, p.childParams());

      });
    }

object-path

Access deep object properties using a path

MIT
Latest version published 3 years ago

Package Health Score

70 / 100
Full package analysis