<commit_before># TypedJSON

*v0.1.4 experimental release*

Typed JSON parsing and serializing that preserves type information. Parse JSON into actual class instances. Recommended (but not required) to be used with [ReflectDecorators](https://github.com/rbuckton/ReflectDecorators), a prototype for an ES7 Reflection API for Decorator Metadata.

## Install & Use

The latest version is available as a [NuGet package](https://www.nuget.org/packages/TypedJSON/):

```none
Install-Package TypedJSON
```

 1. Import the 'typed-json' module
 2. Snap @JsonObject on a class
 3. Snap @JsonMember on some properties to mark them for serialization
   - Use [ReflectDecorators](https://github.com/rbuckton/ReflectDecorators) to auto-infer property type (recommended), or
   - Specify 'type' setting: `@JsonMember({ type: String }) ...`
 4. Parse/stringify with TypedJSON:

```typescript
@JsonObject
class Person {
    @JsonMember
    firstName: string;
    
    @JsonMember
    lastName: string;

    public getFullname() {
        return this.firstName + " " + this.lastName;
    }
}
```

```typescript<commit_msg>wording<commit_after># TypedJSON

*v0.1.4 experimental release*

Typed JSON parsing and serializing that preserves type information. Parse JSON into actual class instances. Recommended (but not required) to be used with [ReflectDecorators](https://github.com/rbuckton/ReflectDecorators), a prototype for an ES7 Reflection API for Decorator Metadata.

## Install & Use

The latest version is available as a [NuGet package](https://www.nuget.org/packages/TypedJSON/):

```none
Install-Package TypedJSON
```

 1. Import the 'typed-json' module
 2. Snap @JsonObject on a class
 3. Snap @JsonMember on some properties to mark them for serialization
   - Use [ReflectDecorators](https://github.com/rbuckton/ReflectDecorators) (recommended), or set 'type' option (syntax: `@JsonMember({ type: String }) ...`)
 4. Parse/stringify with TypedJSON:

```typescript
@JsonObject
class Person {
    @JsonMember
    firstName: string;
    
    @JsonMember
    lastName: string;

    public getFullname() {
        return this.firstName + " " + this.lastName;
    }
}
```

```typescript
{'fraction_non_alphanumeric': 0.10768522779567419, 'fraction_numerical': 0.007363092498849517, 'mean_word_length': 4.103286384976526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5337917', 'n_tokens_mistral': 682, 'n_tokens_neox': 647, 'n_words': 214}