🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

animated-number-vue

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

animated-number-vue - npm Package Compare versions

Comparing version

to
0.1.1

2

package.json
{
"name": "animated-number-vue",
"version": "0.1.0",
"version": "0.1.1",
"private": false,

@@ -5,0 +5,0 @@ "scripts": {

@@ -9,3 +9,3 @@ # animated-number-vue

![](https://media.giphy.com/media/3Fnc5buwtaxS1n0J3L/giphy.gif)
![](https://media.giphy.com/media/iMQAMgUSFrh7X2xBCZ/giphy.gif)

@@ -42,3 +42,3 @@ ## Usage

formatToPrice(value) {
return `R$ ${Number(value).toFixed(2)}`;
return `R$ ${value.toFixed(2)}`;
}

@@ -72,3 +72,3 @@ }

| --- | --- | --- | ---
| formatValue | Function | value `String` | A function that will manipulate the animated value |
| formatValue | Function | value `Number` | A function that will manipulate the animated value |
| update | Function| animation `Object` | Called at time = 0

@@ -75,0 +75,0 @@ | run | Function| animation `Object` | Called after delay is finished

@@ -60,4 +60,13 @@ import { shallow } from '@vue/test-utils';

it('should return a Number when formatValue function is passed', () => {
const formatValue = value_ => value_;
wrapper.setProps({ formatValue });
const formatedValue = wrapper.vm.formatValue(value);
expect(formatedValue).toBe(value);
expect(typeof formatedValue).toBe('number');
});
it('renders $ 10.00 when a format function is passsed', (done) => {
const formatValue = value_ => `$ ${Number(value_).toFixed(2)}`;
const formatValue = value_ => `$ ${value_.toFixed(2)}`;
wrapper.setProps({ formatValue });

@@ -128,3 +137,2 @@ setTimeout(() => {

setTimeout(() => {
console.log(counter);
expect(counter).toBeGreaterThan(30);

@@ -131,0 +139,0 @@ done();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet