@stryke/json 0.7.0 → 0.7.2

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.5.3-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.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)
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
@@ -52,6 +52,7 @@ flexibility and customization.
52
52
 
53
53
  <!-- START doctoc -->
54
54
  <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
55
+
55
56
  ## Table of Contents
56
57
 
57
58
  - [Installing](#installing)
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.stringify = void 0;
7
7
  var _isNumber = require("@stryke/type-checks/is-number");
8
- const stringify = (r, t = 2) => {
9
- const n = (0, _isNumber.isNumber)(t) ? " ".repeat(t) : t;
8
+ var _isUndefined = require("@stryke/type-checks/is-undefined");
9
+ const stringify = (r, e = 2) => {
10
+ const n = (0, _isNumber.isNumber)(e) ? " ".repeat(e) : e;
10
11
  switch (r) {
11
12
  case null:
12
13
  return "null";
@@ -21,7 +22,7 @@ const stringify = (r, t = 2) => {
21
22
  case Number.NEGATIVE_INFINITY:
22
23
  return "-infinity";
23
24
  }
24
- if (Array.isArray(r)) return `[${n}${r.map(e => stringify(e, n)).join(`,${n}`)}${n}]`;
25
+ if (Array.isArray(r)) return `[${n}${r.map(i => stringify(i, n)).join(`,${n}`)}${n}]`;
25
26
  if (r instanceof Uint8Array) return r.toString();
26
27
  switch (typeof r) {
27
28
  case "number":
@@ -30,8 +31,8 @@ const stringify = (r, t = 2) => {
30
31
  return JSON.stringify(r);
31
32
  case "object":
32
33
  {
33
- const e = Object.keys(r);
34
- return `{${n}${e.map(s => `${s}: ${n}${stringify(r[s], n)}`).join(`,${n}`)}${n}}`;
34
+ const i = Object.keys(r).filter(t => !(0, _isUndefined.isUndefined)(r[t]));
35
+ return `{${n}${i.map(t => `${t}: ${n}${stringify(r[t], n)}`).join(`,${n}`)}${n}}`;
35
36
  }
36
37
  default:
37
38
  return "null";
@@ -1 +1 @@
1
- import{isNumber as i}from"@stryke/type-checks/is-number";export const stringify=(r,t=2)=>{const n=i(t)?" ".repeat(t):t;switch(r){case null:return"null";case void 0:return'"undefined"';case!0:return"true";case!1:return"false";case Number.POSITIVE_INFINITY:return"infinity";case Number.NEGATIVE_INFINITY:return"-infinity"}if(Array.isArray(r))return`[${n}${r.map(e=>stringify(e,n)).join(`,${n}`)}${n}]`;if(r instanceof Uint8Array)return r.toString();switch(typeof r){case"number":return`${r}`;case"string":return JSON.stringify(r);case"object":{const e=Object.keys(r);return`{${n}${e.map(s=>`${s}: ${n}${stringify(r[s],n)}`).join(`,${n}`)}${n}}`}default:return"null"}};
1
+ import{isNumber as s}from"@stryke/type-checks/is-number";import{isUndefined as c}from"@stryke/type-checks/is-undefined";export const stringify=(r,e=2)=>{const n=s(e)?" ".repeat(e):e;switch(r){case null:return"null";case void 0:return'"undefined"';case!0:return"true";case!1:return"false";case Number.POSITIVE_INFINITY:return"infinity";case Number.NEGATIVE_INFINITY:return"-infinity"}if(Array.isArray(r))return`[${n}${r.map(i=>stringify(i,n)).join(`,${n}`)}${n}]`;if(r instanceof Uint8Array)return r.toString();switch(typeof r){case"number":return`${r}`;case"string":return JSON.stringify(r);case"object":{const i=Object.keys(r).filter(t=>!c(r[t]));return`{${n}${i.map(t=>`${t}: ${n}${stringify(r[t],n)}`).join(`,${n}`)}${n}}`}default:return"null"}};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/json",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "A package containing JSON parsing/stringify utilities used by Storm Software.",
6
6
  "repository": {
@@ -14,8 +14,8 @@
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.2.0",
18
- "@stryke/types": "^0.7.4"
17
+ "@stryke/type-checks": "^0.3.2",
18
+ "@stryke/types": "^0.8.1"
19
19
  },
20
20
  "publishConfig": { "access": "public" },
21
21
  "devDependencies": {},