Skip to content

Commit

Permalink
fixed for node 4 / 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Smithson committed Mar 4, 2017
1 parent a01b379 commit 526bdad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
'use strict';

const postcss = require('postcss');
const functions = require('postcss-functions');
const consistent = require('consistent');
const url = require('url');

module.exports = postcss.plugin('prefix', (options = {}) => {
module.exports = postcss.plugin('prefix', (options) => {
options = options || {};
let prefix = options.prefix || '';
const useUrl = options.useUrl || false;
const exclude = options.exclude || null;
Expand Down Expand Up @@ -31,7 +34,8 @@ module.exports = postcss.plugin('prefix', (options = {}) => {
return ring.get(path);
}

this.formatUrl = (path, includePrefix = true) => {
this.formatUrl = (path, includePrefix) => {
includePrefix = typeof includePrefix !== 'undefined' ? includePrefix : true;
const sanitizedPath = path.replace(/['"]/g, '');

if ((exclude && exclude.test(path)) || /^([a-z]+:\/\/|\/\/)/i.test(path)) {
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
"description": "Prefix URLs with CDN",
"main": "index.js",
"scripts": {
"test": "ava --fail-fast test"
"test": "ava test"
},
"keywords": [
"postcss",
"postcss-plugin",
"cdn"
"cdn",
"prefix",
"url"
],
"author": "Kevin Smithson <[email protected]>",
"repository": {
"url": "https://github.com/smitt04/postcss-prefix-url.git",
"type": "git"
},
"license": "ISC",
"dependencies": {
"consistent": "^1.1.0",
Expand Down

0 comments on commit 526bdad

Please sign in to comment.