feat: 초기 프로젝트 설정 및 룰.md 파일 추가

This commit is contained in:
2025-07-28 09:53:31 +09:00
commit 09a4d38512
8165 changed files with 1021855 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
"use strict";
// This replaces loadAs with a version that batches concurrent requests for
// the same hash.
module.exports = function (repo) {
var pendingReqs = {};
var loadAs = repo.loadAs;
repo.loadAs = newLoadAs;
function newLoadAs(type, hash, callback) {
if (!callback) return newLoadAs.bind(null, type, hash);
var list = pendingReqs[hash];
if (list) {
if (list.type !== type) callback(new Error("Type mismatch"));
else list.push(callback);
return;
}
list = pendingReqs[hash] = [callback];
list.type = type;
loadAs.call(repo, type, hash, function () {
delete pendingReqs[hash];
for (var i = 0, l = list.length; i < l; i++) {
list[i].apply(this, arguments);
}
});
}
};