Skip to content

Commit 42611ab

Browse files
committed
Thx Ramda for a breaking change in a minor version update
1 parent 49769f7 commit 42611ab

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/formal-syntax.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import { memoize, without, range } from 'ramda'
1+
import { memoizeWith, identity, without, range } from 'ramda'
22

33
// IMAP Formal Syntax
44
// http://tools.ietf.org/html/rfc3501#section-9
55

66
const expandRange = (start, end) => String.fromCharCode.apply(String, range(start, end + 1))
77
const excludeChars = (source, exclude) => without(exclude.split(''), source.split('')).join('')
88

9-
export const CHAR = memoize(() => expandRange(0x01, 0x7F))
10-
export const CHAR8 = memoize(() => expandRange(0x01, 0xFF))
9+
export const CHAR = memoizeWith(identity, () => expandRange(0x01, 0x7F))
10+
export const CHAR8 = memoizeWith(identity, () => expandRange(0x01, 0xFF))
1111
export const SP = () => ' '
12-
export const CTL = memoize(() => expandRange(0x00, 0x1F) + '\x7F')
12+
export const CTL = memoizeWith(identity, () => expandRange(0x00, 0x1F) + '\x7F')
1313
export const DQUOTE = () => '"'
14-
export const ALPHA = memoize(() => expandRange(0x41, 0x5A) + expandRange(0x61, 0x7A))
15-
export const DIGIT = memoize(() => expandRange(0x30, 0x39) + expandRange(0x61, 0x7A))
16-
export const ATOM_CHAR = memoize(() => excludeChars(CHAR(), ATOM_SPECIALS()))
17-
export const ASTRING_CHAR = memoize(() => ATOM_CHAR() + RESP_SPECIALS())
18-
export const TEXT_CHAR = memoize(() => excludeChars(CHAR(), '\r\n'))
19-
export const ATOM_SPECIALS = memoize(() => '(' + ')' + '{' + SP() + CTL() + LIST_WILDCARDS() + QUOTED_SPECIALS() + RESP_SPECIALS())
14+
export const ALPHA = memoizeWith(identity, () => expandRange(0x41, 0x5A) + expandRange(0x61, 0x7A))
15+
export const DIGIT = memoizeWith(identity, () => expandRange(0x30, 0x39) + expandRange(0x61, 0x7A))
16+
export const ATOM_CHAR = memoizeWith(identity, () => excludeChars(CHAR(), ATOM_SPECIALS()))
17+
export const ASTRING_CHAR = memoizeWith(identity, () => ATOM_CHAR() + RESP_SPECIALS())
18+
export const TEXT_CHAR = memoizeWith(identity, () => excludeChars(CHAR(), '\r\n'))
19+
export const ATOM_SPECIALS = memoizeWith(identity, () => '(' + ')' + '{' + SP() + CTL() + LIST_WILDCARDS() + QUOTED_SPECIALS() + RESP_SPECIALS())
2020
export const LIST_WILDCARDS = () => '%' + '*'
21-
export const QUOTED_SPECIALS = memoize(() => DQUOTE() + '\\')
21+
export const QUOTED_SPECIALS = memoizeWith(identity, () => DQUOTE() + '\\')
2222
export const RESP_SPECIALS = () => ']'
23-
export const TAG = memoize(() => excludeChars(ASTRING_CHAR(), '+'))
24-
export const COMMAND = memoize(() => ALPHA() + DIGIT())
23+
export const TAG = memoizeWith(identity, () => excludeChars(ASTRING_CHAR(), '+'))
24+
export const COMMAND = memoizeWith(identity, () => ALPHA() + DIGIT())
2525
export const verify = function (str, allowedChars) {
2626
for (var i = 0, len = str.length; i < len; i++) {
2727
if (allowedChars.indexOf(str.charAt(i)) < 0) {

0 commit comments

Comments
 (0)