@graphql-mesh/cross-helpers 0.1.6-alpha-737fb8ff0.0 → 0.1.6

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 CHANGED
@@ -1,10 +1,11 @@
1
1
  # @graphql-mesh/cross-helpers
2
2
 
3
- ## 0.1.6-alpha-737fb8ff0.0
3
+ ## 0.1.6
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 030e01d45: Support import.meta.env instead of process.env
7
+ - 3c0366d2c: - Support import.meta.env instead of process.env for browsers
8
+ - Ponyfill `util.inspect` only if it is not Node env
8
9
 
9
10
  ## 0.1.5
10
11
 
package/browser.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import path from 'path-browserify';
2
2
  import { inspect } from '@graphql-tools/utils';
3
- import { promisify } from './promisify';
4
3
 
5
4
  export const fs = {
6
5
  promises: {},
@@ -28,6 +27,18 @@ const processObj =
28
27
  export { processObj as process };
29
28
 
30
29
  export const util = {
31
- promisify,
30
+ promisify(oldSchoolFn) {
31
+ return function promisifiedFn(...args) {
32
+ return new Promise(function executor(resolve, reject) {
33
+ oldSchoolFn(...args, function cb(err, result) {
34
+ if (err) {
35
+ reject(err);
36
+ } else {
37
+ resolve(result);
38
+ }
39
+ });
40
+ });
41
+ };
42
+ },
32
43
  inspect,
33
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-mesh/cross-helpers",
3
- "version": "0.1.6-alpha-737fb8ff0.0",
3
+ "version": "0.1.6",
4
4
  "description": "Cross Platform Helpers for GraphQL Mesh",
5
5
  "author": "Arda TANRIKULU <ardatanrikulu@gmail.com>",
6
6
  "repository": {
package/react-native.js CHANGED
@@ -29,10 +29,21 @@ module.exports.process =
29
29
  platform: 'linux',
30
30
  };
31
31
 
32
- const { promisify } = require('./promisify');
33
32
  const { inspect } = require('@graphql-tools/utils');
34
33
 
35
34
  module.exports.util = {
36
- promisify,
35
+ promisify(oldSchoolFn) {
36
+ return function promisifiedFn(...args) {
37
+ return new Promise(function executor(resolve, reject) {
38
+ oldSchoolFn(...args, function cb(err, result) {
39
+ if (err) {
40
+ reject(err);
41
+ } else {
42
+ resolve(result);
43
+ }
44
+ });
45
+ });
46
+ };
47
+ },
37
48
  inspect,
38
49
  };
package/promisify.js DELETED
@@ -1,13 +0,0 @@
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
- };