src/inject.js
function createInjection(fileId, categoryPrefix, declaration, idx, declarationResultHandler) {
  const fnName = `${FN_PREFIX}_${fileId}_${categoryPrefix}_${declaration.declarationClean}_${idx}`;

  const injectedFunction = function(sassValue) {
    const value = createStructuredValue(sassValue);
    declarationResultHandler(declaration, value, sassValue);
    return sassValue;
  };

  let injectedCode = `@if global_variable_exists('${declaration.declarationClean}') { 
    $${fnName}: ${fnName}(${declaration.declaration}); 
  }\n`

  return { fnName, injectedFunction, injectedCode };
}
function createInjection(fileId, categoryPrefix, declaration, idx, declarationResultHandler) {
  const fnName = `${FN_PREFIX}_${fileId}_${categoryPrefix}_${declaration.declarationClean}_${idx}`;

  const injectedFunction = function(sassValue) {
    const value = createStructuredValue(sassValue);
    declarationResultHandler(declaration, value, sassValue);
    return sassValue;
  };

  let injectedCode = `@if global_variable_exists('${declaration.declarationClean}') { 
    $${fnName}: ${fnName}(${declaration.declaration}); 
  }\n`

  return { fnName, injectedFunction, injectedCode };
}
function createInjection ( fileId , categoryPrefix , declaration , idx , declarationResultHandler ) { const fnName = ` ${ FN_PREFIX } ${ fileId } ${ categoryPrefix } ${ declaration . declarationClean } ${ idx } ` ; const injectedFunction = function ( sassValue ) { const value = createStructuredValue ( sassValue ) ; declarationResultHandler ( declaration , value , sassValue ) ; return sassValue ; } ; let injectedCode = ` ${ declaration . declarationClean } ${ fnName } ${ fnName } ${ declaration . declaration } \n ` return { fnName , injectedFunction , injectedCode } ; }
Create injection function and source for a file, category, declaration and result handler
Create injection function and source for a file category declaration and result handler