@jsep-plugin/object
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -12,3 +12,3 @@ 'use strict'; | ||
init(jsep) { | ||
jsep.addBinaryOp(':', 0.5); | ||
jsep.addBinaryOp(':', 0.95); // > assignment operators at 0.9 | ||
@@ -26,2 +26,3 @@ // Object literal support | ||
key: arg, | ||
value: arg, | ||
shorthand: true, | ||
@@ -45,6 +46,6 @@ }; | ||
}); | ||
env.node = { | ||
env.node = this.gobbleTokenProperty({ | ||
type: OBJECT_EXP, | ||
properties, | ||
}; | ||
}); | ||
} | ||
@@ -51,0 +52,0 @@ } |
@@ -1,2 +0,2 @@ | ||
"use strict";var e={name:"object",init(e){function t(t){if(123===this.code){this.index++;const o=this.gobbleArguments(125).map((t=>{if(t.type===e.IDENTIFIER)return{type:"Property",computed:!1,key:t,shorthand:!0};if(t.type===e.BINARY_EXP){const o=t.left.type===e.ARRAY_EXP;return{type:"Property",computed:o,key:o?t.left.elements[0]:t.left,value:t.right,shorthand:!1}}return t}));t.node={type:"ObjectExpression",properties:o}}}e.addBinaryOp(":",.5),e.hooks.add("gobble-token",t),e.hooks.add("after-token",t)}};module.exports=e; | ||
"use strict";var e={name:"object",init(e){function t(t){if(123===this.code){this.index++;const o=this.gobbleArguments(125).map((t=>{if(t.type===e.IDENTIFIER)return{type:"Property",computed:!1,key:t,value:t,shorthand:!0};if(t.type===e.BINARY_EXP){const o=t.left.type===e.ARRAY_EXP;return{type:"Property",computed:o,key:o?t.left.elements[0]:t.left,value:t.right,shorthand:!1}}return t}));t.node=this.gobbleTokenProperty({type:"ObjectExpression",properties:o})}}e.addBinaryOp(":",.95),e.hooks.add("gobble-token",t),e.hooks.add("after-token",t)}};module.exports=e; | ||
//# sourceMappingURL=index.cjs.min.js.map |
{ | ||
"type": "commonjs" | ||
} |
@@ -13,3 +13,3 @@ var index = (function () { | ||
init(jsep) { | ||
jsep.addBinaryOp(':', 0.5); | ||
jsep.addBinaryOp(':', 0.95); // > assignment operators at 0.9 | ||
@@ -27,2 +27,3 @@ // Object literal support | ||
key: arg, | ||
value: arg, | ||
shorthand: true, | ||
@@ -46,6 +47,6 @@ }; | ||
}); | ||
env.node = { | ||
env.node = this.gobbleTokenProperty({ | ||
type: OBJECT_EXP, | ||
properties, | ||
}; | ||
}); | ||
} | ||
@@ -52,0 +53,0 @@ } |
@@ -1,2 +0,2 @@ | ||
var index=function(){"use strict";const e="Property";return{name:"object",init(t){function n(n){if(123===this.code){this.index++;const o=this.gobbleArguments(125).map((n=>{if(n.type===t.IDENTIFIER)return{type:e,computed:!1,key:n,shorthand:!0};if(n.type===t.BINARY_EXP){const o=n.left.type===t.ARRAY_EXP;return{type:e,computed:o,key:o?n.left.elements[0]:n.left,value:n.right,shorthand:!1}}return n}));n.node={type:"ObjectExpression",properties:o}}}t.addBinaryOp(":",.5),t.hooks.add("gobble-token",n),t.hooks.add("after-token",n)}}}(); | ||
var index=function(){"use strict";const e="Property";return{name:"object",init(t){function o(o){if(123===this.code){this.index++;const n=this.gobbleArguments(125).map((o=>{if(o.type===t.IDENTIFIER)return{type:e,computed:!1,key:o,value:o,shorthand:!0};if(o.type===t.BINARY_EXP){const n=o.left.type===t.ARRAY_EXP;return{type:e,computed:n,key:n?o.left.elements[0]:o.left,value:o.right,shorthand:!1}}return o}));o.node=this.gobbleTokenProperty({type:"ObjectExpression",properties:n})}}t.addBinaryOp(":",.95),t.hooks.add("gobble-token",o),t.hooks.add("after-token",o)}}}(); | ||
//# sourceMappingURL=index.iife.min.js.map |
@@ -10,3 +10,3 @@ const OCURLY_CODE = 123; // { | ||
init(jsep) { | ||
jsep.addBinaryOp(':', 0.5); | ||
jsep.addBinaryOp(':', 0.95); // > assignment operators at 0.9 | ||
@@ -24,2 +24,3 @@ // Object literal support | ||
key: arg, | ||
value: arg, | ||
shorthand: true, | ||
@@ -43,6 +44,6 @@ }; | ||
}); | ||
env.node = { | ||
env.node = this.gobbleTokenProperty({ | ||
type: OBJECT_EXP, | ||
properties, | ||
}; | ||
}); | ||
} | ||
@@ -49,0 +50,0 @@ } |
@@ -1,2 +0,2 @@ | ||
var e={name:"object",init(e){function t(t){if(123===this.code){this.index++;const o=this.gobbleArguments(125).map((t=>{if(t.type===e.IDENTIFIER)return{type:"Property",computed:!1,key:t,shorthand:!0};if(t.type===e.BINARY_EXP){const o=t.left.type===e.ARRAY_EXP;return{type:"Property",computed:o,key:o?t.left.elements[0]:t.left,value:t.right,shorthand:!1}}return t}));t.node={type:"ObjectExpression",properties:o}}}e.addBinaryOp(":",.5),e.hooks.add("gobble-token",t),e.hooks.add("after-token",t)}};export{e as default}; | ||
var e={name:"object",init(e){function t(t){if(123===this.code){this.index++;const o=this.gobbleArguments(125).map((t=>{if(t.type===e.IDENTIFIER)return{type:"Property",computed:!1,key:t,value:t,shorthand:!0};if(t.type===e.BINARY_EXP){const o=t.left.type===e.ARRAY_EXP;return{type:"Property",computed:o,key:o?t.left.elements[0]:t.left,value:t.right,shorthand:!1}}return t}));t.node=this.gobbleTokenProperty({type:"ObjectExpression",properties:o})}}e.addBinaryOp(":",.95),e.hooks.add("gobble-token",t),e.hooks.add("after-token",t)}};export{e as default}; | ||
//# sourceMappingURL=index.min.js.map |
{ | ||
"name": "@jsep-plugin/object", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Adds object expression support", | ||
@@ -5,0 +5,0 @@ "author": "Shelly (https://github.com/6utt3rfly)", |
@@ -14,3 +14,3 @@ [npm]: https://img.shields.io/npm/v/@jsep-plugin/object | ||
```javascript | ||
jsep('{ a: 1, b: { c }}'); | ||
jsep('{ a: 1, b: { c }}[d]'); | ||
``` | ||
@@ -17,0 +17,0 @@ |
@@ -0,0 +0,0 @@ import * as jsep from 'jsep'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
21666
180