JSSM, a JavaScript state machine - the FSM for FSL
    Preparing search index...

    Function array_box_if_string


    • Wraps a string in an array, or passes through if already non-string. Used to normalize arguments that accept either a single state name or an array of state names.

      array_box_if_string('hello');    // ['hello']
      array_box_if_string(['a','b']); // ['a','b']

      Parameters

      • n: any

        A string to box, or a value to pass through unchanged.

      Returns any

      The input wrapped in an array if it was a string, otherwise the input unchanged.