New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pico-engine-core

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pico-engine-core - npm Package Versions

1
15

0.14.5

Diff

b1conrad
published 0.14.4 •

farskipper
published 0.14.3 •

farskipper
published 0.14.2 •

farskipper
published 0.14.1 •

farskipper
published 0.14.0 •

farskipper
published 0.13.2 •

farskipper
published 0.13.1 •

farskipper
published 0.13.0 •

Changelog

Source

0.13.0 - September 13, 2017

b1conrad
published 0.12.0 •

Changelog

Source

0.12.0 - May 25, 2017

New Features

  • defaction can return values (expose values to setting(..))
<name> = defaction(<params...>){
     <declaration 0>
     <declaration 1>
     ...

     <action block (i.e. anything you would put in a rule action)>

    returns <expr 0>, <expr 1>, ...
}

NOTE: returns is optional

For example

global {
    foo = defaction(){

        send_directive("foobar")

        returns 1, 2, 3
    }
}
rule bar {
    select when ...

    foo() setting(a, b, c)

    fired {
        //a = 1, b = 2, c = 3
    }
}

Another example

global {
    foo = defaction(){
        every {
            http:get(...) setting(resp)
        }
        return resp["content"].decode()["msg"]
    }
}
rule bar {
    select when ...

    foo() setting(message)
}
  • new action block type: sample This will randomly select an action to run.
rule bar {
    select when ...

    //randomly pick one of these 3 actions to run
    sample {
        send_directive("foo")

        send_directive("bar")

        send_directive("baz")
    }
}
  • action block syntax. The semi-colons are optional.
ActionBlock ->
      <action> ;
    | if <expr> then <action> ;
    | if <expr> then every  { <action 0> ; <action 1> ; ... }
    | if <expr> then sample { <action 0> ; <action 1> ; ... }
    | every  { <action 0> ; <action 1> ; ... }
    | sample { <action 0> ; <action 1> ; ... }
    | choose <expr> { <action 0> ; <action 1> ; ... }

BREAKING CHANGES

  • with is no longer used for named arguments. Both for functions and actions.
//OLD WAY
foo(1, 2) with a = 3 and b = 4

//NEW WAY
foo(1, 2, a = 3, b = 4)
  • with is no longer used on raise/schedule
//OLD WAY
raise domain event "type" with foo = 1 and bar = 2

//NEW WAY
raise domain event "type" attributes {"foo": 1, "bar": 2}
  • send_directive no longer uses with it's now send_directive(name, options = {})
//OLD WAY
send_directive("name") with foo = x and bar = y

//NEW WAY
send_directive("name", {"foo": x, "bar": y})
  • No optional semi-colon after select when ...
//OLD WAY
select when foo bar;

//NEW WAY
select when foo bar

Bug Fixes

  • syntax ambiguities caused by with
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