@stryke/json 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,7 +22,7 @@ This package is part of Storm Software's **đŸŒŠī¸ Stryke** monorepo. Stryke pac
22
22
 
23
23
  <h3 align="center">đŸ’ģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
24
24
 
25
- [![Version](https://img.shields.io/badge/version-0.7.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
+ [![Version](https://img.shields.io/badge/version-0.8.1-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/stryke/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
26
26
 
27
27
  > [!IMPORTANT] This repository, and the apps, libraries, and tools contained
28
28
  > within, is still in it's initial development phase. As a result, bugs and
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.StormJSON = void 0;
7
7
  var _isObject = require("@stryke/type-checks/is-object");
8
8
  var _isString = require("@stryke/type-checks/is-string");
9
- var _buffer = require("buffer/");
10
9
  var _jsoncParser = require("jsonc-parser");
10
+ var _nodeBuffer = require("node:buffer");
11
11
  var _superjson = _interopRequireDefault(require("superjson"));
12
12
  var _parse = require("./utils/parse.cjs");
13
13
  var _parseError = require("./utils/parse-error.cjs");
@@ -66,7 +66,7 @@ class StormJSON extends _superjson.default {
66
66
  }
67
67
  exports.StormJSON = StormJSON;
68
68
  StormJSON.instance.registerCustom({
69
- isApplicable: i => _buffer.Buffer.isBuffer(i),
69
+ isApplicable: i => _nodeBuffer.Buffer.isBuffer(i),
70
70
  serialize: i => i.toString("base64"),
71
- deserialize: i => _buffer.Buffer.from(i, "base64")
71
+ deserialize: i => _nodeBuffer.Buffer.from(i, "base64")
72
72
  }, "Bytes");
@@ -1 +1 @@
1
- import{isObject as o}from"@stryke/type-checks/is-object";import{isString as l}from"@stryke/type-checks/is-string";import{Buffer as a}from"buffer/";import{parse as c}from"jsonc-parser";import p from"superjson";import{parse as u}from"./utils/parse";import{formatParseError as f}from"./utils/parse-error";import{stringify as m}from"./utils/stringify";export class StormJSON extends p{static#r;static get instance(){return StormJSON.#r||(StormJSON.#r=new StormJSON),StormJSON.#r}static deserialize(r){return StormJSON.instance.deserialize(r)}static serialize(r){return StormJSON.instance.serialize(r)}static parse(r){return u(r)}static stringify(r,e){const s=StormJSON.instance.customTransformerRegistry.findApplicable(r);let t=r;return s&&s.isApplicable(r)&&(t=s.serialize(t)),m(t)}static parseJson(r,e){try{if(e?.expectComments===!1)return StormJSON.instance.parse(r)}catch{}const s=[],t={allowTrailingComma:!0,...e},n=c(r,s,t);if(s.length>0&&s[0])throw new Error(f(r,s[0]));return n}static register(r,e,s,t){StormJSON.instance.registerCustom({isApplicable:t,serialize:e,deserialize:s},r)}static registerClass(r,e){StormJSON.instance.registerClass(r,{identifier:l(e)?e:e?.identifier||r.name,allowProps:e&&o(e)&&e?.allowProps&&Array.isArray(e.allowProps)?e.allowProps:["__typename"]})}constructor(){super({dedupe:!0})}}StormJSON.instance.registerCustom({isApplicable:i=>a.isBuffer(i),serialize:i=>i.toString("base64"),deserialize:i=>a.from(i,"base64")},"Bytes");
1
+ import{isObject as o}from"@stryke/type-checks/is-object";import{isString as l}from"@stryke/type-checks/is-string";import{parse as c}from"jsonc-parser";import{Buffer as a}from"node:buffer";import p from"superjson";import{parse as u}from"./utils/parse";import{formatParseError as f}from"./utils/parse-error";import{stringify as m}from"./utils/stringify";export class StormJSON extends p{static#r;static get instance(){return StormJSON.#r||(StormJSON.#r=new StormJSON),StormJSON.#r}static deserialize(r){return StormJSON.instance.deserialize(r)}static serialize(r){return StormJSON.instance.serialize(r)}static parse(r){return u(r)}static stringify(r,e){const s=StormJSON.instance.customTransformerRegistry.findApplicable(r);let t=r;return s&&s.isApplicable(r)&&(t=s.serialize(t)),m(t)}static parseJson(r,e){try{if(e?.expectComments===!1)return StormJSON.instance.parse(r)}catch{}const s=[],t={allowTrailingComma:!0,...e},n=c(r,s,t);if(s.length>0&&s[0])throw new Error(f(r,s[0]));return n}static register(r,e,s,t){StormJSON.instance.registerCustom({isApplicable:t,serialize:e,deserialize:s},r)}static registerClass(r,e){StormJSON.instance.registerClass(r,{identifier:l(e)?e:e?.identifier||r.name,allowProps:e&&o(e)&&e?.allowProps&&Array.isArray(e.allowProps)?e.allowProps:["__typename"]})}constructor(){super({dedupe:!0})}}StormJSON.instance.registerCustom({isApplicable:i=>a.isBuffer(i),serialize:i=>i.toString("base64"),deserialize:i=>a.from(i,"base64")},"Bytes");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/json",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "type": "module",
5
5
  "description": "A package containing JSON parsing/stringify utilities used by Storm Software.",
6
6
  "repository": {
@@ -14,11 +14,11 @@
14
14
  "jsonc-parser": "3.3.1",
15
15
  "lines-and-columns": "2.0.4",
16
16
  "superjson": "2.2.2",
17
- "@stryke/type-checks": "^0.3.2",
18
- "@stryke/types": "^0.8.1"
17
+ "@stryke/type-checks": "^0.3.3",
18
+ "@stryke/types": "^0.8.3"
19
19
  },
20
+ "devDependencies": { "@types/node": "^22.14.0" },
20
21
  "publishConfig": { "access": "public" },
21
- "devDependencies": {},
22
22
  "sideEffects": false,
23
23
  "files": ["dist/**/*"],
24
24
  "homepage": "https://stormsoftware.com",