Comparing version 1.10.0 to 1.10.1
@@ -41,6 +41,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
pretty: false, | ||
keepOrder: true | ||
keepOrder: true, | ||
resolve: false | ||
}, options); | ||
assert(Object.keys(ctx).length === 5, 'Unexpected Option provided!'); | ||
assert(Object.keys(ctx).length === 6, 'Unexpected Option provided!'); | ||
assert(ctx.treatAs === null || typeof ctx.treatAs === 'string'); | ||
@@ -50,2 +51,4 @@ assert(typeof ctx.mergeStrategy === 'function'); | ||
assert(typeof ctx.pretty === 'boolean'); | ||
assert(typeof ctx.keepOrder === 'boolean'); | ||
assert(typeof ctx.resolve === 'boolean'); | ||
const targetExists = fs.existsSync(filepath); | ||
@@ -59,3 +62,4 @@ | ||
const currentContent = targetExists ? smartRead(filepath, { | ||
treatAs: ctx.treatAs === null && ext === 'js' ? 'txt' : ctx.treatAs | ||
treatAs: ctx.treatAs === null && ext === 'js' ? 'txt' : ctx.treatAs, | ||
resolve: ctx.resolve | ||
}) : null; | ||
@@ -99,2 +103,2 @@ const mergedContent = currentContent == null ? content : ctx.mergeStrategy(cloneDeep(currentContent), cloneDeep(content)); | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dpYy9zbWFydC13cml0ZS5qcyJdLCJuYW1lcyI6WyJhc3NlcnQiLCJyZXF1aXJlIiwiZnMiLCJwYXRoIiwiaXNFcXVhbCIsImNsb25lRGVlcCIsImZzRXh0cmEiLCJzdHJpbmdpZnkiLCJ5YW1sIiwib2JqZWN0QWxpZ24iLCJzbWFydFJlYWQiLCJ4bWxQYXJzZXIiLCJnZXRFeHQiLCJtb2R1bGUiLCJleHBv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WFsKGN1cnJlbnRDb250ZW50LCBtZXJnZWRDb250ZW50KSkge1xuICAgIGZzRXh0cmEuZW5zdXJlRGlyU3luYyhwYXRoLmRpcm5hbWUoZmlsZXBhdGgpKTtcbiAgICBpZiAoY3R4LmtlZXBPcmRlcikge1xuICAgICAgb2JqZWN0QWxpZ24obWVyZ2VkQ29udGVudCwgY3VycmVudENvbnRlbnQpO1xuICAgIH1cbiAgICBsZXQgY29udGVudFN0cmluZztcbiAgICBzd2l0Y2ggKGN0eC50cmVhdEFzIHx8IGV4dCkge1xuICAgICAgY2FzZSAneW1sJzpcbiAgICAgIGNhc2UgJ3lhbWwnOlxuICAgICAgICBjb250ZW50U3RyaW5nID0geWFtbC5kdW1wKG1lcmdlZENvbnRlbnQpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ3htbCc6XG4gICAgICAgIGNvbnRlbnRTdHJpbmcgPSB4bWxQYXJzZXIuc3RyaW5naWZ5KG1lcmdlZENvbnRlbnQsIG9wdGlvbnMpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ2pzb24nOlxuICAgICAgICBjb250ZW50U3RyaW5nID0gYCR7Y3R4LnByZXR0eVxuICAgICAgICAgID8gc3RyaW5naWZ5KG1lcmdlZENvbnRlbnQpXG4gICAgICAgICAgOiBKU09OLnN0cmluZ2lmeShtZXJnZWRDb250ZW50LCBudWxsLCAyKX1cXG5gO1xuICAgICAgICBicmVhaztcbiAgICAgIGRlZmF1bHQ6XG4gICAgICAgIGFzc2VydChBcnJheS5pc0FycmF5KG1lcmdlZENvbnRlbnQpKTtcbiAgICAgICAgY29udGVudFN0cmluZyA9IGAke21lcmdlZENvbnRlbnQuam9pbignXFxuJyl9XFxuYDtcbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICAgIGZzLndyaXRlRmlsZVN5bmMoZmlsZXBhdGgsIGNvbnRlbnRTdHJpbmcpO1xuICAgIHJldHVybiB0cnVlO1xuICB9XG4gIHJldHVybiBmYWxzZTt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gICAgc3dpdGNoIChjdHgudHJlYXRBcyB8fCBleHQpIHtcbiAgICAgIGNhc2UgJ3ltbCc6XG4gICAgICBjYXNlICd5YW1sJzpcbiAgICAgICAgY29udGVudFN0cmluZyA9IHlhbWwuZHVtcChtZXJnZWRDb250ZW50KTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICd4bWwnOlxuICAgICAgICBjb250ZW50U3RyaW5nID0geG1sUGFyc2VyLnN0cmluZ2lmeShtZXJnZWRDb250ZW50LCBvcHRpb25zKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdqc29uJzpcbiAgICAgICAgY29udGVudFN0cmluZyA9IGAke2N0eC5wcmV0dHlcbiAgICAgICAgICA/IHN0cmluZ2lmeShtZXJnZWRDb250ZW50KVxuICAgICAgICAgIDogSlNPTi5zdHJpbmdpZnkobWVyZ2VkQ29udGVudCwgbnVsbCwgMil9XFxuYDtcbiAgICAgICAgYnJlYWs7XG4gICAgICBkZWZhdWx0OlxuICAgICAgICBhc3NlcnQoQXJyYXkuaXNBcnJheShtZXJnZWRDb250ZW50KSk7XG4gICAgICAgIGNvbnRlbnRTdHJpbmcgPSBgJHttZXJnZWRDb250ZW50LmpvaW4oJ1xcbicpfVxcbmA7XG4gICAgICAgIGJyZWFrO1xuICAgIH1cbiAgICBmcy53cml0ZUZpbGVTeW5jKGZpbGVwYXRoLCBjb250ZW50U3RyaW5nKTtcbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxuICByZXR1cm4gZmFsc2U7XG59O1xuIl19 |
{ | ||
"name": "smart-fs", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "Abstraction Layer for File Management.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -59,3 +59,3 @@ # smart-fs | ||
### smartWrite(filepath. content, options = { treatAs = null, mergeStrategy = (existing, changeset) => changeset, create = true, pretty = false, keepOrder = true }) | ||
### smartWrite(filepath. content, options = { treatAs = null, mergeStrategy = (existing, changeset) => changeset, create = true, pretty = false, keepOrder = true, resolve = false }) | ||
@@ -88,4 +88,6 @@ Serialize and write content to file based on file extension. | ||
To `resolve` the original file before overwrite merging pass the option as `true`. | ||
## 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
40795
196
92