Comparing version 1.1.0 to 1.2.0
@@ -6,2 +6,3 @@ 'use strict' | ||
const lockfile = require('@yarnpkg/lockfile') | ||
const eol = require('eol') | ||
const nmtree = require('nmtree') | ||
@@ -16,3 +17,4 @@ const { buildYarnTree, buildNpmTree } = require('./lib/tree') | ||
) | ||
const yarnObject = lockfile.parse(yarnLock).object | ||
const yarnLockNormalized = eol.auto(yarnLock) | ||
const yarnObject = lockfile.parse(yarnLockNormalized).object | ||
const nodeModulesTree = nmtree(packageDir) | ||
@@ -19,0 +21,0 @@ const dependencies = buildNpmTree(nodeModulesTree, yarnObject) |
{ | ||
"name": "synp", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Convert yarn.lock to package-lock.json and vice versa", | ||
@@ -33,2 +33,3 @@ "keywords": [ | ||
"commander": "^2.11.0", | ||
"eol": "^0.9.1", | ||
"nmtree": "^1.0.3" | ||
@@ -35,0 +36,0 @@ }, |
@@ -217,2 +217,19 @@ 'use strict' | ||
test('translate yarn.lock to package-lock with crlf line ending', async t => { | ||
try { | ||
t.plan(1) | ||
const path = `${__dirname}/fixtures/yarn-crlf` | ||
const packageLock = fs.readFileSync(`${path}/.package-lock-snapshot.json`, 'utf-8') | ||
const res = yarnToNpm(path) | ||
t.deepEquals( | ||
JSON.parse(res), | ||
JSON.parse(packageLock), | ||
'result is equal to package-lock.json snapshot' | ||
) | ||
} catch (e) { | ||
t.fail(e.stack) | ||
t.end() | ||
} | ||
}) | ||
test('translate corrupted package-lock to yarn.lock', async t => { | ||
@@ -219,0 +236,0 @@ try { |
Sorry, the diff of this file is not supported yet
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
300206
47
1433
5
+ Addedeol@^0.9.1
+ Addedeol@0.9.1(transitive)