postcss-normalize-url
Advanced tools
+4
-9
| { | ||
| "name": "postcss-normalize-url", | ||
| "version": "8.0.4", | ||
| "version": "9.0.0", | ||
| "description": "Normalize URLs with PostCSS", | ||
@@ -9,9 +9,3 @@ "exports": { | ||
| "default": "./src/index.js" | ||
| }, | ||
| "./src": "./src/index.js", | ||
| "./src/index": "./src/index.js", | ||
| "./src/index.js": "./src/index.js", | ||
| "./src/normalize": "./src/normalize.js", | ||
| "./src/normalize.js": "./src/normalize.js", | ||
| "./package.json": "./package.json" | ||
| } | ||
| }, | ||
@@ -56,3 +50,3 @@ "imports": { | ||
| "engines": { | ||
| "node": "^22.11.0 || ^24.11.0 || >=26.0" | ||
| "node": "^22.22.3 || ^24.15.0 || >=26.0" | ||
| }, | ||
@@ -65,2 +59,3 @@ "devDependencies": { | ||
| }, | ||
| "type": "module", | ||
| "scripts": { | ||
@@ -67,0 +62,0 @@ "test": "node --test" |
+8
-0
@@ -34,2 +34,10 @@ # [postcss][postcss]-normalize-url | ||
| ## Security | ||
| This package optimizes `url()` values for output size. It does not provide URL | ||
| validation, sanitization, or security-policy enforcement. | ||
| If CSS may originate from untrusted users, apply your URL policy to the final | ||
| output before using it in a security-sensitive context. | ||
| ## Usage | ||
@@ -36,0 +44,0 @@ |
+7
-8
@@ -1,5 +0,4 @@ | ||
| 'use strict'; | ||
| const path = require('#path'); | ||
| const valueParser = require('postcss-value-parser'); | ||
| const normalize = require('./normalize.js'); | ||
| import path from '#path'; | ||
| import valueParser from 'postcss-value-parser'; | ||
| import normalize from './normalize.js'; | ||
@@ -158,6 +157,6 @@ /** | ||
| } | ||
| /** @type {true} */ | ||
| pluginCreator.postcss = true; | ||
| const moduleExports = pluginCreator; | ||
| pluginCreator.postcss = true; | ||
| module.exports = /** @type {import('postcss').PluginCreator<void>}*/ ( | ||
| pluginCreator | ||
| ); | ||
| export { moduleExports as default, moduleExports as 'module.exports' }; |
@@ -1,5 +0,3 @@ | ||
| 'use strict'; | ||
| import path from 'node:path'; | ||
| const path = require('node:path'); | ||
| module.exports = path; | ||
| export default path; |
+6
-15
@@ -1,16 +0,7 @@ | ||
| 'use strict'; | ||
| /* | ||
| * On the web do nothing, | ||
| * since emulating the built-in Node.js looks quite brittle/ | ||
| */ | ||
| module.exports = { | ||
| /** | ||
| * | ||
| * @param {string} url | ||
| * @returns {string} | ||
| */ | ||
| normalize: function (url) { | ||
| return url; | ||
| }, | ||
| /** @param {string} url */ | ||
| export const normalize = function (url) { | ||
| return url; | ||
| }; | ||
| export default { | ||
| normalize, | ||
| }; |
+2
-7
@@ -1,2 +0,1 @@ | ||
| 'use strict'; | ||
| /* Derived from normalize-url https://github.com/sindresorhus/normalize-url/main/index.js by Sindre Sorhus */ | ||
@@ -86,6 +85,3 @@ | ||
| } | ||
| return `data:${normalizedMediaType.join(';')},${ | ||
| isBase64 ? data.trim() : data | ||
| }${hash ? `#${hash}` : ''}`; | ||
| return `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`; | ||
| } | ||
@@ -157,3 +153,2 @@ | ||
| } | ||
| module.exports = normalizeUrl; | ||
| export default normalizeUrl; |
+9
-2
@@ -1,6 +0,13 @@ | ||
| declare const _exports: import("postcss").PluginCreator<void>; | ||
| export = _exports; | ||
| export type QuotedNode = { | ||
| quote?: string; | ||
| }; | ||
| /** | ||
| * @return {import('postcss').Plugin} | ||
| */ | ||
| declare function pluginCreator(): import('postcss').Plugin; | ||
| declare namespace pluginCreator { | ||
| var postcss: true; | ||
| } | ||
| declare const moduleExports: typeof pluginCreator; | ||
| export { moduleExports as default, moduleExports as 'module.exports' }; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;AAQG,YAA8B,UAAU,GAA9B;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAY"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAOG,YAA8B,UAAU,GAA9B;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAY;AA8H3C;;GAEG;AACH,iBAAS,aAAa,IAFV,OAAO,SAAS,EAAE,MAAM,CAqBnC;kBAnBQ,aAAa;iBAoBX,IAAI;;AAEf,QAAA,MAAM,aAAa,sBAAgB,CAAC;AAEpC,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,CAAC"} |
@@ -1,3 +0,3 @@ | ||
| export = path; | ||
| import path = require('node:path'); | ||
| import path from 'node:path'; | ||
| export default path; | ||
| //# sourceMappingURL=path_normalizer.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"path_normalizer.d.ts","sourceRoot":"","sources":["../../src/lib/path_normalizer.js"],"names":[],"mappings":"SAIiB,IAAI;OAFf,IAAI,WAAW,WAAW"} | ||
| {"version":3,"file":"path_normalizer.d.ts","sourceRoot":"","sources":["../../src/lib/path_normalizer.js"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;eAEd,IAAI"} |
@@ -1,10 +0,7 @@ | ||
| declare const _exports: { | ||
| /** | ||
| * | ||
| * @param {string} url | ||
| * @returns {string} | ||
| */ | ||
| normalize: (url: string) => string; | ||
| /** @param {string} url */ | ||
| export declare const normalize: (url: string) => string; | ||
| declare const _default: { | ||
| normalize: typeof normalize; | ||
| }; | ||
| export = _exports; | ||
| export default _default; | ||
| //# sourceMappingURL=path_shim.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"path_shim.d.ts","sourceRoot":"","sources":["../../src/lib/path_shim.js"],"names":[],"mappings":";IAOE;;;;OAIG;qBAFQ,MAAM,KACJ,MAAM"} | ||
| {"version":3,"file":"path_shim.d.ts","sourceRoot":"","sources":["../../src/lib/path_shim.js"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAO,MAAM,SAAS,QADV,MAAM,WAGjB,CAAC"} |
@@ -1,2 +0,1 @@ | ||
| export = normalizeUrl; | ||
| /** | ||
@@ -7,2 +6,3 @@ * @param {string} urlString | ||
| declare function normalizeUrl(urlString: string): string; | ||
| export default normalizeUrl; | ||
| //# sourceMappingURL=normalize.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.js"],"names":[],"mappings":"SA4JiB,YAAY;AAjE7B;;;GAGG;AACH,iBAAS,YAAY,CAAC,SAAS,EAHpB,MAGoB,GAFnB,MAAM,CA6DjB"} | ||
| {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.js"],"names":[],"mappings":"AAuFA;;;GAGG;AACH,iBAAS,YAAY,CAAC,SAAS,EAHpB,MAGoB,GAFnB,MAAM,CA6DjB;eACc,YAAY"} |
13398
2.47%57
16.33%Yes
NaN299
-2.92%