Socket
Socket
Sign inDemoInstall

messageformat-number-skeleton

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    messageformat-number-skeleton

A parser & formatter for ICU NumberFormat skeleton strings & patterns


Version published
Weekly downloads
11
decreased by-83.33%
Maintainers
1
Install size
74.3 kB
Created
Weekly downloads
 

Readme

Source

messageformat-number-skeleton

Tools for working with ICU NumberFormat skeletons and patterns.

import {
 getNumberFormatter,
 getNumberFormatterSource,
 NumberFormatError,
 parseNumberPattern,
 parseNumberSkeleton,
 Skeleton, // TS only
 Unit // TS only
} from 'messageformat-number-skeleton'

The package is released as an ES module only. If using from a CommonJS context, you may need to import() it, or use a module loader like esm.

Uses Intl.NumberFormat internally, including features provided by the Unified API Proposal.

Classes

ClassDescription
NumberFormatErrorBase class for errors. In addition to a code and a human-friendly message, may also includes the token stem as well as other fields.

Functions

FunctionDescription
getNumberFormatter(locales, skeleton, currency, onError)Returns a number formatter function for the given locales and number skeleton
getNumberFormatterSource(locales, skeleton, currency, onError)Returns a string of JavaScript source that evaluates to a number formatter function with the same (value: number) => string signature as the function returned by getNumberFormatter().
parseNumberPattern(src, currency, onError)Parse an ICU NumberFormatter pattern string into a Skeleton structure.
parseNumberSkeleton(src, onError)Parse an ICU NumberFormatter skeleton string into a Skeleton structure.

Interfaces

InterfaceDescription
SkeletonAn object representation of a parsed string skeleton, with token values grouped by type.

Type Aliases

Type AliasDescription
UnitMeasurement units defined by the Unicode CLDR

Messageformat is an OpenJS Foundation project, and we follow its Code of Conduct.

OpenJS Foundation

Keywords

FAQs

Last updated on 04 Apr 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc