-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
28 lines (22 loc) · 803 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* jshint node: true */
'use strict';
var VersionChecker = require('ember-cli-version-checker');
var hasBeenWarned = false;
module.exports = {
name: 'ember-get-helper',
init: function() {
var checker = new VersionChecker(this);
this._super.init && this._super.init.apply(this, arguments);
this._checkerForEmber = checker.for('ember', 'bower');
},
treeFor: function() {
if (this._checkerForEmber.lt('2.0.0-beta.1')) {
return this._super.treeFor.apply(this, arguments);
} else if (this.parent === this.project) {
if (!hasBeenWarned) {
console.warn('ember-get-helper is not required for Ember 2.0.0 and later (a default `get` helper is included with Ember), please remove from your `package.json`.');
hasBeenWarned = true;
}
}
}
};