Returns true or false depending on value set in looter

const context = { a: { b: 'foo', c: true, d: false } };
dependContext({ context, args: { property: 'a.b' } }); // true
dependContext({ context, args: { property: 'a.b', tobe: 'foo' } }); // true
dependContext({ context, args: { property: 'a.c', tobe: 'foo' } }); // false
dependContext({ context, args: { property: 'a.c' } }); // true
dependContext({ context, args: { property: 'a.d' } }); // false
// Use in a json file:
{
"pools": [
{
"conditions": [
{
"function": "dependContext",
"args": {
"property": "physical.wet"
}
}
],
"entries": [
{
"id": "soggy_newspaper"
}
]
}
]
}
  • Parameters

    • args: {
          args: {
              inverse?: boolean;
              max?: number;
              min?: number;
              property?: string;
              strict?: boolean;
              tobe?: any;
          };
          context: any;
      }
      • args: {
            inverse?: boolean;
            max?: number;
            min?: number;
            property?: string;
            strict?: boolean;
            tobe?: any;
        }
        • Optionalinverse?: boolean
        • Optionalmax?: number
        • Optionalmin?: number
        • Optionalproperty?: string
        • Optionalstrict?: boolean
        • Optionaltobe?: any
      • context: any

    Returns boolean