Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clayutils

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clayutils - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

lib/isDefaultLayout/index.js

3

index.js

@@ -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');

2

lib/getLayoutInstance/index.js

@@ -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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc