From b8629f26bc72925ca4c3fe52fe9cb88d0e844d37 Mon Sep 17 00:00:00 2001 From: Greg Swindle Date: Fri, 6 Sep 2019 23:22:44 -0500 Subject: [PATCH] refactor(function): move function up Move up function assignTypeTo for reuse. #97 --- lib/factory/factory.js | 2 +- lib/factory/helpers/assign-type-to.js | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 lib/factory/helpers/assign-type-to.js diff --git a/lib/factory/factory.js b/lib/factory/factory.js index be06c46..7c0db22 100644 --- a/lib/factory/factory.js +++ b/lib/factory/factory.js @@ -1,4 +1,4 @@ -const assignTypeTo = require('./helpers/assign-type-to') +const assignTypeTo = require('../helpers/assign-type-to') const createFromFile = require('./helpers/create-from-file') const createFromObject = require('./helpers/create-from-object') const Operator = require('../operator/operator') diff --git a/lib/factory/helpers/assign-type-to.js b/lib/factory/helpers/assign-type-to.js deleted file mode 100644 index 0a47607..0000000 --- a/lib/factory/helpers/assign-type-to.js +++ /dev/null @@ -1,11 +0,0 @@ -const assignTypeTo = (instance, namespace = 'archetypes.rules') => { - Object.defineProperty(instance, 'type', { - configurable: false, - enumerable: true, - readable: true, - value: `${namespace}.${instance.name}`, - writable: false - }) -} - -module.exports = assignTypeTo