From eee307fab81d78a1e63ab85904eef8737edcbfdd Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Fri, 8 Mar 2024 19:45:13 +0000 Subject: [PATCH] fix the location of the shorten-version helper this will allow people to import it from guidemaker --- addon/helpers/shorten-version.js | 12 ++++++++++++ app/helpers/shorten-version.js | 9 +-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 addon/helpers/shorten-version.js diff --git a/addon/helpers/shorten-version.js b/addon/helpers/shorten-version.js new file mode 100644 index 0000000..3c4d9f9 --- /dev/null +++ b/addon/helpers/shorten-version.js @@ -0,0 +1,12 @@ +import { helper } from '@ember/component/helper'; + +export function shortenVersion([version = '']) { + return version.slice( + version.indexOf('v') + 1 || 0, + version.lastIndexOf('.') === version.indexOf('.') + ? version.length + : version.lastIndexOf('.'), + ); +} + +export default helper(shortenVersion); diff --git a/app/helpers/shorten-version.js b/app/helpers/shorten-version.js index 5c61728..9520ab7 100644 --- a/app/helpers/shorten-version.js +++ b/app/helpers/shorten-version.js @@ -1,8 +1 @@ -/* eslint-disable prettier/prettier */ -import { helper } from '@ember/component/helper'; - -export function shortenVersion([version='']) { - return version.slice(version.indexOf('v') + 1 || 0, version.lastIndexOf('.') === version.indexOf('.') ? version.length : version.lastIndexOf('.')); -} - -export default helper(shortenVersion); +export { default } from 'guidemaker/helpers/shorten-version';