🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

vue-prism-component

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-prism-component - npm Package Compare versions

Comparing version

to
1.2.0

'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var Prism = _interopDefault(require('prismjs'));
function assign(obj) {
var arguments$1 = arguments;
for (var i = 1; i < arguments.length; i++) {
// eslint-disable-next-line guard-for-in, prefer-rest-params
for (var p in arguments[i]) { obj[p] = arguments$1[i][p]; }
for (var p in arguments[i]) {
obj[p] = arguments[i][p];
}
}
return obj
return obj;
}

@@ -21,50 +26,37 @@

type: Boolean,
default: false
"default": false
},
language: {
type: String,
default: 'markup'
"default": 'markup'
}
},
render: function render(h, ctx) {
var code =
ctx.props.code ||
(ctx.children && ctx.children.length > 0 ? ctx.children[0].text : '');
var code = ctx.props.code || (ctx.children && ctx.children.length > 0 ? ctx.children[0].text : '');
var inline = ctx.props.inline;
var language = ctx.props.language;
var prismLanguage = Prism.languages[language];
var className = "language-" + language;
var className = "language-".concat(language);
if (process.env.NODE_ENV === 'development' && !prismLanguage) {
throw new Error(
("Prism component for language \"" + language + "\" was not found, did you forget to register it? See all available ones: https://cdn.jsdelivr.net/npm/prismjs/components/")
)
throw new Error("Prism component for language \"".concat(language, "\" was not found, did you forget to register it? See all available ones: https://cdn.jsdelivr.net/npm/prismjs/components/"));
}
if (inline) {
return h(
'code',
assign({}, ctx.data, {
class: [ctx.data.class, className],
domProps: assign({}, ctx.data.domProps, {
innerHTML: Prism.highlight(code, prismLanguage)
})
return h('code', assign({}, ctx.data, {
"class": [ctx.data["class"], className],
domProps: assign({}, ctx.data.domProps, {
innerHTML: Prism.highlight(code, prismLanguage)
})
)
}));
}
return h(
'pre',
assign({}, ctx.data, {
class: [ctx.data.class, className]
}),
[
h('code', {
class: className,
domProps: {
innerHTML: Prism.highlight(code, prismLanguage)
}
})
]
)
return h('pre', assign({}, ctx.data, {
"class": [ctx.data["class"], className]
}), [h('code', {
"class": className,
domProps: {
innerHTML: Prism.highlight(code, prismLanguage)
}
})]);
}

@@ -71,0 +63,0 @@ };

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.PrismComponent = factory());
}(this, (function () { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('prismjs')) :
typeof define === 'function' && define.amd ? define(['prismjs'], factory) :
(global = global || self, global.PrismComponent = factory(global.Prism));
}(this, (function (Prism) { 'use strict';
function assign(obj) {
var arguments$1 = arguments;
Prism = Prism && Object.prototype.hasOwnProperty.call(Prism, 'default') ? Prism['default'] : Prism;
for (var i = 1; i < arguments.length; i++) {
// eslint-disable-next-line guard-for-in, prefer-rest-params
for (var p in arguments[i]) { obj[p] = arguments$1[i][p]; }
function assign(obj) {
for (var i = 1; i < arguments.length; i++) {
// eslint-disable-next-line guard-for-in, prefer-rest-params
for (var p in arguments[i]) {
obj[p] = arguments[i][p];
}
}
return obj;
}
return obj
}
var index = {
functional: true,
props: {
code: {
type: String
var index = {
functional: true,
props: {
code: {
type: String
},
inline: {
type: Boolean,
"default": false
},
language: {
type: String,
"default": 'markup'
}
},
inline: {
type: Boolean,
default: false
},
language: {
type: String,
default: 'markup'
}
},
render: function render(h, ctx) {
var code =
ctx.props.code ||
(ctx.children && ctx.children.length > 0 ? ctx.children[0].text : '');
var inline = ctx.props.inline;
var language = ctx.props.language;
var prismLanguage = Prism.languages[language];
var className = "language-" + language;
render: function render(h, ctx) {
var code = ctx.props.code || (ctx.children && ctx.children.length > 0 ? ctx.children[0].text : '');
var inline = ctx.props.inline;
var language = ctx.props.language;
var prismLanguage = Prism.languages[language];
var className = "language-".concat(language);
if ("production" === 'development' && !prismLanguage) {
throw new Error(
("Prism component for language \"" + language + "\" was not found, did you forget to register it? See all available ones: https://cdn.jsdelivr.net/npm/prismjs/components/")
)
}
if (inline) {
return h(
'code',
assign({}, ctx.data, {
class: [ctx.data.class, className],
if (inline) {
return h('code', assign({}, ctx.data, {
"class": [ctx.data["class"], className],
domProps: assign({}, ctx.data.domProps, {
innerHTML: Prism.highlight(code, prismLanguage)
})
})
)
}));
}
return h('pre', assign({}, ctx.data, {
"class": [ctx.data["class"], className]
}), [h('code', {
"class": className,
domProps: {
innerHTML: Prism.highlight(code, prismLanguage)
}
})]);
}
};
return h(
'pre',
assign({}, ctx.data, {
class: [ctx.data.class, className]
}),
[
h('code', {
class: className,
domProps: {
innerHTML: Prism.highlight(code, prismLanguage)
}
})
]
)
}
};
return index;
return index;
})));

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

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.PrismComponent=n()}(this,function(){"use strict";function e(e){for(var n=arguments,t=1;t<arguments.length;t++)for(var r in arguments[t])e[r]=n[t][r];return e}return{functional:!0,props:{code:{type:String},inline:{type:Boolean,default:!1},language:{type:String,default:"markup"}},render:function(n,t){var r=t.props.code||(t.children&&t.children.length>0?t.children[0].text:""),o=t.props.inline,a=t.props.language,i=Prism.languages[a],s="language-"+a;return o?n("code",e({},t.data,{class:[t.data.class,s],domProps:e({},t.data.domProps,{innerHTML:Prism.highlight(r,i)})})):n("pre",e({},t.data,{class:[t.data.class,s]}),[n("code",{class:s,domProps:{innerHTML:Prism.highlight(r,i)}})])}}});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("prismjs")):"function"==typeof define&&define.amd?define(["prismjs"],n):(e=e||self).PrismComponent=n(e.Prism)}(this,function(e){"use strict";function n(e){for(var n=1;n<arguments.length;n++)for(var t in arguments[n])e[t]=arguments[n][t];return e}return e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,{functional:!0,props:{code:{type:String},inline:{type:Boolean,default:!1},language:{type:String,default:"markup"}},render:function(t,r){var o=r.props.code||(r.children&&r.children.length>0?r.children[0].text:""),a=r.props.inline,i=r.props.language,s=e.languages[i],l="language-".concat(i);return a?t("code",n({},r.data,{class:[r.data.class,l],domProps:n({},r.data.domProps,{innerHTML:e.highlight(o,s)})})):t("pre",n({},r.data,{class:[r.data.class,l]}),[t("code",{class:l,domProps:{innerHTML:e.highlight(o,s)}})])}}});
//# sourceMappingURL=vue-prism-component.min.js.map
{
"name": "vue-prism-component",
"version": "1.1.1",
"version": "1.2.0",
"description": "vue component for prism.js",

@@ -17,8 +17,8 @@ "repository": {

"scripts": {
"test": "echo 'no tests!' && npm run lint",
"test": "npm run build",
"lint": "xo",
"prepublish": "npm run build",
"build": "npm run build:umd && npm run build:cjs",
"build:umd": "bili --format umd,umdCompress --env.NODE_ENV production --module-name PrismComponent",
"build:cjs": "bili --format cjs"
"build:umd": "bili --file-name \"vue-prism-component[min].js\" --format umd --format umd-min --env.NODE_ENV production --module-name PrismComponent --external prismjs",
"build:cjs": "bili --file-name \"vue-prism-component.common.js\" --format cjs"
},

@@ -29,5 +29,4 @@ "author": "egoist <0x142857@gmail.com>",

"devDependencies": {
"bili": "^0.17.3",
"bili": "^4.9.0",
"eslint-config-rem": "^3.0.0",
"poi": "^9.1.2",
"prismjs": "^1.6.0",

@@ -41,13 +40,6 @@ "xo": "^0.18.0"

],
"globals": [
"Prism"
],
"rules": {
"import/prefer-default-export": 0
}
},
"poi": {
"entry": "example/index.js",
"dist": "example/dist"
}
}

Sorry, the diff of this file is not supported yet