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,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeAuthenticatorExtensions = decodeAuthenticatorExtensions;
const index_js_1 = require("./iso/index.js");
/**
* Convert authenticator extension data buffer to a proper object
*
* @param extensionData Authenticator Extension Data buffer
*/
function decodeAuthenticatorExtensions(extensionData) {
let toCBOR;
try {
toCBOR = index_js_1.isoCBOR.decodeFirst(extensionData);
}
catch (err) {
const _err = err;
throw new Error(`Error decoding authenticator extensions: ${_err.message}`);
}
return convertMapToObjectDeep(toCBOR);
}
/**
* CBOR-encoded extensions can be deeply-nested Maps, which are too deep for a simple
* `Object.entries()`. This method will recursively make sure that all Maps are converted into
* basic objects.
*/
function convertMapToObjectDeep(input) {
const mapped = {};
for (const [key, value] of input) {
if (value instanceof Map) {
mapped[key] = convertMapToObjectDeep(value);
}
else {
mapped[key] = value;
}
}
return mapped;
}