Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
literal-toast
Advanced tools
Helper for making template literal tags; combines template literal values so you don't have to
Helper for making template literal tags; combines template literal values so you don't have to
Tagged template literals are a feature of ES6/ES2015 which allows processing of template literals (template strings).
This is a little helper for zipping the literals and substitutions so your tag can operate on or return the final value of the template string without reimplementing this logic itself.
Spread the literals and substitutions from the template literal onto literalToast
;
import literalToast from 'literal-toast';
function lineReverse(literals, ...substitutions) {
return literalToast(literals, ...substitutions)
.split('\n')
.reverse()
.join('\n');
}
lineReverse`but it demonstrates what this does pretty simply.
This is a weird example,`;
// Returns:
// "This is a weird example,
// but it demonstrates what this does pretty simply."
The above example shows both the literals and substitutions for clarity, but if you don't use either parameter yourself, you can write it like this instead;
function myTag(...literalValues) {
return literalToast(...literalValues) // your logic here
}
FAQs
Helper for making template literal tags; combines template literal values so you don't have to
The npm package literal-toast receives a total of 31 weekly downloads. As such, literal-toast popularity was classified as not popular.
We found that literal-toast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.