<commit_before>'use strict';

var unmarshalJson = require('../index').unmarshalJson;

var item = {
  name: {S: '<NAME>'},
  age: {N: '30'},
  employed: {BOOL: true},
  relationshipStatus: {NULL: true},
  defaultReplies: {
    L: [
      {S: 'No.'},
      {N: '42'}
    ]
  },
  appearance: {
    M: {
      height: {N: '183'},
      weight: {N: '79'},
      eyeColor: {S: 'brown'},
      ethnicity: {
        M: {
          whiteAmerican: {BOOL: true},
          nativeAmerican: {BOOL: false},
          asianAmerican: {BOOL: false},
          africanAmerican: {BOOL: false},
          nativeHawaiianOrPacificIslander: {BOOL: false},
          someOtherRace: {BOOL: false}
        }
      }
    }
  },
  favoriteFoods: {
    SS: [
      'burritos',
      'fried chicken',
      'pad kee mao'
    ]
  },
  luckyNumbers: {
    NS: ['42', '98', '777']
  }
};

// unmarshalJson() uses unmarshalItem() to do the work, but just stringifies the item to JSON for you.
console.log(unmarshalJson(item));

//{
//  "name": "<NAME>",
//  "age": 30,
//  "employed": true,
//  "relationshipStatus": null,
//  "defaultReplies": ["No.", 42],
//  "appearance": {
//    "height": 183,
//    "weight": 79,
//    "eyeColor": "brown",
//    "ethnicity": {
//      "whiteAmerican": true,
//      "nativeAmerican": false,
//      "asianAmerican": false,
//      "africanAmerican": false,
//      "nativeHawaiianOrPacificIslander": false,
//      "someOtherRace": false<commit_msg>80 maxchar on a comment in example-unmarshal.js<commit_after>'use strict';

var unmarshalJson = require('../index').unmarshalJson;

var item = {
  name: {S: '<NAME>'},
  age: {N: '30'},
  employed: {BOOL: true},
  relationshipStatus: {NULL: true},
  defaultReplies: {
    L: [
      {S: 'No.'},
      {N: '42'}
    ]
  },
  appearance: {
    M: {
      height: {N: '183'},
      weight: {N: '79'},
      eyeColor: {S: 'brown'},
      ethnicity: {
        M: {
          whiteAmerican: {BOOL: true},
          nativeAmerican: {BOOL: false},
          asianAmerican: {BOOL: false},
          africanAmerican: {BOOL: false},
          nativeHawaiianOrPacificIslander: {BOOL: false},
          someOtherRace: {BOOL: false}
        }
      }
    }
  },
  favoriteFoods: {
    SS: [
      'burritos',
      'fried chicken',
      'pad kee mao'
    ]
  },
  luckyNumbers: {
    NS: ['42', '98', '777']
  }
};

// unmarshalJson() uses unmarshalItem() to do the work.
// It just stringifies the item to JSON for you.
console.log(unmarshalJson(item));

//{
//  "name": "<NAME>",
//  "age": 30,
//  "employed": true,
//  "relationshipStatus": null,
//  "defaultReplies": ["No.", 42],
//  "appearance": {
//    "height": 183,
//    "weight": 79,
//    "eyeColor": "brown",
//    "ethnicity": {
//      "whiteAmerican": true,
//      "nativeAmerican": false,
//      "asianAmerican": false,
//      "africanAmerican": false,
//      "nativeHawaiianOrPacificIslander": false,
//      "someOtherRace": false
{'fraction_non_alphanumeric': 0.1919945725915875, 'fraction_numerical': 0.017639077340569877, 'mean_word_length': 2.2876254180602005, 'pattern_counts': {'":': 32, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2241833', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1026, 'n_words': 239}