Skip to content

ari-party/sub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@robertsspaceindustries/sub

Template string substition

Usage

import formatString from "@robertsspaceindustries/sub";

formatString("Lorem {{ipsum}}", {
	ipsum: "Ipsum",
}); // Expected result: "Lorem Ipsum"

Custom delimiters

import formatString from "@robertsspaceindustries/sub";

formatString(
	"Lorem {ipsum}",
	{
		ipsum: "Ipsum",
	},
	{
		prefix: "{",
		suffix: "}",
	},
); // Expected result: "Lorem Ipsum"