Comparing version 1.7.9 to 1.8.0
@@ -17,2 +17,4 @@ const assert = require('assert'); | ||
const objectAlign = require('object-align'); | ||
const smartRead = require('./smart-read'); | ||
@@ -32,5 +34,6 @@ | ||
create: true, | ||
pretty: false | ||
pretty: false, | ||
keepOrder: true | ||
}, options); | ||
assert(Object.keys(ctx).length === 4, 'Unexpected Option provided!'); | ||
assert(Object.keys(ctx).length === 5, 'Unexpected Option provided!'); | ||
assert(ctx.treatAs === null || typeof ctx.treatAs === 'string'); | ||
@@ -54,2 +57,7 @@ assert(typeof ctx.mergeStrategy === 'function'); | ||
fsExtra.ensureDirSync(path.dirname(filepath)); | ||
if (ctx.keepOrder) { | ||
objectAlign(mergedContent, currentContent); | ||
} | ||
let contentString; | ||
@@ -83,2 +91,2 @@ | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dpYy9zbWFydC13cml0ZS5qcyJdLCJuYW1lcyI6WyJhc3NlcnQiLCJyZXF1aXJlIiwiZnMiLCJwYXRoIiwiaXNFcXVhbCIsImNsb25lRGVlcCIsImZzRXh0cmEiLCJzdHJpbmdpZnkiLCJ5YW1sIiwic21hcnRSZWFkIiwieG1sUGFyc2VyIiwiZ2V0RXh0IiwibW9kdWxlIiwiZXhwb3J0cyIsImZpbGVwYXRoIiwiY29udGVudCIsIm9wdGlvbnMiLCJPYmplY3QiLCJBcnJheSIsImlzQXJyYXkiLCJjdHgiLCJhc3NpZ24iLCJ0cmVhdEFzIiwibWVyZ2VTdHJhdGVneSIsImV4aXN0aW5nIiwiY2hhbmdlc2V0IiwiY3JlYXRlIiwicHJldHR5Iiwia2V5cyIsImxlbmd0aCIsInRhcmdldEV4aXN0cyIsImV4aXN0c1N5bmMiLCJleHQiLCJjdXJyZW50Q29udGVudCIsIm1lcmdlZENvbnRlbnQiLCJlbnN1cmVEaXJTeW5jIiwiZGlybmFtZSIsImNvbnRlbnRTd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eC50cmVhdEFzIHx8IGV4dCkge1xuICAgICAgY2FzZSAneW1sJzpcbiAgICAgIGNhc2UgJ3lhbWwnOlxuICAgICAgICBjb250ZW50U3RyaW5nID0geWFtbC5kdW1wKG1lcmdlZENvbnRlbnQpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ3htbCc6XG4gICAgICAgIGNvbnRlbnRTdHJpbmcgPSB4bWxQYXJzZXIuc3RyaW5naWZ5KG1lcmdlZENvbnRlbnQsIG9wdGlvbnMpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2pzb24nOlxuICAgICAgICBjb250ZW50U3RyaW5nID0gYCR7Y3R4LnByZXR0eVxuICAgICAgICAgID8gc3RyaW5naWZ5KG1lcmdlZENvbnRlbnQpXG4gICAgICAgICAgOiBKU09OLnN0cmluZ2lmeShtZXJnZWRDb250ZW50LCBudWxsLCAyKX1cXG5gO1xuICAgICAgICBicmVhaztcbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIGFzc2VydChBcnJheS5pc0FycmF5KG1lcmdlZENvbnRlbnQpKTtcbiAgICAgICAgY29udGVudFN0cmluZyA9IGAke21lcmdlZENvbnRlbnQuam9pbignXFxuJyl9XFxuYDtcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICAgIGZzLndyaXRlRmlsZVN5bmMoZmlsZXBhdGgsIGNvbnRlbnRTdHJpbmcpO1xuICAgIHJldHVybiB0cnVlO1xuICB9XG4gIHJldHVybiBmYWxzZTtcbn07XG4iXX0= |
{ | ||
"name": "smart-fs", | ||
"version": "1.7.9", | ||
"version": "1.8.0", | ||
"description": "Abstraction Layer for File Management.", | ||
@@ -44,9 +44,9 @@ "main": "lib/index.js", | ||
"@babel/register": "7.4.4", | ||
"@blackflux/eslint-plugin-rules": "1.0.16", | ||
"@blackflux/robo-config-plugin": "1.10.4", | ||
"@blackflux/eslint-plugin-rules": "1.0.18", | ||
"@blackflux/robo-config-plugin": "1.10.5", | ||
"babel-eslint": "10.0.1", | ||
"chai": "4.2.0", | ||
"coveralls": "3.0.3", | ||
"coveralls": "3.0.4", | ||
"eslint": "5.16.0", | ||
"js-gardener": "2.0.32", | ||
"js-gardener": "2.0.36", | ||
"nyc": "14.1.1", | ||
@@ -103,2 +103,3 @@ "semantic-release": "15.13.12", | ||
"lodash.isequal": "4.5.0", | ||
"object-align": "1.0.0", | ||
"xml-js": "1.6.11", | ||
@@ -105,0 +106,0 @@ "yaml-boost": "1.9.7" |
@@ -55,3 +55,3 @@ # smart-fs | ||
### smartWrite(filepath. content, options = { treatAs = null, mergeStrategy = (existing, changeset) => changeset, create = true, pretty = false }) | ||
### smartWrite(filepath. content, options = { treatAs = null, mergeStrategy = (existing, changeset) => changeset, create = true, pretty = false, keepOrder = true }) | ||
@@ -81,4 +81,7 @@ Serialize and write content to file based on file extension. | ||
When `keepOrder` is set to `true` and a file is overwritten, | ||
the new content is ordered according to the existing content (e.g. for `json` and `yml`) | ||
## Important | ||
Do not use this library for loading if you don't trust the source of the files you are loading! |
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
35234
172
86
7
+ Addedobject-align@1.0.0
+ Addedobject-align@1.0.0(transitive)