Comparing version 2.4.0 to 2.5.0
@@ -13,4 +13,7 @@ 'use strict'; | ||
module.exports.isLayout = require('./lib/isLayout'); | ||
module.exports.isLayoutMeta = require('./lib/isLayoutMeta'); | ||
module.exports.isDefaultComponent = require('./lib/isDefaultComponent'); | ||
module.exports.isDefaultLayout = require('./lib/isDefaultLayout'); | ||
module.exports.isPage = require('./lib/isPage'); | ||
module.exports.isPageMeta = require('./lib/isPageMeta'); | ||
module.exports.isPublished = require('./lib/isPublished'); | ||
@@ -17,0 +20,0 @@ module.exports.isList = require('./lib/isList'); |
@@ -14,5 +14,5 @@ 'use strict'; | ||
isUriStringCheck.strCheck(uri); | ||
const result = /\/_layouts\/.+?\/instances\/([^\.@]+)/.exec(uri); | ||
const result = /\/_layouts\/.+?\/instances\/([^\.\/@]+)/.exec(uri); | ||
return result && result[1]; | ||
}; |
@@ -21,5 +21,9 @@ 'use strict'; | ||
it('gets instance from full uri', function () { | ||
expect(fn('nymag.com/press/_layouts/base/instances/foobarbaz@published')).to.equal('foobarbaz'); | ||
expect(fn('domain.com/sitepath/_layouts/base/instances/foobarbaz@published')).to.equal('foobarbaz'); | ||
}); | ||
it('gets instance without meta', function () { | ||
expect(fn('domain.com/_layouts/foobar/instances/baz/meta')).to.equal('baz'); | ||
}); | ||
it('CANNOT get instance from default uri', function () { | ||
@@ -26,0 +30,0 @@ expect(fn('/_layouts/base')).to.not.equal('0'); |
@@ -14,5 +14,5 @@ 'use strict'; | ||
isUriStringCheck.strCheck(uri); | ||
const result = /\/_pages\/(.*)/.exec(uri); | ||
const result = /\/_pages\/([^\.\/]+)/.exec(uri); | ||
return result && result[1]; | ||
}; |
@@ -17,5 +17,9 @@ 'use strict'; | ||
it('gets instance from full uri', function () { | ||
expect(fn('nymag.com/scienceofus/_pages/foobarbaz@published')).to.equal('foobarbaz@published'); | ||
expect(fn('domain.com/sitepath/_pages/foobarbaz@published')).to.equal('foobarbaz@published'); | ||
}); | ||
it('gets instance from uri with meta', function () { | ||
expect(fn('domain.com/_pages/foobar/meta')).to.equal('foobar'); | ||
}); | ||
it('CANNOT get instance from a non-page uri', function () { | ||
@@ -22,0 +26,0 @@ expect(fn('/_components/base/instances/0')).to.not.equal('0'); |
{ | ||
"name": "clayutils", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "A collection of utility functions for working with Clay.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,5 +31,8 @@ # clayutils | ||
* **isDefaultComponent** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isDefaultComponent) | ||
* **isDefaultLayout** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isDefaultLayout) | ||
* **isLayout** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isLayout) | ||
* **isLayoutMeta** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isLayoutMeta) | ||
* **isList** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isList) | ||
* **isPage** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isPage) | ||
* **isPageMeta** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isPageMeta) | ||
* **isPublished** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isPublished) | ||
@@ -36,0 +39,0 @@ * **isUri** [(code|tests|docs)](https://github.com/clay/clayutils/tree/master/lib/isUri) |
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
60181
88
1222
45
31