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

jyt

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jyt - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

1

lib/jyt.js

@@ -30,2 +30,3 @@ /**

render: runtime.render,
naked: runtime.naked,
runtime: runtime,

@@ -32,0 +33,0 @@ utils: utils

6

lib/jyt.plugins.js

@@ -42,3 +42,3 @@ /**

// ex. jif(true, div('blah'))
registerPlugin("jif", function jif(condition, elem) {
registerPlugin('jif', function jif(condition, elem) {
if (utils.isArray(elem)) {

@@ -52,3 +52,3 @@ elem = runtime.naked(elem, null);

// ex. jeach({}, function (item) {})
registerPlugin("jeach", function jeach(items, cb) {
registerPlugin('jeach', function jeach(items, cb) {
if (!items || !cb) { return null; }

@@ -65,3 +65,3 @@

// export all functions for use by jft
// export all functions for use by jyt
module.exports = {

@@ -68,0 +68,0 @@ plugins: plugins,

@@ -22,3 +22,15 @@ /**

/**
* Take a jft element and render it to an HTML string
* Since an array designates chidlren, we need this in order to identify an
* array of sibling elements that have no parent.
*
* @param elements
* @param text
* @returns {*}
*/
function naked(elements, text) {
return elem('', elements, text);
}
/**
* Take a jyt element and render it to an HTML string
* @param elem

@@ -45,2 +57,5 @@ * @param opts

// if an array, wrap it
if (utils.isArray(elem)) { elem = naked(elem, null); }
// set the indentation level to the current indent

@@ -53,3 +68,2 @@ if (isPretty && indentLevel) {

// if we are prepending some string, add it first

@@ -126,3 +140,3 @@ if (prepend) {

/**
* This will convert a tag with attributes, chidlren and text to a jft object
* This will convert a tag with attributes, chidlren and text to a jyt object
* that can later be rendered.

@@ -178,14 +192,2 @@ * ex. elem('div', attributes, children, text);

/**
* Since an array designates chidlren, we need this in order to identify an
* array of sibling elements that have no parent.
*
* @param elements
* @param text
* @returns {*}
*/
function naked(elements, text) {
return elem('', elements, text);
}
/**
* Add all elements to the given scope

@@ -227,3 +229,3 @@ * @param scope

// expose all functions for resting purposes (jft.js limits exposure to outside world)
// expose all functions for resting purposes (jyt.js limits exposure to outside world)
module.exports = {

@@ -230,0 +232,0 @@ elems: elems,

@@ -82,3 +82,3 @@ /**

// Handle a deep copy situation
if (typeof target === "boolean") {
if (typeof target === 'boolean') {
deep = target;

@@ -92,3 +92,3 @@

// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && !isFunction(target)) {
if (typeof target !== 'object' && !isFunction(target)) {
target = {};

@@ -147,3 +147,3 @@ }

// expose all functions for resting purposes (jft.js limits exposure to outside world)
// expose all functions for resting purposes (jyt.js limits exposure to outside world)
module.exports = {

@@ -150,0 +150,0 @@ isFunction: isFunction,

{
"name": "jyt",
"version": "0.1.0",
"version": "0.1.1",
"description": "JavaScript Your Templates",

@@ -5,0 +5,0 @@ "main": "lib/jyt.js",

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