UNPKG

@serverless-guru/prettier-plugin-import-order

Version:

A prettier plugin to sort TS/JS import declarations by provided Regular Expression order

17 lines (16 loc) 563 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSortedNodesNamesAndNewlines = void 0; var getSortedNodesNamesAndNewlines = function (imports) { return imports .filter(function (i) { return i.type === 'ImportDeclaration' || i.type === 'ExpressionStatement'; }) .map(function (i) { if (i.type === 'ImportDeclaration') { return i.source.value; } else { return ''; } }); }; exports.getSortedNodesNamesAndNewlines = getSortedNodesNamesAndNewlines;