Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[TOKEN.TYPE])
) {
this.position ++;
let current = this.content();
word += current;
if (current.lastIndexOf('\\') === current.length - 1) {
let next = this.nextToken;
if (next && next[TOKEN.TYPE] === tokens.space) {
word += this.requiredSpace(this.content(next));
this.position ++;
}
}
nextToken = this.nextToken;
}
const hasClass = indexesOf(word, '.').filter(i => word[i - 1] !== '\\');
let hasId = indexesOf(word, '#').filter(i => word[i - 1] !== '\\');
// Eliminate Sass interpolations from the list of id indexes
const interpolations = indexesOf(word, '#{');
if (interpolations.length) {
hasId = hasId.filter(hashIndex => !~interpolations.indexOf(hashIndex));
}
let indices = sortAsc(uniq([0, ...hasClass, ...hasId]));
indices.forEach((ind, i) => {
const index = indices[i + 1] || word.length;
const value = word.slice(ind, index);
if (i === 0 && firstCallback) {
return firstCallback.call(this, value, indices.length);
}
let node;
const current = this.currToken;
const sourceIndex = current[TOKEN.START_POS] + indices[i];
const source = getSource(
this.position ++;
let current = this.content();
word += current;
if (current.lastIndexOf('\\') === current.length - 1) {
let next = this.nextToken;
if (next && next[TOKEN.TYPE] === tokens.space) {
word += this.requiredSpace(this.content(next));
this.position ++;
}
}
nextToken = this.nextToken;
}
const hasClass = indexesOf(word, '.').filter(i => word[i - 1] !== '\\');
let hasId = indexesOf(word, '#').filter(i => word[i - 1] !== '\\');
// Eliminate Sass interpolations from the list of id indexes
const interpolations = indexesOf(word, '#{');
if (interpolations.length) {
hasId = hasId.filter(hashIndex => !~interpolations.indexOf(hashIndex));
}
let indices = sortAsc(uniq([0, ...hasClass, ...hasId]));
indices.forEach((ind, i) => {
const index = indices[i + 1] || word.length;
const value = word.slice(ind, index);
if (i === 0 && firstCallback) {
return firstCallback.call(this, value, indices.length);
}
let node;
const current = this.currToken;
const sourceIndex = current[TOKEN.START_POS] + indices[i];
const source = getSource(
current[1],
current[2] + ind,
nextToken &&
~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[TOKEN.TYPE])
) {
this.position ++;
let current = this.content();
word += current;
if (current.lastIndexOf('\\') === current.length - 1) {
let next = this.nextToken;
if (next && next[TOKEN.TYPE] === tokens.space) {
word += this.requiredSpace(this.content(next));
this.position ++;
}
}
nextToken = this.nextToken;
}
const hasClass = indexesOf(word, '.').filter(i => word[i - 1] !== '\\');
let hasId = indexesOf(word, '#').filter(i => word[i - 1] !== '\\');
// Eliminate Sass interpolations from the list of id indexes
const interpolations = indexesOf(word, '#{');
if (interpolations.length) {
hasId = hasId.filter(hashIndex => !~interpolations.indexOf(hashIndex));
}
let indices = sortAsc(uniq([0, ...hasClass, ...hasId]));
indices.forEach((ind, i) => {
const index = indices[i + 1] || word.length;
const value = word.slice(ind, index);
if (i === 0 && firstCallback) {
return firstCallback.call(this, value, indices.length);
}
let node;
const current = this.currToken;
const sourceIndex = current[TOKEN.START_POS] + indices[i];