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

@arroyodev-llc/utils.projen

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arroyodev-llc/utils.projen - npm Package Compare versions

Comparing version 0.1.11 to 0.1.12

106

dist/index.d.ts

@@ -1,3 +0,1 @@

import { ObjectLiteralExpression, PropertyAssignment, WriterFunction, Expression, ArrayLiteralExpression } from 'ts-morph';
import { Primitive, Schema } from 'type-fest';
import * as projen from 'projen';

@@ -18,104 +16,2 @@ import { Component, Project, TaskStep } from 'projen';

declare const applyOverrides: <T extends SupportsOverrides>(item: T, overrides: Record<string, any>) => T;
/**
* Maps simple objects to property assignments on ts-morph wrapped AST node.
* @param expression - Wrapped object literal expression node.
* @param obj - object with properties to apply.
*/
declare const addPropertyAssignmentsFromObject: <T extends object>(expression: ObjectLiteralExpression, obj: T) => PropertyAssignment[];
type Enumerable<T> = T | Array<T>;
/**
* Merge object acceptable key values.
*/
type ObjectLiteralMergeObjectValue = WriterFunction | Enumerable<Primitive | Record<string, WriterFunction | Enumerable<Primitive>>>;
/**
* {@link ArrayLiteralExpression} merge value.
*/
type ArrayLiteralMergeValue = Array<Primitive | WriterFunction | ObjectLiteralMergeObjectValue>;
/**
* {@link ObjectLiteralExpression}, {@link ArrayLiteralExpression}, primitive,
* or writer function literal merge value.
*/
type LiteralExpressionMergeValue = ObjectLiteralMergeObjectValue | ArrayLiteralMergeValue;
/**
* Create ObjectLiteral merge schema from type.
*/
type ObjectLiteralMergeSchema<T> = Schema<T, ObjectLiteralMergeObjectValue> | T;
/**
* Ensure given value is a valid initializer.
* @param value Input writer function or primitive value.
*/
declare const convertInitializer: <T extends LiteralExpressionMergeValue>(value: T) => WriterFunction | string;
/**
* Resolve appropriate default initializer for given value.
* @param value Input value.
*/
declare const defaultInitializerFor: <T extends LiteralExpressionMergeValue>(value: T) => string | WriterFunction;
/**
* Test equality between two expressions.
*
* @remarks
* Converts both expressions to strings strips all whitespace,
* quotations, and escapes. The resulting strings are then compared.
*
* @param a Left expression.
* @param b Right expression.
*/
declare const isExpressionEqual: (a: Expression | string, b: Expression | string) => boolean;
/**
* Metadata key for object array merge strategy.
*/
declare const ArrayLiteralMergeStrategy: unique symbol;
/**
* Array literal merge strategy type.
*/
declare enum ArrayLiteralMergeStrategyType {
/**
* Always append as new element.
*/
APPEND = "append",
/**
* If existing element and new element share the same index
* and they are both a collection-type, merge the two.
*/
MERGE = "merge",
/**
* If an element exists at the same index, overwrite it.
*/
OVERWRITE = "overwrite"
}
/**
* Define a merge strategy for a given element.
* @param obj Merge object in question.
* @param strategy Strategy to utilize.
*/
declare const setMergeStrategy: <T extends Object>(obj: T, strategy: ArrayLiteralMergeStrategyType) => T;
/**
* Retrieve merge strategy for given object.
* @param obj Merge object in question.
* @default {@link ArrayLiteralMergeStrategyType.APPEND}
*/
declare const getMergeStrategy: <T extends Object>(obj: T) => ArrayLiteralMergeStrategyType;
/**
* Merge array into {@link ArrayLiteralExpression}.
*
* @remarks
* Produces a concat-ed array of unique elements.
* Any writer functions will be added as-is.
*
* @param arrayLiteral {@link ArrayLiteralExpression} to merge into.
* @param value Values to merge in array literal.
*/
declare function mergeArrayLiteral(arrayLiteral: ArrayLiteralExpression, value: ArrayLiteralMergeValue): (string | WriterFunction)[];
/**
* Merge property assignment initializer.
* @param propAssign {@link PropertyAssignment} to merge into.
* @param value Value to merge with.
*/
declare function mergePropertyAssignment<T extends LiteralExpressionMergeValue>(propAssign: PropertyAssignment, value: T): void;
/**
* Deeply merge `obj` into an existing {@link ObjectLiteralExpression}
* @param expression {@link ObjectLiteralExpression} to merge into.
* @param obj Input merge object.
*/
declare function mergeObjectLiteral<T extends Record<string, any>>(expression: ObjectLiteralExpression, obj: Schema<T, LiteralExpressionMergeValue>): ObjectLiteralExpression;

@@ -163,2 +59,2 @@ /**

export { ArrayLiteralMergeStrategy, ArrayLiteralMergeStrategyType, ArrayLiteralMergeValue, Enumerable, LiteralExpressionMergeValue, ObjectLiteralMergeObjectValue, ObjectLiteralMergeSchema, ProjectName, addPropertyAssignmentsFromObject, applyOverrides, convertInitializer, cwdRelativePath, defaultInitializerFor, findComponent, findRootProject, getMergeStrategy, isComponent, isExpressionEqual, mergeArrayLiteral, mergeObjectLiteral, mergePropertyAssignment, replaceTask, setMergeStrategy };
export { ProjectName, applyOverrides, cwdRelativePath, findComponent, findRootProject, isComponent, replaceTask };

6

package.json

@@ -29,6 +29,4 @@ {

"projen": "^0.71.74",
"reflect-metadata": "^0.1.13",
"ts-morph": "^18.0.0",
"type-fest": "^3.11.0",
"@arroyodev-llc/utils.fs": "0.1.4"
"@arroyodev-llc/utils.fs": "0.1.5"
},

@@ -40,3 +38,3 @@ "main": "./dist/index.cjs",

},
"version": "0.1.11",
"version": "0.1.12",
"types": "./dist/index.d.ts",

@@ -43,0 +41,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

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