Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Interface PTArgs

A customizer object for PTypes.

Hierarchy

  • PTArgs

Index

Cosmetic Properties

Optional separator

separator: string

A delimiter for PType.iterables when the List-value is a String.

Optional sort

sort: boolean

if true, PType.iterable items will be sorted by byte-size.

Optional join

join: string

Will join a PType.iterable with the specified value.

Example

var myIntList = [1,2,3,4];
var myIntType = PT.L.Int({ join: ' + ' });
console.log(myIntType.sanitze(myIntList));
// "1 + 2 + 3 + 4"

Optional enclose

enclose: [string, string]

A 2-length string Array, indicating characters to wrap a joined, PType.iterable with.

Example

var myIntList = [1,2,3,4];
var myIntType = PT.L.Int({ join: '|', enclose: ["<",">"] });
console.log(myIntType.sanitze(myIntList));
// "<1|2|3|4>"

Optional map

map: function

Will map a PType.iterable with the specified callback.

param

The Array item value.

param

The Array item index.

param

The current Array.

returns

The newly mapped Array.

Type declaration

    • <T>(value: T, index?: number, array?: Array<T>): Array<T>
    • Type parameters

      • T

      Parameters

      • value: T
      • Optional index: number
      • Optional array: Array<T>

      Returns Array<T>

Optional tags

tags: string[]

An Array of items that can be used within {@link PTOpts.sanitzer} and PTArgs.map callbacks.

Optional leveled

leveled: boolean

if true, PType.iterable "leveled" items (i.e: value@level) are considered Edits/Additions, while "non-leveled" items (i.e: value) are marked separately for removal.

Optional grouped

grouped: boolean

if true, PType.iterable items will be grouped according to their key (i.e: key@value).

Optional restricted

restricted: boolean

Toggles all of the restriction-properties on or off.

Restrictive Properties

Optional selects

selects: Array<object>

A list of Key/Value pairs for restricting any type.

Optional omit

omit: string[]

An array of values to ignore in {@link PTArgs.select} restrictions.

Optional slice

slice: [number, number]

An Array of Array.slice() parameters for restricting the length of a PType.iterable.

Array[0] = 2;  // Where the slice STARTS.
Array[1] = 10; // The LENGTH of the slice, or undefined.

Optional step

step: number

The increment a Number-PType must adhere to.

Optional min

min: number

The minimum amount a Number-PType can be.

Optional max

max: number

The maximum amount a Number-PType can be.

Optional regex

regex: RegExp

A RegexP pattern a Text-type must match.

Optional hidden

hidden: boolean

If true, this type should be obfuscated.