Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lingui-formats

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lingui-formats - npm Package Compare versions

Comparing version 1.0.0-3 to 1.0.0-4

9

dist/index.es.js

@@ -0,6 +1,7 @@

var globalIntl = window.Intl;
function date(language) {
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
// $FlowIgnore: DateTimeFormat is member of Intl
var formatter = new Intl.DateTimeFormat(language, format);
var formatter = new globalIntl.DateTimeFormat(language, format);
return function (value) {

@@ -11,6 +12,8 @@ return formatter.format(value);

var globalIntl$1 = window.Intl;
function number(language) {
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var formatter = new Intl.NumberFormat(language, format);
var formatter = new globalIntl$1.NumberFormat(language, format);
return function (value) {

@@ -17,0 +20,0 @@ return formatter.format(value);

@@ -5,7 +5,8 @@ 'use strict';

var globalIntl = window.Intl;
function date(language) {
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
// $FlowIgnore: DateTimeFormat is member of Intl
var formatter = new Intl.DateTimeFormat(language, format);
var formatter = new globalIntl.DateTimeFormat(language, format);
return function (value) {

@@ -16,6 +17,8 @@ return formatter.format(value);

var globalIntl$1 = window.Intl;
function number(language) {
var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var formatter = new Intl.NumberFormat(language, format);
var formatter = new globalIntl$1.NumberFormat(language, format);
return function (value) {

@@ -22,0 +25,0 @@ return formatter.format(value);

{
"name": "lingui-formats",
"version": "1.0.0-3",
"version": "1.0.0-4",
"description": "Built-in formats for numbers and dates",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

// @flow
type DateFormat = string | {}
type IntlType = {|
DateTimeFormat: Function
|};
const globalIntl: IntlType = window.Intl
function date (language: string, format?: DateFormat = {}): (value: string) => string {
// $FlowIgnore: DateTimeFormat is member of Intl
const formatter = new Intl.DateTimeFormat(language, format)
const formatter = new globalIntl.DateTimeFormat(language, format)
return value => formatter.format(value)

@@ -8,0 +12,0 @@ }

// @flow
type NumberFormat = string | {}
type IntlType = {|
NumberFormat: Function
|};
const globalIntl: IntlType = window.Intl
function number (language: string, format?: NumberFormat = {}): (value: number) => string {
const formatter = new Intl.NumberFormat(language, format)
const formatter = new globalIntl.NumberFormat(language, format)
return value => formatter.format(value)

@@ -7,0 +12,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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