cli: fix yaml transform and add test for loading yaml

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-20 18:02:28 +02:00
parent f368ad7279
commit 1720afed04
3 changed files with 28 additions and 1 deletions
+3 -1
View File
@@ -15,6 +15,7 @@
*/
const yaml = require('yaml');
const crypto = require('crypto');
function createTransformer(config) {
const process = source => {
@@ -23,7 +24,8 @@ function createTransformer(config) {
};
const getCacheKey = sourceText => {
return createHash('md5')
return crypto
.createHash('md5')
.update(sourceText)
.update(Buffer.alloc(1))
.update(JSON.stringify(config))