Socket
Socket
Sign inDemoInstall

path-notation

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    path-notation

Dot-notation based path string which yields key literals, allows for the inclusion of keys with "." characters, and provides path meta data and other useful utilities.


Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Install size
40.2 kB
Created
Weekly downloads
 

Readme

Source

PathNotation

A dot-notation based path string which yields key literals, allows for the inclusion of "." character in keys, and provides other useful utilities for reasoning and working with document paths.

Docs

Example:

import PathNotation from 'path-notation':

const path = new PathNotation('foo.bar.baz\\.baz');

console.log(`Path String: ${path}`); // Path String: foo.bar.baz\.baz
console.log(`First key: ${path.firstKey}); // First key: foo
console.log(`Last Key: ${path.lastKey}`; // Last Key: baz.baz
console.log(`Number of Keys: ${path.numKeys}`); // 3
console.log(`Sub Path: ${path.slicePath(0,2)}`); // foo.bar
console.log(`Keys: ${Array.from(path.keys())}`); // foo,bar,baz.baz

Keywords

FAQs

Last updated on 09 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc