@stoplight/json
Advanced tools
Comparing version 2.3.3 to 3.0.0
export declare const replaceInString: (str: string, find: string, repl: string) => string; |
export declare const decodePointer: (value: string) => string; |
export declare const decodePointerFragment: (value: string) => string; |
export declare const encodePointer: (value: string) => string; |
import { Segment } from '@stoplight/types'; | ||
export declare const encodePointerFragment: (value: Segment) => Segment; |
import { GetJsonPathForPosition } from '@stoplight/types'; | ||
import { IJsonASTNode } from './types'; | ||
export declare const getJsonPathForPosition: GetJsonPathForPosition<IJsonASTNode, number[]>; |
export declare function getLastPathSegment(path: string): string; |
import { GetLocationForJsonPath } from '@stoplight/types'; | ||
import { IJsonASTNode } from './types'; | ||
export declare const getLocationForJsonPath: GetLocationForJsonPath<IJsonASTNode, number[]>; |
@@ -1,2 +0,1 @@ | ||
export * from './decycle'; | ||
export * from './decodePointer'; | ||
@@ -6,7 +5,14 @@ export * from './decodePointerFragment'; | ||
export * from './encodePointerFragment'; | ||
export * from './getJsonPathForPosition'; | ||
export * from './getLastPathSegment'; | ||
export * from './getLocationForJsonPath'; | ||
export * from './parseWithPointers'; | ||
export * from './pathToPointer'; | ||
export * from './pointerToPath'; | ||
export * from './renameObjectKey'; | ||
export * from './safeParse'; | ||
export * from './safeStringify'; | ||
export * from './startsWith'; | ||
export * from './toPropertyPath'; | ||
export * from './trimStart'; | ||
export * from './types'; |
{ | ||
"name": "@stoplight/json", | ||
"version": "2.3.3", | ||
"version": "3.0.0", | ||
"description": "Useful functions when working with JSON.", | ||
@@ -12,3 +12,2 @@ "keywords": [ | ||
], | ||
"main": "index.js", | ||
"sideEffects": false, | ||
@@ -28,8 +27,10 @@ "files": [ | ||
"dependencies": { | ||
"@stoplight/fast-safe-stringify": "^2.1.2", | ||
"@stoplight/types": "^9.1.2", | ||
"jsonc-parser": "~2.1.0", | ||
"lodash": "^4.10" | ||
"jsonc-parser": "~2.1", | ||
"lodash": "^4.17", | ||
"safe-stable-stringify": "^1.1" | ||
}, | ||
"main": "index.cjs.js", | ||
"module": "index.es.js", | ||
"typings": "index.d.ts" | ||
} |
@@ -0,0 +0,0 @@ import { IDiagnostic, IParserASTResult, IParserResult } from '@stoplight/types'; |
export declare const pathToPointer: (path: import("@stoplight/types").Segment[]) => string; |
export declare const pointerToPath: (pointer: string) => import("@stoplight/types").Segment[]; |
@@ -7,3 +7,2 @@ # @stoplight/json | ||
- Explore the interfaces: [TSDoc](https://stoplightio.github.io/json) | ||
- View the changelog: [Releases](https://github.com/stoplightio/json/releases) | ||
@@ -22,3 +21,2 @@ | ||
- **[decycle](https://stoplightio.github.io/json/globals.html#decycle)**: Remove circular references with support for an optional replacer. | ||
- **[parseWithPointers](https://stoplightio.github.io/json/globals.html#parsewithpointers)**: Like `JSON.parse(val)` but also returns parsing errors as well as full ast with line information. | ||
@@ -36,6 +34,4 @@ - **[pathToPointer](https://stoplightio.github.io/json/globals.html#pathtopointer)**: Turns an array of path segments into a json pointer IE `['paths', '/user', 'get']` -> `#/paths/~1/user/get`. | ||
_Note: Unlike most of the other functions, parseWithPointers is not exported from root. You must import by name._ | ||
```ts | ||
import { parseWithPointers } from "@stoplight/json/parseWithPointers"; | ||
import { parseWithPointers } from "@stoplight/json"; | ||
@@ -42,0 +38,0 @@ const result = parseWithPointers('{"foo": "bar"}'); |
export declare const renameObjectKey: (obj: object, oldKey: string, newKey: string) => object; |
export declare const safeParse: JSON['parse']; |
export declare const safeStringify: (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined) => string; |
export declare const startsWith: (source: string | any[], val: string | any[]) => boolean; |
export declare function toPropertyPath(path: string): string; |
@@ -1,1 +0,1 @@ | ||
export declare const trimStart: (target: string | any[], elems: string | any[]) => any; | ||
export declare const trimStart: (target: string | any[], elems: string | any[]) => string | any[]; |
@@ -0,0 +0,0 @@ import { IRange } from '@stoplight/types'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31506
41
130
2
71
1
+ Addedsafe-stable-stringify@^1.1
+ Addedsafe-stable-stringify@1.1.1(transitive)
- Removed@stoplight/fast-safe-stringify@2.1.2(transitive)
Updatedjsonc-parser@~2.1
Updatedlodash@^4.17