You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This iterates on the spec outlined by @coreyfarrel in
#46.
For each :: separated item:
* If the item has no : then it is a commit-ish
* If the item has : then split into name and value.
* If the name is semver then do semver lookup of ref or tag
* If the name is path then use the value as the subdir to install from.
* If the name is unknown then warn that the name-value pair is being ignored.
This loop errors if duplicate values are found.
Unknown values log a warning instead of erroring.
Copy file name to clipboardexpand all lines: test/basic.js
+55
Original file line number
Diff line number
Diff line change
@@ -298,6 +298,41 @@ t.test('basic', function (t) {
298
298
raw: 'user/foo#semver:^1.2.3',
299
299
},
300
300
301
+
'user/foo#path:dist': {
302
+
name: null,
303
+
escapedName: null,
304
+
type: 'git',
305
+
saveSpec: 'github:user/foo#path:dist',
306
+
fetchSpec: null,
307
+
gitCommittish: null,
308
+
gitSubdir: '/dist',
309
+
raw: 'user/foo#path:dist',
310
+
},
311
+
312
+
'user/foo#1234::path:dist': {
313
+
name: null,
314
+
escapedName: null,
315
+
type: 'git',
316
+
saveSpec: 'github:user/foo#1234::path:dist',
317
+
fetchSpec: null,
318
+
gitCommittish: '1234',
319
+
gitRange: null,
320
+
gitSubdir: '/dist',
321
+
raw: 'user/foo#1234::path:dist',
322
+
},
323
+
324
+
'user/foo#notimplemented:value': {
325
+
name: null,
326
+
escapedName: null,
327
+
type: 'git',
328
+
saveSpec: 'github:user/foo#notimplemented:value',
329
+
fetchSpec: null,
330
+
gitCommittish: null,
331
+
gitRange: null,
332
+
gitSubdir: null,
333
+
raw: 'user/foo#notimplemented:value',
334
+
},
335
+
301
336
'git+file://path/to/repo#1.2.3': {
302
337
name: null,
303
338
escapedName: null,
@@ -705,5 +740,25 @@ t.test('error message', t => {
705
740
message: 'Invalid package name "lodash.has " of package "lodash.has @^4": name cannot contain leading or trailing spaces; name can only contain URL-friendly characters.',
0 commit comments