Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A plop helper that conditionally renders if an array includes a value.

License

NotificationsYou must be signed in to change notification settings

bradgarropy/plop-helper-includes

Repository files navigation

versiondownloadssizegithub actionscoveragetypescriptcontributingcontributorsdiscord

Aplop helper that determines if an array includes a value.

📦 Installation

This package is hosted onnpm.

npm install @bradgarropy/plop-helper-includes

🥑 Usage

First, be sure you haveplop installed. Then, add the following line to yourplopfile.js.

plop.load("@bradgarropy/plop-helper-includes")

Once loaded, you now have access the following helpers.

includes

Conditional template based on if an array includes a string.

input

{toppings:["pepperoni","onions"]}

helper

{{#includestoppings"pepperoni"}}    pepperoni{{else}}    no pepperoni{{/includes}}{{#includestoppings"onions"}}    onions{{else}}    no onions{{/includes}}

output

pepperonionions

❔ Questions

🐛 report bugs by filingissues
📢 provide feedback withissues or ontwitter
🙋🏼‍♂️ use myama ortwitter to ask any other questions

✨ contributors


Brad Garropy

💻📖⚠️🚇

[8]ページ先頭

©2009-2025 Movatter.jp