diff --git a/README.md b/README.md index dc84e79..9fc2bd4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Spraypaint -JS Client for [Graphiti](https://graphiti-api.github.io/graphiti) similar to ActiveRecord. +A fork of the JS Client for [Graphiti](https://graphiti-api.github.io/graphiti), made compatible with React-Native. +This repository will be deleted if the compatibility-focused changes are merged into the main project. Written in [Typescript](https://www.typescriptlang.org) but works in plain old ES5 as well. This library is isomorphic - use it from the browser, or from the server with NodeJS. @@ -49,4 +50,4 @@ let names = data.map((p) => { return p.fullName }) console.log(names) // ['Joe Blow', 'Joe DiMaggio', ...] console.log(data[0].pets[0].name) // "Fido" -``` \ No newline at end of file +``` diff --git a/src/util/parameterize.ts b/src/util/parameterize.ts index 2c1913b..f0c6cf1 100644 --- a/src/util/parameterize.ts +++ b/src/util/parameterize.ts @@ -36,7 +36,9 @@ const parameterize = (obj: any, prefix?: string): string => { // IE does not encode by default like other browsers const maybeEncode = (value: string): string => { - const isBrowser = typeof window !== "undefined" + var isBrowser = + typeof window !== "undefined" && + typeof window.navigator.userAgent !== "undefined" const isIE = isBrowser && window.navigator.userAgent.match(/(MSIE|Trident)/) const isEncoded = typeof value === "string" && value.indexOf("%") !== -1 const shouldEncode = isBrowser && isIE && !isEncoded