@graphql-mesh/cross-helpers 0.1.5 → 0.1.6-alpha-737fb8ff0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/browser.js +26 -0
- package/index.d.ts +4 -1
- package/index.js +3 -0
- package/package.json +2 -1
- package/promisify.js +13 -0
- package/react-native.js +18 -0
package/CHANGELOG.md
CHANGED
package/browser.js
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import path from 'path-browserify';
|
|
2
|
+
import { inspect } from '@graphql-tools/utils';
|
|
3
|
+
import { promisify } from './promisify';
|
|
2
4
|
|
|
3
5
|
export const fs = {
|
|
4
6
|
promises: {},
|
|
5
7
|
};
|
|
6
8
|
|
|
7
9
|
export { path };
|
|
10
|
+
|
|
11
|
+
const processObj =
|
|
12
|
+
typeof process !== 'undefined'
|
|
13
|
+
? process
|
|
14
|
+
: {
|
|
15
|
+
get env() {
|
|
16
|
+
try {
|
|
17
|
+
// eslint-disable-next-line no-new-func
|
|
18
|
+
return new Function('return import.meta.env')();
|
|
19
|
+
} catch {
|
|
20
|
+
return {
|
|
21
|
+
NODE_ENV: 'production',
|
|
22
|
+
platform: 'linux',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { processObj as process };
|
|
29
|
+
|
|
30
|
+
export const util = {
|
|
31
|
+
promisify,
|
|
32
|
+
inspect,
|
|
33
|
+
};
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/cross-helpers",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-alpha-737fb8ff0.0",
|
|
4
4
|
"description": "Cross Platform Helpers for GraphQL Mesh",
|
|
5
5
|
"author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",
|
|
6
6
|
"repository": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"react-native": "react-native.js",
|
|
16
16
|
"types": "index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@graphql-tools/utils": "8.6.12",
|
|
18
19
|
"react-native-fs": "2.20.0",
|
|
19
20
|
"react-native-path": "0.0.5",
|
|
20
21
|
"path-browserify": "1.0.1"
|
package/promisify.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports.promisify = function promisify(oldSchoolFn, thisContext) {
|
|
2
|
+
return function promisifiedFn(...args) {
|
|
3
|
+
return new Promise(function executor(resolve, reject) {
|
|
4
|
+
oldSchoolFn.call(thisContext, ...args, function cb(err, result) {
|
|
5
|
+
if (err) {
|
|
6
|
+
reject(err);
|
|
7
|
+
} else {
|
|
8
|
+
resolve(result);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
};
|
package/react-native.js
CHANGED
|
@@ -18,3 +18,21 @@ Promise.allSettled =
|
|
|
18
18
|
}))
|
|
19
19
|
)
|
|
20
20
|
));
|
|
21
|
+
|
|
22
|
+
module.exports.process =
|
|
23
|
+
typeof process !== 'undefined'
|
|
24
|
+
? process
|
|
25
|
+
: {
|
|
26
|
+
env: {
|
|
27
|
+
NODE_ENV: 'production',
|
|
28
|
+
},
|
|
29
|
+
platform: 'linux',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const { promisify } = require('./promisify');
|
|
33
|
+
const { inspect } = require('@graphql-tools/utils');
|
|
34
|
+
|
|
35
|
+
module.exports.util = {
|
|
36
|
+
promisify,
|
|
37
|
+
inspect,
|
|
38
|
+
};
|