🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

json-as

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-as - npm Package Compare versions

Comparing version

to
1.1.12

@@ -5,6 +5,7 @@ import { JSON } from "..";

@json
class RepoOwner {
public login!: string;
public id!: number;
public id!: i32;
public node_id!: string;

@@ -29,2 +30,3 @@ public avatar_url!: string;

@json

@@ -39,5 +41,6 @@ class RepoLicense {

@json
class Repo {
public id!: number;
public id!: i32;
public node_id!: string;

@@ -96,5 +99,5 @@ public name!: string;

public homepage!: string | null;
public size!: number;
public stargazers_count!: number;
public watchers_count!: number;
public size!: i32;
public stargazers_count!: i32;
public watchers_count!: i32;
public language!: string | null;

@@ -107,7 +110,7 @@ public has_issues!: boolean;

public has_discussions!: boolean;
public forks_count!: number;
public forks_count!: i32;
public mirror_url!: string | null;
public archived!: boolean;
public disabled!: boolean;
public open_issues_count!: number;
public open_issues_count!: i32;
public license!: RepoLicense | null;

@@ -119,9 +122,9 @@ public allow_forking!: boolean;

public visibility!: string;
public forks!: number;
public open_issues!: number;
public watchers!: number;
public forks!: i32;
public open_issues!: i32;
public watchers!: i32;
public default_branch!: string;
}
let v1: Repo = {
const v1: Repo = {
id: 132935648,

@@ -151,3 +154,3 @@ node_id: "MDEwOlJlcG9zaXRvcnkxMzI5MzU2NDg=",

user_view_type: "public",
site_admin: false
site_admin: false,
},

@@ -226,4 +229,4 @@ html_url: "https://github.com/octocat/boysenberry-repo-1",

watchers: 332,
default_branch: "master"
}
default_branch: "master",
};

@@ -233,3 +236,3 @@ const v2 = `{"id":132935648,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI5MzU2NDg=","name":"boysenberry-repo-1","full_name":"octocat/boysenberry-repo-1","private":true,"owner":{"login":"octocat","id":583231,"node_id":"MDQ6VXNlcjU4MzIzMQ==","avatar_url":"https://avatars.githubusercontent.com/u/583231?v=4","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","user_view_type":"public","site_admin":false},"html_url":"https://github.com/octocat/boysenberry-repo-1","description":"Testing","fork":true,"url":"https://api.github.com/repos/octocat/boysenberry-repo-1","forks_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/forks","keys_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/teams","hooks_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/hooks","issue_events_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/events","assignees_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/tags","blobs_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/languages","stargazers_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/stargazers","contributors_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/contributors","subscribers_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/subscribers","subscription_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/subscription","commits_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/merges","archive_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/downloads","issues_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/deployments","created_at":"2018-05-10T17:51:29Z","updated_at":"2025-05-24T02:01:19Z","pushed_at":"2024-05-26T07:02:05Z","git_url":"git://github.com/octocat/boysenberry-repo-1.git","ssh_url":"git@github.com:octocat/boysenberry-repo-1.git","clone_url":"https://github.com/octocat/boysenberry-repo-1.git","svn_url":"https://github.com/octocat/boysenberry-repo-1","homepage":"","size":4,"stargazers_count":332,"watchers_count":332,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":20,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":20,"open_issues":1,"watchers":332,"default_branch":"master"}`;

expect(JSON.stringify(v1)).toBe(v2);
expect(JSON.stringify(JSON.parse(v2))).toBe(v2);
expect(JSON.stringify(JSON.parse<Repo>(v2))).toBe(v2);

@@ -241,3 +244,3 @@ bench(

},
1_000_000,
100_00,
);

@@ -248,5 +251,5 @@

() => {
JSON.parse(v2);
JSON.parse<Repo>(v2);
},
1_000_000,
);
100_00,
);

@@ -16,3 +16,3 @@ let currentDescription: string = "";

// @ts-ignore
return new Expectation(isNull(left) ? "null" : left.toString());
return new Expectation(left == null ? "null" : left.toString());
}

@@ -30,6 +30,6 @@

// @ts-ignore
if (this.left != (isNull(right) ? "null" : right.toString())) {
if (this.left != (right == null ? "null" : right.toString())) {
console.log(" " + currentDescription + "\n");
// @ts-ignore
console.log(" (expected) -> " + (isNull(right) ? "null" : right.toString()));
console.log(" (expected) -> " + (right == null ? "null" : right.toString()));
console.log(" (received) -> " + this.left);

@@ -40,5 +40,1 @@ unreachable();

}
function isNull<T>(value: T): boolean {
return isInteger<T>() && !isSigned<T>() && nameof<T>() == "usize" && value == 0;
}
import { bench } from "./lib/bench.js";
import { expect } from "./lib/test.js";
class RepoOwner {
public login!: string;
public id!: number;
public node_id!: string;
public avatar_url!: string;
public gravatar_id!: string;
public url!: string;
public html_url!: string;
public followers_url!: string;
public following_url!: string;
public gists_url!: string;
public starred_url!: string;
public subscriptions_url!: string;
public organizations_url!: string;
public repos_url!: string;
public events_url!: string;
public received_events_url!: string;
public type!: string;
public user_view_type!: string;
public site_admin!: boolean;
class Vec3 {
public x!: number;
public y!: number;
public z!: number;
}
class RepoLicense {
public key!: string;
public name!: string;
public spdx_id!: string;
public url!: string | null;
public node_id!: string;
}
class Repo {
class LargeJSON {
public id!: number;
public node_id!: string;
public name!: string;
public full_name!: string;
public private!: boolean;
public owner: RepoOwner = new RepoOwner();
public html_url!: string;
public description!: string | null;
public fork!: boolean;
public url!: string;
public forks_url!: string;
public keys_url!: string;
public collaborators_url!: string;
public teams_url!: string;
public hooks_url!: string;
public issue_events_url!: string;
public events_url!: string;
public assignees_url!: string;
public branches_url!: string;
public tags_url!: string;
public blobs_url!: string;
public git_tags_url!: string;
public git_refs_url!: string;
public trees_url!: string;
public statuses_url!: string;
public languages_url!: string;
public stargazers_url!: string;
public contributors_url!: string;
public subscribers_url!: string;
public subscription_url!: string;
public commits_url!: string;
public git_commits_url!: string;
public comments_url!: string;
public issue_comment_url!: string;
public contents_url!: string;
public compare_url!: string;
public merges_url!: string;
public archive_url!: string;
public downloads_url!: string;
public issues_url!: string;
public pulls_url!: string;
public milestones_url!: string;
public notifications_url!: string;
public labels_url!: string;
public releases_url!: string;
public deployments_url!: string;
public created_at!: string;
public updated_at!: string;
public pushed_at!: string;
public git_url!: string;
public ssh_url!: string;
public clone_url!: string;
public svn_url!: string;
public homepage!: string | null;
public size!: number;
public stargazers_count!: number;
public watchers_count!: number;
public language!: string | null;
public has_issues!: boolean;
public has_projects!: boolean;
public has_downloads!: boolean;
public has_wiki!: boolean;
public has_pages!: boolean;
public has_discussions!: boolean;
public forks_count!: number;
public mirror_url!: string | null;
public archived!: boolean;
public disabled!: boolean;
public open_issues_count!: number;
public license!: RepoLicense | null;
public allow_forking!: boolean;
public is_template!: boolean;
public web_commit_signoff_required!: boolean;
public topics!: string[];
public visibility!: string;
public forks!: number;
public open_issues!: number;
public watchers!: number;
public default_branch!: string;
public age!: number;
public email!: string;
public street!: string;
public city!: string;
public state!: string;
public zip!: string;
public tags!: string[];
public theme!: string;
public notifications!: boolean;
public language!: string;
public movement!: Vec3[];
}
let v1: Repo = {
id: 132935648,
node_id: "MDEwOlJlcG9zaXRvcnkxMzI5MzU2NDg=",
name: "boysenberry-repo-1",
full_name: "octocat/boysenberry-repo-1",
private: true,
owner: {
login: "octocat",
id: 583231,
node_id: "MDQ6VXNlcjU4MzIzMQ==",
avatar_url: "https://avatars.githubusercontent.com/u/583231?v=4",
gravatar_id: "",
url: "https://api.github.com/users/octocat",
html_url: "https://github.com/octocat",
followers_url: "https://api.github.com/users/octocat/followers",
following_url: "https://api.github.com/users/octocat/following{/other_user}",
gists_url: "https://api.github.com/users/octocat/gists{/gist_id}",
starred_url: "https://api.github.com/users/octocat/starred{/owner}{/repo}",
subscriptions_url: "https://api.github.com/users/octocat/subscriptions",
organizations_url: "https://api.github.com/users/octocat/orgs",
repos_url: "https://api.github.com/users/octocat/repos",
events_url: "https://api.github.com/users/octocat/events{/privacy}",
received_events_url: "https://api.github.com/users/octocat/received_events",
type: "User",
user_view_type: "public",
site_admin: false
},
html_url: "https://github.com/octocat/boysenberry-repo-1",
description: "Testing",
fork: true,
url: "https://api.github.com/repos/octocat/boysenberry-repo-1",
forks_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/forks",
keys_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/keys{/key_id}",
collaborators_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/collaborators{/collaborator}",
teams_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/teams",
hooks_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/hooks",
issue_events_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/issues/events{/number}",
events_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/events",
assignees_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/assignees{/user}",
branches_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/branches{/branch}",
tags_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/tags",
blobs_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/git/blobs{/sha}",
git_tags_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/git/tags{/sha}",
git_refs_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/git/refs{/sha}",
trees_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/git/trees{/sha}",
statuses_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/statuses/{sha}",
languages_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/languages",
stargazers_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/stargazers",
contributors_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/contributors",
subscribers_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/subscribers",
subscription_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/subscription",
commits_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/commits{/sha}",
git_commits_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/git/commits{/sha}",
comments_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/comments{/number}",
issue_comment_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/issues/comments{/number}",
contents_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/contents/{+path}",
compare_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/compare/{base}...{head}",
merges_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/merges",
archive_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/{archive_format}{/ref}",
downloads_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/downloads",
issues_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/issues{/number}",
pulls_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/pulls{/number}",
milestones_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/milestones{/number}",
notifications_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/notifications{?since,all,participating}",
labels_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/labels{/name}",
releases_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/releases{/id}",
deployments_url: "https://api.github.com/repos/octocat/boysenberry-repo-1/deployments",
created_at: "2018-05-10T17:51:29Z",
updated_at: "2025-05-24T02:01:19Z",
pushed_at: "2024-05-26T07:02:05Z",
git_url: "git://github.com/octocat/boysenberry-repo-1.git",
ssh_url: "git@github.com:octocat/boysenberry-repo-1.git",
clone_url: "https://github.com/octocat/boysenberry-repo-1.git",
svn_url: "https://github.com/octocat/boysenberry-repo-1",
homepage: "",
size: 4,
stargazers_count: 332,
watchers_count: 332,
language: null,
has_issues: false,
has_projects: true,
has_downloads: true,
has_wiki: true,
has_pages: false,
has_discussions: false,
forks_count: 20,
mirror_url: null,
archived: false,
disabled: false,
open_issues_count: 1,
license: null,
allow_forking: true,
is_template: false,
web_commit_signoff_required: false,
topics: [],
visibility: "public",
forks: 20,
open_issues: 1,
watchers: 332,
default_branch: "master"
}
const v1: LargeJSON = {
id: 2,
name: "Medium Object",
age: 18,
email: "me@jairus.dev",
street: "I don't want to say my street",
city: "I don't want to say this either",
state: "It really depends",
zip: "I forget what it is",
tags: ["me", "dogs", "mountains", "bar", "foo"],
theme: "Hyper Term Black",
notifications: true,
language: "en-US",
movement: [
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
{ x: 1, y: 2, z: 3 },
],
};
const v2 = `{"id":132935648,"node_id":"MDEwOlJlcG9zaXRvcnkxMzI5MzU2NDg=","name":"boysenberry-repo-1","full_name":"octocat/boysenberry-repo-1","private":true,"owner":{"login":"octocat","id":583231,"node_id":"MDQ6VXNlcjU4MzIzMQ==","avatar_url":"https://avatars.githubusercontent.com/u/583231?v=4","gravatar_id":"","url":"https://api.github.com/users/octocat","html_url":"https://github.com/octocat","followers_url":"https://api.github.com/users/octocat/followers","following_url":"https://api.github.com/users/octocat/following{/other_user}","gists_url":"https://api.github.com/users/octocat/gists{/gist_id}","starred_url":"https://api.github.com/users/octocat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/octocat/subscriptions","organizations_url":"https://api.github.com/users/octocat/orgs","repos_url":"https://api.github.com/users/octocat/repos","events_url":"https://api.github.com/users/octocat/events{/privacy}","received_events_url":"https://api.github.com/users/octocat/received_events","type":"User","user_view_type":"public","site_admin":false},"html_url":"https://github.com/octocat/boysenberry-repo-1","description":"Testing","fork":true,"url":"https://api.github.com/repos/octocat/boysenberry-repo-1","forks_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/forks","keys_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/teams","hooks_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/hooks","issue_events_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/issues/events{/number}","events_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/events","assignees_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/assignees{/user}","branches_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/branches{/branch}","tags_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/tags","blobs_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/statuses/{sha}","languages_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/languages","stargazers_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/stargazers","contributors_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/contributors","subscribers_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/subscribers","subscription_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/subscription","commits_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/contents/{+path}","compare_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/merges","archive_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/downloads","issues_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/issues{/number}","pulls_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/pulls{/number}","milestones_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/milestones{/number}","notifications_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/labels{/name}","releases_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/releases{/id}","deployments_url":"https://api.github.com/repos/octocat/boysenberry-repo-1/deployments","created_at":"2018-05-10T17:51:29Z","updated_at":"2025-05-24T02:01:19Z","pushed_at":"2024-05-26T07:02:05Z","git_url":"git://github.com/octocat/boysenberry-repo-1.git","ssh_url":"git@github.com:octocat/boysenberry-repo-1.git","clone_url":"https://github.com/octocat/boysenberry-repo-1.git","svn_url":"https://github.com/octocat/boysenberry-repo-1","homepage":"","size":4,"stargazers_count":332,"watchers_count":332,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":20,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":20,"open_issues":1,"watchers":332,"default_branch":"master"}`;
const v2 = `{"id":2,"name":"Medium Object","age":18,"email":"me@jairus.dev","street":"I don't want to say my street","city":"I don't want to say this either","state":"It really depends","zip":"I forget what it is","tags":["me","dogs","mountains","bar","foo"],"theme":"Hyper Term Black","notifications":true,"language":"en-US","movement":[{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3},{"x":1,"y":2,"z":3}]}`;
expect(JSON.stringify(v1)).toBe(v2);
expect(JSON.stringify(JSON.parse(v2))).toBe(v2);
bench(

@@ -228,3 +117,3 @@ "Serialize Large Object",

},
1_000_000,
3_000_00,
);

@@ -237,3 +126,3 @@

},
1_000_000,
);
3_000_00,
);
# Change Log
## 2025-05-29 - 1.1.2
- fix: add helpful warning on unknown or unaccessible types in fields
- feat: support deserialization of class generics
- fix: add support for numerical generics
- tests: add proper testing for generics
- feat: support type aliases with a custom type resolver/linker
- chore: add other linkers to tsconfig and clean up
- feat: add type alias resolving
## 2025-05-28 - 1.1.11

@@ -4,0 +14,0 @@

{
"name": "json-as",
"version": "1.1.11",
"version": "1.1.12",
"author": "Jairus Tanaka",

@@ -22,4 +22,3 @@ "description": "The only JSON library you'll need for AssemblyScript. SIMD enabled",

"bench:js": "bash ./run-bench.js.sh",
"build:test": "rm -rf ./build/ && JSON_DEBUG=1 asc assembly/test.ts --transform ./transform -o ./build/test.wasm --textFile ./build/test.wat --debug --config ./node_modules/@assemblyscript/wasi-shim/asconfig.json",
"build:test:simd": "rm -rf ./build/ && JSON_DEBUG=true asc assembly/test.ts --transform ./transform -o ./build/test.wasm --textFile ./build/test.wat --optimizeLevel 3 --shrinkLevel 0 --enable simd --config ./node_modules/@assemblyscript/wasi-shim/asconfig.json",
"build:test": "rm -rf ./build/ && JSON_DEBUG=1 JSON_WRITE=assembly/test.ts asc assembly/test.ts --transform ./transform -o ./build/test.wasm --textFile ./build/test.wat --debug --config ./node_modules/@assemblyscript/wasi-shim/asconfig.json",
"test:wasmtime": "wasmtime ./build/test.wasm",

@@ -26,0 +25,0 @@ "test:wasmer": "wasmer ./build/test.wasm",

@@ -9,3 +9,3 @@ <h6 align="center">

</span>
AssemblyScript - v1.1.11
AssemblyScript - v1.1.12
</pre>

@@ -12,0 +12,0 @@ </h6>

@@ -0,1 +1,2 @@

import { TypeAlias } from "./linkers/alias.js";
export var PropertyFlags;

@@ -16,2 +17,3 @@ (function (PropertyFlags) {

byteSize = 0;
generic = false;
}

@@ -29,2 +31,13 @@ export class Schema {

}
export class Src {
internalPath;
schemas;
aliases;
imports;
exports;
constructor(source) {
this.internalPath = source.internalPath;
this.aliases = TypeAlias.getAliases(source);
}
}
//# sourceMappingURL=types.js.map

@@ -1,2 +0,3 @@

import { ClassDeclaration, Expression, FieldDeclaration } from "assemblyscript/dist/assemblyscript.js";
import { ClassDeclaration, Expression, FieldDeclaration, Source } from "assemblyscript/dist/assemblyscript.js";
import { TypeAlias } from "./linkers/alias.js";

@@ -18,2 +19,3 @@ export enum PropertyFlags {

public byteSize: number = 0;
public generic: boolean = false;
}

@@ -32,1 +34,13 @@

}
export class Src {
public internalPath: string;
public schemas: Schema[];
public aliases: TypeAlias[];
public imports: Schema[];
public exports: Schema[];
constructor(source: Source) {
this.internalPath = source.internalPath;
this.aliases = TypeAlias.getAliases(source);
}
}

@@ -11,3 +11,3 @@ {

},
"include": ["./src/*.ts"]
"include": ["./src/**.ts"]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display