Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsonpos

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonpos - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

LICENSE

2

dist/lib/parse.d.ts

@@ -7,2 +7,2 @@ export interface ParsedJson {

export declare function getAstByString(jsonString: string, json?: any): ParsedJson;
export declare function getAstByObject(json: any): ParsedJson;
export declare function getAstByObject(json: any, indent?: number): ParsedJson;

@@ -14,6 +14,6 @@ "use strict";

exports.getAstByString = getAstByString;
function getAstByObject(json) {
const jsonString = JSON.stringify(json, null, 4);
function getAstByObject(json, indent = 4) {
const jsonString = JSON.stringify(json, null, indent);
return getAstByString(jsonString);
}
exports.getAstByObject = getAstByObject;
{
"name": "jsonpos",
"version": "1.0.5",
"version": "1.1.0",
"description": "Get the textual position of a property in a JSON text",

@@ -5,0 +5,0 @@ "author": "Gustaf Räntilä",

@@ -133,2 +133,8 @@ [![npm version][npm-image]][npm-url]

`getAstByObject` takes an optional second argument `indent` which can be set to something else than `4` if necessary, e.g. `2`:
```ts
const ast = getAstByObject( { foo: "bar" }, 2 );
```
### getLocation

@@ -135,0 +141,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc