@pnpm/catalogs.protocol-parser
Advanced tools
@@ -5,2 +5,2 @@ /** | ||
| */ | ||
| export declare function parseCatalogProtocol(pref: string): string | 'default' | null; | ||
| export declare function parseCatalogProtocol(bareSpecifier: string): string | 'default' | null; |
@@ -9,7 +9,7 @@ "use strict"; | ||
| */ | ||
| function parseCatalogProtocol(pref) { | ||
| if (!pref.startsWith(CATALOG_PROTOCOL)) { | ||
| function parseCatalogProtocol(bareSpecifier) { | ||
| if (!bareSpecifier.startsWith(CATALOG_PROTOCOL)) { | ||
| return null; | ||
| } | ||
| const catalogNameRaw = pref.slice(CATALOG_PROTOCOL.length).trim(); | ||
| const catalogNameRaw = bareSpecifier.slice(CATALOG_PROTOCOL.length).trim(); | ||
| // Allow a specifier of 'catalog:' to be a short-hand for 'catalog:default'. | ||
@@ -16,0 +16,0 @@ const catalogNameNormalized = catalogNameRaw === '' ? 'default' : catalogNameRaw; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"parseCatalogProtocol.js","sourceRoot":"","sources":["../src/parseCatalogProtocol.ts"],"names":[],"mappings":";;AAMA,oDAWC;AAjBD,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAEnC;;;GAGG;AACH,SAAgB,oBAAoB,CAAE,IAAY;IAChD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAEjE,4EAA4E;IAC5E,MAAM,qBAAqB,GAAG,cAAc,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAA;IAEhF,OAAO,qBAAqB,CAAA;AAC9B,CAAC"} | ||
| {"version":3,"file":"parseCatalogProtocol.js","sourceRoot":"","sources":["../src/parseCatalogProtocol.ts"],"names":[],"mappings":";;AAMA,oDAWC;AAjBD,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAEnC;;;GAGG;AACH,SAAgB,oBAAoB,CAAE,aAAqB;IACzD,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAE1E,4EAA4E;IAC5E,MAAM,qBAAqB,GAAG,cAAc,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAA;IAEhF,OAAO,qBAAqB,CAAA;AAC9B,CAAC"} |
+1
-1
| The MIT License (MIT) | ||
| Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors | ||
| Copyright (c) 2016-2024 Zoltan Kochan and other contributors | ||
| Copyright (c) 2016-2025 Zoltan Kochan and other contributors | ||
@@ -6,0 +6,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+15
-15
| { | ||
| "name": "@pnpm/catalogs.protocol-parser", | ||
| "version": "1000.0.0", | ||
| "version": "1001.0.0", | ||
| "description": "Parse catalog protocol specifiers and return the catalog name.", | ||
| "main": "lib/index.js", | ||
| "types": "lib/index.d.ts", | ||
| "engines": { | ||
| "node": ">=18.12" | ||
| }, | ||
| "files": [ | ||
| "lib", | ||
| "!*.map" | ||
| ], | ||
| "repository": "https://github.com/pnpm/pnpm/blob/main/catalogs/protocol-parser", | ||
| "keywords": [ | ||
| "pnpm", | ||
| "pnpm10", | ||
| "pnpm", | ||
| "types" | ||
| ], | ||
| "license": "MIT", | ||
| "funding": "https://opencollective.com/pnpm", | ||
| "repository": "https://github.com/pnpm/pnpm/blob/main/catalogs/protocol-parser", | ||
| "homepage": "https://github.com/pnpm/pnpm/blob/main/catalogs/protocol-parser#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/pnpm/pnpm/issues" | ||
| }, | ||
| "homepage": "https://github.com/pnpm/pnpm/blob/main/catalogs/protocol-parser#readme", | ||
| "funding": "https://opencollective.com/pnpm", | ||
| "main": "lib/index.js", | ||
| "types": "lib/index.d.ts", | ||
| "exports": { | ||
| ".": "./lib/index.js" | ||
| }, | ||
| "files": [ | ||
| "lib", | ||
| "!*.map" | ||
| ], | ||
| "devDependencies": { | ||
| "@pnpm/catalogs.protocol-parser": "1000.0.0" | ||
| "@pnpm/catalogs.protocol-parser": "1001.0.0" | ||
| }, | ||
| "engines": { | ||
| "node": ">=18.12" | ||
| }, | ||
| "jest": { | ||
@@ -33,0 +33,0 @@ "preset": "@pnpm/jest-config" |
4415
0.85%