{"size": 1035, "ext": "js", "max_stars_repo_path": "node_modules/share/node_modules/browserchannel/node_modules/ascii-json/test/ascii-json.js", "max_stars_repo_name": "abraarsyed/workshare", "max_stars_repo_stars_event_min_datetime": "2020-08-05T21:04:32.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-08T08:55:41.000Z", "max_issues_repo_path": "node_modules/react-async/node_modules/ascii-json/test/ascii-json.js", "max_issues_repo_name": "Lukkub/Redux-ShopCartApp", "max_issues_repo_issues_event_min_datetime": "2021-05-21T12:20:47.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-06T00:38:52.000Z", "max_forks_repo_path": "node_modules/react-async/node_modules/ascii-json/test/ascii-json.js", "max_forks_repo_name": "Lukkub/Redux-ShopCartApp", "max_forks_repo_forks_event_min_datetime": "2020-08-24T08:28:58.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-14T12:44:36.000Z"}
{"max_stars_count": 86, "max_issues_count": 2, "max_forks_count": 16, "avg_line_length": 32.34375, "max_line_length": 97, "alphanum_fraction": 0.6434782609}
// Generated by CoffeeScript 1.6.2
(function() {
  describe("ascii-json", function() {
    var asciiJSON;

    asciiJSON = require('../lib/ascii-json');
    it("should detect non-ASCII string", function() {
      asciiJSON.isAscii('this is all ASCII').should.be["true"];
      return asciiJSON.isAscii('this is not 에스키').should.be["false"];
    });
    it("should escape non-ASCII string to ASCII-only string", function() {
      var escaped;

      escaped = asciiJSON.escapeNonAsciis('this is not 에스키');
      return asciiJSON.isAscii(escaped).should.be["true"];
    });
    return it("should stringify objects with non-ASCII string into ASCII only JSON", function() {
      var asciiOnly, restored, troublemaker;

      troublemaker = {
        ascii: "hello world",
        nonascii: "안녕하세요"
      };
      asciiOnly = asciiJSON.stringify(troublemaker);
      asciiJSON.isAscii(asciiOnly).should.be["true"];
      restored = asciiJSON.parse(asciiOnly);
      return restored.should.eql(troublemaker);
    });
  });

}).call(this);
