Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including object-chain with all npm packages installed. Try it out:

const objectChain = require('object-chain'); const match = objectChain({ beginningOfInput: '^', endOfInput: '#x27;, anySingleCharExceptTheNewline: '.', zeroOrMoreTimes: '*', oneOrMoreTimes: '+', zeroOrOneTime: '?', or: '|', escapeChar: '\\', backslash: '\\', backspace: '\\b', nonWordBoundary: '\\B', digit: '\\d', nonDigitChar: '\\D', formFeed: '\\f', lineFeed: '\\n', carriageReturn: '\\r', whiteSpace: '\\s', tab: '\\t', verticalTab: '\\v', alphanumericChar: '\\w', nonWordChar: '\\W', nil: '\\0', lowerCase: '[a-z]', upperCase: '[A-Z]', letter: '[a-zA-Z]', number: '[0-9]', varchar: '[$0-9A-Za-z_\\s]', pathChar: '[@$0-9a-zA-Z_\\s-.\\/]', value: (self, last, value) => `${self}${value}`, controlChar: (self, last, value) => `${self}\\c${value}`, notRemember: (self, last, value) => `${self}(?:${value})`, ifFollowedBy: (self, last, value) => `${self}(?=${value})`, ifNotFollowedBy: (self, last, value) => `${self}(?!${value})`, notCharset: (self, last, value) => `${self}[^${value}]`, charset: (self, last, value) => `${self}[${value}]`, size: (self, last, value) => `${self}{${value>>>0}}`, atLeast: (self, last, value) => `${self}{${value>>>0},}`, atMost: (self, last, value) => `${self}{,${value>>>0}}`, group: (self, last, value) => `${self}(${value})`, range: (self, last, min, max) => `${self}{${min>>>0},${max>>>0}}`, flags: (self, last, value) => new RegExp(self, value), }); const matchId = match.beginningOfInput.group(match.digit()).range(3, 8).endOfInput.flags('i'); const rId = matchId(); [ rId.test('abc'), rId.test(123), rId, ]

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

object-chain v1.1.0

Create objects with chainable properties

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free