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

@poppinss/intl-formatter

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poppinss/intl-formatter - npm Package Compare versions

Comparing version 3.0.0-4 to 3.0.0

280

build/index.d.ts

@@ -1,1 +0,279 @@

export * as default from './src/formatters.js';
import moize from 'moize';
declare const number: moize.Moized<(locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined) => Intl.NumberFormat, Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined) => Intl.NumberFormat>;
onCacheChange: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined) => Intl.NumberFormat>;
onCacheHit: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.NumberFormatOptions | undefined) => Intl.NumberFormat>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & {
isDeepEqual: true;
}>;
declare const date: moize.Moized<(locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined) => Intl.DateTimeFormat, Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined) => Intl.DateTimeFormat>;
onCacheChange: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined) => Intl.DateTimeFormat>;
onCacheHit: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined) => Intl.DateTimeFormat>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & {
isDeepEqual: true;
}>;
declare const plural: moize.Moized<(locales?: string | string[] | undefined, options?: Intl.PluralRulesOptions | undefined) => Intl.PluralRules, Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.PluralRulesOptions | undefined) => Intl.PluralRules>;
onCacheChange: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.PluralRulesOptions | undefined) => Intl.PluralRules>;
onCacheHit: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.PluralRulesOptions | undefined) => Intl.PluralRules>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & {
isDeepEqual: true;
}>;
declare const relative: moize.Moized<(locales?: string | string[] | undefined, options?: Intl.RelativeTimeFormatOptions | undefined) => Intl.RelativeTimeFormat, Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.RelativeTimeFormatOptions | undefined) => Intl.RelativeTimeFormat>;
onCacheChange: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.RelativeTimeFormatOptions | undefined) => Intl.RelativeTimeFormat>;
onCacheHit: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.RelativeTimeFormatOptions | undefined) => Intl.RelativeTimeFormat>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & {
isDeepEqual: true;
}>;
declare const list: moize.Moized<(locales?: string | string[] | undefined, options?: Intl.ListFormatOptions | undefined) => Intl.ListFormat, Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.ListFormatOptions | undefined) => Intl.ListFormat>;
onCacheChange: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.ListFormatOptions | undefined) => Intl.ListFormat>;
onCacheHit: moize.OnCacheOperation<(locales?: string | string[] | undefined, options?: Intl.ListFormatOptions | undefined) => Intl.ListFormat>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & {
isDeepEqual: true;
}>;
declare const displayNames: moize.Moized<(locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions) => Intl.DisplayNames, Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<(locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions) => Intl.DisplayNames>;
onCacheChange: moize.OnCacheOperation<(locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions) => Intl.DisplayNames>;
onCacheHit: moize.OnCacheOperation<(locales: Intl.LocalesArgument, options: Intl.DisplayNamesOptions) => Intl.DisplayNames>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & Partial<{
isDeepEqual: boolean;
isPromise: boolean;
isReact: boolean;
isSerialized: boolean;
isShallowEqual: boolean;
matchesArg: moize.IsEqual;
matchesKey: moize.IsMatchingKey;
maxAge: number;
maxArgs: number;
maxSize: number;
onCacheAdd: moize.OnCacheOperation<moize.Moizeable>;
onCacheChange: moize.OnCacheOperation<moize.Moizeable>;
onCacheHit: moize.OnCacheOperation<moize.Moizeable>;
onExpire: moize.OnExpire;
profileName: string;
serializer: moize.Serialize;
transformArgs: moize.TransformKey;
updateCacheForKey: moize.UpdateCacheForKey;
updateExpire: boolean;
}> & {
isDeepEqual: true;
}>;
declare const formatters_date: typeof date;
declare const formatters_displayNames: typeof displayNames;
declare const formatters_list: typeof list;
declare const formatters_number: typeof number;
declare const formatters_plural: typeof plural;
declare const formatters_relative: typeof relative;
declare namespace formatters {
export {
formatters_date as date,
formatters_displayNames as displayNames,
formatters_list as list,
formatters_number as number,
formatters_plural as plural,
formatters_relative as relative,
};
}
export { formatters as default };

@@ -1,9 +0,56 @@

/*
* @poppinss/intl-formatter
*
* (c) Poppinss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export * as default from './src/formatters.js';
var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
// src/formatters.ts
var formatters_exports = {};
__export(formatters_exports, {
date: () => date,
displayNames: () => displayNames,
list: () => list,
number: () => number,
plural: () => plural,
relative: () => relative
});
import moize from "moize";
var number = moize.default(
(...args) => {
return new Intl.NumberFormat(...args);
},
{ isDeepEqual: true }
);
var date = moize.default(
(...args) => {
return new Intl.DateTimeFormat(...args);
},
{ isDeepEqual: true }
);
var plural = moize.default(
(...args) => {
return new Intl.PluralRules(...args);
},
{ isDeepEqual: true }
);
var relative = moize.default(
(...args) => {
return new Intl.RelativeTimeFormat(...args);
},
{ isDeepEqual: true }
);
var list = moize.default(
(...args) => {
return new Intl.ListFormat(...args);
},
{ isDeepEqual: true }
);
var displayNames = moize.default(
(...args) => {
return new Intl.DisplayNames(...args);
},
{ isDeepEqual: true }
);
export {
formatters_exports as default
};

38

package.json
{
"name": "@poppinss/intl-formatter",
"version": "3.0.0-4",
"version": "3.0.0",
"description": "Memoized API for Intl (To be used within Node)",

@@ -8,5 +8,3 @@ "main": "build/index.js",

"files": [
"build/src",
"build/index.d.ts",
"build/index.js"
"build"
],

@@ -20,4 +18,3 @@ "exports": {

"scripts": {
"prebenchmark": "npm run build",
"benchmark": "node build/benchmarks/date.js && node build/benchmarks/number.js && node build/benchmarks/plural.js && node build/benchmarks/relative.js && node build/benchmarks/list.js && node build/benchmarks/display_names.js",
"benchmark": "node --loader=ts-node/esm benchmarks/date.js && node --loader=ts-node/esm benchmarks/number.js && node --loader=ts-node/esm benchmarks/plural.js && node --loader=ts-node/esm benchmarks/relative.js && node --loader=ts-node/esm benchmarks/list.js && node --loader=ts-node/esm benchmarks/display_names.js",
"pretest": "npm run lint",

@@ -27,3 +24,3 @@ "test": "c8 npm run vscode:test",

"typecheck": "tsc --noEmit",
"compile": "npm run lint && npm run clean && tsc",
"compile": "npm run lint && npm run clean && tsup-node",
"build": "npm run compile",

@@ -48,12 +45,12 @@ "release": "np",

"@adonisjs/tsconfig": "^1.1.8",
"@commitlint/cli": "^17.7.1",
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@japa/assert": "^2.0.0-1",
"@japa/runner": "^3.0.0-2",
"@japa/assert": "^2.0.0",
"@japa/runner": "^3.0.1",
"@swc/core": "1.3.82",
"@types/node": "^20.6.3",
"@types/node": "^20.8.6",
"benchmark": "^2.1.4",
"c8": "^8.0.1",
"del-cli": "^5.1.0",
"eslint": "^8.50.0",
"eslint": "^8.51.0",
"github-label-sync": "^2.3.1",

@@ -64,2 +61,3 @@ "husky": "^8.0.3",

"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^5.2.2"

@@ -85,7 +83,7 @@ },

"access": "public",
"tag": "next"
"tag": "latest"
},
"np": {
"message": "chore(release): %s",
"tag": "next",
"tag": "latest",
"branch": "main",

@@ -106,3 +104,13 @@ "anyBranch": false

},
"prettier": "@adonisjs/prettier-config"
"prettier": "@adonisjs/prettier-config",
"tsup": {
"entry": [
"./index.ts"
],
"outDir": "./build",
"clean": true,
"format": "esm",
"dts": true,
"target": "esnext"
}
}

@@ -24,3 +24,3 @@ # @poppinss/intl-formatter

```ts
import { formatters } from '@poppinss/intl-formatter'
import formatters from '@poppinss/intl-formatter'

@@ -27,0 +27,0 @@ const amount = formatters

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