How to use the pinkie-promise.resolve function in pinkie-promise

To help you get started, we’ve selected a few pinkie-promise 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 mauriciopoppe / generator-mnm / test / helpers / set-up-mockery.js View on Github external
mockery.registerMock('deps-object', function (deps) {
      var obj = deps.reduce(function (o, v) {
        var tok = v.split('@')
        if (tok.length === 1) tok.push('*')
        o[tok[0]] = tok[1]
        return o
      }, {})
      return Promise.resolve(obj)
    })
  })
github davidtheclark / cosmiconfig / lib / mergeExtends.js View on Github external
function mergeExtends(config, configDir) {
  if (!config.extends) {
    return Promise.resolve(config);
  }

  var extendLookups = [].concat(config.extends);
  var resultPromise = extendLookups.reduce(function(mergedConfigPromise, extendLookup) {
    return mergedConfigPromise.then(function(priorMergedConfig) {
      return loadExtendConfig(priorMergedConfig, configDir, extendLookup)
        .then(function(extendConfig) {
          return Promise.resolve(_.merge({}, priorMergedConfig, extendConfig));
        });
    });
  }, Promise.resolve(_.omit(config, 'extends')));

  return resultPromise;
}
github davidtheclark / cosmiconfig / lib / mergeExtends.js View on Github external
function mergeExtends(config, configDir) {
  if (!config.extends) {
    return Promise.resolve(config);
  }

  var extendLookups = [].concat(config.extends);
  var resultPromise = extendLookups.reduce(function(mergedConfigPromise, extendLookup) {
    return mergedConfigPromise.then(function(priorMergedConfig) {
      return loadExtendConfig(priorMergedConfig, configDir, extendLookup)
        .then(function(extendConfig) {
          return Promise.resolve(_.merge({}, priorMergedConfig, extendConfig));
        });
    });
  }, Promise.resolve(_.omit(config, 'extends')));

  return resultPromise;
}
github tadatuta / betterc / lib / async.js View on Github external
return Promise.all(realFiles.map(function(file) {
            var parsedConfig;

            try {
                parsedConfig = require(file);
                parsedConfig.__source = file;

                return Promise.resolve(parsedConfig);
            } catch (err) {
                return fsHelpers.read(file).then(function(content) {
                    parsedConfig = nodeEval('(' + content + ')');

                    parsedConfig.__source = file;
                    return parsedConfig;
                });
            }
        }));
    });
github bem / bem-sdk / packages / config / index.js View on Github external
return Promise.resolve(_thisConfigs).then(function(cfgs) {
        doSomeMagicProcedure(cfgs, cwd);

        _this._root = getConfigsRootDir(cfgs);

        return plugins.reduce(
            function(cfgsPromise, plugin) {
                return cfgsPromise.then(function(configs_) {
                    return Promise.all(configs_.map(function(config) {
                        return new Promise(function(resolve) {
                            plugin(config, configs_, options, resolve);
                        });
                    }));
                });
            },
            Promise.resolve(cfgs));
    });
};
github Graphite-Docs / graphite / node_modules / del / index.js View on Github external
return Promise.all(files.map(function (file) {
			if (!force) {
				safeCheck(file);
			}

			file = path.resolve(opts.cwd || '', file);

			if (dryRun) {
				return Promise.resolve(file);
			}

			return rimrafP(file).then(function () {
				return file;
			});
		}));
	});
github davidtheclark / cosmiconfig / lib / mergeExtends.js View on Github external
.then(function(extendConfig) {
          return Promise.resolve(_.merge({}, priorMergedConfig, extendConfig));
        });
    });
github abhaydoke09 / Deep-Learning-For-Surveillance / FrontEnd / node_modules / opn / index.js View on Github external
cp.once('error', reject);

			cp.once('close', function (code) {
				if (code > 0) {
					reject(new Error('Exited with code ' + code));
					return;
				}

				resolve(cp);
			});
		});
	}

	cp.unref();

	return Promise.resolve(cp);
};

pinkie-promise

ES2015 Promise ponyfill

MIT
Latest version published 9 years ago

Package Health Score

67 / 100
Full package analysis