���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /proc/self/root/home/real/node-v13.0.1/deps/npm/test/tap/ |
'use strict' var test = require('tap').test var packageId = require('../../lib/utils/package-id.js') test('packageId', function (t) { t.is(packageId({package: {_id: 'abc@123'}}), 'abc@123', 'basic') t.is(packageId({_id: 'abc@123'}), 'abc@123', 'basic no tree') t.is(packageId({package: {name: 'abc', version: '123'}}), 'abc@123', 'computed') t.is(packageId({package: {_id: '@', name: 'abc', version: '123'}}), 'abc@123', 'computed, ignore invalid id') t.is(packageId({package: {name: 'abc'}}), 'abc', 'no version') t.is(packageId({package: {version: '123'}}), '!invalid#1@123', 'version, no name') t.is(packageId({package: {version: '123'}, path: '/path/to/abc'}), 'abc@123', 'version path-name') t.is(packageId({package: {version: '123'}, path: '/path/@to/abc'}), '@to/abc@123', 'version scoped-path-name') t.is(packageId({path: '/path/to/abc'}), 'abc', 'path name, no version') t.is(packageId({}), '!invalid#2', 'nothing') t.done() })