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

@useparagon/whiskers-core

Package Overview
Dependencies
Maintainers
7
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useparagon/whiskers-core - npm Package Compare versions

Comparing version 0.0.1-canary.18 to 0.0.1-canary.19

21

dist/utils/enums.d.ts

@@ -1,5 +0,18 @@

export declare function prefixEnumValues<T extends {
[key: string]: string;
}>(enumObject: T, prefix: string): {
[K in keyof T]: string;
/**
* Prefix and/or suffix enum values
*
* @example
*
* export enum SecretKeys {
* NPM_TOKEN = 'NPM_TOKEN',
* }
*
* export const Secrets = prefixSuffixEnumValues('secrets.', SecretKeys, '');
*
* console.log(Secrets.NPM_TOKEN) // secrets.NPM_TOKEN
*/
export declare function prefixSuffixEnumValues<TPrefix extends string, TSuffix extends string, TEnumKey extends string, TEnumValue extends string>(prefix: TPrefix, enumObj: {
[key in TEnumKey]: string;
}, suffix: TSuffix): {
[key in TEnumKey]: `${TPrefix}${TEnumValue}${TSuffix}`;
};

28

dist/utils/enums.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.prefixEnumValues = void 0;
// Helper object to prefix enum values
function prefixEnumValues(enumObject, prefix) {
return Object.keys(enumObject).reduce((acc, key) => {
acc[key] = `${prefix}${enumObject[key]}`;
return acc;
exports.prefixSuffixEnumValues = void 0;
/**
* Prefix and/or suffix enum values
*
* @example
*
* export enum SecretKeys {
* NPM_TOKEN = 'NPM_TOKEN',
* }
*
* export const Secrets = prefixSuffixEnumValues('secrets.', SecretKeys, '');
*
* console.log(Secrets.NPM_TOKEN) // secrets.NPM_TOKEN
*/
function prefixSuffixEnumValues(prefix, enumObj, suffix) {
return Object.keys(enumObj).reduce((aggregate, key) => {
return {
...aggregate,
[key]: `${prefix}${enumObj[key]}${suffix}`,
};
}, {});
}
exports.prefixEnumValues = prefixEnumValues;
exports.prefixSuffixEnumValues = prefixSuffixEnumValues;
//# sourceMappingURL=enums.js.map

@@ -10,1 +10,21 @@ /**

export declare function deepMerge<A extends object, B extends object>(a: A, b: B): A & B;
/**
* Prefix and/or suffix enum values
*
* @example
*
* export const InputsConfig {
* input_1: {
* key: value
* }
* }
*
* export const Inputs = prefixSuffixObjectKeys('inputs.', InputsConfig, '');
*
* console.log(InputRef.input_1) // inputs.input_1
*/
export declare function prefixSuffixObjectKeys<TPrefix extends string, TSuffix extends string, TEnumKey extends string>(prefix: TPrefix, obj: {
[key in TEnumKey]: any;
}, suffix: TSuffix): {
[key in TEnumKey]: `${TPrefix}${TEnumKey}${TSuffix}`;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deepMerge = exports.removeKeys = void 0;
exports.prefixSuffixObjectKeys = exports.deepMerge = exports.removeKeys = void 0;
/**

@@ -33,2 +33,26 @@ * returns an object with the specified keys removed

exports.deepMerge = deepMerge;
/**
* Prefix and/or suffix enum values
*
* @example
*
* export const InputsConfig {
* input_1: {
* key: value
* }
* }
*
* export const Inputs = prefixSuffixObjectKeys('inputs.', InputsConfig, '');
*
* console.log(InputRef.input_1) // inputs.input_1
*/
function prefixSuffixObjectKeys(prefix, obj, suffix) {
return Object.keys(obj).reduce((aggregate, key) => {
return {
...aggregate,
[key]: `${prefix}${key}${suffix}`,
};
}, {});
}
exports.prefixSuffixObjectKeys = prefixSuffixObjectKeys;
//# sourceMappingURL=objects.js.map
{
"name": "@useparagon/whiskers-core",
"version": "0.0.1-canary.18",
"version": "0.0.1-canary.19",
"bugs": "https://github.com/useparagon/whiskers/issues",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/useparagon/whiskers#readme",

Sorry, the diff of this file is not supported yet

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