All files / src/sass/utils helpers.ts

73.68% Statements 14/19
12.5% Branches 1/8
60% Functions 3/5
66.66% Lines 8/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    1x   1x     8x     1x 8x   1x 8x 8x            
import type { Syntax } from "sass";
 
export const isset = (x: unknown): boolean => x !== null && x !== undefined;
 
export const isString = (x: unknown): x is string =>
  isset(x) && (x as object).constructor === String;
 
export const isObject = (x: unknown): x is object => typeof x === "object";
 
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export const isFunction = (x: unknown): x is Function =>
  typeof x === "function";
 
export const getSyntax = (ext: string): Syntax => {
  if (ext === ".scss") {
    return "scss";
  } else Eif (ext === ".sass") {
    return "indented";
  }
  return "css";
};