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

yurine

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yurine - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

index.js.map

66

build/delegate.js

@@ -10,12 +10,4 @@ "use strict";

var _ignore = _interopRequireDefault(require("./ignore"));
var _InnerTree = _interopRequireDefault(require("./InnerTree"));
var _join = _interopRequireDefault(require("./join"));
var _join2 = _interopRequireDefault(require("./join2"));
var _jaw = _interopRequireDefault(require("jaw"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

@@ -36,13 +28,5 @@

var objltr = prmr.first();
if (objltr && objltr.name() === Node.OBJLTR) {
res = (0, _ignore["default"])(node.first(), true).res + '[';
recursion(objltr);
res += (0, _ignore["default"])(node.last(), true).res + ']';
} else {
var tree = new _InnerTree["default"]();
res = tree.parse(node);
res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
res = filter(res);
}
var tree = new _InnerTree["default"]();
res = tree.parse(node);
res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
} else {

@@ -53,3 +37,2 @@ var _tree = new _InnerTree["default"]();

res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
res = filter(res);
}

@@ -60,46 +43,3 @@

function recursion(objltr) {
res += (0, _ignore["default"])(objltr.first(), true).res;
for (var i = 1, len = objltr.size(); i < len - 1; i++) {
var leaf = objltr.leaf(i);
if (leaf.isToken()) {
var s = (0, _join2["default"])(leaf);
res += s;
} else if (leaf.name() === Node.PROPTDEF) {
res += '[';
var proptname = leaf.first();
var _s = (0, _join["default"])(proptname).replace(/^(["'])(.+)\1$/, '$2') + '{}';
_s = _jaw["default"].parse(_s, {
noPriority: true,
noValue: true,
noMedia: true
});
res += JSON.stringify(_s);
res += ',';
res += filter((0, _join["default"])(leaf.last()));
res += ']';
res += (0, _ignore["default"])(leaf, true).res;
}
}
res += (0, _ignore["default"])(objltr.last(), true).res;
}
function filter(s) {
if (/^\s*this\b/.test(s) || /^\s*function\b/.test(s)) {
if (/^\s*this\s*\.\s*model\s*\./.test(s)) {
return 'new yurine.Cb(this.model,' + s + ')';
}
return 'new yurine.Cb(this,' + s + ')';
}
return s;
}
var _default = parse;
exports["default"] = _default;

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

module.exports = require('./build/yurine')['default'];
module.exports = require('./build/yurine')['default'];
{
"name": "yurine",
"version": "0.1.2",
"version": "0.1.3",
"description": "A CSX transformer for karas",

@@ -21,2 +21,3 @@ "author": "army8735 <army8735@qq.com>",

"dev": "gulp watch",
"pack": "rollup -c rollup.config.js",
"test": "make test"

@@ -29,4 +30,3 @@ },

"dependencies": {
"homunculus": "~1.4.2",
"jaw": "~5.0.0"
"homunculus": "~1.6.0"
},

@@ -45,2 +45,5 @@ "devDependencies": {

"mocha-lcov-reporter": "^0.0.2",
"rollup": "^1.21.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"through2": "^3.0.0"

@@ -47,0 +50,0 @@ },

import homunculus from 'homunculus';
import ignore from './ignore';
import InnerTree from './InnerTree';
import join from './join';
import join2 from './join2';
import jaw from 'jaw';

@@ -20,13 +16,5 @@ let Token = homunculus.getClass('token', 'csx');

let objltr = prmr.first();
if(objltr && objltr.name() === Node.OBJLTR) {
res = ignore(node.first(), true).res + '[';
recursion(objltr);
res += ignore(node.last(), true).res + ']';
}
else {
let tree = new InnerTree();
res = tree.parse(node);
res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
res = filter(res);
}
let tree = new InnerTree();
res = tree.parse(node);
res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
}

@@ -37,3 +25,2 @@ else {

res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
res = filter(res);
}

@@ -43,35 +30,2 @@ return res;

function recursion(objltr) {
res += ignore(objltr.first(), true).res;
for(let i = 1, len = objltr.size(); i < len - 1; i++) {
let leaf = objltr.leaf(i);
if(leaf.isToken()) {
let s = join2(leaf);
res += s;
}
else if(leaf.name() === Node.PROPTDEF) {
res += '[';
let proptname = leaf.first();
let s = join(proptname).replace(/^(["'])(.+)\1$/, '$2') + '{}';
s = jaw.parse(s, { noPriority: true, noValue: true, noMedia: true });
res += JSON.stringify(s);
res += ',';
res += filter(join(leaf.last()));
res += ']';
res += ignore(leaf, true).res;
}
}
res += ignore(objltr.last(), true).res;
}
function filter(s) {
if(/^\s*this\b/.test(s) || /^\s*function\b/.test(s)) {
if(/^\s*this\s*\.\s*model\s*\./.test(s)) {
return 'new yurine.Cb(this.model,' + s + ')';
}
return 'new yurine.Cb(this,' + s + ')';
}
return s;
}
export default parse;
export default parse;

@@ -10,12 +10,4 @@ define(function(require, exports, module){"use strict";

var _ignore = _interopRequireDefault(require("./ignore"));
var _InnerTree = _interopRequireDefault(require("./InnerTree"));
var _join = _interopRequireDefault(require("./join"));
var _join2 = _interopRequireDefault(require("./join2"));
var _jaw = _interopRequireDefault(require("jaw"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

@@ -36,13 +28,5 @@

var objltr = prmr.first();
if (objltr && objltr.name() === Node.OBJLTR) {
res = (0, _ignore["default"])(node.first(), true).res + '[';
recursion(objltr);
res += (0, _ignore["default"])(node.last(), true).res + ']';
} else {
var tree = new _InnerTree["default"]();
res = tree.parse(node);
res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
res = filter(res);
}
var tree = new _InnerTree["default"]();
res = tree.parse(node);
res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
} else {

@@ -53,3 +37,2 @@ var _tree = new _InnerTree["default"]();

res = res.replace(/^(\s*){/, '$1').replace(/}(\s*)$/, '$1');
res = filter(res);
}

@@ -60,46 +43,3 @@

function recursion(objltr) {
res += (0, _ignore["default"])(objltr.first(), true).res;
for (var i = 1, len = objltr.size(); i < len - 1; i++) {
var leaf = objltr.leaf(i);
if (leaf.isToken()) {
var s = (0, _join2["default"])(leaf);
res += s;
} else if (leaf.name() === Node.PROPTDEF) {
res += '[';
var proptname = leaf.first();
var _s = (0, _join["default"])(proptname).replace(/^(["'])(.+)\1$/, '$2') + '{}';
_s = _jaw["default"].parse(_s, {
noPriority: true,
noValue: true,
noMedia: true
});
res += JSON.stringify(_s);
res += ',';
res += filter((0, _join["default"])(leaf.last()));
res += ']';
res += (0, _ignore["default"])(leaf, true).res;
}
}
res += (0, _ignore["default"])(objltr.last(), true).res;
}
function filter(s) {
if (/^\s*this\b/.test(s) || /^\s*function\b/.test(s)) {
if (/^\s*this\s*\.\s*model\s*\./.test(s)) {
return 'new yurine.Cb(this.model,' + s + ')';
}
return 'new yurine.Cb(this,' + s + ')';
}
return s;
}
var _default = parse;
exports["default"] = _default;});
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