From d254d81a96038166dc77f4c61b1220b9b10a5b39 Mon Sep 17 00:00:00 2001 From: Collin Didier Date: Mon, 27 Sep 2021 19:04:53 -0500 Subject: [PATCH 1/3] [./src/parameterize.ts] require navigator property "userAgent" is defined --- src/util/parameterize.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 From c275ae3c5886798c8b43d4d9e8f4b10a2e4d13bc Mon Sep 17 00:00:00 2001 From: Collin D Didier <67519279+CDidier80@users.noreply.github.com> Date: Tue, 28 Sep 2021 15:53:31 -0500 Subject: [PATCH 2/3] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc84e79..6d5d885 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) similar to ActiveRecord, 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 +``` From 7e25594edfcae15bb89ca851369f33d4390d61f9 Mon Sep 17 00:00:00 2001 From: Collin D Didier <67519279+CDidier80@users.noreply.github.com> Date: Tue, 28 Sep 2021 15:54:05 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d5d885..9fc2bd4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Spraypaint -A fork of the JS Client for [Graphiti](https://graphiti-api.github.io/graphiti) similar to ActiveRecord, made compatible with React-Native. +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.