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

json-as

Package Overview
Dependencies
Maintainers
0
Versions
192
Alerts
File Explorer

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.0.0-beta.6

28

index.ts

@@ -1,27 +0,1 @@

function isValidType(type: string): boolean {
console.log(type);
const validTypes = [
"string",
"u8",
"i8",
"u16",
"i16",
"u32",
"i32",
"u64",
"i64",
"f32",
"f64",
"bool",
"boolean",
// ...this.schemas.map((v) => v.name)
];
if (type.endsWith("| null")) return isValidType(type.slice(0, type.length - 7));
if (type.includes("<")) return isValidType(type.slice(type.indexOf("<") + 1, type.lastIndexOf(">")));
if (validTypes.includes(type)) return true;
return false;
}
console.log(isValidType("string | null"))
console.log(isValidType("Array<string | null>"))
export * from "./assembly/index.ts";

2

package.json
{
"name": "json-as",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.6",
"author": "Jairus Tanaka",

@@ -5,0 +5,0 @@ "repository": {

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

</span>
AssemblyScript - v1.0.0-beta.5
AssemblyScript - v1.0.0-beta.6
</pre>

@@ -35,3 +35,3 @@ </h5>

```bash
npm install json-as@1.0.0-beta.5
npm install json-as@1.0.0-beta.6
```

@@ -38,0 +38,0 @@

@@ -133,4 +133,2 @@ import { IdentifierExpression, Source, StringLiteralExpression, IntegerLiteralExpression, FloatLiteralExpression, NullExpression, TrueExpression, FalseExpression, Node, Tokenizer } from "assemblyscript/dist/assemblyscript.js";

const value = member.initializer ? toString(member.initializer) : null;
if (!this.isValidType(type, node))
throwError("Invalid Type. " + type + " is not a JSON-compatible type. Either decorate it with @omit, set it to private, or remove it.", member.type.range);
if (type.startsWith("(") && type.includes("=>"))

@@ -137,0 +135,0 @@ continue;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet