Skip to content

Commit

Permalink
✨ Add custom janeway representation to Trail class
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Feb 10, 2024
1 parent d21602e commit aa39b2e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
30 changes: 30 additions & 0 deletions lib/trail.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,34 @@ Trail.setMethod(function extractOrEvaluate(context) {
}

return this[GET_OR_EVALUATE](context, true);
});

if (!Blast.isServer) {
return;
}

/**
* Custom Janeway representation (left side)
*
* @author Jelle De Loecker <[email protected]>
* @since 0.9.0
* @version 0.9.0
*
* @return {string}
*/
Trail.setMethod(Symbol.for('janeway_arg_left'), function janewayClassIdentifier() {
return this.constructor.name;
});

/**
* Custom Janeway representation (right side)
*
* @author Jelle De Loecker <[email protected]>
* @since 0.9.0
* @version 0.9.0
*
* @return {string}
*/
Trail.setMethod(Symbol.for('janeway_arg_right'), function janewayInstanceInfo() {
return this[CHAIN].join(' » ');
});
1 change: 0 additions & 1 deletion test/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ describe('String', function() {

source = source.trim();
let tokens = Function.tokenize(source);
console.log('Tokens:', tokens);
return tokens[0];
};

Expand Down

0 comments on commit aa39b2e

Please sign in to comment.