# booking/11.9/vendors/imask/esm/masked/pipe.js

Booking Calendar, version 11.9. 35 lines.

- Page: https://pluginprobe.com/plugins/booking/11.9/code/vendors/imask/esm/masked/pipe.js
- Raw: https://pluginprobe.com/plugins/booking/11.9/raw/vendors/imask/esm/masked/pipe.js
- Modified: 2025-07-25T07:28:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/booking/11.9/code/vendors/imask/esm/masked/pipe.js#L10-L20`.

```javascript
import createMask from './factory.js';
import IMask from '../core/holder.js';
import '../core/utils.js';

/** Mask pipe source and destination types */
const PIPE_TYPE = {
  MASKED: 'value',
  UNMASKED: 'unmaskedValue',
  TYPED: 'typedValue'
};
/** Creates new pipe function depending on mask type, source and destination options */
function createPipe(arg, from, to) {
  if (from === void 0) {
    from = PIPE_TYPE.MASKED;
  }
  if (to === void 0) {
    to = PIPE_TYPE.MASKED;
  }
  const masked = createMask(arg);
  return value => masked.runIsolated(m => {
    m[from] = value;
    return m[to];
  });
}

/** Pipes value through mask depending on mask type, source and destination options */
function pipe(value, mask, from, to) {
  return createPipe(mask, from, to)(value);
}
IMask.PIPE_TYPE = PIPE_TYPE;
IMask.createPipe = createPipe;
IMask.pipe = pipe;

export { PIPE_TYPE, createPipe, pipe };

```
