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

@lrnwebcomponents/schema-behaviors

Package Overview
Dependencies
Maintainers
4
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lrnwebcomponents/schema-behaviors - npm Package Compare versions

Comparing version 2.1.4 to 2.2.0

12

analysis.json

@@ -15,3 +15,3 @@ {

"end": {
"line": 88,
"line": 86,
"column": 1

@@ -37,7 +37,7 @@ }

"start": {
"line": 43,
"line": 41,
"column": 4
},
"end": {
"line": 60,
"line": 58,
"column": 5

@@ -55,7 +55,7 @@ }

"start": {
"line": 64,
"line": 62,
"column": 4
},
"end": {
"line": 86,
"line": 84,
"column": 5

@@ -87,3 +87,3 @@ }

"end": {
"line": 87,
"line": 85,
"column": 3

@@ -90,0 +90,0 @@ }

@@ -40,5 +40,12 @@ const gulp = require("gulp");

);
let props = `${rawprops}`;
props = props.replace(/\"type\": \"(\w+)\"/g, '"type": $1');
let cssResult = "<style>";
let props = `${rawprops}`,
comma = props
.replace(/\/\*[\s\S]*?\*\//g, "")
.replace(/\/\/.*/g, "")
.replace(/[\{\s\n\}]/g, "");
(props = props.replace(/\"type\": \"(\w+)\"/g, '"type": $1')),
(superprops =
comma === "" ? `...super.properties` : `...super.properties,`);
props = props.replace(/\{([\s\n]*)/, `{$1$1${superprops}$1$1`);
let cssResult = "";
if (

@@ -57,9 +64,46 @@ packageJson.wcfactory.useSass &&

}
cssResult += "</style>";
let styleRegex = /\/\*[\s]*LIST SHARED STYLES BELOW[\s]*((?:(?:\w+)[\s,]*)*)\*\//g,
styleArray =
cssResult.match(styleRegex) &&
cssResult.match(styleRegex).length > 0
? cssResult
.match(styleRegex)[0]
.replace(styleRegex, "$1")
.match(/(\w+)[\s,]*/g)
: [];
sharedStyles =
styleArray && styleArray.length > 0
? styleArray.map(style =>
style.replace(
/(\w+)[\s,]*/g,
`
$1`
)
)
: ``;
cssResult = stripCssComments(cssResult).trim();
return `
let litResult =
packageJson.wcfactory.customElementClass !== "LitElement"
? ``
: `
//styles function
static get styles() {
return [${sharedStyles ? `${sharedStyles},` : ``}
css\`
${cssResult}
\`
];
}`,
styleResult =
packageJson.wcfactory.customElementClass !== "LitElement"
? `<style>
${cssResult}
</style>`
: ``;
return `${litResult}
// render function
static get template() {
return html\`
${cssResult}
${styleResult}
${html}\`;

@@ -70,7 +114,3 @@ }

static get properties() {
let props = ${props};
if (super.properties) {
props = Object.assign(props, super.properties);
}
return props;
return ${props};
}`;

@@ -77,0 +117,0 @@ }

@@ -14,3 +14,3 @@ {

},
"version": "2.1.4",
"version": "2.2.0",
"description": "Apply schema helper behaviors to existing Polymer (Legacy) based elements",

@@ -42,3 +42,3 @@ "repository": {

"@lrnwebcomponents/deduping-fix": "^2.1.1",
"@lrnwebcomponents/storybook-utilities": "^2.1.2",
"@lrnwebcomponents/storybook-utilities": "^2.2.0",
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page",

@@ -62,3 +62,3 @@ "@polymer/iron-demo-helpers": "3.1.0",

],
"gitHead": "ff737f87266a717930bde80432ceb95c1d64c6e8"
"gitHead": "d8dfc961c1e93dbe8c38b40c82e288af057d6477"
}

@@ -9,3 +9,5 @@ /**

static get properties() {
let props = {
return {
...super.properties,
/**

@@ -37,6 +39,2 @@ * Unique Resource ID, generated when schemaMap processes.

};
if (super.properties) {
props = Object.assign(props, super.properties);
}
return props;
}

@@ -43,0 +41,0 @@ /**

@@ -9,3 +9,5 @@ /**

static get properties() {
let props = {
return {
...super.properties,
/**

@@ -37,6 +39,2 @@ * Unique Resource ID, generated when schemaMap processes.

};
if (super.properties) {
props = Object.assign(props, super.properties);
}
return props;
}

@@ -43,0 +41,0 @@ /**

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).SchemaBehaviors={})}(this,function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}(e,t);if(n){var c=Object.getOwnPropertyDescriptor(n,t);return c.get?c.get.call(r):c.value}})(e,t,r||e)}e.SchemaBehaviors=function(e){return function(u){function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),c(this,o(s).apply(this,arguments))}var f,a,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}(s,e),f=s,p=[{key:"properties",get:function(){var e={schemaResourceID:{type:String,value:""},schemaMap:{type:Object,readOnly:!0,value:{prefix:{oer:"http://oerschema.org/",schema:"http://schema.org/",dc:"http://purl.org/dc/terms/",foaf:"http://xmlns.com/foaf/0.1/",cc:"http://creativecommons.org/ns#",bib:"http://bib.schema.org"}},observer:"_schemaMapChanged"}};return i(o(s),"properties",this)&&(e=Object.assign(e,i(o(s),"properties",this))),e}}],(a=[{key:"generateResourceID",value:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return"#"+e()+e()+"-"+e()+"-"+e()+"-"+e()}},{key:"_schemaMapChanged",value:function(e,r){if("undefined"!==t(e)){this.schemaResourceID=this.getAttribute("resource"),""!=this.schemaResourceID&&null!=this.schemaResourceID||(this.schemaResourceID=this.generateResourceID(),this.setAttribute("resource",this.schemaResourceID));var o=e.prefix,n="";for(var c in o)o.hasOwnProperty(c)&&(n+=c+":"+o[c]+" ");""!=n&&this.setAttribute("prefix",n)}}}])&&r(f.prototype,a),p&&r(f,p),s}()},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).SchemaBehaviors={})}(this,function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function i(e,t,r){return(i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}(e,t);if(n){var c=Object.getOwnPropertyDescriptor(n,t);return c.get?c.get.call(r):c.value}})(e,t,r||e)}e.SchemaBehaviors=function(e){return function(f){function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),u(this,o(s).apply(this,arguments))}var a,p,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(s,e),a=s,l=[{key:"properties",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){n(e,t,r[t])})}return e}({},i(o(s),"properties",this),{schemaResourceID:{type:String,value:""},schemaMap:{type:Object,readOnly:!0,value:{prefix:{oer:"http://oerschema.org/",schema:"http://schema.org/",dc:"http://purl.org/dc/terms/",foaf:"http://xmlns.com/foaf/0.1/",cc:"http://creativecommons.org/ns#",bib:"http://bib.schema.org"}},observer:"_schemaMapChanged"}})}}],(p=[{key:"generateResourceID",value:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return"#"+e()+e()+"-"+e()+"-"+e()+"-"+e()}},{key:"_schemaMapChanged",value:function(e,r){if("undefined"!==t(e)){this.schemaResourceID=this.getAttribute("resource"),""!=this.schemaResourceID&&null!=this.schemaResourceID||(this.schemaResourceID=this.generateResourceID(),this.setAttribute("resource",this.schemaResourceID));var n=e.prefix,o="";for(var c in n)n.hasOwnProperty(c)&&(o+=c+":"+n[c]+" ");""!=o&&this.setAttribute("prefix",o)}}}])&&r(a.prototype,p),l&&r(a,l),s}()},Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=schema-behaviors.umd.js.map

@@ -9,3 +9,5 @@ /**

static get properties() {
let props = {
return {
...super.properties,
/**

@@ -37,6 +39,2 @@ * Unique Resource ID, generated when schemaMap processes.

};
if (super.properties) {
props = Object.assign(props, super.properties);
}
return props;
}

@@ -43,0 +41,0 @@ /**

Sorry, the diff of this file is not supported yet

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