![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/postcss-url/src/ |
'use strict'; const path = require('path'); const postcss = require('postcss'); const declProcessor = require('./lib/decl-processor').declProcessor; /** * * @type {Plugin} */ module.exports = postcss.plugin('postcss-url', (options) => { options = options || {}; return function(styles, result) { const opts = result.opts; const from = opts.from ? path.dirname(opts.from) : '.'; const to = opts.to ? path.dirname(opts.to) : from; styles.walkDecls((decl) => declProcessor(from, to, options, result, decl) ); }; }); /** * @callback PostcssUrl~UrlProcessor * @param {String} from from * @param {String} dirname to dirname * @param {String} oldUrl url * @param {String} to destination * @param {Object} options plugin options * @param {Object} decl postcss declaration * @return {String|undefined} new url or undefined if url is old */ /** * @typedef {Object} PostcssUrl~HashOptions * @property {Function|String} [method=^xxhash32|xxhash64] - hash name or custom function, accepting file content * @see https://github.com/pierrec/js-xxhash * @property {Number} [shrink=8] - shrink hash string */ /** * @typedef {Object} Decl - postcss decl * @see http://api.postcss.org/Declaration.html */ /** * @typedef {Object} Result - postcss result * @see http://api.postcss.org/Result.html */