Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for nested properties in an object #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ahmad44452
Copy link

Added the functionality to inject nested properties from an object. For example, for an object {platform: { username: "Ahmad" } } and the string "My name is {platform.username}" the output will be "My name is Ahmad"

Added the functionality to inject nested properties from an object. For example, for an object
{platform: { username: "Ahmad" } } and the string "My name is {platform.username}" the output will be "My name is Ahmad"
@@ -33,6 +33,27 @@ describe("replace object values based on their keys", function() {
expect(str).to.equal("My username is tjcafferkey on GitHub");
});

it("replace object values based on one nested key", function() {
var str = stringInject("My username is {profile.username}", { profile: { username: "tjcafferkey" } });
console.log(str)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this console.log please

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Removed the unnecessary log in the commit c0698b0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants