New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bbc/psammead-detokeniser

Package Overview
Dependencies
Maintainers
39
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bbc/psammead-detokeniser

Replaces % delimited tokens with a value from the dictionary object

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by11.11%
Maintainers
39
Weekly downloads
 
Created
Source

psammead-detokeniser - Known Vulnerabilities Dependency Status peerDependencies Status Storybook GitHub license npm version PRs Welcome

Description

The detokeniser utility operates on strings and replaces % delimited tokens with a value from the dictionary object.

Installation

npm install @bbc/psammead-detokeniser --save

Props

ArgumentTypeRequiredDefaultExample
textstringyesN/A'Foo %token%'
dictionaryobjectyesN/A{ '%token%': 'Bar' }

dictionary is an object which maps keys as tokens to values. For example, in psammead-social-embeds, all social media providers in the data are in lowercase which corresponds as the token to be interpolated into the full name. E.g. '%youtube%' -> 'YouTube'

Usage

import detokenise from "@bbc/psammead-detokeniser"

// This will return 'Duration: 20 minutes'
detokenise('Duration: %token%', { '%token%': '20 minutes' });

When to use this utility

When not to use this utility

Accessibility notes

Roadmap

Contributing

Psammead is completely open source. We are grateful for any contributions, whether they be new utilities, bug fixes or general improvements. Please see our primary contributing guide which can be found at the root of the Psammead repository.

Code of Conduct

We welcome feedback and help on this work. By participating in this project, you agree to abide by the code of conduct. Please take a moment to read it.

License

Psammead is Apache 2.0 licensed.

Keywords

FAQs

Package last updated on 10 Mar 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc