How to use the transit-js.mapToObject function in transit-js

To help you get started, we’ve selected a few transit-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sweet-js / sweet-core / src / serializer.js View on Github external
"stx": (rep) => {
        let scopesets = transit.mapToObject(rep[1]);
        if (List.isList(rep[0])) {
          let token = rep[0];
          return new Syntax(token, {bindings, scopesets: scopesets});
        } else {
          let token = transit.mapToObject(rep[0]);
          token.type = typeMap[rep[0].get("type")];
          token.slice = rep[0].has("slice") ? transit.mapToObject(rep[0].get("slice")) : undefined;
          if (token.slice) {
            token.slice.startLocation = transit.mapToObject(token.slice.startLocation);
          }
          return new Syntax(token, {bindings, scopesets: scopesets});
        }
      },
      "symb": (rep) => {
github sweet-js / sweet-core / src / serializer.js View on Github external
"stx": (rep) => {
        let scopesets = transit.mapToObject(rep[1]);
        if (List.isList(rep[0])) {
          let token = rep[0];
          return new Syntax(token, {bindings, scopesets: scopesets});
        } else {
          let token = transit.mapToObject(rep[0]);
          token.type = typeMap[rep[0].get("type")];
          token.slice = rep[0].has("slice") ? transit.mapToObject(rep[0].get("slice")) : undefined;
          if (token.slice) {
            token.slice.startLocation = transit.mapToObject(token.slice.startLocation);
          }
          return new Syntax(token, {bindings, scopesets: scopesets});
        }
      },
      "symb": (rep) => {
github sweet-js / sweet-core / src / serializer.js View on Github external
"stx": (rep) => {
        let scopesets = transit.mapToObject(rep[1]);
        if (List.isList(rep[0])) {
          let token = rep[0];
          return new Syntax(token, {bindings, scopesets: scopesets});
        } else {
          let token = transit.mapToObject(rep[0]);
          token.type = typeMap[rep[0].get("type")];
          token.slice = rep[0].has("slice") ? transit.mapToObject(rep[0].get("slice")) : undefined;
          if (token.slice) {
            token.slice.startLocation = transit.mapToObject(token.slice.startLocation);
          }
          return new Syntax(token, {bindings, scopesets: scopesets});
        }
      },
      "symb": (rep) => {
github sweet-js / sweet-core / src / serializer.js View on Github external
"stx": (rep) => {
        let scopesets = transit.mapToObject(rep[1]);
        if (List.isList(rep[0])) {
          let token = rep[0];
          return new Syntax(token, {bindings, scopesets: scopesets});
        } else {
          let token = transit.mapToObject(rep[0]);
          token.type = typeMap[rep[0].get("type")];
          token.slice = rep[0].has("slice") ? transit.mapToObject(rep[0].get("slice")) : undefined;
          if (token.slice) {
            token.slice.startLocation = transit.mapToObject(token.slice.startLocation);
          }
          return new Syntax(token, {bindings, scopesets: scopesets});
        }
      },
      "symb": (rep) => {

transit-js

Transit is a data format and a set of libraries for conveying values between applications written in different languages. This library provides support for marshalling Transit data to/from Javascript.

Apache-2.0
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis