Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 08c74e7

Browse files
parser update + simplify code
1 parent d008c81 commit 08c74e7

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"lodash.isarray": "^3.0.4",
1616
"lodash.isfunction": "^3.0.6",
1717
"lodash.isstring": "^3.0.1",
18-
"postcss-modules-parser": "^1.0.1"
18+
"postcss-modules-parser": "^1.1.0"
1919
},
2020
"devDependencies": {
2121
"babel": "^5.8.20",

‎src/index.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import identity from 'lodash.identity';
44
import extractor from './extractor';
55
import { readFileSync } from 'fs';
66
import { dirname, resolve } from 'path';
7-
import { removeQuotes } from './utility';
87
import validate from './validate';
98
import './guard';
109

@@ -42,12 +41,11 @@ export default function setup({ extensions: extraExtensions, preprocessCss, proc
4241
}
4342

4443
/**
45-
* @param {string} _to Absolute or relative path. Also can be path to the Node.JS module.
44+
* @param {string} to Absolute or relative path. Also can be path to the Node.JS module.
4645
* @param {string} from Absolute path.
4746
* @return {object}
4847
*/
49-
function fetch(_to, from) {
50-
const to = removeQuotes(_to);
48+
function fetch(to, from) {
5149
// getting absolute path to the processing file
5250
const filename = /\w/i.test(to[0])
5351
? require.resolve(to)

‎src/utility.js‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,3 @@ const check = {
1616
export function is(type, value) {
1717
return check[type](value);
1818
}
19-
20-
/**
21-
* @param {string} str
22-
* @return {string}
23-
*/
24-
export function removeQuotes(str) {
25-
return str.replace(/^["']|["']$/g, '');
26-
}

‎test/utility.js‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ok,equal } from 'assert';
2-
import { is,removeQuotes } from '../src/utility';
1+
import { ok } from 'assert';
2+
import { is } from '../src/utility';
33

44
describe('utility', () => {
55
describe('is()', () => {
@@ -15,8 +15,4 @@ describe('utility', () => {
1515

1616
it('should return false for not a string', () => ok(!is('string', null)));
1717
});
18-
19-
describe('removeQuotes()', () => {
20-
it('should remove quotes', () => equal(removeQuotes('"TEST"'), 'TEST'));
21-
});
2218
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /