15 lines
1.6 KiB
JavaScript
15 lines
1.6 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const lodash_1 = require("lodash");
|
|
const aliases_1 = __importDefault(require("../aliases"));
|
|
function default_1(key) {
|
|
const name = lodash_1.findKey(aliases_1.default, alias => alias.nameRe && alias.nameRe.test(key));
|
|
if (!name)
|
|
return void 0;
|
|
return { name, alias: aliases_1.default[name] };
|
|
}
|
|
exports.default = default_1;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmluZC1hbGlhcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9maW5kLWFsaWFzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbUNBQWlDO0FBQ2pDLHlEQUFpQztBQUdqQyxtQkFBeUIsR0FBRztJQUN4QixNQUFNLElBQUksR0FBRyxnQkFBTyxDQUFDLGlCQUFPLEVBQUUsS0FBSyxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsTUFBTSxJQUFJLEtBQUssQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7SUFFL0UsSUFBSSxDQUFDLElBQUk7UUFDTCxPQUFPLEtBQUssQ0FBQyxDQUFDO0lBRWxCLE9BQU8sRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLGlCQUFPLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQztBQUMxQyxDQUFDO0FBUEQsNEJBT0MiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBmaW5kS2V5IH0gZnJvbSAnbG9kYXNoJztcbmltcG9ydCBBTElBU0VTIGZyb20gJy4uL2FsaWFzZXMnO1xuXG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIChrZXkpIHtcbiAgICBjb25zdCBuYW1lID0gZmluZEtleShBTElBU0VTLCBhbGlhcyA9PiBhbGlhcy5uYW1lUmUgJiYgYWxpYXMubmFtZVJlLnRlc3Qoa2V5KSk7XG5cbiAgICBpZiAoIW5hbWUpXG4gICAgICAgIHJldHVybiB2b2lkIDA7XG5cbiAgICByZXR1cm4geyBuYW1lLCBhbGlhczogQUxJQVNFU1tuYW1lXSB9O1xufVxuIl19
|