node-gulp-4.0.2+~cs38.20.35/000077500000000000000000000000001415667007300150405ustar00rootroot00000000000000node-gulp-4.0.2+~cs38.20.35/.editorconfig000066400000000000000000000003051415667007300175130ustar00rootroot00000000000000# http://editorconfig.org root = true [*] indent_style = space indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false node-gulp-4.0.2+~cs38.20.35/.eslintrc000066400000000000000000000000301415667007300166550ustar00rootroot00000000000000{ "extends": "gulp" } node-gulp-4.0.2+~cs38.20.35/.jscsrc000066400000000000000000000000271415667007300163270ustar00rootroot00000000000000{ "preset": "gulp" } node-gulp-4.0.2+~cs38.20.35/.travis.yml000066400000000000000000000001711415667007300171500ustar00rootroot00000000000000sudo: false language: node_js node_js: - '6' - '5' - '4' - '0.12' - '0.10' after_script: - npm run coveralls node-gulp-4.0.2+~cs38.20.35/LICENSE000066400000000000000000000021421415667007300160440ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014 Blaine Bublitz, Eric Schoffstall and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-gulp-4.0.2+~cs38.20.35/README.md000066400000000000000000000060331415667007300163210ustar00rootroot00000000000000

# async-settle [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] Settle an async function. It will always complete successfully with an object of the resulting state. Handles completion and errors for callbacks, promises, observables and streams. Will run call the function on `nextTick`. This will cause all functions to be async. ## Usage ### Successful completion ```js var asyncSettle = require('async-settle'); asyncSettle(function(done){ // do async things done(null, 2); }, function(error, result){ // `error` will ALWAYS be null on execution of the first function. // `result` will ALWAYS be a settled object with the result or error of the first function. }); ``` ### Failed completion ```js var asyncSettle = require('async-settle'); asyncSettle(function(done){ // do async things done(new Error('Some Error Occurred')); }, function(error, result){ // `error` will ALWAYS be null on execution of the first function. // `result` will ALWAYS be a settled object with the result or error of the first function. }); ``` ## API ### `asyncSettle(fn, callback)` Takes a function to execute (`fn`) and a function to call on completion (`callback`). #### `fn([done])` Optionally takes a callback (`done`) to call when async tasks are complete. Executed in the context of [`async-done`][async-done], with all errors and results being settled. Completion is handled by [`async-done` completion and error resolution][completions]. #### `callback(error, result)` Called on completion of `fn` and recieves a settled object as the `result` argument. The `error` argument will always be `null`. #### Settled Object Settled values have two properties, `state` and `value`. `state` has two possible options `'error'` and `'success'`. `value` will be the value passed to original callback. ## License MIT [async-done]: https://github.com/gulpjs/async-done [completions]: https://github.com/gulpjs/async-done#completion-and-error-resolution [downloads-image]: http://img.shields.io/npm/dm/async-settle.svg [npm-url]: https://www.npmjs.com/package/async-settle [npm-image]: http://img.shields.io/npm/v/async-settle.svg [travis-url]: https://travis-ci.org/gulpjs/async-settle [travis-image]: http://img.shields.io/travis/gulpjs/async-settle.svg?label=travis-ci [appveyor-url]: https://ci.appveyor.com/project/gulpjs/async-settle [appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/async-settle.svg?label=appveyor [coveralls-url]: https://coveralls.io/r/gulpjs/async-settle [coveralls-image]: http://img.shields.io/coveralls/gulpjs/async-settle/master.svg [gitter-url]: https://gitter.im/gulpjs/gulp [gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg node-gulp-4.0.2+~cs38.20.35/appveyor.yml000066400000000000000000000007211415667007300174300ustar00rootroot00000000000000# http://www.appveyor.com/docs/appveyor-yml # http://www.appveyor.com/docs/lang/nodejs-iojs environment: matrix: # node.js - nodejs_version: "0.10" - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "5" - nodejs_version: "6" install: - ps: Install-Product node $env:nodejs_version - npm install test_script: - node --version - npm --version - cmd: npm test build: off # build version format version: "{build}" node-gulp-4.0.2+~cs38.20.35/index.js000066400000000000000000000005671415667007300165150ustar00rootroot00000000000000'use strict'; var asyncDone = require('async-done'); function settle(fn, done) { asyncDone(fn, function(error, result) { var settled = {}; if (error != null) { settled.state = 'error'; settled.value = error; } else { settled.state = 'success'; settled.value = result; } done(null, settled); }); } module.exports = settle; node-gulp-4.0.2+~cs38.20.35/package.json000066400000000000000000000020471415667007300173310ustar00rootroot00000000000000{ "name": "async-settle", "version": "1.0.0", "description": "Settle an async function.", "author": "Gulp Team (http://gulpjs.com/)", "contributors": [ "Blaine Bublitz " ], "repository": "gulpjs/async-settle", "license": "MIT", "engines": { "node": ">= 0.10" }, "main": "index.js", "files": [ "index.js", "LICENSE" ], "scripts": { "lint": "eslint . && jscs index.js test/", "pretest": "npm run lint", "test": "mocha --async-only", "cover": "istanbul cover _mocha --report lcovonly", "coveralls": "npm run cover && istanbul-coveralls" }, "dependencies": { "async-done": "^1.2.2" }, "devDependencies": { "eslint": "^1.7.3", "eslint-config-gulp": "^2.0.0", "expect": "^1.19.0", "istanbul": "^0.4.3", "istanbul-coveralls": "^1.0.3", "jscs": "^2.3.5", "jscs-preset-gulp": "^1.0.0", "mocha": "^2.4.5" }, "keywords": [ "settle", "async", "async-done", "complete", "error", "parallel" ] } node-gulp-4.0.2+~cs38.20.35/test/000077500000000000000000000000001415667007300160175ustar00rootroot00000000000000node-gulp-4.0.2+~cs38.20.35/test/.eslintrc000066400000000000000000000000351415667007300176410ustar00rootroot00000000000000{ "extends": "gulp/test" } node-gulp-4.0.2+~cs38.20.35/test/index.js000066400000000000000000000013731415667007300174700ustar00rootroot00000000000000'use strict'; var expect = require('expect'); var settle = require('../'); describe('asyncSettle', function() { it('should transform success into settled success values', function(done) { var val = 'value to be settled'; settle(function(done) { done(null, val); }, function(err, result) { expect(result).toInclude({ state: 'success', value: val, }); done(err); }); }); it('should transform errors into settled success values', function(done) { var error = new Error('Error to be settled'); settle(function(done) { done(error); }, function(err, result) { expect(result).toInclude({ state: 'error', value: error, }); done(err); }); }); });