New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@awsless/json

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@awsless/json - npm Package Compare versions

Comparing version
0.0.4
to
0.0.5
+8
-3
./dist/index.cjs

@@ -27,3 +27,4 @@ "use strict";

patch: () => patch,
stringify: () => stringify
stringify: () => stringify,
unpatch: () => unpatch
});

@@ -134,4 +135,7 @@ module.exports = __toCommonJS(src_exports);

var patch = (value, types = {}) => {
return parse(stringify(value, types), types);
return parse(JSON.stringify(value), types);
};
var unpatch = (value, types = {}) => {
return JSON.parse(stringify(value, types));
};
// Annotate the CommonJS export names for ESM import in node:

@@ -143,3 +147,4 @@ 0 && (module.exports = {

patch,
stringify
stringify,
unpatch
});

@@ -27,3 +27,4 @@ "use strict";

patch: () => patch,
stringify: () => stringify
stringify: () => stringify,
unpatch: () => unpatch
});

@@ -134,4 +135,7 @@ module.exports = __toCommonJS(src_exports);

var patch = (value, types = {}) => {
return parse(stringify(value, types), types);
return parse(JSON.stringify(value), types);
};
var unpatch = (value, types = {}) => {
return JSON.parse(stringify(value, types));
};
// Annotate the CommonJS export names for ESM import in node:

@@ -143,3 +147,4 @@ 0 && (module.exports = {

patch,
stringify
stringify,
unpatch
});

@@ -8,3 +8,4 @@ type Serializable<I, O> = {

declare const patch: <T>(value: T, types?: SerializableTypes) => T;
declare const patch: (value: unknown, types?: SerializableTypes) => any;
declare const unpatch: (value: unknown, types?: SerializableTypes) => any;

@@ -19,2 +20,2 @@ declare const parse: (json: string, types?: SerializableTypes) => any;

export { type Serializable, createReplacer, createReviver, parse, patch, stringify };
export { type Serializable, createReplacer, createReviver, parse, patch, stringify, unpatch };

@@ -8,3 +8,4 @@ type Serializable<I, O> = {

declare const patch: <T>(value: T, types?: SerializableTypes) => T;
declare const patch: (value: unknown, types?: SerializableTypes) => any;
declare const unpatch: (value: unknown, types?: SerializableTypes) => any;

@@ -19,2 +20,2 @@ declare const parse: (json: string, types?: SerializableTypes) => any;

export { type Serializable, createReplacer, createReviver, parse, patch, stringify };
export { type Serializable, createReplacer, createReviver, parse, patch, stringify, unpatch };

@@ -103,4 +103,7 @@ // src/type/bigfloat.ts

var patch = (value, types = {}) => {
return parse(stringify(value, types), types);
return parse(JSON.stringify(value), types);
};
var unpatch = (value, types = {}) => {
return JSON.parse(stringify(value, types));
};
export {

@@ -111,3 +114,4 @@ createReplacer,

patch,
stringify
stringify,
unpatch
};
{
"name": "@awsless/json",
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",

@@ -5,0 +5,0 @@ "type": "module",

@@ -68,6 +68,6 @@

// Stringify your custom type
// Stringify your custom type.
const json = stringify(new Custom('example'), { $custom })
// Parse the json with your custom type
// Parse the json with your custom type.
const value = parse(json, { $custom })

@@ -78,13 +78,17 @@ ```

Object properties with `undefined` as value type will be stripped away.
### Don't use the $ character inside your JSON.
We use the `$` character to encode our special types inside JSON. In order to prevent parsing errors we recommend to avoid using the `$` character inside your object property names.
### Object properties with `undefined` as value type will be stripped away.
```ts
// Will result in an empty object
// Will result in an empty object.
const result = parse(stringify({ key: undefined }))
// Will log false
// Will log false.
console.log('key' in result)
// Will log true
// Will log true.
console.log(result.key === undefined)
```