@arroyodev-llc/utils.projen
Advanced tools
Comparing version 0.1.11 to 0.1.12
@@ -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 }; |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
21534
259
1
+ Added@arroyodev-llc/utils.fs@0.1.5(transitive)
- Removedreflect-metadata@^0.1.13
- Removedts-morph@^18.0.0
- Removed@arroyodev-llc/utils.fs@0.1.4(transitive)
- Removed@nodelib/fs.scandir@2.1.5(transitive)
- Removed@nodelib/fs.stat@2.0.5(transitive)
- Removed@nodelib/fs.walk@1.2.8(transitive)
- Removed@ts-morph/common@0.19.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedbraces@3.0.3(transitive)
- Removedcode-block-writer@12.0.0(transitive)
- Removedfast-glob@3.3.3(transitive)
- Removedfastq@1.18.0(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedmerge2@1.4.1(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminimatch@7.4.6(transitive)
- Removedmkdirp@2.1.6(transitive)
- Removedpath-browserify@1.0.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedqueue-microtask@1.2.3(transitive)
- Removedreflect-metadata@0.1.14(transitive)
- Removedreusify@1.0.4(transitive)
- Removedrun-parallel@1.2.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedts-morph@18.0.0(transitive)