OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
silver
/
main
/
ts
/
ui
/
sizing
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:40:48 AM
rwxr-xr-x
📄
Resize.ts
1.86 KB
02/20/2020 06:38:48 AM
rw-r--r--
📄
Utils.ts
645 bytes
02/20/2020 06:38:50 AM
rw-r--r--
Editing: Utils.ts
Close
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ import { Option, Type } from '@ephox/katamari'; const parseToInt = (val) => { // if size is a number or '_px', will return the number const re = /^[0-9\.]+(|px)$/i; if (re.test('' + val)) { return Option.some(parseInt(val, 10)); } return Option.none(); }; const numToPx = (val) => { return Type.isNumber(val) ? val + 'px' : val; }; export default { parseToInt, numToPx };