@glimmer/resolver
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -9,2 +9,17 @@ define('@glimmer/resolver', ['exports', '@glimmer/di'], function (exports, _glimmer_di) { 'use strict'; | ||
function detectLocalResolutionCollection(specifier) { | ||
var namespace = specifier.namespace, | ||
collection = specifier.collection; | ||
// Look for the local-most private collection contained in the namespace | ||
// (which will appear closest to the end of the string) | ||
var startPos = namespace.lastIndexOf('/-'); | ||
if (startPos > -1) { | ||
startPos += 2; | ||
var endPos = namespace.indexOf('/', startPos); | ||
collection = namespace.slice(startPos, endPos > -1 ? endPos : undefined); | ||
} | ||
return collection; | ||
} | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -43,3 +58,3 @@ | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
if (detectLocalResolutionCollection(s) === definitiveCollection) { | ||
/* | ||
@@ -46,0 +61,0 @@ * For specifiers with a name, try local resolution. Based on |
@@ -11,2 +11,4 @@ 'use strict'; | ||
var _specifiers = require('./utils/specifiers'); | ||
class Resolver { | ||
@@ -40,3 +42,3 @@ constructor(config, registry) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
if ((0, _specifiers.detectLocalResolutionCollection)(s) === definitiveCollection) { | ||
/* | ||
@@ -116,2 +118,2 @@ * For specifiers with a name, try local resolution. Based on | ||
exports.default = Resolver; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsQUFBTyxBQUdMLEFBQXlCLEFBQ3pCLEFBQXlCLEFBQ3pCLEFBQW9CLEFBQ3BCLEFB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AgICAgICAgcy5yb290TmFtZSA9IHIucm9vdE5hbWU7XG4gICAgICAgIHMuY29sbGVjdGlvbiA9IHIuY29sbGVjdGlvbjtcbiAgICAgICAgbGV0IGRlZmluaXRpdmVDb2xsZWN0aW9uID0gdGhpcy5fZGVmaW5pdGl2ZUNvbGxlY3Rpb24ocy50eXBlKTtcblxuICAgICAgICBpZiAoIXMubmFtZSkge1xuICAgICAgICAgIC8qXG4gICAgICAgICAgICogRm9yIHNwZWNpZmllcnMgd2l0aG91dCBhIG5hbWUgdXNlIHRoZSByZWZlcnJlcidzIG5hbWUgYW5kXG4gICAgICAgICAgICogZG8gbm90IGZhbGxiYWNrIHRvIGFueSBvdGhlciByZXNvbHV0aW9uIHJ1bGVzLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHMubmFtZXNwYWNlID0gci5uYW1lc3BhY2U7XG4gICAgICAgICAgcy5uYW1lID0gci5uYW1lO1xuICAgICAgICAgIHJldHVybiB0aGlzLl9zZXJpYWxpemVBbmRWZXJpZnkocyk7XG4gICAgICAgIH1cblxuICAgICAgICBzLm5hbWVzcGFjZSA9IHIubmFtZXNwYWNlID8gci5uYW1lc3BhY2UgKyAnLycgKyByLm5hbWUgOiByLm5hbWU7XG4gICAgICAgIGlmIChkZXRlY3RMb2NhbFJlc29sdXRpb25Db2xsZWN0aW9uKHMpID09PSBkZWZpbml0aXZlQ29sbGVjdGlvbikge1xuICAgICAgICAgIC8qXG4gICAgICAgICAgICogRm9yIHNwZWNpZmllcnMgd2l0aCBhIG5hbWUsIHRyeSBsb2NhbCByZXNvbHV0aW9uLiBCYXNlZCBvblxuICAgICAgICAgICAqIHRoZSByZWZlcnJlci5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAocmVzdWx0ID0gdGhpcy5fc2VyaWFsaXplQW5kVmVyaWZ5KHMpKSB7IHJldHVybiByZXN1bHQ7IH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIExvb2sgZm9yIGEgcHJpdmF0ZSB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| ||
var _specifiers = require('./utils/specifiers'); | ||
function _classCallCheck(instance, Constructor) { | ||
@@ -49,3 +51,3 @@ if (!(instance instanceof Constructor)) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
if ((0, _specifiers.detectLocalResolutionCollection)(s) === definitiveCollection) { | ||
/* | ||
@@ -132,2 +134,2 @@ * For specifiers with a name, try local resolution. Based on | ||
exports.default = Resolver; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsQUFBTyxBQUdMLEFBQXlCLEFBQ3pCLEFBQXlCLEFBQ3pCLEFBQW9CLEFBQ3BCLEFBQWtCLEFBQ25CLEFBQU0sQUFBYSxBQUFDOztBQUNyQixBQUFPLEFBQUUsQUFBTSxBQUFFLEFBQU0sQUFBZSxBQUFDLEFBSXZDLEFBQU0sQUFBQyxBQUFPOzs7Ozs7OzsyQkFJWjtzQkFBWSxBQUE2QixRQUFFLEFBQXdCOzhCQUNqRSxBQUFJOzthQUFDLEFBQU0sU0FBRyxBQUFNLEFBQUMsQUFDckIsQUFBSTthQUFDLEFBQVEsV0FBRyxBQUFRLEFBQUMsQUFDM0IsQUFBQzs7O3VCQUVELEFBQVEsNkJBQUMsQUFBaUIsV0FBRSxBQUFpQixVQUMzQyxBQUFFLEFBQUM7WUFBQyxBQUF5QixtQ0FBQyxBQUFTLEFBQUMsQUFBQyxZQUFDLEFBQUMsQUFDekMsQUFBTTttQkFBQyxBQUFTLEFBQUMsQUFDbkIsQUFBQztBQUVEO1lBQUksQUFBQyxJQUFHLEFBQW9CLDhCQUFDLEFBQVMsQUFBQyxBQUFDLEFBQ3hDO1lBQUksQUFBYyxBQUFDLGNBRW5C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9XG5cbiAgcHJpdmF0ZSBfZGVmaW5pdGl2ZUNvbGxlY3Rpb24odHlwZTogc3RyaW5nKTogc3RyaW5nIHtcbiAgICBsZXQgdHlwZURlZiA9IHRoaXMuY29uZmlnLnR5cGVzW3R5cGVdO1xuICAgIGFzc2VydChgJyR7dHlwZX0nIGlzIG5vdCBhIHJlY29nbml6ZWQgdHlwZWAsIHR5cGVEZWYpO1xuICAgIHJldHVybiB0eXBlRGVmLmRlZmluaXRpdmVDb2xsZWN0aW9uO1xuICB9XG5cbiAgcHJpdmF0ZSBfc2VyaWFsaXplQW5kVmVyaWZ5KHNwZWNpZmllcjogU3BlY2lmaWVyKTogc3RyaW5nIHtcbiAgICBsZXQgc2VyaWFsaXplZCA9IHNlcmlhbGl6ZVNwZWNpZmllcihzcGVjaWZpZXIpO1xuICAgIGlmICh0aGlzLnJlZ2lzdHJ5LmhhcyhzZXJpYWxpemVkKSkge1xuICAgICAgcmV0dXJuIHNlcmlhbGl6ZWQ7XG4gICAgfVxuICB9XG59XG4iXX0= |
import { isSpecifierStringAbsolute, isSpecifierObjectAbsolute, deserializeSpecifier, serializeSpecifier } from '@glimmer/di'; | ||
import { assert } from './utils/debug'; | ||
import { detectLocalResolutionCollection } from './utils/specifiers'; | ||
export default class Resolver { | ||
@@ -31,3 +32,3 @@ constructor(config, registry) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
if (detectLocalResolutionCollection(s) === definitiveCollection) { | ||
/* | ||
@@ -108,2 +109,2 @@ * For specifiers with a name, try local resolution. Based on | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUdMLHlCQUF5QixFQUN6Qix5QkFBeUIsR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9XG4gICAgfVxuXG4gICAgaWYgKHJlc3VsdCA9IHRoaXMuX3NlcmlhbGl6ZUFuZFZlcmlmeShzKSkgeyByZXR1cm4gcmVzdWx0OyB9XG4gIH1cblxuICByZXRyaWV2ZShzcGVjaWZpZXI6IHN0cmluZyk6IGFueSB7XG4gICAgcmV0dXJuIHRoaXMucmVnaXN0cnkuZ2V0KHNwZWNpZmllcik7XG4gIH1cblxuICByZXNvbHZlKHNwZWNpZmllcjogc3RyaW5nLCByZWZlcnJlcj86IHN0cmluZyk6IGFueSB7XG4gICAgbGV0IGlkID0gdGhpcy5pZGVudGlmeShzcGVjaWZpZXIsIHJlZmVycmVyKTtcbiAgICBpZiAoaWQpIHtcbiAgICAgIHJldHVybiB0aGlzLnJldHJpZXZlKGlkKTtcbiAgICB9XG4gIH1cblxuICBwcml2YXRlIF9kZWZpbml0aXZlQ29sbGVjdGlvbih0eXBlOiBzdHJpbmcpOiBzdHJpbmcge1xuICAgIGxldCB0eXBlRGVmID0gdGhpcy5jb25maWcudHlwZXNbdHlwZV07XG4gICAgYXNzZXJ0KGAnJHt0eXBlfScgaXMgbm90IGEgcmVjb2duaXplZCB0eXBlYCwgdHlwZURlZik7XG4gICAgcmV0dXJuIHR5cGVEZWYuZGVmaW5pdGl2ZUNvbGxlY3Rpb247XG4gIH1cblxuICBwcml2YXRlIF9zZXJpYWxpemVBbmRWZXJpZnkoc3BlY2lmaWVyOiBTcGVjaWZpZXIpOiBzdHJpbmcge1xuICAgIGxldCBzZXJpYWxpemVkID0gc2VyaWFsaXplU3BlY2lmaWVyKHNwZWNpZmllcik7XG4gICAgaWYgKHRoaXMucmVnaXN0cnkuaGFzKHNlcmlhbGl6ZWQpKSB7XG4gICAgICByZXR1cm4gc2VyaWFsaXplZDtcbiAgICB9XG4gIH1cbn1cbiJdfQ== |
@@ -5,2 +5,3 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
import { assert } from './utils/debug'; | ||
import { detectLocalResolutionCollection } from './utils/specifiers'; | ||
@@ -38,3 +39,3 @@ var Resolver = function () { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
if (detectLocalResolutionCollection(s) === definitiveCollection) { | ||
/* | ||
@@ -121,2 +122,2 @@ * For specifiers with a name, try local resolution. Based on | ||
export default Resolver; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxBQUFPLFNBR0wsQUFBeUIsMkJBQ3pCLEFBQXlCLDJCQUN6QixBQUFvQixzQkFDcEIsQUFBa0IsQUFDbkIsMEJBQU0sQUFBYSxBQUFDO0FBQ3JCLEFBQU8sU0FBRSxBQUFNLEFBQUUsY0FBTSxBQUFlLEFBQUMsQUFJdkMsQUFBTSxBQUFDLEFBQU87OztBQUlaLHNCQUFZLEFBQTZCLFFBQUUsQUFBd0I7OztBQUNqRSxBQUFJLGFBQUMsQUFBTSxTQUFHLEFBQU0sQUFBQztBQUNyQixBQUFJLGFBQUMsQUFBUSxXQUFHLEFBQVEsQUFBQyxBQUMzQjtBQUFDOzt1QkFFRCxBQUFRLDZCQUFDLEFBQWlCLFdBQUUsQUFBaUI7QUFDM0MsQUFBRSxBQUFDLFlBQUMsQUFBeUIsMEJBQUMsQUFBUyxBQUFDLEFBQUMsWUFBQyxBQUFDO0FBQ3pDLEFBQU0sbUJBQUMsQUFBUyxBQUFDLEFBQ25CO0FBQUM7QUFFRCxZQUFJLEFBQUMsSUFBRyxBQUFvQixxQkFBQyxBQUFTLEFBQUMsQUFBQztBQUN4QyxZQUFJLEFBQWMsQUFBQztBQUVuQixBQUFFLEFBQUMsWUFBQyxBQUFRLEFBQUMsVUFBQyxB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gICAgICogRm9yIHNwZWNpZmllcnMgd2l0aG91dCBhIG5hbWUgdXNlIHRoZSByZWZlcnJlcidzIG5hbWUgYW5kXG4gICAgICAgICAgICogZG8gbm90IGZhbGxiYWNrIHRvIGFueSBvdGhlciByZXNvbHV0aW9uIHJ1bGVzLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHMubmFtZXNwYWNlID0gci5uYW1lc3BhY2U7XG4gICAgICAgICAgcy5uYW1lID0gci5uYW1lO1xuICAgICAgICAgIHJldHVybiB0aGlzLl9zZXJpYWxpemVBbmRWZXJpZnkocyk7XG4gICAgICAgIH1cblxuICAgICAgICBzLm5hbWVzcGFjZSA9IHIubmFtZXNwYWNlID8gci5uYW1lc3BhY2UgKyAnLycgKyByLm5hbWUgOiByLm5hbWU7XG4gICAgICAgIGlmIChzLmNvbGxlY3Rpb24gPT09IGRlZmluaXRpdmVDb2xsZWN0aW9uKSB7XG4gICAgICAgICAgLypcbiAgICAgICAgICAgKiBGb3Igc3BlY2lmaWVycyB3aXRoIGEgbmFtZSwgdHJ5IGxvY2FsIHJlc29sdXRpb24uIEJhc2VkIG9uXG4gICAgICAgICAgICogdGhlIHJlZmVycmVyLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIGlmIChyZXN1bHQgPSB0aGlzLl9zZXJpYWxpemVBbmRWZXJpZnkocykpIHsgcmV0dXJuIHJlc3VsdDsgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gTG9vayBmb3IgYSBwcml2YXRlIGNvbGxlY3Rpb24gaW4gdGhlIHJlZmVycmVyJ3MgbmFtZXNwYWNlXG4gICAgICAgIGlmIChkZWZpbml0aXZlQ29sbGVjdGlvbikge1xuICAgICAgICAgIHMubmFtZXNwYWNlICs9ICcvLScgKyBkZWZpbml0aXZlQ29sbGVjdGlvbjtcbiAgICAgICAgICBpZiAocmVzdWx0ID0gdGhpcy5fc2VyaWFsaXplQW5kVmVyaWZ5KHMpKSB7IHJldHVybiByZXN1bHQ7IH1cbiAgIC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WcudHlwZXNbdHlwZV07XG4gICAgYXNzZXJ0KGAnJHt0eXBlfScgaXMgbm90IGEgcmVjb2duaXplZCB0eXBlYCwgdHlwZURlZik7XG4gICAgcmV0dXJuIHR5cGVEZWYuZGVmaW5pdGl2ZUNvbGxlY3Rpb247XG4gIH1cblxuICBwcml2YXRlIF9zZXJpYWxpemVBbmRWZXJpZnkoc3BlY2lmaWVyOiBTcGVjaWZpZXIpOiBzdHJpbmcge1xuICAgIGxldCBzZXJpYWxpemVkID0gc2VyaWFsaXplU3BlY2lmaWVyKHNwZWNpZmllcik7XG4gICAgaWYgKHRoaXMucmVnaXN0cnkuaGFzKHNlcmlhbGl6ZWQpKSB7XG4gICAgICByZXR1cm4gc2VyaWFsaXplZDtcbiAgICB9XG4gIH1cbn1cbiJdfQ== |
{ | ||
"name": "@glimmer/resolver", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Resolver for Glimmer apps.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -10,2 +10,3 @@ import { | ||
import { assert } from './utils/debug'; | ||
import { detectLocalResolutionCollection } from './utils/specifiers'; | ||
import { ModuleRegistry } from './module-registry'; | ||
@@ -52,3 +53,3 @@ import { ResolverConfiguration } from './resolver-configuration'; | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
if (detectLocalResolutionCollection(s) === definitiveCollection) { | ||
/* | ||
@@ -55,0 +56,0 @@ * For specifiers with a name, try local resolution. Based on |
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
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
225589
50
1067