@es-git/walkers-mixin
Advanced tools
Comparing version 0.8.3 to 0.9.0
@@ -21,1 +21,2 @@ import { Mode, Constructor, Hash } from '@es-git/core'; | ||
}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,3 +8,3 @@ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } | ||
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } | ||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } | ||
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } | ||
function fulfill(value) { resume("next", value); } | ||
@@ -16,4 +16,6 @@ function reject(value) { resume("throw", value); } | ||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | ||
var m = o[Symbol.asyncIterator]; | ||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); | ||
var m = o[Symbol.asyncIterator], i; | ||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); | ||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } | ||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } | ||
}; | ||
@@ -23,3 +25,3 @@ var __asyncDelegator = (this && this.__asyncDelegator) || function (o) { | ||
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; | ||
function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; } | ||
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } | ||
}; | ||
@@ -46,3 +48,3 @@ import { Type, isFile } from '@es-git/core'; | ||
throw new Error(`Object is not a commit ${hash}`); | ||
const visitParents = yield { hash, commit: commit.body }; | ||
const visitParents = yield yield __await({ hash, commit: commit.body }); | ||
if (visitParents === false) | ||
@@ -70,5 +72,5 @@ continue; | ||
if (isFile(mode)) { | ||
yield { mode, hash, path }; | ||
yield yield __await({ mode, hash, path }); | ||
} | ||
else if ((yield { mode, hash, path }) !== false) { | ||
else if ((yield yield __await({ mode, hash, path })) !== false) { | ||
yield __await(yield* __asyncDelegator(__asyncValues(this.walkTree(hash, path)))); | ||
@@ -82,7 +84,8 @@ } | ||
return __asyncGenerator(this, arguments, function* listFiles_1() { | ||
var e_1, _a; | ||
try { | ||
for (var _a = __asyncValues(this.walkTree(hash)), _b; _b = yield __await(_a.next()), !_b.done;) { | ||
const entry = yield __await(_b.value); | ||
for (var _b = __asyncValues(this.walkTree(hash)), _c; _c = yield __await(_b.next()), !_c.done;) { | ||
const entry = yield yield __await(__await(_c.value)); | ||
if (isFile(entry.mode)) | ||
yield entry; | ||
yield yield __await(entry); | ||
} | ||
@@ -93,7 +96,6 @@ } | ||
try { | ||
if (_b && !_b.done && (_c = _a.return)) yield __await(_c.call(_a)); | ||
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b)); | ||
} | ||
finally { if (e_1) throw e_1.error; } | ||
} | ||
var e_1, _c; | ||
}); | ||
@@ -100,0 +102,0 @@ } |
export {}; | ||
//# sourceMappingURL=index.test.d.ts.map |
223
js/index.js
@@ -118,4 +118,19 @@ "use strict"; | ||
if (!_symbol2.default.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | ||
var m = o[_symbol2.default.asyncIterator]; | ||
return m ? m.call(o) : typeof __values === "function" ? __values(o) : (0, _getIterator3.default)(o); | ||
var m = o[_symbol2.default.asyncIterator], | ||
i; | ||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : (0, _getIterator3.default)(o), i = {}, verb("next"), verb("throw"), verb("return"), i[_symbol2.default.asyncIterator] = function () { | ||
return this; | ||
}, i); | ||
function verb(n) { | ||
i[n] = o[n] && function (v) { | ||
return new _promise2.default(function (resolve, reject) { | ||
v = o[n](v), settle(resolve, reject, v.done, v.value); | ||
}); | ||
}; | ||
} | ||
function settle(resolve, reject, d, v) { | ||
_promise2.default.resolve(v).then(function (v) { | ||
resolve({ value: v, done: d }); | ||
}, reject); | ||
} | ||
}; | ||
@@ -130,5 +145,5 @@ var __asyncDelegator = undefined && undefined.__asyncDelegator || function (o) { | ||
function verb(n, f) { | ||
if (o[n]) i[n] = function (v) { | ||
i[n] = o[n] ? function (v) { | ||
return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; | ||
}; | ||
} : f; | ||
} | ||
@@ -177,3 +192,3 @@ }; | ||
if (!(queue.length > 0)) { | ||
_context.next = 48; | ||
_context.next = 50; | ||
break; | ||
@@ -215,9 +230,13 @@ } | ||
_context.next = 15; | ||
return { hash: _hash, commit: commit.body }; | ||
return __await({ hash: _hash, commit: commit.body }); | ||
case 15: | ||
_context.next = 17; | ||
return _context.sent; | ||
case 17: | ||
visitParents = _context.sent; | ||
if (!(visitParents === false)) { | ||
_context.next = 18; | ||
_context.next = 20; | ||
break; | ||
@@ -228,12 +247,12 @@ } | ||
case 18: | ||
case 20: | ||
_iteratorNormalCompletion = true; | ||
_didIteratorError = false; | ||
_iteratorError = undefined; | ||
_context.prev = 21; | ||
_context.prev = 23; | ||
_iterator = (0, _getIterator3.default)(commit.body.parents); | ||
case 23: | ||
case 25: | ||
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { | ||
_context.next = 32; | ||
_context.next = 34; | ||
break; | ||
@@ -245,30 +264,30 @@ } | ||
if (!visited.has(parent)) { | ||
_context.next = 27; | ||
_context.next = 29; | ||
break; | ||
} | ||
return _context.abrupt("continue", 29); | ||
return _context.abrupt("continue", 31); | ||
case 27: | ||
case 29: | ||
visited.add(parent); | ||
queue.push(parent); | ||
case 29: | ||
case 31: | ||
_iteratorNormalCompletion = true; | ||
_context.next = 23; | ||
_context.next = 25; | ||
break; | ||
case 32: | ||
_context.next = 38; | ||
case 34: | ||
_context.next = 40; | ||
break; | ||
case 34: | ||
_context.prev = 34; | ||
_context.t0 = _context["catch"](21); | ||
case 36: | ||
_context.prev = 36; | ||
_context.t0 = _context["catch"](23); | ||
_didIteratorError = true; | ||
_iteratorError = _context.t0; | ||
case 38: | ||
_context.prev = 38; | ||
_context.prev = 39; | ||
case 40: | ||
_context.prev = 40; | ||
_context.prev = 41; | ||
@@ -279,7 +298,7 @@ if (!_iteratorNormalCompletion && _iterator.return) { | ||
case 41: | ||
_context.prev = 41; | ||
case 43: | ||
_context.prev = 43; | ||
if (!_didIteratorError) { | ||
_context.next = 44; | ||
_context.next = 46; | ||
break; | ||
@@ -290,13 +309,13 @@ } | ||
case 44: | ||
return _context.finish(41); | ||
case 46: | ||
return _context.finish(43); | ||
case 45: | ||
return _context.finish(38); | ||
case 47: | ||
return _context.finish(40); | ||
case 46: | ||
case 48: | ||
_context.next = 2; | ||
break; | ||
case 48: | ||
case 50: | ||
case "end": | ||
@@ -306,3 +325,3 @@ return _context.stop(); | ||
} | ||
}, walkCommits_1, this, [[21, 34, 38, 46], [39,, 41, 45]]); | ||
}, walkCommits_1, this, [[23, 36, 40, 48], [41,, 43, 47]]); | ||
})); | ||
@@ -343,3 +362,3 @@ } | ||
if (!(object.type === _core.Type.tree)) { | ||
_context2.next = 46; | ||
_context2.next = 50; | ||
break; | ||
@@ -356,3 +375,3 @@ } | ||
if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { | ||
_context2.next = 32; | ||
_context2.next = 36; | ||
break; | ||
@@ -366,3 +385,3 @@ } | ||
if (!(0, _core.isFile)(mode)) { | ||
_context2.next = 20; | ||
_context2.next = 22; | ||
break; | ||
@@ -372,17 +391,25 @@ } | ||
_context2.next = 18; | ||
return { mode: mode, hash: _hash2, path: path }; | ||
return __await({ mode: mode, hash: _hash2, path: path }); | ||
case 18: | ||
_context2.next = 29; | ||
break; | ||
_context2.next = 20; | ||
return _context2.sent; | ||
case 20: | ||
_context2.next = 22; | ||
return { mode: mode, hash: _hash2, path: path }; | ||
_context2.next = 33; | ||
break; | ||
case 22: | ||
_context2.next = 24; | ||
return __await({ mode: mode, hash: _hash2, path: path }); | ||
case 24: | ||
_context2.next = 26; | ||
return _context2.sent; | ||
case 26: | ||
_context2.t0 = _context2.sent; | ||
if (!(_context2.t0 !== false)) { | ||
_context2.next = 29; | ||
_context2.next = 33; | ||
break; | ||
@@ -392,10 +419,10 @@ } | ||
_context2.t1 = __await; | ||
return _context2.delegateYield(__asyncDelegator(__asyncValues(this.walkTree(_hash2, path))), "t2", 26); | ||
return _context2.delegateYield(__asyncDelegator(__asyncValues(this.walkTree(_hash2, path))), "t2", 30); | ||
case 26: | ||
case 30: | ||
_context2.t3 = _context2.t2; | ||
_context2.next = 29; | ||
_context2.next = 33; | ||
return (0, _context2.t1)(_context2.t3); | ||
case 29: | ||
case 33: | ||
_iteratorNormalCompletion2 = true; | ||
@@ -405,8 +432,8 @@ _context2.next = 11; | ||
case 32: | ||
_context2.next = 38; | ||
case 36: | ||
_context2.next = 42; | ||
break; | ||
case 34: | ||
_context2.prev = 34; | ||
case 38: | ||
_context2.prev = 38; | ||
_context2.t4 = _context2["catch"](9); | ||
@@ -416,5 +443,5 @@ _didIteratorError2 = true; | ||
case 38: | ||
_context2.prev = 38; | ||
_context2.prev = 39; | ||
case 42: | ||
_context2.prev = 42; | ||
_context2.prev = 43; | ||
@@ -425,7 +452,7 @@ if (!_iteratorNormalCompletion2 && _iterator2.return) { | ||
case 41: | ||
_context2.prev = 41; | ||
case 45: | ||
_context2.prev = 45; | ||
if (!_didIteratorError2) { | ||
_context2.next = 44; | ||
_context2.next = 48; | ||
break; | ||
@@ -436,9 +463,9 @@ } | ||
case 44: | ||
return _context2.finish(41); | ||
case 48: | ||
return _context2.finish(45); | ||
case 45: | ||
return _context2.finish(38); | ||
case 49: | ||
return _context2.finish(42); | ||
case 46: | ||
case 50: | ||
case "end": | ||
@@ -448,3 +475,3 @@ return _context2.stop(); | ||
} | ||
}, walkTree_1, this, [[9, 34, 38, 46], [39,, 41, 45]]); | ||
}, walkTree_1, this, [[9, 38, 42, 50], [43,, 45, 49]]); | ||
})); | ||
@@ -456,3 +483,3 @@ } | ||
return __asyncGenerator(this, arguments, /*#__PURE__*/_regenerator2.default.mark(function listFiles_1() { | ||
var _a, _b, entry, e_1, _c; | ||
var e_1, _a, _b, _c, entry; | ||
@@ -464,13 +491,13 @@ return _regenerator2.default.wrap(function listFiles_1$(_context3) { | ||
_context3.prev = 0; | ||
_a = __asyncValues(this.walkTree(hash)); | ||
_b = __asyncValues(this.walkTree(hash)); | ||
case 2: | ||
_context3.next = 4; | ||
return __await(_a.next()); | ||
return __await(_b.next()); | ||
case 4: | ||
_b = _context3.sent; | ||
_c = _context3.sent; | ||
if (_b.done) { | ||
_context3.next = 14; | ||
if (_c.done) { | ||
_context3.next = 18; | ||
break; | ||
@@ -480,45 +507,53 @@ } | ||
_context3.next = 8; | ||
return __await(_b.value); | ||
return __await(__await(_c.value)); | ||
case 8: | ||
_context3.next = 10; | ||
return _context3.sent; | ||
case 10: | ||
entry = _context3.sent; | ||
if (!(0, _core.isFile)(entry.mode)) { | ||
_context3.next = 12; | ||
_context3.next = 16; | ||
break; | ||
} | ||
_context3.next = 12; | ||
return entry; | ||
_context3.next = 14; | ||
return __await(entry); | ||
case 12: | ||
case 14: | ||
_context3.next = 16; | ||
return _context3.sent; | ||
case 16: | ||
_context3.next = 2; | ||
break; | ||
case 14: | ||
_context3.next = 19; | ||
case 18: | ||
_context3.next = 23; | ||
break; | ||
case 16: | ||
_context3.prev = 16; | ||
case 20: | ||
_context3.prev = 20; | ||
_context3.t0 = _context3["catch"](0); | ||
e_1 = { error: _context3.t0 }; | ||
case 19: | ||
_context3.prev = 19; | ||
_context3.prev = 20; | ||
case 23: | ||
_context3.prev = 23; | ||
_context3.prev = 24; | ||
if (!(_b && !_b.done && (_c = _a.return))) { | ||
_context3.next = 24; | ||
if (!(_c && !_c.done && (_a = _b.return))) { | ||
_context3.next = 28; | ||
break; | ||
} | ||
_context3.next = 24; | ||
return __await(_c.call(_a)); | ||
_context3.next = 28; | ||
return __await(_a.call(_b)); | ||
case 24: | ||
_context3.prev = 24; | ||
case 28: | ||
_context3.prev = 28; | ||
if (!e_1) { | ||
_context3.next = 27; | ||
_context3.next = 31; | ||
break; | ||
@@ -529,9 +564,9 @@ } | ||
case 27: | ||
return _context3.finish(24); | ||
case 31: | ||
return _context3.finish(28); | ||
case 28: | ||
return _context3.finish(19); | ||
case 32: | ||
return _context3.finish(23); | ||
case 29: | ||
case 33: | ||
case "end": | ||
@@ -541,3 +576,3 @@ return _context3.stop(); | ||
} | ||
}, listFiles_1, this, [[0, 16, 19, 29], [20,, 24, 28]]); | ||
}, listFiles_1, this, [[0, 20, 23, 33], [24,, 28, 32]]); | ||
})); | ||
@@ -544,0 +579,0 @@ } |
{ | ||
"name": "@es-git/walkers-mixin", | ||
"version": "0.8.3", | ||
"version": "0.9.0", | ||
"description": "", | ||
@@ -42,5 +42,5 @@ "main": "js/index.js", | ||
"dependencies": { | ||
"@es-git/core": "^0.8.3", | ||
"@es-git/object-mixin": "^0.8.3" | ||
"@es-git/core": "^0.9.0", | ||
"@es-git/object-mixin": "^0.9.0" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
import { Type, Mode, Constructor, IRawRepo, Hash, isFile } from '@es-git/core'; | ||
import { IObjectRepo, GitObject, CommitObject, TreeObject, CommitBody } from '@es-git/object-mixin'; | ||
import { Type, Mode, Constructor, Hash, isFile } from '@es-git/core'; | ||
import { IObjectRepo, CommitBody } from '@es-git/object-mixin'; | ||
@@ -4,0 +4,0 @@ export type HashAndCommitBody = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86043
14
642
+ Added@es-git/core@0.9.0(transitive)
+ Added@es-git/mix@0.9.0(transitive)
+ Added@es-git/object-mixin@0.9.0(transitive)
- Removed@es-git/core@0.8.3(transitive)
- Removed@es-git/mix@0.1.2(transitive)
- Removed@es-git/object-mixin@0.8.3(transitive)
Updated@es-git/core@^0.9.0
Updated@es-git/object-mixin@^0.9.0