Skip to content

Conversation

@fenyagg
Copy link

@fenyagg fenyagg commented Mar 30, 2018

No description provided.

@rodneyrehm
Copy link
Member

Thanks for helping to make sass.js better :)

I think we can simplify the path splitting cases, what do you think?

function getBasePath(path, needle) {
  var pos = path.indexOf(needle);
  return pos > -1 ? path.substring(0, pos) : null;
}

var paths = [
  { input: '/foo/bar/sass.js', output: '/foo/bar' },
  { input: '/foo/bar/sass.sync.js', output: '/foo/bar' },
  { input: '/foo/bar/sass.js?cachbuster', output: '/foo/bar' },
  { input: '/foo/bar/sass.sync.js?cachbuster', output: '/foo/bar' },
];

paths.forEach(path => {
  var result = getBasePath(path.input, '/sass.js') || getBasePath(path.input, '/sass.sync.js');
  console.log(path.output === result, result);
});

@fenyagg
Copy link
Author

fenyagg commented Apr 5, 2018

yes, it better )

@fenyagg fenyagg closed this Apr 5, 2018
@rodneyrehm
Copy link
Member

did you want to update your PR?

@fenyagg
Copy link
Author

fenyagg commented Apr 5, 2018

i can a bit later

@fenyagg fenyagg reopened this Apr 5, 2018
@fenyagg fenyagg closed this Dec 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants