perf: improve performance by 4x by simplified parseFile

- previously deprecated `getTemplate()` and `getTemplateSync()` not no longer supported
- `opts` no longer support dynamic set in `parseFile()`, `renderFile()` arguments
This commit is contained in:
harttle
2021-09-27 23:04:41 +08:00
parent 6b9f872bcc
commit 24f5346084
14 changed files with 103 additions and 151 deletions
+2 -2
View File
@@ -210,8 +210,8 @@ describe('util/strftime', function () {
expect(t(now, '%#P')).to.equal('PM')
})
it('should support : flag', () => {
const date = new Date('2016-01-04T13:15:23.000Z')
date.getTimezoneOffset = () => -480 // suppose we're in +8:00
const date = new Date('2016-01-04T13:15:23.000Z');
(timezoneOffset as any) = -480 // suppose we're in +8:00
expect(t(date, '%:z')).to.equal('+08:00')
expect(t(date, '%z')).to.equal('+0800')
})