objectpath

WebJar for objectpath

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

objectpath
Last Version

Last Version

1.2.1
Release Date

Release Date

Type

Type

jar
Description

Description

objectpath
WebJar for objectpath
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mike-marcacci/objectpath

Download objectpath

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/objectpath/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>objectpath</artifactId>
    <version>1.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/objectpath/
implementation 'org.webjars.bower:objectpath:1.2.1'
// https://jarcasting.com/artifacts/org.webjars.bower/objectpath/
implementation ("org.webjars.bower:objectpath:1.2.1")
'org.webjars.bower:objectpath:jar:1.2.1'
<dependency org="org.webjars.bower" name="objectpath" rev="1.2.1">
  <artifact name="objectpath" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='objectpath', version='1.2.1')
)
libraryDependencies += "org.webjars.bower" % "objectpath" % "1.2.1"
[org.webjars.bower/objectpath "1.2.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

ObjectPath

Build Status

Parse js object paths using both dot and bracket notation. Stringify an array of properties into a valid path.

  • parse JS object reference fragments
  • build JS object reference fragments
  • supports presence of unicode characters
  • supports presence of control characters in key names

Parse a Path

ObjectPath.parse(str)

var ObjectPath = require('objectpath');

ObjectPath.parse('a[1].b.c.d["e"]["f-f"].g');
// => ['a','1','b','c','d','e','f-f','g']

Build a Path String

ObjectPath.stringify(arr, [quote="'"], [forceQuote=false]);

var ObjectPath = require('objectpath');

ObjectPath.stringify(['a','1','b','c','d-d','e']);
// => "a[1].b.c['d-d'].e"


ObjectPath.stringify(['a','1','b','c','d-d','e'],'"');
// => 'a[1].b.c["d-d"].e'


ObjectPath.stringify(['a','1','b','c','d-d','e'],"'", true);
// => "['a']['1']['b']['c']['d-d']['e']"

Normalize a Path

ObjectPath.normalize(str, [quote="'"], [forceQuote=false])

var ObjectPath = require('objectpath');

ObjectPath.normalize('a[1].b.c.d["e"]["f-f"].g');
// => "a[1].b.c.d.e['f-f'].g"

ObjectPath.normalize('a[1].b.c.d["e"]["f-f"].g', '"');
// => 'a[1].b.c.d.e["f-f"].g'

ObjectPath.normalize('a[1].b.c.d["e"]["f-f"].g', "'", true);
// => "['a']['1']['b']['c']['d']['e']['f-f']['g']"

Versions

Version
1.2.1
1.1.0