Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gammarers/aws-resource-naming

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gammarers/aws-resource-naming - npm Package Compare versions

Comparing version 0.6.1 to 0.7.0

17

lib/index.d.ts

@@ -15,18 +15,11 @@ import * as crypto from 'crypto';

function createRandomString(value: crypto.BinaryLike, length?: number): string;
type NamingOptions = ResourceNaming.AutoNaming | ResourceNaming.DefaultNaming | {
type: ResourceNaming.NamingType.CUSTOM;
[key: string]: string;
};
function naming(autoNaming: {
[p: string]: string;
}, resourceNaming?: NamingOptions): {
names: {
[k: string]: string | undefined;
};
[k: string]: string | undefined;
};
}
interface NamingOptions {
readonly naming: ResourceNaming.AutoNaming | ResourceNaming.DefaultNaming | {
readonly type: ResourceNaming.NamingType.CUSTOM;
readonly names: {
[key: string]: string;
};
};
}
export {};

@@ -46,13 +46,17 @@ "use strict";

ResourceNaming.createRandomString = createRandomString;
// const value = getValueByKey(originalObject, key as keyof MyObject);
// function getValueByKey<K extends keyof MyObject>(obj: MyObject, key: K): MyObject[K] {
// return obj[key];
// }
//export function naming<T extends string>(resourceNaming: NamingOptions<T>, defaultNaming: {[p: string]: string | undefined}) {
function naming(autoNaming, resourceNaming) {
const names = Object.fromEntries(Object.entries(autoNaming).map(([name, value]) => {
// ResourceNaming.AutoNaming | ResourceNaming.DefaultNaming | {type: ResourceNaming.NamingType.CUSTOM; names: {[key: string]: string}}
//export function naming(autoNaming: {[p: string]: string}, resourceNaming?: NamingOptions) {
function naming(autoNaming,
// resourceNaming?: {
// naming: ResourceNaming.AutoNaming | ResourceNaming.DefaultNaming | {type: ResourceNaming.NamingType.CUSTOM; names: {[key: string]: string}};
// }) {
resourceNaming) {
return Object.fromEntries(Object.entries(autoNaming).map(([name, value]) => {
return [name, (() => {
switch (resourceNaming?.naming.type) {
switch (resourceNaming?.type) {
case ResourceNaming.NamingType.CUSTOM:
return resourceNaming.naming.names[name];
// return resourceNaming.[name as keyof {[key: string]: string}];
// return resourceNaming.names[name as keyof {[key: string]: string}];
return resourceNaming[name];
case ResourceNaming.NamingType.AUTO:

@@ -78,6 +82,11 @@ return value;

}));
return { names };
}
ResourceNaming.naming = naming;
})(ResourceNaming || (exports.ResourceNaming = ResourceNaming = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUNBQWlDO0FBRWpDLFVBQVU7QUFDViw2QkFBNkI7QUFDN0IsU0FBUztBQUVULHlCQUF5QjtBQUN6Qix3RUFBd0U7QUFDeEUsSUFBSTtBQUVKLElBQWlCLGNBQWMsQ0F3RjlCO0FBeEZELFdBQWlCLGNBQWM7SUFDN0IsSUFBWSxVQUlYO0lBSkQsV0FBWSxVQUFVO1FBQ3BCLGlDQUFtQixDQUFBO1FBQ25CLDJCQUFhLENBQUE7UUFDYiwrQkFBaUIsQ0FBQTtJQUNuQixDQUFDLEVBSlcsVUFBVSxHQUFWLHlCQUFVLEtBQVYseUJBQVUsUUFJckI7SUFlRCxtQ0FBbUM7SUFDbkMsMENBQTBDO0lBQzFDLHVDQUF1QztJQUN2Qyx1QkFBdUI7SUFDdkIsOEJBQThCO0lBQzlCLFFBQVE7SUFDUixLQUFLO0lBRUwsMEJBQTBCO0lBQzFCLHNEQUFzRDtJQUN0RCw0QkFBNEI7SUFDNUIsb0RBQW9EO0lBQ3BELGlDQUFpQztJQUNqQyx5QkFBeUI7SUFDekIsUUFBUTtJQUNSLEtBQUs7SUFFTCwwQkFBMEI7SUFDMUIsb0RBQW9EO0lBQ3BELEtBQUs7SUFFTCxvR0FBb0c7SUFDcEcscUVBQXFFO0lBQ3JFLEtBQUs7SU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yaWVzKGF1dG9OYW1pbmcpLm1hcCgoW25hbWUsIHZhbHVlXSkgPT4ge1xuICAgICAgICByZXR1cm4gW25hbWUsICgoKSA9PiB7XG4gICAgICAgICAgc3dpdGNoIChyZXNvdXJjZU5hbWluZz8ubmFtaW5nLnR5cGUpIHtcbiAgICAgICAgICAgIGNhc2UgUmVzb3VyY2VOYW1pbmcuTmFtaW5nVHlwZS5DVVNUT006XG4gICAgICAgICAgICAgIHJldHVybiByZXNvdXJjZU5hbWluZy5uYW1pbmcubmFtZXNbbmFtZSBhcyBrZXlvZiB7W2tleTogc3RyaW5nXTogc3RyaW5nfV07XG4gICAgICAgICAgICBjYXNlIFJlc291cmNlTmFtaW5nLk5hbWluZ1R5cGUuQVVUTzpcbiAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGNhc2UgUmVzb3VyY2VOYW1pbmcuTmFtaW5nVHlwZS5ERUZBVUxUOlxuICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyAgICAgICAgICBpZiAoUmVzb3VyY2VOYW1pbmcuaXNOYW1pbmdUeXBlKHJlc291cmNlTmFtaW5nLm5hbWluZy50eXBlKSkge1xuICAgICAgICAgIC8vICAgICAgICAgICAgaWYgKHJlc291cmNlTmFtaW5nLm5hbWluZy50eXBlID09PSBSZXNvdXJjZU5hbWluZy5OYW1pbmdUeXBlLkRFRkFVTFQpIHtcbiAgICAgICAgICAvLyAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgIC8vICAgICAgICAgICAgfVxuICAgICAgICAgIC8vICAgICAgICAgICAgaWYgKHJlc291cmNlTmFtaW5nLm5hbWluZy50eXBlID09PSBSZXNvdXJjZU5hbWluZy5OYW1pbmdUeXBlLk5PKSB7XG4gICAgICAgICAgLy8gICAgICAgICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgICAgLy8gICAgICAgICAgICB9XG4gICAgICAgICAgLy8gICAgICAgICAgICByZXR1cm4gcmVzb3VyY2VOYW1pbmcubmFtaW5nLm5hbWVzW25hbWUgYXMga2V5b2Yge1trZXk6IHN0cmluZ106IHN0cmluZ31dO1xuICAgICAgICAgIC8vICAgICAgICAgIH1cbiAgICAgICAgICAvLyByZXR1cm4gcmVzb3VyY2VOYW1pbmcubmFtaW5nW25hbWUgYXMga2V5b2Yge1tLIGluIFRdOiBzdHJpbmd9XTtcbiAgICAgICAgICAvLyByZXR1cm4gcmVzb3VyY2VOYW1pbmcubmFtaW5nLm5hbWVzW25hbWUgYXMga2V5b2Yge1trZXk6IHN0cmluZ106IHN0cmluZ31dO1xuXG4gICAgICAgICAgLy8gcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgfSkoKV07XG4gICAgICB9KSxcbiAgICApO1xuICAgIHJldHVybiB7IG5hbWVzIH07XG4gIH1cbn1cblxuaW50ZXJmYWNlIE5hbWluZ09wdGlvbnMge1xuICByZWFkb25seSBuYW1pbmc6IFJlc291cmNlTmFtaW5nLkF1dG9OYW1pbmcgfCBSZXNvdXJjZU5hbWluZy5EZWZhdWx0TmFtaW5nIHwge1xuICAgIHJlYWRvbmx5IHR5cGU6IFJlc291cmNlTmFtaW5nLk5hbWluZ1R5cGUuQ1VTVE9NO1xuICAgIHJlYWRvbmx5IG5hbWVzOiB7W2tleTogc3RyaW5nXTogc3RyaW5nfTtcbiAgfTtcbn0iXX0=
//interface NamingOptions {
// readonly naming: ResourceNaming.AutoNaming | ResourceNaming.DefaultNaming | {
// readonly type: ResourceNaming.NamingType.CUSTOM;
// readonly names: {[key: string]: string};
// };
//}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0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c291cmNlTmFtaW5nPy50eXBlKSB7XG4gICAgICAgICAgICBjYXNlIFJlc291cmNlTmFtaW5nLk5hbWluZ1R5cGUuQ1VTVE9NOlxuICAgICAgICAgICAgICAvLyByZXR1cm4gcmVzb3VyY2VOYW1pbmcuW25hbWUgYXMga2V5b2Yge1trZXk6IHN0cmluZ106IHN0cmluZ31dO1xuICAgICAgICAgICAgICAvLyByZXR1cm4gcmVzb3VyY2VOYW1pbmcubmFtZXNbbmFtZSBhcyBrZXlvZiB7W2tleTogc3RyaW5nXTogc3RyaW5nfV07XG4gICAgICAgICAgICAgIHJldHVybiByZXNvdXJjZU5hbWluZ1tuYW1lIGFzIGtleW9mIHsgW2tleTogc3RyaW5nXTogc3RyaW5nIH1dO1xuICAgICAgICAgICAgY2FzZSBSZXNvdXJjZU5hbWluZy5OYW1pbmdUeXBlLkFVVE86XG4gICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBjYXNlIFJlc291cmNlTmFtaW5nLk5hbWluZ1R5cGUuREVGQVVMVDpcbiAgICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gICAgICAgICAgaWYgKFJlc291cmNlTmFtaW5nLmlzTmFtaW5nVHlwZShyZXNvdXJjZU5hbWluZy5uYW1pbmcudHlwZSkpIHtcbiAgICAgICAgICAvLyAgICAgICAgICAgIGlmIChyZXNvdXJjZU5hbWluZy5uYW1pbmcudHlwZSA9PT0gUmVzb3VyY2VOYW1pbmcuTmFtaW5nVHlwZS5ERUZBVUxUKSB7XG4gICAgICAgICAgLy8gICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAvLyAgICAgICAgICAgIH1cbiAgICAgICAgICAvLyAgICAgICAgICAgIGlmIChyZXNvdXJjZU5hbWluZy5uYW1pbmcudHlwZSA9PT0gUmVzb3VyY2VOYW1pbmcuTmFtaW5nVHlwZS5OTykge1xuICAgICAgICAgIC8vICAgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICAgIC8vICAgICAgICAgICAgfVxuICAgICAgICAgIC8vICAgICAgICAgICAgcmV0dXJuIHJlc291cmNlTmFtaW5nLm5hbWluZy5uYW1lc1tuYW1lIGFzIGtleW9mIHtba2V5OiBzdHJpbmddOiBzdHJpbmd9XTtcbiAgICAgICAgICAvLyAgICAgICAgICB9XG4gICAgICAgICAgLy8gcmV0dXJuIHJlc291cmNlTmFtaW5nLm5hbWluZ1tuYW1lIGFzIGtleW9mIHtbSyBpbiBUXTogc3RyaW5nfV07XG4gICAgICAgICAgLy8gcmV0dXJuIHJlc291cmNlTmFtaW5nLm5hbWluZy5uYW1lc1tuYW1lIGFzIGtleW9mIHtba2V5OiBzdHJpbmddOiBzdHJpbmd9XTtcblxuICAgICAgICAgIC8vIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgIH0pKCldO1xuICAgICAgfSksXG4gICAgKTtcbiAgfVxufVxuXG4vL2ludGVyZmFjZSBOYW1pbmdPcHRpb25zIHtcbi8vICByZWFkb25seSBuYW1pbmc6IFJlc291cmNlTmFtaW5nLkF1dG9OYW1pbmcgfCBSZXNvdXJjZU5hbWluZy5EZWZhdWx0TmFtaW5nIHwge1xuLy8gICAgcmVhZG9ubHkgdHlwZTogUmVzb3VyY2VOYW1pbmcuTmFtaW5nVHlwZS5DVVNUT007XG4vLyAgICByZWFkb25seSBuYW1lczoge1trZXk6IHN0cmluZ106IHN0cmluZ307XG4vLyAgfTtcbi8vfSJdfQ==

@@ -67,3 +67,3 @@ {

},
"version": "0.6.1",
"version": "0.7.0",
"jest": {

@@ -70,0 +70,0 @@ "coverageProvider": "v8",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc