@glimmer/resolver
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -29,18 +29,27 @@ define('@glimmer/resolver', ['exports', '@glimmer/di'], function (exports, _glimmer_di) { 'use strict'; | ||
assert('Specifier must not include a rootName, collection, or namespace when combined with an absolute referrer', s.rootName === undefined && s.collection === undefined && s.namespace === undefined); | ||
// Look locally in the referrer's namespace | ||
s.rootName = r.rootName; | ||
s.collection = r.collection; | ||
if (s.name) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
} else { | ||
var definitiveCollection = this._definitiveCollection(s.type); | ||
if (!s.name) { | ||
/* | ||
* For specifiers without a name use the referrer's name and | ||
* do not fallback to any other resolution rules. | ||
*/ | ||
s.namespace = r.namespace; | ||
s.name = r.name; | ||
return this._serializeAndVerify(s); | ||
} | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
/* | ||
* For specifiers with a name, try local resolution. Based on | ||
* the referrer. | ||
*/ | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
} | ||
} | ||
// Look for a private collection in the referrer's namespace | ||
var privateCollection = this._definitiveCollection(s.type); | ||
if (privateCollection) { | ||
s.namespace += '/-' + privateCollection; | ||
if (definitiveCollection) { | ||
s.namespace += '/-' + definitiveCollection; | ||
if (result = this._serializeAndVerify(s)) { | ||
@@ -47,0 +56,0 @@ return result; |
@@ -26,18 +26,27 @@ 'use strict'; | ||
(0, _debug.assert)('Specifier must not include a rootName, collection, or namespace when combined with an absolute referrer', s.rootName === undefined && s.collection === undefined && s.namespace === undefined); | ||
// Look locally in the referrer's namespace | ||
s.rootName = r.rootName; | ||
s.collection = r.collection; | ||
if (s.name) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
} else { | ||
let definitiveCollection = this._definitiveCollection(s.type); | ||
if (!s.name) { | ||
/* | ||
* For specifiers without a name use the referrer's name and | ||
* do not fallback to any other resolution rules. | ||
*/ | ||
s.namespace = r.namespace; | ||
s.name = r.name; | ||
return this._serializeAndVerify(s); | ||
} | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
/* | ||
* For specifiers with a name, try local resolution. Based on | ||
* the referrer. | ||
*/ | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
} | ||
} | ||
// Look for a private collection in the referrer's namespace | ||
let privateCollection = this._definitiveCollection(s.type); | ||
if (privateCollection) { | ||
s.namespace += '/-' + privateCollection; | ||
if (definitiveCollection) { | ||
s.namespace += '/-' + definitiveCollection; | ||
if (result = this._serializeAndVerify(s)) { | ||
@@ -106,2 +115,2 @@ return result; | ||
exports.default = Resolver; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsQUFBTyxBQUdMLEFBQXlCLEFBQ3pCLEFBQXlCLEFBQ3pCLEFBQW9CLEFBQ3BCLEFBQWtCLEFBQ25CLEFBQU0sQUFBYSxBQUFDOztBQUNyQixBQUFPLEFBQUUsQUFBTSxBQUFFLEFBQU0sQUFBZSxBQUFDLEFBSXZDLEFBQU0sQUFBQyxBQUFPOzs7QUFJWixnQkFBWSxBQUE2QixRQUFFLEFBQXdCO0FBQ2pFLEFBQUksYUFBQyxBQUFNLFNBQUcsQUFBTSxBQUFDO0FBQ3JCLEFBQUksYUFBQyxBQUFRLFdBQUcsQUFBUSxBQUFDLEFBQzNCO0FBQUM7QUFFRCxBQUFRLGFBQUMsQUFBaUIsV0FBRSxBQUFpQjtBQUMzQyxBQUFFLEFBQUMsWUFBQyxBQUF5QixtQ0FBQyxBQUFTLEFBQU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l9zZXJpYWxpemVBbmRWZXJpZnkocykpIHsgcmV0dXJuIHJlc3VsdDsgfVxuICB9XG5cbiAgcmV0cmlldmUoc3BlY2lmaWVyOiBzdHJpbmcpOiBhbnkge1xuICAgIHJldHVybiB0aGlzLnJlZ2lzdHJ5LmdldChzcGVjaWZpZXIpO1xuICB9XG5cbiAgcmVzb2x2ZShzcGVjaWZpZXI6IHN0cmluZywgcmVmZXJyZXI/OiBzdHJpbmcpOiBhbnkge1xuICAgIGxldCBpZCA9IHRoaXMuaWRlbnRpZnkoc3BlY2lmaWVyLCByZWZlcnJlcik7XG4gICAgaWYgKGlkKSB7XG4gICAgICByZXR1cm4gdGhpcy5yZXRyaWV2ZShpZCk7XG4gICAgfVxuICB9XG5cbiAgcHJpdmF0ZSBfZGVmaW5pdGl2ZUNvbGxlY3Rpb24odHlwZTogc3RyaW5nKTogc3RyaW5nIHtcbiAgICBsZXQgdHlwZURlZiA9IHRoaXMuY29uZmlnLnR5cGVzW3R5cGVdO1xuICAgIGFzc2VydChgJyR7dHlwZX0nIGlzIG5vdCBhIHJlY29nbml6ZWQgdHlwZWAsIHR5cGVEZWYpO1xuICAgIHJldHVybiB0eXBlRGVmLmRlZmluaXRpdmVDb2xsZWN0aW9uO1xuICB9XG5cbiAgcHJpdmF0ZSBfc2VyaWFsaXplQW5kVmVyaWZ5KHNwZWNpZmllcjogU3BlY2lmaWVyKTogc3RyaW5nIHtcbiAgICBsZXQgc2VyaWFsaXplZCA9IHNlcmlhbGl6ZVNwZWNpZmllcihzcGVjaWZpZXIpO1xuICAgIGlmICh0aGlzLnJlZ2lzdHJ5LmhhcyhzZXJpYWxpemVkKSkge1xuICAgICAgcmV0dXJuIHNlcmlhbGl6ZWQ7XG4gICAgfVxuICB9XG59XG4iXX0= |
@@ -35,18 +35,27 @@ 'use strict'; | ||
(0, _debug.assert)('Specifier must not include a rootName, collection, or namespace when combined with an absolute referrer', s.rootName === undefined && s.collection === undefined && s.namespace === undefined); | ||
// Look locally in the referrer's namespace | ||
s.rootName = r.rootName; | ||
s.collection = r.collection; | ||
if (s.name) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
} else { | ||
var definitiveCollection = this._definitiveCollection(s.type); | ||
if (!s.name) { | ||
/* | ||
* For specifiers without a name use the referrer's name and | ||
* do not fallback to any other resolution rules. | ||
*/ | ||
s.namespace = r.namespace; | ||
s.name = r.name; | ||
return this._serializeAndVerify(s); | ||
} | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
/* | ||
* For specifiers with a name, try local resolution. Based on | ||
* the referrer. | ||
*/ | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
} | ||
} | ||
// Look for a private collection in the referrer's namespace | ||
var privateCollection = this._definitiveCollection(s.type); | ||
if (privateCollection) { | ||
s.namespace += '/-' + privateCollection; | ||
if (definitiveCollection) { | ||
s.namespace += '/-' + definitiveCollection; | ||
if (result = this._serializeAndVerify(s)) { | ||
@@ -122,2 +131,2 @@ return result; | ||
exports.default = Resolver; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsQUFBTyxBQUdMLEFBQXlCLEFBQ3pCLEFBQXlCLEFBQ3pCLEFBQW9CLEFBQ3BCLEFBQWtCLEFBQ25CLEFBQU0sQUFBYSxBQUFDOztBQUNyQixBQUFPLEFBQUUsQUFBTSxBQUFFLEFBQU0sQUFBZSxBQUFDLEFBSXZDLEFBQU0sQUFBQyxBQUFPOzs7Ozs7OzsyQkFJWjtzQkFBWSxBQUE2QixRQUFFLEFBQXdCOzhCQUNqRSxBQUFJOzthQUFDLEFBQU0sU0F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B3aXRoIGFuIGFic29sdXRlIHJlZmVycmVyJywgcy5yb290TmFtZSA9PT0gdW5kZWZpbmVkICYmIHMuY29sbGVjdGlvbiA9PT0gdW5kZWZpbmVkICYmIHMubmFtZXNwYWNlID09PSB1bmRlZmluZWQpO1xuXG4gICAgICAgIHMucm9vdE5hbWUgPSByLnJvb3ROYW1lO1xuICAgICAgICBzLmNvbGxlY3Rpb24gPSByLmNvbGxlY3Rpb247XG4gICAgICAgIGxldCBkZWZpbml0aXZlQ29sbGVjdGlvbiA9IHRoaXMuX2RlZmluaXRpdmVDb2xsZWN0aW9uKHMudHlwZSk7XG5cbiAgICAgICAgaWYgKCFzLm5hbWUpIHtcbiAgICAgICAgICAvKlxuICAgICAgICAgICAqIEZvciBzcGVjaWZpZXJzIHdpdGhvdXQgYSBuYW1lIHVzZSB0aGUgcmVmZXJyZXIncyBuYW1lIGFuZFxuICAgICAgICAgICAqIGRvIG5vdCBmYWxsYmFjayB0byBhbnkgb3RoZXIgcmVzb2x1dGlvbiBydWxlcy5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBzLm5hbWVzcGFjZSA9IHIubmFtZXNwYWNlO1xuICAgICAgICAgIHMubmFtZSA9IHIubmFtZTtcbiAgICAgICAgICByZXR1cm4gdGhpcy5fc2VyaWFsaXplQW5kVmVyaWZ5KHMpO1xuICAgICAgICB9XG5cbiAgICAgICAgcy5uYW1lc3BhY2UgPSByLm5hbWVzcGFjZSA/IHIubmFtZXNwYWNlICsgJy8nICsgci5uYW1lIDogci5uYW1lO1xuICAgICAgICBpZiAocy5jb2xsZWN0aW9uID09PSBkZWZpbml0aXZlQ29sbGVjdGlvbikge1xuICAgICAgICAgIC8qXG4gICAgICAgICAgICogRm9yIHNwZWNpZmllcnMgd2l0aCBhIG5hbWUsIHRyeSBsb2NhbCByZXNvbHV0aW9uLiBCYXNlZCBvblxuICAgICAgICAgICAqIHRoZSByZWZlcnJlci5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoc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h0aGlzLnJlZ2lzdHJ5LmhhcyhzZXJpYWxpemVkKSkge1xuICAgICAgcmV0dXJuIHNlcmlhbGl6ZWQ7XG4gICAgfVxuICB9XG59XG4iXX0= |
@@ -18,19 +18,27 @@ import { isSpecifierStringAbsolute, isSpecifierObjectAbsolute, deserializeSpecifier, serializeSpecifier } from '@glimmer/di'; | ||
assert('Specifier must not include a rootName, collection, or namespace when combined with an absolute referrer', s.rootName === undefined && s.collection === undefined && s.namespace === undefined); | ||
// Look locally in the referrer's namespace | ||
s.rootName = r.rootName; | ||
s.collection = r.collection; | ||
if (s.name) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
} | ||
else { | ||
let definitiveCollection = this._definitiveCollection(s.type); | ||
if (!s.name) { | ||
/* | ||
* For specifiers without a name use the referrer's name and | ||
* do not fallback to any other resolution rules. | ||
*/ | ||
s.namespace = r.namespace; | ||
s.name = r.name; | ||
return this._serializeAndVerify(s); | ||
} | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
/* | ||
* For specifiers with a name, try local resolution. Based on | ||
* the referrer. | ||
*/ | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
} | ||
} | ||
// Look for a private collection in the referrer's namespace | ||
let privateCollection = this._definitiveCollection(s.type); | ||
if (privateCollection) { | ||
s.namespace += '/-' + privateCollection; | ||
if (definitiveCollection) { | ||
s.namespace += '/-' + definitiveCollection; | ||
if (result = this._serializeAndVerify(s)) { | ||
@@ -100,2 +108,2 @@ return result; | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJzcmMvcmVzb2x2ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUdMLHlCQUF5QixFQUN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VjaWZpZXI6IFNwZWNpZmllcik6IHN0cmluZyB7XG4gICAgbGV0IHNlcmlhbGl6ZWQgPSBzZXJpYWxpemVTcGVjaWZpZXIoc3BlY2lmaWVyKTtcbiAgICBpZiAodGhpcy5yZWdpc3RyeS5oYXMoc2VyaWFsaXplZCkpIHtcbiAgICAgIHJldHVybiBzZXJpYWxpemVkO1xuICAgIH1cbiAgfVxufVxuIl19 |
@@ -24,18 +24,27 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
assert('Specifier must not include a rootName, collection, or namespace when combined with an absolute referrer', s.rootName === undefined && s.collection === undefined && s.namespace === undefined); | ||
// Look locally in the referrer's namespace | ||
s.rootName = r.rootName; | ||
s.collection = r.collection; | ||
if (s.name) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
} else { | ||
var definitiveCollection = this._definitiveCollection(s.type); | ||
if (!s.name) { | ||
/* | ||
* For specifiers without a name use the referrer's name and | ||
* do not fallback to any other resolution rules. | ||
*/ | ||
s.namespace = r.namespace; | ||
s.name = r.name; | ||
return this._serializeAndVerify(s); | ||
} | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
/* | ||
* For specifiers with a name, try local resolution. Based on | ||
* the referrer. | ||
*/ | ||
if (result = this._serializeAndVerify(s)) { | ||
return result; | ||
} | ||
} | ||
// Look for a private collection in the referrer's namespace | ||
var privateCollection = this._definitiveCollection(s.type); | ||
if (privateCollection) { | ||
s.namespace += '/-' + privateCollection; | ||
if (definitiveCollection) { | ||
s.namespace += '/-' + definitiveCollection; | ||
if (result = this._serializeAndVerify(s)) { | ||
@@ -111,2 +120,2 @@ return result; | ||
export default Resolver; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZXIuanMiLCJ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0eXBlRGVmID0gdGhpcy5jb25maWcudHlwZXNbdHlwZV07XG4gICAgYXNzZXJ0KGAnJHt0eXBlfScgaXMgbm90IGEgcmVjb2duaXplZCB0eXBlYCwgdHlwZURlZik7XG4gICAgcmV0dXJuIHR5cGVEZWYuZGVmaW5pdGl2ZUNvbGxlY3Rpb247XG4gIH1cblxuICBwcml2YXRlIF9zZXJpYWxpemVBbmRWZXJpZnkoc3BlY2lmaWVyOiBTcGVjaWZpZXIpOiBzdHJpbmcge1xuICAgIGxldCBzZXJpYWxpemVkID0gc2VyaWFsaXplU3BlY2lmaWVyKHNwZWNpZmllcik7XG4gICAgaWYgKHRoaXMucmVnaXN0cnkuaGFzKHNlcmlhbGl6ZWQpKSB7XG4gICAgICByZXR1cm4gc2VyaWFsaXplZDtcbiAgICB9XG4gIH1cbn1cbiJdfQ== |
{ | ||
"name": "@glimmer/resolver", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "Resolver for Glimmer apps.", | ||
@@ -33,3 +33,6 @@ "contributors": [ | ||
"testem": "^1.13.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
@@ -36,17 +36,28 @@ import { | ||
// Look locally in the referrer's namespace | ||
s.rootName = r.rootName; | ||
s.collection = r.collection; | ||
if (s.name) { | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
} else { | ||
let definitiveCollection = this._definitiveCollection(s.type); | ||
if (!s.name) { | ||
/* | ||
* For specifiers without a name use the referrer's name and | ||
* do not fallback to any other resolution rules. | ||
*/ | ||
s.namespace = r.namespace; | ||
s.name = r.name; | ||
return this._serializeAndVerify(s); | ||
} | ||
if (result = this._serializeAndVerify(s)) { return result; } | ||
s.namespace = r.namespace ? r.namespace + '/' + r.name : r.name; | ||
if (s.collection === definitiveCollection) { | ||
/* | ||
* For specifiers with a name, try local resolution. Based on | ||
* the referrer. | ||
*/ | ||
if (result = this._serializeAndVerify(s)) { return result; } | ||
} | ||
// Look for a private collection in the referrer's namespace | ||
let privateCollection = this._definitiveCollection(s.type); | ||
if (privateCollection) { | ||
s.namespace += '/-' + privateCollection; | ||
if (definitiveCollection) { | ||
s.namespace += '/-' + definitiveCollection; | ||
if (result = this._serializeAndVerify(s)) { return result; } | ||
@@ -53,0 +64,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
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
214348
974
0