ember-cli-document-title
Advanced tools
Comparing version 0.4.0 to 1.0.0
{ | ||
"name": "ember-cli-document-title", | ||
"version": "0.4.0", | ||
"version": "1.0.0", | ||
"description": "Adding document title functionality to your ember app", | ||
@@ -25,34 +25,42 @@ "keywords": [ | ||
"build": "ember build", | ||
"lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests fastboot-tests", | ||
"lint:hbs": "ember-template-lint .", | ||
"lint:js": "eslint .", | ||
"start": "ember serve", | ||
"test": "ember try:each && ember fastboot:test" | ||
"test": "ember test && ember fastboot:test", | ||
"test:all": "ember try:each" | ||
}, | ||
"dependencies": { | ||
"ember-cli-babel": "^6.6.0" | ||
"ember-cli-babel": "^6.16.0" | ||
}, | ||
"devDependencies": { | ||
"broccoli-asset-rev": "^2.4.5", | ||
"@ember/optional-features": "^0.6.3", | ||
"broccoli-asset-rev": "^2.7.0", | ||
"chai": "^4.1.2", | ||
"ember-cli": "~2.18.0", | ||
"ember-cli-dependency-checker": "^2.0.0", | ||
"ember-cli-eslint": "^4.2.1", | ||
"ember-cli-htmlbars": "^2.0.1", | ||
"ember-cli-htmlbars-inline-precompile": "^1.0.0", | ||
"ember-cli-inject-live-reload": "^1.4.1", | ||
"ember-cli-qunit": "^4.1.1", | ||
"ember-cli-shims": "^1.2.0", | ||
"ember-cli-sri": "^2.1.0", | ||
"ember-cli-uglify": "^2.0.0", | ||
"ember-disable-prototype-extensions": "^1.1.2", | ||
"ember-ajax": "^3.1.0", | ||
"ember-cli": "~3.6.0-beta.1", | ||
"ember-cli-dependency-checker": "^3.0.0", | ||
"ember-cli-eslint": "^4.2.3", | ||
"ember-cli-htmlbars": "^3.0.0", | ||
"ember-cli-htmlbars-inline-precompile": "^1.0.3", | ||
"ember-cli-inject-live-reload": "^1.8.2", | ||
"ember-cli-sri": "^2.1.1", | ||
"ember-cli-template-lint": "^1.0.0-beta.1", | ||
"ember-cli-uglify": "^2.1.0", | ||
"ember-disable-prototype-extensions": "^1.1.3", | ||
"ember-export-application-global": "^2.0.0", | ||
"ember-fastboot-addon-tests": "^0.4.0", | ||
"ember-load-initializers": "^1.0.0", | ||
"ember-resolver": "^4.0.0", | ||
"ember-source": "~2.18.0", | ||
"eslint-plugin-ember": "^5.0.0", | ||
"eslint-plugin-node": "^5.2.1", | ||
"loader.js": "^4.2.3" | ||
"ember-fastboot-addon-tests": "^0.5.0", | ||
"ember-load-initializers": "^1.1.0", | ||
"ember-maybe-import-regenerator": "^0.1.6", | ||
"ember-qunit": "^3.4.1", | ||
"ember-resolver": "^5.0.1", | ||
"ember-source": "~3.6.0-beta.4", | ||
"ember-source-channel-url": "^1.1.0", | ||
"ember-try": "^1.0.0", | ||
"eslint-plugin-ember": "^5.2.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"loader.js": "^4.7.0", | ||
"qunit-dom": "^0.8.0" | ||
}, | ||
"engines": { | ||
"node": "^4.5 || 6.* || >= 7.*" | ||
"node": "6.* || 8.* || >= 10.*" | ||
}, | ||
@@ -59,0 +67,0 @@ "ember-addon": { |
@@ -16,3 +16,3 @@ var get = Ember.get; | ||
// defined. | ||
title: null | ||
title: null, | ||
}; | ||
@@ -61,20 +61,21 @@ | ||
var completion = Promise.resolve() | ||
.then(function() { | ||
if (typeof title === 'function') { | ||
// Wait for all tokens to resolve. It resolves immediately if all tokens are plain values (not promises). | ||
return Promise.all(tokens) | ||
.then(function(resolvedTokens) { | ||
.then(function() { | ||
if (typeof title === 'function') { | ||
// Wait for all tokens to resolve. It resolves immediately if all tokens are plain values (not promises). | ||
return Promise.all(tokens).then(function(resolvedTokens) { | ||
return title.call(self, resolvedTokens); | ||
}); | ||
} else { | ||
// Tokens aren't even considered... a string | ||
// title just sledgehammer overwrites any children tokens. | ||
return title; | ||
} | ||
}) | ||
.then(function(finalTitle) { | ||
// Stubbable fn that sets document.title | ||
self.router.setTitle(finalTitle); | ||
}); | ||
} else { | ||
// Tokens aren't even considered... a string | ||
// title just sledgehammer overwrites any children tokens. | ||
return title; | ||
} | ||
}) | ||
.then(function(finalTitle) { | ||
let router = getOwner(self).lookup('router:main'); | ||
// Stubbable fn that sets document.title | ||
router.setTitle(finalTitle); | ||
}); | ||
// Tell FastBoot about our async code | ||
@@ -85,3 +86,2 @@ var fastboot = lookupFastBoot(this); | ||
} | ||
} else { | ||
@@ -91,3 +91,3 @@ // Continue bubbling. | ||
} | ||
} | ||
}, | ||
}; | ||
@@ -115,3 +115,3 @@ | ||
} | ||
} | ||
}, | ||
}); | ||
@@ -118,0 +118,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17719
14
164
0
27
1
Updatedember-cli-babel@^6.16.0