File: parse-package-name.js

package info (click to toggle)
node-yarnpkg 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 92,980 kB
  • sloc: sh: 323; makefile: 19
file content (23 lines) | stat: -rw-r--r-- 439 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* @flow */

import parsePackageName from '../../src/util/parse-package-name.js';

test('parsePackageName', () => {
  expect(parsePackageName('foo@1.2.3')).toEqual({
    name: 'foo',
    version: '1.2.3',
  });

  expect(parsePackageName('foo')).toEqual({
    name: 'foo',
  });

  expect(parsePackageName('q')).toEqual({
    name: 'q',
  });

  expect(parsePackageName('q@1.2.3')).toEqual({
    name: 'q',
    version: '1.2.3',
  });
});