File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @utcp/sdk" ,
3- "version" : " 1.0.15 " ,
3+ "version" : " 1.0.16 " ,
44 "description" : " Universal Tool Calling Protocol SDK" ,
55 "main" : " dist/index.cjs" ,
66 "module" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -77,12 +77,10 @@ export class DefaultVariableSubstitutor implements VariableSubstitutor {
7777 throw new Error ( `Variable namespace '${ namespace } ' contains invalid characters. Only alphanumeric characters and underscores are allowed.` ) ;
7878 }
7979
80- const objString = JSON . stringify ( obj ) ;
81- if ( objString && objString . includes ( '$ref' ) ) {
82- return obj ;
83- }
84-
8580 if ( typeof obj === 'string' ) {
81+ if ( obj . includes ( '$ref' ) ) {
82+ return obj ;
83+ }
8684 let currentString : string = obj ;
8785 const regex = / \$ \{ ( [ a - z A - Z 0 - 9 _ ] + ) \} | \$ ( [ a - z A - Z 0 - 9 _ ] + ) / g;
8886 let match : RegExpExecArray | null ;
@@ -147,6 +145,10 @@ export class DefaultVariableSubstitutor implements VariableSubstitutor {
147145 const regex = / \$ \{ ( [ a - z A - Z 0 - 9 _ ] + ) \} | \$ ( [ a - z A - Z 0 - 9 _ ] + ) / g;
148146
149147 if ( typeof obj === 'string' ) {
148+ if ( obj . includes ( '$ref' ) ) {
149+ return [ ] ;
150+ }
151+
150152 let match ;
151153 while ( ( match = regex . exec ( obj ) ) !== null ) {
152154 const varNameInTemplate = match [ 1 ] || match [ 2 ] ;
You can’t perform that action at this time.
0 commit comments