@vivareal/javascript-utils
Advanced tools
Comparing version 1.6.7 to 1.6.8
@@ -6,4 +6,15 @@ # Change Log | ||
## [1.6.8](https://github.com/grupozap/javascript/compare/@vivareal/javascript-utils@1.6.7...@vivareal/javascript-utils@1.6.8) (2020-03-09) | ||
### Performance Improvements | ||
* **javascript-utils:** improve tree-shaking ([#32](https://github.com/grupozap/javascript/issues/32)) ([3c199c2](https://github.com/grupozap/javascript/commit/3c199c2c329e06621f6428bf5d9ddfc4c1e64148)) | ||
## [1.6.7](https://github.com/grupozap/javascript/compare/@vivareal/javascript-utils@1.6.6...@vivareal/javascript-utils@1.6.7) (2020-02-18) | ||
**Note:** Version bump only for package @vivareal/javascript-utils |
@@ -7,3 +7,7 @@ 'use strict'; | ||
var dateFns = require('date-fns'); | ||
var format = _interopDefault(require('date-fns/format')); | ||
var formatRelative = _interopDefault(require('date-fns/formatRelative')); | ||
var isWithinInterval = _interopDefault(require('date-fns/isWithinInterval')); | ||
var subDays = _interopDefault(require('date-fns/subDays')); | ||
var addDays = _interopDefault(require('date-fns/addDays')); | ||
var locale = _interopDefault(require('date-fns/locale/pt-BR')); | ||
@@ -25,10 +29,10 @@ | ||
relative && | ||
dateFns.isWithinInterval(givenDate, { | ||
start: dateFns.subDays(today, 1), | ||
end: dateFns.addDays(today, 1), | ||
isWithinInterval(givenDate, { | ||
start: subDays(today, 1), | ||
end: addDays(today, 1), | ||
}); | ||
return shouldBeRelativeFormatted | ||
? uppercaseFirstLetter(dateFns.formatRelative(givenDate, today, { locale })) | ||
: dateFns.format(givenDate, dateFormat, { locale }); | ||
? uppercaseFirstLetter(formatRelative(givenDate, today, { locale })) | ||
: format(givenDate, dateFormat, { locale }); | ||
}; | ||
@@ -35,0 +39,0 @@ |
@@ -1,2 +0,6 @@ | ||
import { isWithinInterval, subDays, addDays, formatRelative, format } from 'date-fns'; | ||
import format from 'date-fns/format'; | ||
import formatRelative from 'date-fns/formatRelative'; | ||
import isWithinInterval from 'date-fns/isWithinInterval'; | ||
import subDays from 'date-fns/subDays'; | ||
import addDays from 'date-fns/addDays'; | ||
import locale from 'date-fns/locale/pt-BR'; | ||
@@ -3,0 +7,0 @@ |
{ | ||
"name": "@vivareal/javascript-utils", | ||
"version": "1.6.7", | ||
"version": "1.6.8", | ||
"description": "A set of javascript utilities", | ||
@@ -52,3 +52,3 @@ "author": "Grupo ZAP", | ||
}, | ||
"gitHead": "63b326452bd1bd1674a6620eee26b078001767a2" | ||
"gitHead": "ff996fbfadbe1a858cc4b36bc216699ad8b70dd9" | ||
} |
@@ -33,6 +33,5 @@ # **Javascript Utils** | ||
## Build | ||
Build all brands to dist folder | ||
Build to dist folder | ||
@@ -39,0 +38,0 @@ ```sh |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11518
236
0
49