afformative
Advanced tools
Comparing version 0.6.0-alpha.3 to 0.6.0
@@ -84,3 +84,3 @@ declare type PrimitiveSuggestion = "primitive"; | ||
* | ||
* @deprecated Since v0.6.0. Prefer using the `.format` method instead. | ||
* @deprecated Since v0.6.0. Prefer using the `Formatter.format` method instead. | ||
*/ | ||
@@ -87,0 +87,0 @@ (props: FormatterProps<TInput>): TOutput | TPrimitiveOutput | null; |
{ | ||
"name": "afformative", | ||
"version": "0.6.0-alpha.3", | ||
"version": "0.6.0", | ||
"license": "MIT", | ||
@@ -34,3 +34,3 @@ "main": "dist/afformative.cjs.js", | ||
"sideEffects": false, | ||
"gitHead": "79f91d572671154fefa97eca63aa7fbeb7299345" | ||
"gitHead": "b5ffb3e48e19a74b2ca89af2ad7a96becbe711e7" | ||
} |
@@ -45,3 +45,3 @@ <h1 align="center"> | ||
A formatter is an object with a `.format` method. Formatters should be created solely using the `makeFormatter` factory. | ||
A formatter is an object with a `format` method. Formatters should be created solely using the `makeFormatter` factory. | ||
@@ -102,2 +102,9 @@ ```js | ||
All formatters also have the `formatAsPrimitive` method, which automatically passes the `"primitive"` suggestion in addition to all other suggestions. | ||
```js | ||
booleanFormatter.formatAsPrimitive(true) // "True" | ||
booleanFormatter.formatAsPrimitive(true, ["abbreviated"]) // "True" | ||
``` | ||
You can also pass arbitrary data to formatters as the third argument: data context. Let's use a dummy table component as an example. | ||
@@ -167,3 +174,3 @@ | ||
All formatters also expose the `.wrap` method. You can use this method to alter the behaviour of the formatter for some specific values. | ||
All formatters also expose the `wrap` method. You can use this method to alter the behaviour of the formatter for some specific values. | ||
@@ -170,0 +177,0 @@ ```js |
@@ -124,3 +124,3 @@ type PrimitiveSuggestion = "primitive" | ||
* | ||
* @deprecated Since v0.6.0. Prefer using the `.format` method instead. | ||
* @deprecated Since v0.6.0. Prefer using the `Formatter.format` method instead. | ||
*/ | ||
@@ -127,0 +127,0 @@ (props: FormatterProps<TInput>): TOutput | TPrimitiveOutput | null |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37131
199