diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..11c5874 Binary files /dev/null and b/.DS_Store differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..8dac0f0 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +

+ +#### Dweb ❌ Incheon National University (INU) + +## 🌟 Base code for the term project in Web class + +⚠️ Copyright © 2024. _Dweb_ All Rights Reserved. + +

diff --git a/app.js b/app.js new file mode 100644 index 0000000..f65f3ee --- /dev/null +++ b/app.js @@ -0,0 +1,103 @@ +'use strict'; + +/** + * Module dependencies. + */ + +var express = require('express'); +var http = require('http'); + +var socket = require('./routes/socket.js'); + +var app = express(); +var server = http.createServer(app); + +/* Configuration */ +app.set('views', __dirname + '/views'); +app.use(express.static(__dirname + '/public')); +app.set('port', 3000); + +if (process.env.NODE_ENV === 'development') { + app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); +} + +/* Socket.io Communication */ +var io = require('socket.io').listen(server); +io.sockets.on('connection', socket); + +/* Start server */ +server.listen(app.get('port'), function (){ + //console.log('Express server listening on port %d in %s mode', app.get('port'), app.get('env')); +}); + + + + +const bodyParser = require('body-parser'); +app.use(bodyParser.json()); +let users = []; //유저 목록을 관리하는 배열 + +// Register endpoint +app.post('/api/register', (req, res) => { + const { username, password } = req.body; + + // 동일한 이름의 사용자가 존재하는지 체크 + if (users.find(user => user.username === username)) { + return res.json({ success: false, message: '이미 사용 중인 아이디입니다.' }); + } + + // 유저 리스트에 추가 + users.push({ username, password }); + let ids = users.map(user => user.username); + res.json({ success: true, userlist: ids }); +}); + +// Login endpoint +app.post('/api/login', (req, res) => { + const { username, password } = req.body; + + // 아이디와 비밀번호가 일치하는지 검사 + const user = users.find(user => + user.username === username && user.password === password); + if (user) { + res.json({ success: true }); + } else { + res.json({ success: false, + message: '아이디 또는 비밀번호가 올바르지 않습니다.' }); + } +}); + +// Update user endpoint +app.post('/api/update', (req, res) => { + const { currentname, newName } = req.body; + //console.log(currentname, newName); + + // 동일한 이름의 사용자가 존재하는지 체크 + if (users.find(user => user.username === newName)) { + return res.json({ success: false, message: '이미 사용 중인 아이디입니다.' }); + } + + // 현재 이름을 찾아서 + const userIndex = users.findIndex(user => user.username === currentname); + + if (userIndex !== -1) { + // 새 이름으로 update + users[userIndex].username = newName; + res.json({ success: true, message: '아이디가 성공적으로 변경되었습니다.' }); + //console.log(users, '성공'); + } else { + res.json({ success: false, message: '해당하는 아이디를 찾을 수 없습니다.' }); + //console.log('실패'); + + } +}); + +// Get endpoint +app.post('/api/get', (req, res) => { + let ids = users.map(user => user.username); + res.json({userlist : ids}); +}); + + + +module.exports = app; \ No newline at end of file diff --git a/client/app.jsx b/client/app.jsx new file mode 100644 index 0000000..9056ee2 --- /dev/null +++ b/client/app.jsx @@ -0,0 +1,814 @@ +'use strict'; + +var React = require('react'); + +var socket = io.connect(); + + +var RoomTitle = React.createClass({ + render() { + return ( +
+ {this.props.roomname} +
+ ); + } +}); + +var UsersList = React.createClass({ + render() { + return ( +
+

참여자들

+ +
+ ); + } +}); + +var Message = React.createClass({ + render() { + //console.log('messageuser:', this.props.user, 'loginuser:', this.props.curruser); + if(this.props.user == this.props.curruser){ + return ( +
+
+
+ userlogo + {this.props.user} +
+
+
+ {this.props.time} +
+
+ {this.props.text} +
+
+
+ +
+ ); + }else{ + return ( +
+
+
+ userlogo + {this.props.user} +
+
+
+ {this.props.text} +
+
+ {this.props.time} +
+
+
+ +
+ ); + } + } +}); + +var MessageList = React.createClass({ + + render() { + + return ( +
+

채팅방

+ { + this.props.messages.map((message, i) => { + return ( + + ); + }) + } +
+ ); + } +}); + +const emojis = ['😀', '😂', '😍', '😭', '😡', '👍', '👎', '🙏', '❤️', '🔥']; + +var EmoticonList = React.createClass({ + + + togglePicker() { + if(this.state.isOpen) + this.setState({isOpen:false}); + else + this.setState({isOpen:true}); + }, + + handleSelect(emoji) { + this.setState({isOpen:false}); + + var today = new Date(); + + var year = today.getFullYear(); + var month = ('0' + (today.getMonth() + 1)).slice(-2); + var day = ('0' + today.getDate()).slice(-2); + var hours = ('0' + today.getHours()).slice(-2); + var minutes = ('0' + today.getMinutes()).slice(-2); + var seconds = ('0' + today.getSeconds()).slice(-2); + + var formattedTime = year + '년' + month + '월' + day + '일 ' + hours + ':' + minutes + ':' + seconds; + var message = { + user : this.props.user, + text : emoji, + time : formattedTime + } + if(message.text!=""){ + this.props.onMessageSubmit(message); + this.props.onEmoticionBtnClicked(); + } + }, + + render() { + + return ( +
+
+
+

이모티콘 선택

+
    + { + emojis.map((emoji) => { + return ( +
  • this.handleSelect(emoji)}> + {emoji} +
  • + ); + }) + } +
+ +
+
+
+ ); + + + } +}); + + var MessageForm = React.createClass({ + + getInitialState() { + return { + text: '', + }; + }, + + handleSubmit(e) { + e.preventDefault(); + + var today = new Date(); + + var year = today.getFullYear(); + var month = ('0' + (today.getMonth() + 1)).slice(-2); + var day = ('0' + today.getDate()).slice(-2); + var hours = ('0' + today.getHours()).slice(-2); + var minutes = ('0' + today.getMinutes()).slice(-2); + var seconds = ('0' + today.getSeconds()).slice(-2); + + var formattedTime = year + '년' + month + '월' + day + '일 ' + + hours + ':' + minutes + ':' + seconds; + var message = { + user : this.props.user, + text : this.state.text, + time : formattedTime + } + if(message.text!=""){ + this.props.onMessageSubmit(message); + this.setState({ text: '' }); + }else{ + alert('메시지를 입력해주세요!'); + } + }, + + changeHandler(e) { + this.setState({ text : e.target.value }); + }, + + + + render() { + return( +
+
+ + +
+
+ ); + } + }); + +var ChangeNameForm = React.createClass({ + getInitialState() { + return {newName: ''}; + }, + + onKey(e) { + this.setState({ newName : e.target.value }); + }, + + handleSubmit(e) { + e.preventDefault(); + var newName = this.state.newName; + if(newName == ''){ + alert('변경할 아이디를 입력해주세요!'); + return; + } + var currentname = this.props.currentname; + + // Send update request to server + fetch('/api/update', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ currentname, newName }) + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + alert(data.message); + this.props.onChangeName(newName); + } else { + alert(data.message); + } + }) + .catch(error => { + console.error('아이디 변경 오류:', error); + alert('아이디 변경 중 오류가 발생했습니다.'); + }); + + this.setState({ newName: '' }); + + }, + + render() { + return( +
+
+

아이디 변경

+
+
+

현재 아이디 : {this.props.currentname}

+
+ +
+
+
+ ); + } +}); + + +var UsersScreen = React.createClass({ + + getInitialState() { + return {userlist: []}; + }, + + componentDidMount() { + fetch('/api/get', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ }) + }) + .then(response => response.json()) + .then(data => { + this.setState({userlist : data.userlist}) + }) + }, + + render() { + //console.log(this.state.userlist); + + return( +
+
+

가입된 유저 목록

+
+
+ +
+
+ + + ); + } +}); + +var LoginScreen = React.createClass({ + getInitialState() { + return { + username: '', + password: '', + isRegistering: false, // Flag to switch between login and registration + currfunction: '로그인' + }; + }, + + handleUsernameChange(e) { + this.setState({ username: e.target.value }); + }, + + handlePasswordChange(e) { + this.setState({ password: e.target.value }); + }, + + handleLogin() { + const { username, password } = this.state; + + // Send login request to server + fetch('/api/login', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ username, password }) + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + // Login successful, proceed to chat room + this.props.onEnterChat(username); + } else { + // Login failed, show error message + alert('로그인 실패: 아이디 또는 비밀번호가 올바르지 않습니다.'); + } + }) + .catch(error => { + console.error('로그인 오류:', error); + alert('로그인 중 오류가 발생했습니다.'); + }); + }, + + handleRegister() { + const { username, password } = this.state; + if(username=='' || password==''){ + alert('아이디와 비밀번호를 모두 입력해주세요!'); + return; + } + + // Send registration request to server + fetch('/api/register', { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ username, password }) + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + // Registration successful, show success message + this.props.handleSetUsers(data.userlist); + alert('회원가입 성공!\n로그인 버튼을 눌러 로그인하세요.'); + this.setState({isRegistering:false, currfunction:'로그인'}) + } else { + // Registration failed, show error message + alert('회원가입 실패: 이미 사용 중인 아이디입니다.'); + } + }) + .catch(error => { + console.error('회원가입 오류:', error); + alert('회원가입 중 오류가 발생했습니다.'); + }); + }, + + handleFunction(){ + if(this.state.isRegistering){ + this.setState({isRegistering: !this.state.isRegistering, currfunction:"로그인"}); + }else{ + this.setState({isRegistering: !this.state.isRegistering, currfunction:"회원가입"}); + } + + }, + + render() { + return ( +
+
+ INU +
+ 횃불이 +
+

{this.state.currfunction}

+
+ +
+
+ +
+

+ {this.state.isRegistering ? ( + + ) : ( + + )} +
+ +
+
+ ); + } + +}); + + +var SelectRoom = React.createClass({ + getInitialState() { + return { + selectedRoom: null, + searchTerm: '', + rooms: [], + filteredRooms: [] + }; + }, + + componentDidMount() { + socket.emit('mounted:roomlist'); //서버에 roomlist 요청 + socket.on('init:roomlist', this.roomlist_init); //roomlist받아와서 초기화 + }, + componentWillUnmount() { + socket.off('init:roomlist'); // 이벤트 리스너 해제 + }, + + roomlist_init: function (data) { + //var {rooms} = data; + this.setState({rooms:data.rooms}); + }, + + handleRoomClick: function(roomId) { + this.setState({ selectedRoom: roomId }); + var userid = this.props.user; + socket.emit('select:room', roomId, userid); + //console.log('my room id is : ', roomId, 'curruserid is :', userid); + }, + + handleSearchChange: function(event) { + const searchTerm = event.target.value.toLowerCase(); + const filteredRooms = this.state.rooms.filter(room => + room.name.toLowerCase() === searchTerm + ); + //console.log(filteredRooms); + this.setState({ searchTerm, filteredRooms }); + }, + + handleNewRoom: function(roomname) { + //console.log(roomname); + if (roomname != ""){ + socket.emit('new:room',roomname); + this.setState({searchTerm:""}); + }else{ + alert("개설할 채팅방 이름을 입력하세요!!"); + } + }, + + render: function() { + const { searchTerm, filteredRooms, selectedRoom } = this.state; + const roomsToDisplay = searchTerm ? filteredRooms : this.state.rooms; + //console.log(roomsToDisplay.length); + + return ( +
+

채팅방 목록

+ + {roomsToDisplay.map(room => ( +

this.handleRoomClick(room.id)}> + + + + {room.name} + +
+ + 최근 메시지: + {room.messages.length > 0 && ( + {room.messages[room.messages.length - 1].text} + )} + {room.messages.length == 0 && ( + 없음 + )} + +
+

+ ))} + {!roomsToDisplay.length && (

채팅방이 없습니다.
채팅방을 개설하시겠습니까?



+

)} + {selectedRoom && ( +

현재 선택된 방: {this.state.rooms.find(room => room.id === selectedRoom).name}

+ )} +
+ ); + } + }); + + + var AppFrame = React.createClass({ + getInitialState() { + return { + enteredChat: false, // Initially not entered the chat + selectedMenu: 2, + user: '', //로그인된 유저 아이디 + users: [] + }; + }, + componentDidMount(){ + document.title = "인천대학교 채팅 페이지"; + }, + + handleEnterChat(username) { + //console.log(username); + socket.emit('send:username', username); + this.setState({ user: username}); + //console.log('로그인된아이디:', this.state.user); + this.setState({ enteredChat: true }); + }, + + handleMenuChange(menu) { + this.setState({ selectedMenu: menu }); + }, + + handleChangeName(newName) { + var oldName = this.state.user; + socket.emit('change:name', { name : newName}, (result) => { + if(!result) { + return alert('There was an error changing your name'); + } + var {users} = this.state; + var index = users.indexOf(oldName); + users.splice(index, 1, newName); + this.setState({users, user: newName}); + }); + }, + + handleLogout() { + this.setState({ enteredChat: false }); + }, + + handleSetUsers(userlist){ + this.setState({ users: userlist }); + + }, + + renderContent: function() { + switch(this.state.selectedMenu) { + case 1: + return + case 2: + return ; + case 3: + return ; + } + }, + + render() { + + if (!this.state.enteredChat) { + return ; + } else { + return ( +
+
+
+ INU +
+
+
+ 사용자 +

아이디 : {this.state.user}

+
+ +
+
+
+ +
+ {this.renderContent()} +
+
+
+ ); + } + } + }); + + var MenuFrame = React.createClass({ + + handleFriendMenuClick: function() { + this.props.onMenuChange(1); + }, + + handleChatMenuClick: function() { + this.props.onMenuChange(2); + }, + + handleUserMenuClick: function() { + this.props.onMenuChange(3); + }, + + render() { + return ( +
+ 친구 메뉴
+ 채팅 메뉴
+ 유저 메뉴
+
+ ); + } + }); + + + +var ChatApp = React.createClass({ + + getInitialState() { + return { + users: [], + messages: [], + text: '', + enteredChat: false, // Initially not entered the chat + roomid:'', + roomname:'', + user: '', + + emoticionbtnClicked : false + }; + }, + + componentDidMount() { + socket.on('init', this._initialize); + socket.on('send:message', this._messageRecieve); + socket.on('user:join', this._userJoined); + socket.on('user:left', this._userLeft); + socket.on('change:name', this._userChangedName); + this.setState({ + user:this.props.username + }); + }, + + _initialize(data) { + var {messages, roomid, roomname, users} = data; + this.setState({user: this.props.username, messages, roomid, roomname, users}); + //console.log(messages); + }, + + _userJoined(data) { + var {users} = data; + this.setState({users}); + }, + + _messageRecieve(message) { + //console.log("받은 메시지", message); + var {messages} = this.state; + messages.push(message); + this.setState({messages}); + }, + + handleMessageSubmit(message) { + //console.log(message); + var {messages} = this.state; + messages.push(message); + this.setState({messages}); + socket.emit('send:message', message, this.state.roomid); + }, + + + handleEmoticonbtnClick(){ + if(this.state.emoticionbtnClicked) + this.setState({emoticionbtnClicked:false}); + else + this.setState({emoticionbtnClicked:true}); + + }, + + renderContent(){ + if(this.state.emoticionbtnClicked==true) + return ; + else + return
+ }, + + + + render() { + + //console.log("roomid:", this.state.roomid); + return( +
+ + + { + // Conditional Rendering + } + {this.state.roomid.length===0 ?( //방이 선택되지 않은 경우 +
+ +
+ ) : ( //방이 선택된 경우 +
+
+ + +
+
+ {this.renderContent()} +
+
+ + +
+
+ )} + +
+ + ) + + } +}); + + + +React.render(, document.getElementById('app')); \ No newline at end of file diff --git a/images/Dweb.png b/images/Dweb.png new file mode 100644 index 0000000..27d9b68 Binary files /dev/null and b/images/Dweb.png differ diff --git a/images/INU.png b/images/INU.png new file mode 100644 index 0000000..cea7afc Binary files /dev/null and b/images/INU.png differ diff --git a/images/changeNameForm.png b/images/changeNameForm.png new file mode 100644 index 0000000..25d6ded Binary files /dev/null and b/images/changeNameForm.png differ diff --git a/images/chattingRoom.png b/images/chattingRoom.png new file mode 100644 index 0000000..4e0aa6d Binary files /dev/null and b/images/chattingRoom.png differ diff --git a/images/loginScreen.png b/images/loginScreen.png new file mode 100644 index 0000000..af678ec Binary files /dev/null and b/images/loginScreen.png differ diff --git a/images/mainScreen.png b/images/mainScreen.png new file mode 100644 index 0000000..3e3ce08 Binary files /dev/null and b/images/mainScreen.png differ diff --git a/images/selectEmoticon.png b/images/selectEmoticon.png new file mode 100644 index 0000000..fd6f187 Binary files /dev/null and b/images/selectEmoticon.png differ diff --git a/images/userlist.png b/images/userlist.png new file mode 100644 index 0000000..0947061 Binary files /dev/null and b/images/userlist.png differ diff --git a/node_modules/.bin/JSONStream b/node_modules/.bin/JSONStream new file mode 100644 index 0000000..936e297 --- /dev/null +++ b/node_modules/.bin/JSONStream @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../JSONStream/bin.js" "$@" +else + exec node "$basedir/../JSONStream/bin.js" "$@" +fi diff --git a/node_modules/.bin/JSONStream.cmd b/node_modules/.bin/JSONStream.cmd new file mode 100644 index 0000000..6b131c0 --- /dev/null +++ b/node_modules/.bin/JSONStream.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\JSONStream\bin.js" %* diff --git a/node_modules/.bin/JSONStream.ps1 b/node_modules/.bin/JSONStream.ps1 new file mode 100644 index 0000000..05f9d8a --- /dev/null +++ b/node_modules/.bin/JSONStream.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../JSONStream/bin.js" $args + } else { + & "$basedir/node$exe" "$basedir/../JSONStream/bin.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../JSONStream/bin.js" $args + } else { + & "node$exe" "$basedir/../JSONStream/bin.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 100644 index 0000000..679bd16 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" +else + exec node "$basedir/../acorn/bin/acorn" "$@" +fi diff --git a/node_modules/.bin/acorn.cmd b/node_modules/.bin/acorn.cmd new file mode 100644 index 0000000..a9324df --- /dev/null +++ b/node_modules/.bin/acorn.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %* diff --git a/node_modules/.bin/acorn.ps1 b/node_modules/.bin/acorn.ps1 new file mode 100644 index 0000000..6f6dcdd --- /dev/null +++ b/node_modules/.bin/acorn.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + } else { + & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../acorn/bin/acorn" $args + } else { + & "node$exe" "$basedir/../acorn/bin/acorn" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/browser-pack b/node_modules/.bin/browser-pack new file mode 100644 index 0000000..4e0e8ed --- /dev/null +++ b/node_modules/.bin/browser-pack @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../browser-pack/bin/cmd.js" "$@" +else + exec node "$basedir/../browser-pack/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/browser-pack.cmd b/node_modules/.bin/browser-pack.cmd new file mode 100644 index 0000000..7cd9465 --- /dev/null +++ b/node_modules/.bin/browser-pack.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browser-pack\bin\cmd.js" %* diff --git a/node_modules/.bin/browser-pack.ps1 b/node_modules/.bin/browser-pack.ps1 new file mode 100644 index 0000000..9807d60 --- /dev/null +++ b/node_modules/.bin/browser-pack.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../browser-pack/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../browser-pack/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../browser-pack/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../browser-pack/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/browserify b/node_modules/.bin/browserify new file mode 100644 index 0000000..cbb9eed --- /dev/null +++ b/node_modules/.bin/browserify @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../browserify/bin/cmd.js" "$@" +else + exec node "$basedir/../browserify/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/browserify.cmd b/node_modules/.bin/browserify.cmd new file mode 100644 index 0000000..f89a5c6 --- /dev/null +++ b/node_modules/.bin/browserify.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserify\bin\cmd.js" %* diff --git a/node_modules/.bin/browserify.ps1 b/node_modules/.bin/browserify.ps1 new file mode 100644 index 0000000..3992ac4 --- /dev/null +++ b/node_modules/.bin/browserify.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../browserify/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../browserify/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../browserify/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../browserify/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/commonize b/node_modules/.bin/commonize new file mode 100644 index 0000000..f7657e7 --- /dev/null +++ b/node_modules/.bin/commonize @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../commoner/bin/commonize" "$@" +else + exec node "$basedir/../commoner/bin/commonize" "$@" +fi diff --git a/node_modules/.bin/commonize.cmd b/node_modules/.bin/commonize.cmd new file mode 100644 index 0000000..333c81b --- /dev/null +++ b/node_modules/.bin/commonize.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\commoner\bin\commonize" %* diff --git a/node_modules/.bin/commonize.ps1 b/node_modules/.bin/commonize.ps1 new file mode 100644 index 0000000..70231f1 --- /dev/null +++ b/node_modules/.bin/commonize.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../commoner/bin/commonize" $args + } else { + & "$basedir/node$exe" "$basedir/../commoner/bin/commonize" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../commoner/bin/commonize" $args + } else { + & "node$exe" "$basedir/../commoner/bin/commonize" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/defs b/node_modules/.bin/defs new file mode 100644 index 0000000..bccce9e --- /dev/null +++ b/node_modules/.bin/defs @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../defs/build/es5/defs" "$@" +else + exec node "$basedir/../defs/build/es5/defs" "$@" +fi diff --git a/node_modules/.bin/defs.cmd b/node_modules/.bin/defs.cmd new file mode 100644 index 0000000..8030f9b --- /dev/null +++ b/node_modules/.bin/defs.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\defs\build\es5\defs" %* diff --git a/node_modules/.bin/defs.ps1 b/node_modules/.bin/defs.ps1 new file mode 100644 index 0000000..e9e7d65 --- /dev/null +++ b/node_modules/.bin/defs.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../defs/build/es5/defs" $args + } else { + & "$basedir/node$exe" "$basedir/../defs/build/es5/defs" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../defs/build/es5/defs" $args + } else { + & "node$exe" "$basedir/../defs/build/es5/defs" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/deps-sort b/node_modules/.bin/deps-sort new file mode 100644 index 0000000..d637b5c --- /dev/null +++ b/node_modules/.bin/deps-sort @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../deps-sort/bin/cmd.js" "$@" +else + exec node "$basedir/../deps-sort/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/deps-sort.cmd b/node_modules/.bin/deps-sort.cmd new file mode 100644 index 0000000..2064456 --- /dev/null +++ b/node_modules/.bin/deps-sort.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\deps-sort\bin\cmd.js" %* diff --git a/node_modules/.bin/deps-sort.ps1 b/node_modules/.bin/deps-sort.ps1 new file mode 100644 index 0000000..2857052 --- /dev/null +++ b/node_modules/.bin/deps-sort.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../deps-sort/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../deps-sort/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../deps-sort/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../deps-sort/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/detect-indent b/node_modules/.bin/detect-indent new file mode 100644 index 0000000..3452bf8 --- /dev/null +++ b/node_modules/.bin/detect-indent @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../detect-indent/cli.js" "$@" +else + exec node "$basedir/../detect-indent/cli.js" "$@" +fi diff --git a/node_modules/.bin/detect-indent.cmd b/node_modules/.bin/detect-indent.cmd new file mode 100644 index 0000000..37a99e0 --- /dev/null +++ b/node_modules/.bin/detect-indent.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\detect-indent\cli.js" %* diff --git a/node_modules/.bin/detect-indent.ps1 b/node_modules/.bin/detect-indent.ps1 new file mode 100644 index 0000000..bb15e0c --- /dev/null +++ b/node_modules/.bin/detect-indent.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../detect-indent/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../detect-indent/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../detect-indent/cli.js" $args + } else { + & "node$exe" "$basedir/../detect-indent/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/envify b/node_modules/.bin/envify new file mode 100644 index 0000000..6091dcc --- /dev/null +++ b/node_modules/.bin/envify @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../envify/bin/envify" "$@" +else + exec node "$basedir/../envify/bin/envify" "$@" +fi diff --git a/node_modules/.bin/envify.cmd b/node_modules/.bin/envify.cmd new file mode 100644 index 0000000..2c47101 --- /dev/null +++ b/node_modules/.bin/envify.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\envify\bin\envify" %* diff --git a/node_modules/.bin/envify.ps1 b/node_modules/.bin/envify.ps1 new file mode 100644 index 0000000..504345b --- /dev/null +++ b/node_modules/.bin/envify.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../envify/bin/envify" $args + } else { + & "$basedir/node$exe" "$basedir/../envify/bin/envify" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../envify/bin/envify" $args + } else { + & "node$exe" "$basedir/../envify/bin/envify" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 100644 index 0000000..601762c --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" +else + exec node "$basedir/../esprima/bin/esparse.js" "$@" +fi diff --git a/node_modules/.bin/esparse.cmd b/node_modules/.bin/esparse.cmd new file mode 100644 index 0000000..2ca6d50 --- /dev/null +++ b/node_modules/.bin/esparse.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* diff --git a/node_modules/.bin/esparse.ps1 b/node_modules/.bin/esparse.ps1 new file mode 100644 index 0000000..f19ed73 --- /dev/null +++ b/node_modules/.bin/esparse.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + } else { + & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + } else { + & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 100644 index 0000000..e2fee1f --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" +else + exec node "$basedir/../esprima/bin/esvalidate.js" "$@" +fi diff --git a/node_modules/.bin/esvalidate.cmd b/node_modules/.bin/esvalidate.cmd new file mode 100644 index 0000000..4c41643 --- /dev/null +++ b/node_modules/.bin/esvalidate.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* diff --git a/node_modules/.bin/esvalidate.ps1 b/node_modules/.bin/esvalidate.ps1 new file mode 100644 index 0000000..23699d1 --- /dev/null +++ b/node_modules/.bin/esvalidate.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } else { + & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } else { + & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/gh-pages b/node_modules/.bin/gh-pages new file mode 100644 index 0000000..3dc56c7 --- /dev/null +++ b/node_modules/.bin/gh-pages @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../gh-pages/bin/gh-pages.js" "$@" +else + exec node "$basedir/../gh-pages/bin/gh-pages.js" "$@" +fi diff --git a/node_modules/.bin/gh-pages-clean b/node_modules/.bin/gh-pages-clean new file mode 100644 index 0000000..57519e4 --- /dev/null +++ b/node_modules/.bin/gh-pages-clean @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../gh-pages/bin/gh-pages-clean.js" "$@" +else + exec node "$basedir/../gh-pages/bin/gh-pages-clean.js" "$@" +fi diff --git a/node_modules/.bin/gh-pages-clean.cmd b/node_modules/.bin/gh-pages-clean.cmd new file mode 100644 index 0000000..f4c0147 --- /dev/null +++ b/node_modules/.bin/gh-pages-clean.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\gh-pages\bin\gh-pages-clean.js" %* diff --git a/node_modules/.bin/gh-pages-clean.ps1 b/node_modules/.bin/gh-pages-clean.ps1 new file mode 100644 index 0000000..6c7e458 --- /dev/null +++ b/node_modules/.bin/gh-pages-clean.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../gh-pages/bin/gh-pages-clean.js" $args + } else { + & "$basedir/node$exe" "$basedir/../gh-pages/bin/gh-pages-clean.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../gh-pages/bin/gh-pages-clean.js" $args + } else { + & "node$exe" "$basedir/../gh-pages/bin/gh-pages-clean.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/gh-pages.cmd b/node_modules/.bin/gh-pages.cmd new file mode 100644 index 0000000..4222fe5 --- /dev/null +++ b/node_modules/.bin/gh-pages.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\gh-pages\bin\gh-pages.js" %* diff --git a/node_modules/.bin/gh-pages.ps1 b/node_modules/.bin/gh-pages.ps1 new file mode 100644 index 0000000..28ce665 --- /dev/null +++ b/node_modules/.bin/gh-pages.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../gh-pages/bin/gh-pages.js" $args + } else { + & "$basedir/node$exe" "$basedir/../gh-pages/bin/gh-pages.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../gh-pages/bin/gh-pages.js" $args + } else { + & "node$exe" "$basedir/../gh-pages/bin/gh-pages.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/insert-module-globals b/node_modules/.bin/insert-module-globals new file mode 100644 index 0000000..cdb32c0 --- /dev/null +++ b/node_modules/.bin/insert-module-globals @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../insert-module-globals/bin/cmd.js" "$@" +else + exec node "$basedir/../insert-module-globals/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/insert-module-globals.cmd b/node_modules/.bin/insert-module-globals.cmd new file mode 100644 index 0000000..63f866e --- /dev/null +++ b/node_modules/.bin/insert-module-globals.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\insert-module-globals\bin\cmd.js" %* diff --git a/node_modules/.bin/insert-module-globals.ps1 b/node_modules/.bin/insert-module-globals.ps1 new file mode 100644 index 0000000..42dfcb6 --- /dev/null +++ b/node_modules/.bin/insert-module-globals.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../insert-module-globals/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../insert-module-globals/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../insert-module-globals/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../insert-module-globals/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc new file mode 100644 index 0000000..879c413 --- /dev/null +++ b/node_modules/.bin/jsesc @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@" +else + exec node "$basedir/../jsesc/bin/jsesc" "$@" +fi diff --git a/node_modules/.bin/jsesc.cmd b/node_modules/.bin/jsesc.cmd new file mode 100644 index 0000000..eb41110 --- /dev/null +++ b/node_modules/.bin/jsesc.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jsesc\bin\jsesc" %* diff --git a/node_modules/.bin/jsesc.ps1 b/node_modules/.bin/jsesc.ps1 new file mode 100644 index 0000000..6007e02 --- /dev/null +++ b/node_modules/.bin/jsesc.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args + } else { + & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args + } else { + & "node$exe" "$basedir/../jsesc/bin/jsesc" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 100644 index 0000000..abf72a4 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" +else + exec node "$basedir/../json5/lib/cli.js" "$@" +fi diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd new file mode 100644 index 0000000..95c137f --- /dev/null +++ b/node_modules/.bin/json5.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 new file mode 100644 index 0000000..8700ddb --- /dev/null +++ b/node_modules/.bin/json5.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/jstransform b/node_modules/.bin/jstransform new file mode 100644 index 0000000..f8f4e70 --- /dev/null +++ b/node_modules/.bin/jstransform @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../jstransform/bin/jstransform" "$@" +else + exec node "$basedir/../jstransform/bin/jstransform" "$@" +fi diff --git a/node_modules/.bin/jstransform.cmd b/node_modules/.bin/jstransform.cmd new file mode 100644 index 0000000..7d6f0b9 --- /dev/null +++ b/node_modules/.bin/jstransform.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jstransform\bin\jstransform" %* diff --git a/node_modules/.bin/jstransform.ps1 b/node_modules/.bin/jstransform.ps1 new file mode 100644 index 0000000..d3c9794 --- /dev/null +++ b/node_modules/.bin/jstransform.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../jstransform/bin/jstransform" $args + } else { + & "$basedir/node$exe" "$basedir/../jstransform/bin/jstransform" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../jstransform/bin/jstransform" $args + } else { + & "node$exe" "$basedir/../jstransform/bin/jstransform" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/leven b/node_modules/.bin/leven new file mode 100644 index 0000000..f731a21 --- /dev/null +++ b/node_modules/.bin/leven @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../leven/cli.js" "$@" +else + exec node "$basedir/../leven/cli.js" "$@" +fi diff --git a/node_modules/.bin/leven.cmd b/node_modules/.bin/leven.cmd new file mode 100644 index 0000000..6e60606 --- /dev/null +++ b/node_modules/.bin/leven.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\leven\cli.js" %* diff --git a/node_modules/.bin/leven.ps1 b/node_modules/.bin/leven.ps1 new file mode 100644 index 0000000..336f368 --- /dev/null +++ b/node_modules/.bin/leven.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../leven/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../leven/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../leven/cli.js" $args + } else { + & "node$exe" "$basedir/../leven/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/miller-rabin b/node_modules/.bin/miller-rabin new file mode 100644 index 0000000..ae37d90 --- /dev/null +++ b/node_modules/.bin/miller-rabin @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../miller-rabin/bin/miller-rabin" "$@" +else + exec node "$basedir/../miller-rabin/bin/miller-rabin" "$@" +fi diff --git a/node_modules/.bin/miller-rabin.cmd b/node_modules/.bin/miller-rabin.cmd new file mode 100644 index 0000000..26427db --- /dev/null +++ b/node_modules/.bin/miller-rabin.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\miller-rabin\bin\miller-rabin" %* diff --git a/node_modules/.bin/miller-rabin.ps1 b/node_modules/.bin/miller-rabin.ps1 new file mode 100644 index 0000000..3a5beee --- /dev/null +++ b/node_modules/.bin/miller-rabin.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args + } else { + & "$basedir/node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args + } else { + & "node$exe" "$basedir/../miller-rabin/bin/miller-rabin" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime new file mode 100644 index 0000000..7751de3 --- /dev/null +++ b/node_modules/.bin/mime @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mime/cli.js" "$@" +else + exec node "$basedir/../mime/cli.js" "$@" +fi diff --git a/node_modules/.bin/mime.cmd b/node_modules/.bin/mime.cmd new file mode 100644 index 0000000..54491f1 --- /dev/null +++ b/node_modules/.bin/mime.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* diff --git a/node_modules/.bin/mime.ps1 b/node_modules/.bin/mime.ps1 new file mode 100644 index 0000000..2222f40 --- /dev/null +++ b/node_modules/.bin/mime.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mime/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mime/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mime/cli.js" $args + } else { + & "node$exe" "$basedir/../mime/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/mkdirp b/node_modules/.bin/mkdirp new file mode 100644 index 0000000..1ab9c81 --- /dev/null +++ b/node_modules/.bin/mkdirp @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" +else + exec node "$basedir/../mkdirp/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/mkdirp.cmd b/node_modules/.bin/mkdirp.cmd new file mode 100644 index 0000000..a865dd9 --- /dev/null +++ b/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %* diff --git a/node_modules/.bin/mkdirp.ps1 b/node_modules/.bin/mkdirp.ps1 new file mode 100644 index 0000000..911e854 --- /dev/null +++ b/node_modules/.bin/mkdirp.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/module-deps b/node_modules/.bin/module-deps new file mode 100644 index 0000000..6c8cc4e --- /dev/null +++ b/node_modules/.bin/module-deps @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../module-deps/bin/cmd.js" "$@" +else + exec node "$basedir/../module-deps/bin/cmd.js" "$@" +fi diff --git a/node_modules/.bin/module-deps.cmd b/node_modules/.bin/module-deps.cmd new file mode 100644 index 0000000..b985089 --- /dev/null +++ b/node_modules/.bin/module-deps.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\module-deps\bin\cmd.js" %* diff --git a/node_modules/.bin/module-deps.ps1 b/node_modules/.bin/module-deps.ps1 new file mode 100644 index 0000000..08ac720 --- /dev/null +++ b/node_modules/.bin/module-deps.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../module-deps/bin/cmd.js" $args + } else { + & "$basedir/node$exe" "$basedir/../module-deps/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../module-deps/bin/cmd.js" $args + } else { + & "node$exe" "$basedir/../module-deps/bin/cmd.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/regenerator b/node_modules/.bin/regenerator new file mode 100644 index 0000000..006b1aa --- /dev/null +++ b/node_modules/.bin/regenerator @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../regenerator/bin/regenerator" "$@" +else + exec node "$basedir/../regenerator/bin/regenerator" "$@" +fi diff --git a/node_modules/.bin/regenerator.cmd b/node_modules/.bin/regenerator.cmd new file mode 100644 index 0000000..a5e5d8d --- /dev/null +++ b/node_modules/.bin/regenerator.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\regenerator\bin\regenerator" %* diff --git a/node_modules/.bin/regenerator.ps1 b/node_modules/.bin/regenerator.ps1 new file mode 100644 index 0000000..466bc3f --- /dev/null +++ b/node_modules/.bin/regenerator.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../regenerator/bin/regenerator" $args + } else { + & "$basedir/node$exe" "$basedir/../regenerator/bin/regenerator" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../regenerator/bin/regenerator" $args + } else { + & "node$exe" "$basedir/../regenerator/bin/regenerator" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/regexpu b/node_modules/.bin/regexpu new file mode 100644 index 0000000..30c3784 --- /dev/null +++ b/node_modules/.bin/regexpu @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../regexpu/bin/regexpu" "$@" +else + exec node "$basedir/../regexpu/bin/regexpu" "$@" +fi diff --git a/node_modules/.bin/regexpu.cmd b/node_modules/.bin/regexpu.cmd new file mode 100644 index 0000000..5dbd0f8 --- /dev/null +++ b/node_modules/.bin/regexpu.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\regexpu\bin\regexpu" %* diff --git a/node_modules/.bin/regexpu.ps1 b/node_modules/.bin/regexpu.ps1 new file mode 100644 index 0000000..8f0e814 --- /dev/null +++ b/node_modules/.bin/regexpu.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../regexpu/bin/regexpu" $args + } else { + & "$basedir/node$exe" "$basedir/../regexpu/bin/regexpu" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../regexpu/bin/regexpu" $args + } else { + & "node$exe" "$basedir/../regexpu/bin/regexpu" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/regjsparser b/node_modules/.bin/regjsparser new file mode 100644 index 0000000..3e923c7 --- /dev/null +++ b/node_modules/.bin/regjsparser @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../regjsparser/bin/parser" "$@" +else + exec node "$basedir/../regjsparser/bin/parser" "$@" +fi diff --git a/node_modules/.bin/regjsparser.cmd b/node_modules/.bin/regjsparser.cmd new file mode 100644 index 0000000..36b5e78 --- /dev/null +++ b/node_modules/.bin/regjsparser.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\regjsparser\bin\parser" %* diff --git a/node_modules/.bin/regjsparser.ps1 b/node_modules/.bin/regjsparser.ps1 new file mode 100644 index 0000000..7d45ef7 --- /dev/null +++ b/node_modules/.bin/regjsparser.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../regjsparser/bin/parser" $args + } else { + & "$basedir/node$exe" "$basedir/../regjsparser/bin/parser" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../regjsparser/bin/parser" $args + } else { + & "node$exe" "$basedir/../regjsparser/bin/parser" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/repeating b/node_modules/.bin/repeating new file mode 100644 index 0000000..2b12b20 --- /dev/null +++ b/node_modules/.bin/repeating @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../repeating/cli.js" "$@" +else + exec node "$basedir/../repeating/cli.js" "$@" +fi diff --git a/node_modules/.bin/repeating.cmd b/node_modules/.bin/repeating.cmd new file mode 100644 index 0000000..e1f78bb --- /dev/null +++ b/node_modules/.bin/repeating.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\repeating\cli.js" %* diff --git a/node_modules/.bin/repeating.ps1 b/node_modules/.bin/repeating.ps1 new file mode 100644 index 0000000..8dd8cad --- /dev/null +++ b/node_modules/.bin/repeating.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../repeating/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../repeating/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../repeating/cli.js" $args + } else { + & "node$exe" "$basedir/../repeating/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 100644 index 0000000..c043cba --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" +else + exec node "$basedir/../resolve/bin/resolve" "$@" +fi diff --git a/node_modules/.bin/resolve.cmd b/node_modules/.bin/resolve.cmd new file mode 100644 index 0000000..1a017c4 --- /dev/null +++ b/node_modules/.bin/resolve.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %* diff --git a/node_modules/.bin/resolve.ps1 b/node_modules/.bin/resolve.ps1 new file mode 100644 index 0000000..f22b2d3 --- /dev/null +++ b/node_modules/.bin/resolve.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args + } else { + & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../resolve/bin/resolve" $args + } else { + & "node$exe" "$basedir/../resolve/bin/resolve" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 100644 index 0000000..97c5327 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..9913fa9 --- /dev/null +++ b/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..314717a --- /dev/null +++ b/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/sha.js b/node_modules/.bin/sha.js new file mode 100644 index 0000000..9215bc2 --- /dev/null +++ b/node_modules/.bin/sha.js @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../sha.js/bin.js" "$@" +else + exec node "$basedir/../sha.js/bin.js" "$@" +fi diff --git a/node_modules/.bin/sha.js.cmd b/node_modules/.bin/sha.js.cmd new file mode 100644 index 0000000..ce87b00 --- /dev/null +++ b/node_modules/.bin/sha.js.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sha.js\bin.js" %* diff --git a/node_modules/.bin/sha.js.ps1 b/node_modules/.bin/sha.js.ps1 new file mode 100644 index 0000000..fceb31a --- /dev/null +++ b/node_modules/.bin/sha.js.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../sha.js/bin.js" $args + } else { + & "$basedir/node$exe" "$basedir/../sha.js/bin.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../sha.js/bin.js" $args + } else { + & "node$exe" "$basedir/../sha.js/bin.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/umd b/node_modules/.bin/umd new file mode 100644 index 0000000..3564923 --- /dev/null +++ b/node_modules/.bin/umd @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../umd/bin/cli.js" "$@" +else + exec node "$basedir/../umd/bin/cli.js" "$@" +fi diff --git a/node_modules/.bin/umd.cmd b/node_modules/.bin/umd.cmd new file mode 100644 index 0000000..f0e07a1 --- /dev/null +++ b/node_modules/.bin/umd.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\umd\bin\cli.js" %* diff --git a/node_modules/.bin/umd.ps1 b/node_modules/.bin/umd.ps1 new file mode 100644 index 0000000..c0b8b43 --- /dev/null +++ b/node_modules/.bin/umd.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../umd/bin/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../umd/bin/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../umd/bin/cli.js" $args + } else { + & "node$exe" "$basedir/../umd/bin/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/user-home b/node_modules/.bin/user-home new file mode 100644 index 0000000..4c33364 --- /dev/null +++ b/node_modules/.bin/user-home @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../user-home/cli.js" "$@" +else + exec node "$basedir/../user-home/cli.js" "$@" +fi diff --git a/node_modules/.bin/user-home.cmd b/node_modules/.bin/user-home.cmd new file mode 100644 index 0000000..b41418d --- /dev/null +++ b/node_modules/.bin/user-home.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\user-home\cli.js" %* diff --git a/node_modules/.bin/user-home.ps1 b/node_modules/.bin/user-home.ps1 new file mode 100644 index 0000000..8d5877f --- /dev/null +++ b/node_modules/.bin/user-home.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../user-home/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../user-home/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../user-home/cli.js" $args + } else { + & "node$exe" "$basedir/../user-home/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/window-size b/node_modules/.bin/window-size new file mode 100644 index 0000000..03baf6b --- /dev/null +++ b/node_modules/.bin/window-size @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../window-size/cli.js" "$@" +else + exec node "$basedir/../window-size/cli.js" "$@" +fi diff --git a/node_modules/.bin/window-size.cmd b/node_modules/.bin/window-size.cmd new file mode 100644 index 0000000..b28b1dd --- /dev/null +++ b/node_modules/.bin/window-size.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\window-size\cli.js" %* diff --git a/node_modules/.bin/window-size.ps1 b/node_modules/.bin/window-size.ps1 new file mode 100644 index 0000000..c71b6fa --- /dev/null +++ b/node_modules/.bin/window-size.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../window-size/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../window-size/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../window-size/cli.js" $args + } else { + & "node$exe" "$basedir/../window-size/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.cache/gh-pages/https!github.com!Dweb-Incheon!chattering.git b/node_modules/.cache/gh-pages/https!github.com!Dweb-Incheon!chattering.git new file mode 160000 index 0000000..f7fa150 --- /dev/null +++ b/node_modules/.cache/gh-pages/https!github.com!Dweb-Incheon!chattering.git @@ -0,0 +1 @@ +Subproject commit f7fa15091310c0d45ffd5aab7bb11c2b69c55a27 diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..b1d528d --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,4048 @@ +{ + "name": "reactjs-socket-io-chat-app", + "version": "0.6.9", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-node": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", + "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", + "dev": true, + "dependencies": { + "acorn": "^7.0.0", + "acorn-walk": "^7.0.0", + "xtend": "^4.0.2" + } + }, + "node_modules/acorn-node/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha512-QbJ0NTQ/I9DI3uSJA4cbexiwQeRAfjPScqIbSjUDd9TOrcg6pTkdgziesOqxBMBzit8vFCTwrP27t13vFOORRA==" + }, + "node_modules/align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/alter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/alter/-/alter-0.2.0.tgz", + "integrity": "sha512-Wuss6JIZ6h4j2+NgU2t+9mSwS7gBSZJbU4Dg8xETguAD2veJUSuCrvTIiC78QgZE7/zX7h6OnXw2PiiCBirEGw==", + "dev": true, + "dependencies": { + "stable": "~0.1.3" + } + }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + }, + "node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==", + "dev": true, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha512-6ZjfQaBSy6CuIH0+B0NrxMfDE5VIOCP/5gOqSpEIsaAZx9/giszzrXg6PZ7G51U/n88UmlAgYLNQ9wAnII7PJA==" + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/assert": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.3.0.tgz", + "integrity": "sha512-5aKcpD+XnHpZ7EGxsuo6uoILNh0rvm0Ypa17GlkrF2CNSPhvdgi3ft9XsL2ajdVOI2I3xuGZnHvlXAeqTZYvXg==", + "dev": true, + "dependencies": { + "util": "0.10.3" + } + }, + "node_modules/assert/node_modules/inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==", + "dev": true + }, + "node_modules/assert/node_modules/util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==", + "dev": true, + "dependencies": { + "inherits": "2.0.1" + } + }, + "node_modules/ast-traverse": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ast-traverse/-/ast-traverse-0.1.1.tgz", + "integrity": "sha512-CPuE4BWIhJjsNMvFkrzjiBgOl56NJTuBPBkBqyRyfq/nZtx1Z1f5I+qx7G/Zt+FAOS+ABhghkEuWJrfW9Njjog==", + "dev": true + }, + "node_modules/ast-types": { + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.9.6.tgz", + "integrity": "sha512-qEdtR2UH78yyHX/AUNfXmJTlM48XoFZKBdwi1nzkI1mJL21cmbu0cvjxjpkXJ5NENMq42H+hNs8VLJcqXLerBQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha512-E/4z//dvN0lfr8zAx8hXeQ8o3nRoQaL/wqI7fAALEvh/40mnyUxfFB9MwyDHYKVDtS3cp3Pow5s96djZR5lkWw==", + "dev": true, + "dependencies": { + "acorn": "^4.0.3" + } + }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "dev": true + }, + "node_modules/babel-core": { + "version": "5.8.38", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-5.8.38.tgz", + "integrity": "sha512-aVoPuaEiJJ/vqFpYuGp3kHOrKeKciCkjDE/e9va3VoSPAe37Qc0+9AZ+gBgIMTu8V8reCt2lW809e8k1KJQdaQ==", + "dev": true, + "dependencies": { + "babel-plugin-constant-folding": "^1.0.1", + "babel-plugin-dead-code-elimination": "^1.0.2", + "babel-plugin-eval": "^1.0.1", + "babel-plugin-inline-environment-variables": "^1.0.1", + "babel-plugin-jscript": "^1.0.4", + "babel-plugin-member-expression-literals": "^1.0.1", + "babel-plugin-property-literals": "^1.0.1", + "babel-plugin-proto-to-assign": "^1.0.3", + "babel-plugin-react-constant-elements": "^1.0.3", + "babel-plugin-react-display-name": "^1.0.3", + "babel-plugin-remove-console": "^1.0.1", + "babel-plugin-remove-debugger": "^1.0.1", + "babel-plugin-runtime": "^1.0.7", + "babel-plugin-undeclared-variables-check": "^1.0.2", + "babel-plugin-undefined-to-void": "^1.1.6", + "babylon": "^5.8.38", + "bluebird": "^2.9.33", + "chalk": "^1.0.0", + "convert-source-map": "^1.1.0", + "core-js": "^1.0.0", + "debug": "^2.1.1", + "detect-indent": "^3.0.0", + "esutils": "^2.0.0", + "fs-readdir-recursive": "^0.1.0", + "globals": "^6.4.0", + "home-or-tmp": "^1.0.0", + "is-integer": "^1.0.4", + "js-tokens": "1.0.1", + "json5": "^0.4.0", + "lodash": "^3.10.0", + "minimatch": "^2.0.3", + "output-file-sync": "^1.1.0", + "path-exists": "^1.0.0", + "path-is-absolute": "^1.0.0", + "private": "^0.1.6", + "regenerator": "0.8.40", + "regexpu": "^1.3.0", + "repeating": "^1.1.2", + "resolve": "^1.1.6", + "shebang-regex": "^1.0.0", + "slash": "^1.0.0", + "source-map": "^0.5.0", + "source-map-support": "^0.2.10", + "to-fast-properties": "^1.0.0", + "trim-right": "^1.0.0", + "try-resolve": "^1.0.0" + } + }, + "node_modules/babel-plugin-constant-folding": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-constant-folding/-/babel-plugin-constant-folding-1.0.1.tgz", + "integrity": "sha512-Rvhz9+o8/Bbqq6qTCO7FUPYxhrzqd/XkIY482DdYrXpFbhhqDu/xZZUd5/vYHV3oEE1poW+M10pjRZELDepwyQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-dead-code-elimination": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-dead-code-elimination/-/babel-plugin-dead-code-elimination-1.0.2.tgz", + "integrity": "sha512-wbVXBByKqaaIL3+3a9bRSLAL0GYhQWYmQCWTaGTXOsqqe1Jhi+qaj8/H+yQ5GMiJhvYEQiawzOCjCS1dmjvE5g==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-eval": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-eval/-/babel-plugin-eval-1.0.1.tgz", + "integrity": "sha512-Yu9H5PbQKGVp/O/BFXUUbHVIUzBeZtEL+Yk+Io8ND4NobQYW8eg/ztToMkn+1/dQrQjaOeFtiBKtkYBwWLvFhw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-inline-environment-variables": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-inline-environment-variables/-/babel-plugin-inline-environment-variables-1.0.1.tgz", + "integrity": "sha512-upNlt2GMmPkLMtJEQEqJB+Y1OeNs78W5+toLTYD/zotypPg0K2w79fFfmiee34ehvLwOZL7khxtkPU54IS1Kvw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-jscript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/babel-plugin-jscript/-/babel-plugin-jscript-1.0.4.tgz", + "integrity": "sha512-eMT10ilWqWvBtGL70fFVciexOcjfPaeOHsyfp5OuumTFPSxla2kJTZuDzIpTbKspHVFyzCGxY6NpGJolfVywgQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-member-expression-literals": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-member-expression-literals/-/babel-plugin-member-expression-literals-1.0.1.tgz", + "integrity": "sha512-Ql/UCGOaA0nQP/9H0MfhFSn2U1m2mLsJFo76NDVBQry5uCDbF8++Uv4VyAtyQ8s6UHcoIKxepzRbZGl//X569w==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-property-literals": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-property-literals/-/babel-plugin-property-literals-1.0.1.tgz", + "integrity": "sha512-ZS1JuVJuo0j8IW2RRk8xA6MR/i14KIAhmDNHkipFn51uXe1S/hCH6u+V7TweF9aroT07F9PoxtENmuhFfVvq4g==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-proto-to-assign": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/babel-plugin-proto-to-assign/-/babel-plugin-proto-to-assign-1.0.4.tgz", + "integrity": "sha512-VY0VnODP15n5ORbJNFIQ0lzewhf+XqkcwbA5UpeeJ96/wIFmbvHK8fNAJoddHUuxl6b5hZtygVdSs3qwPAa/0A==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true, + "dependencies": { + "lodash": "^3.9.3" + } + }, + "node_modules/babel-plugin-react-constant-elements": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-react-constant-elements/-/babel-plugin-react-constant-elements-1.0.3.tgz", + "integrity": "sha512-5vv5DJ8NB5kKzjD5tqnkbm0znmKBzDDKFz82zJKn4hFxs1Vwk3WolLN8RypRzlDsddNQPLuDS/0xHq/u/J6i7w==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-react-display-name": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-react-display-name/-/babel-plugin-react-display-name-1.0.3.tgz", + "integrity": "sha512-IMO+IEvFKzZgLbmO+lGcoPKeD+pBg48T9p+ZgMbKkXyFvHk1pKeHsnhjV45GRxVBQC+SLYkmG7EHbXDWxfThOA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-remove-console": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-remove-console/-/babel-plugin-remove-console-1.0.1.tgz", + "integrity": "sha512-dNNqqYeRa0HpJbL+bXgSXeNnkgHbpLuU9o3040iyQjzHoTrIRUwltRWy1ZZgluuw/P0j1ukUOZsiudLLVRCmKw==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-remove-debugger": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-remove-debugger/-/babel-plugin-remove-debugger-1.0.1.tgz", + "integrity": "sha512-/rGQc8sgCVpTEeWQhHZShzQjANqWxpwxPlY3RkG9keK5+NKdA2U6ukfC/cySoSa1XmFwM6NBO67QWuOGR/DHrg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-runtime": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/babel-plugin-runtime/-/babel-plugin-runtime-1.0.7.tgz", + "integrity": "sha512-tDVsSImhImOPIszO/6O4FhGW+o+PirMt53fkuBQ/plT41i2SRzTSnGvisrKtV/2jaAVSRnCiFwhN7v8dQ1Ymag==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babel-plugin-undeclared-variables-check": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-undeclared-variables-check/-/babel-plugin-undeclared-variables-check-1.0.2.tgz", + "integrity": "sha512-NytRjvfh0DMsjUNaxOIROntf5c03PktIBQlTK6texdQZR7KhpeFxc2W8wGfF5LoJY13bHr2WnRY5xLZp6JXKOg==", + "dev": true, + "dependencies": { + "leven": "^1.0.2" + } + }, + "node_modules/babel-plugin-undefined-to-void": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/babel-plugin-undefined-to-void/-/babel-plugin-undefined-to-void-1.1.6.tgz", + "integrity": "sha512-YAi+mWX+Al08e6Isbv8g2UigZUoVnZuuF/JFmG5uAZKQ+6EYILBCFmS28BedM7Ts4QbAIpSqwXdMBzej+9tHUg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/babelify": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/babelify/-/babelify-6.4.0.tgz", + "integrity": "sha512-0VFkPu2vNP7cK1GVl9knzu1orwL+lAzUif+iakXQeQJEj80uptKJcJTzq+v0fHolW/AMtTJxE4FQP12Cc0dPVA==", + "dev": true, + "dependencies": { + "babel-core": "^5.0.0", + "object-assign": "^4.0.0" + } + }, + "node_modules/babylon": { + "version": "5.8.38", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-5.8.38.tgz", + "integrity": "sha512-jtLAtIWCbI17buqCVN4/DtuHf3N1w9ZvbwrTWIae+EBSu2N3sVGCwSJeiZdAkTH4KRwinfMQIyoovP/xZtRwXQ==", + "dev": true + }, + "node_modules/backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base62": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/base62/-/base62-1.2.8.tgz", + "integrity": "sha512-V6YHUbjLxN1ymqNLb1DPHoU1CpfdL7d2YTIp5W3U4hhoG4hhxNmsFDs66M9EXxBiSEke5Bt5dwdfMwwZF70iLA==", + "engines": { + "node": "*" + } + }, + "node_modules/Base64": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz", + "integrity": "sha512-reGEWshDmTDQDsCec/HduOO9Wyj6yMOupMfhIf3ugN1TDlK2NQW4DDJSqNNtp380SNcvRfXtO8HSCQot0d0SMw==", + "dev": true + }, + "node_modules/base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha512-437oANT9tP582zZMwSvZGy2nmSeAb8DW2me3y+Uv1Wp2Rulr8Mqlyrv3E7MLxmsiaPSMMDmiDVzgE+e8zlMx9g==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/base64id": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", + "integrity": "sha512-rz8L+d/xByiB/vLVftPkyY215fqNrmasrcJsYkVcm4TgJNz+YXKrFaFAWibSaHkiKoSgMDCb+lipOIRQNGYesw==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha512-bYeph2DFlpK1XmGs6fvlLRUN29QISM3GBuUwSFsMY2XRx4AvC0WNCS57j4c/xGrK2RS24C1w3YoBOsw9fT46tQ==", + "dependencies": { + "callsite": "1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha512-YRc9zvVz4wNaxcXmiSgb9LAg7YYwqQ2xd0Sj6osfA7k/PKmIGVlnOYs3wOFdkRC9/JpQu8sGt/zHgJV7xzerfg==" + }, + "node_modules/bluebird": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha512-UfFSr22dmHPQqPP9XWHRhq+gWnHCYguQGkXQlbyPtW5qTnhFWA8/iXg765tH0cAjy7l/zPJ1aBTO0g5XgA7kvQ==", + "dev": true + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/breakable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/breakable/-/breakable-1.0.0.tgz", + "integrity": "sha512-+ityJqcjhozQNrezzTd2dtH/lkIXmE52HL+FohK2TOLQDl3QURTNkim+2C0xcso4Zehq/HM4Wkumcdz7Ue+XmA==", + "dev": true + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true + }, + "node_modules/browser-pack": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-5.0.1.tgz", + "integrity": "sha512-BFMQuYXCcwr3Uvna1y1hikqd3r2dQpWIQBIN3m5YwE3ClfnXDeF3tqP6Wqjhs1LRUeBJpgHn8yD+fPX/YSEgMQ==", + "dev": true, + "dependencies": { + "combine-source-map": "~0.6.1", + "defined": "^1.0.0", + "JSONStream": "^1.0.3", + "through2": "^1.0.0", + "umd": "^3.0.0" + }, + "bin": { + "browser-pack": "bin/cmd.js" + } + }, + "node_modules/browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "dependencies": { + "resolve": "1.1.7" + } + }, + "node_modules/browser-resolve/node_modules/resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", + "dev": true + }, + "node_modules/browserify": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-10.2.6.tgz", + "integrity": "sha512-rhKmIuWDcE1ULm6lrd3kQdUTqFsLd/UJp3yYt4Ur5rDzk/Gj2AH6+ZTNqkaMqwMphkf8Rp83S1GfMxtu9QjGDA==", + "dev": true, + "dependencies": { + "assert": "~1.3.0", + "browser-pack": "^5.0.0", + "browser-resolve": "^1.7.1", + "browserify-zlib": "~0.1.2", + "buffer": "^3.0.0", + "builtins": "~0.0.3", + "commondir": "0.0.1", + "concat-stream": "~1.4.1", + "console-browserify": "^1.1.0", + "constants-browserify": "~0.0.1", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^1.3.7", + "domain-browser": "~1.1.0", + "duplexer2": "~0.0.2", + "events": "~1.0.0", + "glob": "^4.0.5", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "http-browserify": "^1.4.0", + "https-browserify": "~0.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^6.4.1", + "isarray": "0.0.1", + "JSONStream": "^1.0.3", + "labeled-stream-splicer": "^1.0.0", + "module-deps": "^3.7.11", + "os-browserify": "~0.1.1", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^1.1.1", + "readable-stream": "^1.1.13", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "~0.0.1", + "stream-browserify": "^1.0.0", + "string_decoder": "~0.10.0", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^1.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "~0.0.0", + "url": "~0.10.1", + "util": "~0.10.1", + "vm-browserify": "~0.0.1", + "xtend": "^4.0.0" + }, + "bin": { + "browserify": "bin/cmd.js" + } + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/browserify-sign/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/browserify-sign/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha512-19OEpq7vWgsH6WkvkBJQDFvJS1uPcbFOQ4v9CU839dO+ZZXUZO6XpE6hNCqvlIIj+4fZvRiJ6DsAQ382GwiyTQ==", + "dev": true, + "dependencies": { + "pako": "~0.2.0" + } + }, + "node_modules/buffer": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-3.6.2.tgz", + "integrity": "sha512-c3M77NkHJxS0zx/ErxXhDLr1v3y2MDXPeTJPvLNOaIYJ4ymHBUFQ9EXzt9HYuqAJllMoNb/EZ8hIiulnQFAUuQ==", + "dev": true, + "dependencies": { + "base64-js": "0.0.8", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true + }, + "node_modules/buffer/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/builtins": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-0.0.7.tgz", + "integrity": "sha512-T8uCGKc0/2aLVt6omt8JxDRBoWEMkku+wFesxnhxnt4NygVZG99zqxo7ciK8eebszceKamGoUiLdkXCgGQyrQw==", + "dev": true + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==", + "engines": { + "node": "*" + } + }, + "node_modules/camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==", + "dev": true, + "dependencies": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha512-GIOYRizG+TGoc7Wgc1LiOTLare95R3mzKgoln+Q/lE4ceiYH19gUpl0l0Ffq4lJDEf3FxujMe6IBfOCs7pfqNA==", + "dev": true, + "dependencies": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "node_modules/combine-source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.6.1.tgz", + "integrity": "sha512-XKRNtuZRlVDTuSGKsfZpXYz80y0XDbYS4a+FzafTgmYHy/ckruFBx7Nd6WaQnFHVI3O6IseWVdXUvZutMpjSkQ==", + "dev": true, + "dependencies": { + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.5.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.4.2" + } + }, + "node_modules/combine-source-map/node_modules/convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==", + "dev": true + }, + "node_modules/combine-source-map/node_modules/source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha512-Y8nIfcb1s/7DcobUz1yOO1GSp7gyL+D9zLHDehT7iRESqGSxjJ448Sg7rvfgsRJCnKLdSl11uGf0s9X80cH0/A==", + "dev": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/commondir": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-0.0.1.tgz", + "integrity": "sha512-Ghe1LmLv3G3c0XJYu+c88MCRIPqWQ67qaqKY1KvuN4uPAjfUj+y4hvcpZ2kCPrjpRNyklW4dpAZZ8a7vOh50tg==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/commoner": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/commoner/-/commoner-0.10.8.tgz", + "integrity": "sha512-3/qHkNMM6o/KGXHITA14y78PcfmXh4+AOCJpSoF73h4VY1JpdGv3CHMS5+JW6SwLhfJt4RhNmLAa7+RRX/62EQ==", + "dependencies": { + "commander": "^2.5.0", + "detective": "^4.3.1", + "glob": "^5.0.15", + "graceful-fs": "^4.1.2", + "iconv-lite": "^0.4.5", + "mkdirp": "^0.5.0", + "private": "^0.1.6", + "q": "^1.1.2", + "recast": "^0.11.17" + }, + "bin": { + "commonize": "bin/commonize" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commoner/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw==" + }, + "node_modules/component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA==" + }, + "node_modules/component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha512-w+LhYREhatpVqTESyGFg3NlP6Iu0kEKUHETY9GoZP/pQyW4mHFZuFWRUCIqVPZ36ueVLtoOEZaAqbCF2RDndaA==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/concat-stream": { + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.11.tgz", + "integrity": "sha512-X3JMh8+4je3U1cQpG87+f9lXHDrqcb2MVLg9L7o8b1UZ0DzhRrUpdn65ttzu10PpJPPI3MQNkis+oha6TSA9Mw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "~1.1.9", + "typedarray": "~0.0.5" + } + }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "node_modules/constants-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-0.0.1.tgz", + "integrity": "sha512-FL+diDS9AKR5BAA2M+GNk8lnH64tRE3zepTG9hucxc7o04LgCRhkQZhF7u/OKHZT8LLRT+sZEi9qFzXUchq9pA==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + }, + "node_modules/core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha512-ZiPp9pZlgxpWRu0M+YWbm6+aQ84XEfH1JRXvfOc/fILWI0VKhLC2LX13X1NYq4fULzLMq7Hfh43CSo2/aIaUPA==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defined": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz", + "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/defs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/defs/-/defs-1.1.1.tgz", + "integrity": "sha512-KgGV1vmSa2UPKeDXaWE5FiXjix8BOtYMgiPGpYhd/42wxiC6YGwtscj/zU9gD5/xk4K2iLDpyGhGA5puZxaeMg==", + "dev": true, + "dependencies": { + "alter": "~0.2.0", + "ast-traverse": "~0.1.1", + "breakable": "~1.0.0", + "esprima-fb": "~15001.1001.0-dev-harmony-fb", + "simple-fmt": "~0.1.0", + "simple-is": "~0.2.0", + "stringmap": "~0.2.2", + "stringset": "~0.2.1", + "tryor": "~0.1.2", + "yargs": "~3.27.0" + }, + "bin": { + "defs": "build/es5/defs" + } + }, + "node_modules/defs/node_modules/esprima-fb": { + "version": "15001.1001.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", + "integrity": "sha512-m7OsYzocA8OQ3+9CxmhIv7NPHtyDR2ixaLCO7kLZ+YH+xQ/BpaZmll9EXmc+kBxzWA8BRBXbNEuEQqQ6vfsgDw==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/deps-sort": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-1.3.9.tgz", + "integrity": "sha512-aEnmQuu/Hf5h8akL8QshYWzk9MVBg/JYMyNq/Lz68i69nR17tunjP6o/AC6Tn48c8ayzG6aeKs6OoFOtVCtvrQ==", + "dev": true, + "dependencies": { + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^1.0.0" + }, + "bin": { + "deps-sort": "bin/cmd.js" + } + }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-indent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-3.0.1.tgz", + "integrity": "sha512-xo3WP66SNbr1Eim85s/qyH0ZL8PQUwp86HWm0S1l8WnJ/zjT6T3w1nwNA0yOZeuvOemupEYvpvF6BIdYRuERJQ==", + "dev": true, + "dependencies": { + "get-stdin": "^4.0.1", + "minimist": "^1.1.0", + "repeating": "^1.1.0" + }, + "bin": { + "detect-indent": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detective": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", + "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "dependencies": { + "acorn": "^5.2.1", + "defined": "^1.0.0" + } + }, + "node_modules/detective/node_modules/acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha512-fJ5MoHxe69h3E4/lJtFRhcWwLb04bhIBSfvCEMS1YDH+/9yEZTqBHTSTgch8nCP5tE5k2gdQEjodUqJzy7qJ9Q==", + "dev": true, + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + } + }, + "node_modules/duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha512-+AWBwjGadtksxjOQSFDhPNQbed7icNXApT4+2BNpsXzcCBiInq2H9XW0O8sfHFaPmnQRs7cg/P0fAr2IWQSW0g==", + "dev": true, + "dependencies": { + "readable-stream": "~1.1.9" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "node_modules/elliptic": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz", + "integrity": "sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/email-addresses": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-5.0.0.tgz", + "integrity": "sha512-4OIPYlA6JXqtVn8zpHpGiI7vE6EQOAg16aGnDMIAlZVinnoZ8208tW1hAbjWydgN/4PLTT9q+O1K6AH/vALJGw==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/engine.io": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.5.tgz", + "integrity": "sha512-j1DWIcktw4hRwrv6nWx++5nFH2X64x16MAG2P0Lmi5Dvdfi3I+Jhc7JKJIdAmDJa+5aZ/imHV7dWRPy2Cqjh3A==", + "dependencies": { + "accepts": "1.3.3", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "ws": "~1.1.5" + } + }, + "node_modules/engine.io-client": { + "version": "1.8.6", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.6.tgz", + "integrity": "sha512-6+rInQu8xU7c0fIF6RC4SRKuHVWPt8Xq0bZYS4lMrTwmhRineOlEMsU3X0zS5mHIvCgJsmpOKEX7DhihGk7j0g==", + "dependencies": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~1.1.5", + "xmlhttprequest-ssl": "1.6.3", + "yeast": "0.1.2" + } + }, + "node_modules/engine.io-client/node_modules/debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha512-dCHp4G+F11zb+RtEu7BE2U8R32AYmM/4bljQfut8LipH3PdwsVBVGh083MXvtKkB7HSQUzSwiXz53c4mzJvYfw==", + "dependencies": { + "ms": "0.7.2" + } + }, + "node_modules/engine.io-client/node_modules/ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha512-5NnE67nQSQDJHVahPJna1PQ/zCXMnQop3yUCxjKPNzCxuyPSKWTQ/5Gu5CZmjetwGLWRA+PzeF5thlbOdbQldA==" + }, + "node_modules/engine.io-parser": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.2.tgz", + "integrity": "sha512-3UyTJo+5Jbmr7rd3MosTAApK7BOIo4sjx8dJYSHa3Em5R3A9Y2s9GWu4JFJe6Px0VieJC0hKUA5NBytC+O7k2A==", + "dependencies": { + "after": "0.8.2", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary": "0.1.7", + "wtf-8": "1.0.0" + } + }, + "node_modules/engine.io/node_modules/accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha512-AOPopplFOUlmUugwiZUCDpOwmqvSgdCyE8iJVLWI4NcB7qfMKQN34dn5xYtlUU03XGG5egRWW4NW5gIxpa5hEA==", + "dependencies": { + "mime-types": "~2.1.11", + "negotiator": "0.6.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/engine.io/node_modules/debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha512-dCHp4G+F11zb+RtEu7BE2U8R32AYmM/4bljQfut8LipH3PdwsVBVGh083MXvtKkB7HSQUzSwiXz53c4mzJvYfw==", + "dependencies": { + "ms": "0.7.2" + } + }, + "node_modules/engine.io/node_modules/ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha512-5NnE67nQSQDJHVahPJna1PQ/zCXMnQop3yUCxjKPNzCxuyPSKWTQ/5Gu5CZmjetwGLWRA+PzeF5thlbOdbQldA==" + }, + "node_modules/engine.io/node_modules/negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha512-qTxkr1RoLw5Pz+1+PTJ/66hWuyi2LEOeOuIDJDlx6JF8x75bmD5C7qXTg2UlX5W9rLfkqKP+r8q6Vy6NWdWrbw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/envify": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/envify/-/envify-3.4.1.tgz", + "integrity": "sha512-XLiBFsLtNF0MOZl+vWU59yPb3C2JtrQY2CNJn22KH75zPlHWY5ChcAQuf4knJeWT/lLkrx3sqvhP/J349bt4Bw==", + "dependencies": { + "jstransform": "^11.0.3", + "through": "~2.3.4" + }, + "bin": { + "envify": "bin/envify" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha512-AWwVMNxwhN8+NIPQzAQZCm7RkLC4RbM3B1OobMuyp3i+w73X57KCKaVIxaRZb+DYCojq7rspo+fmuQfAboyhFg==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esprima-fb": { + "version": "15001.1.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1.0-dev-harmony-fb.tgz", + "integrity": "sha512-59dDGQo2b3M/JfKIws0/z8dcXH2mnVHkfSPRhCYS91JNGfGNwr7GsSF6qzWZuOGvw5Ii0w9TtylrX07MGmlOoQ==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/events": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/events/-/events-1.0.2.tgz", + "integrity": "sha512-XK19KwlDJo8XsceooxNDK1pObtcT44+Xte6V/jQc4a+fHq1qEouThyyX2ePmS0hS8RcCulmRxzg+T8jiLKAFFQ==", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/filename-reserved-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", + "integrity": "sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/filenamify": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", + "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", + "dev": true, + "dependencies": { + "filename-reserved-regex": "^2.0.0", + "strip-outer": "^1.0.1", + "trim-repeated": "^1.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-cache-dir/node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-0.1.2.tgz", + "integrity": "sha512-//yfxmYAazrsyb/rgeYDNFXFTuPYTGYirp5QHFSH8h/LaNUoP5bQAa2ikstdK1PR/bFd1CIlQLpUq6/u6UVfSw==", + "dev": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha512-F5aQMywwJ2n85s4hJPTT9RPxGmubonuB10MNYo17/xph174n2MIR33HRguhzVag10O/npM7SPk73LMZNP+FaWw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gh-pages": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-6.1.1.tgz", + "integrity": "sha512-upnohfjBwN5hBP9w2dPE7HO5JJTHzSGMV1JrLrHvNuqmjoYHg6TBrCcnEoorjG/e0ejbuvnwyKMdTyM40PEByw==", + "dev": true, + "dependencies": { + "async": "^3.2.4", + "commander": "^11.0.0", + "email-addresses": "^5.0.0", + "filenamify": "^4.3.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "^11.1.1", + "globby": "^6.1.0" + }, + "bin": { + "gh-pages": "bin/gh-pages.js", + "gh-pages-clean": "bin/gh-pages-clean.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gh-pages/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha512-I0rTWUKSZKxPSIAIaqhSXTM/DiII6wame+rEC3cFA5Lqmr9YmdL7z6Hj9+bdWtTvoY1Su4/OiMLmb37Y7JzvJQ==", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^2.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/globals/-/globals-6.4.1.tgz", + "integrity": "sha512-Lh7H0bYRNBMc2CapY+TYsCzcSM4HWHGFoQORuEcePk3y3IhpaZmFSJDirhNYSwq8QeHvaCqV/tHI2bdUhYryuw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==", + "dev": true, + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/globby/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globby/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-binary": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", + "integrity": "sha512-k1Umb4/jrBWZbtL+QKSji8qWeoZ7ZTkXdnDXt1wxwBKAFM0//u96wDj43mBIqCIas8rDQMYyrBEvcS8hdGd4Sg==", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA==" + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha512-EeeoJKjTyt868liAlVmcv2ZsUfGHlE3Q+BICOXcZiwN3osr5Q/zFGYmTJpoIzuaSTAwndFy+GqhEwlU4L3j4Ow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/home-or-tmp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-1.0.0.tgz", + "integrity": "sha512-6LKQZpR6gk8uJ3mXbBkyOumsA24BUk9CH/79ivZ8Kk1urzlXNGZBoAMuieC/YzwCyGBVqq+uCNUpA1JS6glrxg==", + "dev": true, + "dependencies": { + "os-tmpdir": "^1.0.1", + "user-home": "^1.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/http-browserify": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/http-browserify/-/http-browserify-1.7.0.tgz", + "integrity": "sha512-Irf/LJXmE3cBzU1eaR4+NEX6bmVLqt1wkmDiA7kBwH7zmb0D8kBAXsDmQ88hhj/qv9iEZKlyGx/hrMcFi8sOHw==", + "dev": true, + "dependencies": { + "Base64": "~0.2.0", + "inherits": "~2.0.1" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha512-EjDQFbgJr1vDD/175UJeSX3ncQ3+RUnCL5NkthQGHvF4VNHlzTy8ifJfTqz47qiPRqaFH58+CbuG3x51WuB1XQ==", + "dev": true + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/inline-source-map": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.5.0.tgz", + "integrity": "sha512-2WtHG0qX9OH9TVcxsLVfq3Tzr+qtL6PtWgoh0XAAKe4KkdA/57Q+OGJuRJHA4mZ2OZnkJ/ZAaXf9krLB12/nIg==", + "dev": true, + "dependencies": { + "source-map": "~0.4.0" + } + }, + "node_modules/inline-source-map/node_modules/source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha512-Y8nIfcb1s/7DcobUz1yOO1GSp7gyL+D9zLHDehT7iRESqGSxjJ448Sg7rvfgsRJCnKLdSl11uGf0s9X80cH0/A==", + "dev": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/insert-module-globals": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-6.6.3.tgz", + "integrity": "sha512-ryk8hTKUZCc300SPOOwx30WhE5oRUssPDVlIoO8vtoMNBy5HGeesVRl3HF7ra4ll42T0IdnwD9XR9svh6+RRhg==", + "dev": true, + "dependencies": { + "combine-source-map": "~0.6.1", + "concat-stream": "~1.4.1", + "is-buffer": "^1.1.0", + "JSONStream": "^1.0.3", + "lexical-scope": "^1.2.0", + "process": "~0.11.0", + "through2": "^1.0.0", + "xtend": "^4.0.0" + }, + "bin": { + "insert-module-globals": "bin/cmd.js" + } + }, + "node_modules/invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-finite": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-integer": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-integer/-/is-integer-1.0.7.tgz", + "integrity": "sha512-RPQc/s9yBHSvpi+hs9dYiJ2cuFeU6x3TyyIp8O2H6SKEltIvJOzRj9ToyvcStDvPR/pS4rxgr1oBFajQjZ2Szg==", + "dev": true, + "dependencies": { + "is-finite": "^1.0.0" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==" + }, + "node_modules/js-tokens": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.1.tgz", + "integrity": "sha512-WKqed1YxjsT7sGqM2IdbkJHnA3rXHqFqN+4xUy973UeYNjSXZCKM3G/zUmPNYut/6D9QCUbqegDmUCQRdm0lnQ==", + "dev": true + }, + "node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha512-nKtD/Qxm7tWdZqJoldEC7fF0S41v0mWbeaXG3637stOWfyGxTgWTYE2wtfKmjzpvxv2MA2xzxsXOIiwUpkX6Qw==", + "dev": true, + "dependencies": { + "jsonify": "~0.0.0" + } + }, + "node_modules/json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha512-I5YLeauH3rIaE99EE++UeH2M2gSYo8/2TqDac7oZEH6D/DSQ4Woa628Qrfj1X9/OY5Mk5VvIDQaKCDchXaKrmA==", + "deprecated": "Please use the native JSON object instead of JSON 3" + }, + "node_modules/json5": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.4.0.tgz", + "integrity": "sha512-5EEuuI7oad0d6c2PcrTRLoLH2JNuI/aJxHsVT2hVFK6fKHu+MXONdhzzzNAlb3JXMeuN1o+kDU78fV1YH6VmKQ==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ] + }, + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jstransform": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-11.0.3.tgz", + "integrity": "sha512-LGm87w0A8E92RrcXt94PnNHkFqHmgDy3mKHvNZOG7QepKCTCH/VB6S+IEN+bT4uLN3gVpOT0vvOOVd96osG71g==", + "dependencies": { + "base62": "^1.1.0", + "commoner": "^0.10.1", + "esprima-fb": "^15001.1.0-dev-harmony-fb", + "object-assign": "^2.0.0", + "source-map": "^0.4.2" + }, + "bin": { + "jstransform": "bin/jstransform" + }, + "engines": { + "node": ">=0.8.8" + } + }, + "node_modules/jstransform/node_modules/object-assign": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", + "integrity": "sha512-CdsOUYIh5wIiozhJ3rLQgmUTgcyzFwZZrqhkKhODMoGtPKM+wt0h0CNIoauJWMsS9822EdzPsF/6mb4nLvPN5g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jstransform/node_modules/source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha512-Y8nIfcb1s/7DcobUz1yOO1GSp7gyL+D9zLHDehT7iRESqGSxjJ448Sg7rvfgsRJCnKLdSl11uGf0s9X80cH0/A==", + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/labeled-stream-splicer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-1.0.2.tgz", + "integrity": "sha512-3KBjPRnXrYC5h2jEf/d6hO7Lcl+38QzRVTOyHA2sFzZVMYwsUFuejlrOMwAjmz13hVBr9ruDS1RwE4YEz8P58w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "isarray": "~0.0.1", + "stream-splicer": "^1.1.0" + } + }, + "node_modules/lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", + "dev": true, + "dependencies": { + "invert-kv": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/leven": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/leven/-/leven-1.0.2.tgz", + "integrity": "sha512-U3eIzC2mMAOMOuoJ25sA3eyraoBwndpQyYgBq5dyqrMTpvMg9l9X/ucFHxv622YcCg179WWqleoF7rSzfYrV+Q==", + "dev": true, + "bin": { + "leven": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lexical-scope": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha512-ntJ8IcBCuKwudML7vAuT/L0aIMU0+9vO25K4CjLPYgzf1NZ0bAhJJBZrvkO+oUGgKcbdkH8UZdRsaEg+wULLRw==", + "dev": true, + "dependencies": { + "astw": "^2.0.0" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha512-9mDDwqVIma6OZX79ZlDACZl8sBm0TEnkf99zV3iMA4GzkIT/9hiqP5mY0HoT1iNLCrKc/R1HByV+yJfRWVJryQ==", + "dev": true + }, + "node_modules/lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==", + "dev": true + }, + "node_modules/longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true + }, + "node_modules/minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha512-jQo6o1qSVLEWaw3l+bwYA2X0uLuK2KjNh2wjgO7Q/9UJnXr1Q3yQKR8BI0/Bt/rPg75e6SMW4hW/6cBHVTZUjA==", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/module-deps": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-3.9.1.tgz", + "integrity": "sha512-EbWWlSGaCVidEsLsSzkY6l/jm0IcGDSQ8tGwtjM8joTrxqxP0om02Px9Np8D7FMZ/vZFdsOGbio+WqkKQxYuTA==", + "dev": true, + "dependencies": { + "browser-resolve": "^1.7.0", + "concat-stream": "~1.4.5", + "defined": "^1.0.0", + "detective": "^4.0.0", + "duplexer2": "0.0.2", + "inherits": "^2.0.1", + "JSONStream": "^1.0.3", + "parents": "^1.0.0", + "readable-stream": "^1.1.13", + "resolve": "^1.1.3", + "stream-combiner2": "~1.0.0", + "subarg": "^1.0.0", + "through2": "^1.0.0", + "xtend": "^4.0.0" + }, + "bin": { + "module-deps": "bin/cmd.js" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha512-S0sN3agnVh2SZNEIGc0N1X4Z5K0JeFbGBrnuZpsxuUh5XLF0BnvWkMjRXo/zGKLd/eghvNIKcx1pQkmUjXIyrA==" + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha512-bOj3L1ypm++N+n7CEbbe473A414AB7z+amKYshRb//iuL3MpdDCLhPnw6aVTdKB9g5ZRVHIEp8eUln6L2NUStg==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha512-aZicJZccvxWOZ0Bja2eAch2L8RIJWBuRYmM8Gwl/JjNtRltH0Itcz4eH/ESyuIWfse8cc93ZCf0XrzhXK2HEDA==", + "dev": true + }, + "node_modules/os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", + "dev": true, + "dependencies": { + "lcid": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha512-uQLlclru4xpCi+tfs80l3QF24KL81X57ELNMy7W/dox+JTtxUf1bLyQ8968fFCmSqqbokjW0kn+WBIlO+rSkNg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.4", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "dev": true + }, + "node_modules/parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", + "dev": true, + "dependencies": { + "path-platform": "~0.11.15" + } + }, + "node_modules/parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "dev": true, + "dependencies": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha512-v38ZjVbinlZ2r1Rz06WUZEnGoSRcEGX+roMsiWjHeAe23s2qlQUyfmsPQZvh7d8l0E8AZzTIO/RkUr00LfkSiA==", + "dependencies": { + "better-assert": "~1.0.0" + } + }, + "node_modules/parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha512-B3Nrjw2aL7aI4TDujOzfA4NsEc4u1lVcIRE0xesutH8kjeWF70uk+W5cBlIQx04zUH9NTBvuN36Y9xLRPK6Jjw==", + "dependencies": { + "better-assert": "~1.0.0" + } + }, + "node_modules/parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha512-ijhdxJu6l5Ru12jF0JvzXVPvsC+VibqeaExlNoMhWN6VQ79PGjkmc7oA4W1lp00sFkNyj0fx6ivPLdV51/UMog==", + "dependencies": { + "better-assert": "~1.0.0" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "node_modules/path-exists": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-1.0.0.tgz", + "integrity": "sha512-BD2vrQBPFI3VkVKzTrOmaG2WtPQoduNXu1A5tLYMOW8RN6G9CdhdSkmw+ljxUkJcj4pbXQGw0lzl7MFLnhba9Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true + }, + "node_modules/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/react/-/react-0.13.3.tgz", + "integrity": "sha512-f9bivPvgNqGmcxjSuKCkY27YVKi1RlDm4TlPUNjLDH7lN6gnMQp9lJ9PpTVbo9kNEBr2BIZLz1kI/RFh9Cq2Kg==", + "dependencies": { + "envify": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-only-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-1.1.1.tgz", + "integrity": "sha512-CNGbvYZYr0b1F41aN7bYLHUBvvoynSS7ZTf2RLa5egnjZxKJPJUpUdWplD+jxQPijP/eL02IJxBhY8hwJlI3PQ==", + "dev": true, + "dependencies": { + "readable-stream": "^1.0.31", + "readable-wrap": "^1.0.0" + } + }, + "node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/readable-wrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/readable-wrap/-/readable-wrap-1.0.0.tgz", + "integrity": "sha512-/8n0Mr10S+HGKFygQ42Z40JIXwafPH3A72pwmlNClThgsImV5LJJiCue5Je1asxwY082sYxq/+kTxH6nTn0w3g==", + "dev": true, + "dependencies": { + "readable-stream": "^1.1.13-1" + } + }, + "node_modules/recast": { + "version": "0.11.23", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", + "integrity": "sha512-+nixG+3NugceyR8O1bLU45qs84JgI3+8EauyRZafLgC9XbdAOIVgwV1Pe2da0YzGo62KzWoZwUpVEQf6qNAXWA==", + "dependencies": { + "ast-types": "0.9.6", + "esprima": "~3.1.0", + "private": "~0.1.5", + "source-map": "~0.5.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerator": { + "version": "0.8.40", + "resolved": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz", + "integrity": "sha512-NsE91xz22nl5JsAwE5kZNmaMaK6g4HipZaGhrQJeVo8DsTwYYONx0TYEm8+7kFIODeuLNQpRsomV1CChmEY5Yg==", + "dev": true, + "dependencies": { + "commoner": "~0.10.3", + "defs": "~1.1.0", + "esprima-fb": "~15001.1001.0-dev-harmony-fb", + "private": "~0.1.5", + "recast": "0.10.33", + "through": "~2.3.8" + }, + "bin": { + "regenerator": "bin/regenerator" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/regenerator/node_modules/ast-types": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.12.tgz", + "integrity": "sha512-rWhsoD0aHKpx+aKIP0Sf92bai1HC5iZcB1n/HCnkIMR8Bhx0gYRQySo062Y65ND4oRgcuxpLcPrcco09I1shpg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/regenerator/node_modules/esprima-fb": { + "version": "15001.1001.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", + "integrity": "sha512-m7OsYzocA8OQ3+9CxmhIv7NPHtyDR2ixaLCO7kLZ+YH+xQ/BpaZmll9EXmc+kBxzWA8BRBXbNEuEQqQ6vfsgDw==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/regenerator/node_modules/recast": { + "version": "0.10.33", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.10.33.tgz", + "integrity": "sha512-RxAVgvgWGzfFYsdc3PB6TM4/cq8HMgBH8PC9r+SkO7j1MeHZvIMxLSVlUhin3sv9wbAy8CMAPXSGSGkWPovyKQ==", + "dev": true, + "dependencies": { + "ast-types": "0.8.12", + "esprima-fb": "~15001.1001.0-dev-harmony-fb", + "private": "~0.1.5", + "source-map": "~0.5.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/regexpu": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexpu/-/regexpu-1.3.0.tgz", + "integrity": "sha512-OqpQCTCcVM6k9IbzxLjNN6TRj3NV7qF4L8zUqsNoeAmmIZp8wH1tdZnn0vNXE2tGNU4ho0xTZWk3FmahOtyMRA==", + "dev": true, + "dependencies": { + "esprima": "^2.6.0", + "recast": "^0.10.10", + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + }, + "bin": { + "regexpu": "bin/regexpu" + } + }, + "node_modules/regexpu/node_modules/ast-types": { + "version": "0.8.15", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.8.15.tgz", + "integrity": "sha512-8WsusRFHT6D2CpPTCLLLeIp4dN4pMEgmVX/jaSBsbMFObktStNdGOE1ZW4x8V/RABr1VtqruQgpabZyvzrrrww==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/regexpu/node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regexpu/node_modules/esprima-fb": { + "version": "15001.1001.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-15001.1001.0-dev-harmony-fb.tgz", + "integrity": "sha512-m7OsYzocA8OQ3+9CxmhIv7NPHtyDR2ixaLCO7kLZ+YH+xQ/BpaZmll9EXmc+kBxzWA8BRBXbNEuEQqQ6vfsgDw==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/regexpu/node_modules/recast": { + "version": "0.10.43", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.10.43.tgz", + "integrity": "sha512-GC1g4P336t8WOpzVGFOo83m14xQfHbVqe+eDus+4oubobkWb/kONwMWSG6+K3BUtBOoUdUU+GT9kmNCSOBv9+g==", + "dev": true, + "dependencies": { + "ast-types": "0.8.15", + "esprima-fb": "~15001.1001.0-dev-harmony-fb", + "private": "~0.1.5", + "source-map": "~0.5.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha512-x+Y3yA24uF68m5GA+tBjbGYo64xXVJpbToBaWCoSNSc1hdk6dfctaRWrNFTVJZIIhL5GxW8zwjoixbnifnK59g==", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha512-jlQ9gYLfk2p3V5Ag5fYhA7fv7OHzd1KUH0PRP46xc3TgwjwgROIW572AfYg/X9kaNq/LJnu6oJcFRXlIrGoTRw==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/repeating": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", + "integrity": "sha512-Nh30JLeMHdoI+AsQ5eblhZ7YlTsM9wiJQe/AHIunlK3KWzvXhXb36IJ7K1IOeRjIOtzMjdUHjwXUFxKJoPTSOg==", + "dev": true, + "dependencies": { + "is-finite": "^1.0.0" + }, + "bin": { + "repeating": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha512-yqINtL/G7vs2v+dFIZmFUDbnVyFUJFKd6gK22Kgo6R4jfJGFtisKyncWDDULgjfqf4ASQuIQyjJ7XZ+3aWpsAg==", + "dev": true, + "dependencies": { + "align-text": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha512-UTzHm/+AzKfO9RgPgRpDIuMSNie1ubXRaljjlhFMNGYoG7z+rm9AHLPMf70R7887xboDH9Q+5YQbWKObFHEAtw==", + "dev": true, + "dependencies": { + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shell-quote": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-0.0.1.tgz", + "integrity": "sha512-uEWz7wa9vnCi9w4mvKZMgbHFk3DCKjLQlZcy0tJxUH4NwZjRrPPHXAYIEt2TmJs600Dcgj0Z3fZLZKVPVdGNbQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/simple-fmt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/simple-fmt/-/simple-fmt-0.1.0.tgz", + "integrity": "sha512-9a3zTDDh9LXbTR37qBhACWIQ/mP/ry5xtmbE98BJM8GR02sanCkfMzp7AdCTqYhkBZggK/w7hJtc8Pb9nmo16A==", + "dev": true + }, + "node_modules/simple-is": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/simple-is/-/simple-is-0.2.0.tgz", + "integrity": "sha512-GJXhv3r5vdj5tGWO+rcrWgjU2azLB+fb7Ehh3SmZpXE0o4KrrFLti0w4mdDCbR29X/z0Ls20ApjZitlpAXhAeg==", + "dev": true + }, + "node_modules/slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/socket.io": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.7.4.tgz", + "integrity": "sha512-rKMY/U7gBmbHjwrljcPHy+uEXZ5973WvO2DrooL643w1R24SZVzsmhvNmJFjYVhAL4y7wrZJJS/znUfp0VWfKw==", + "dependencies": { + "debug": "2.3.3", + "engine.io": "~1.8.4", + "has-binary": "0.1.7", + "object-assign": "4.1.0", + "socket.io-adapter": "0.5.0", + "socket.io-client": "1.7.4", + "socket.io-parser": "2.3.1" + } + }, + "node_modules/socket.io-adapter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", + "integrity": "sha512-zmYvlFJay9skt4yk1MffE9p93HKvQtyy0BLZ5dRM73bOXFJXNZWq8qZVdY456sLaxdK6fHGiZ7glxzqvzwGzkw==", + "dependencies": { + "debug": "2.3.3", + "socket.io-parser": "2.3.1" + } + }, + "node_modules/socket.io-adapter/node_modules/debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha512-dCHp4G+F11zb+RtEu7BE2U8R32AYmM/4bljQfut8LipH3PdwsVBVGh083MXvtKkB7HSQUzSwiXz53c4mzJvYfw==", + "dependencies": { + "ms": "0.7.2" + } + }, + "node_modules/socket.io-adapter/node_modules/ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha512-5NnE67nQSQDJHVahPJna1PQ/zCXMnQop3yUCxjKPNzCxuyPSKWTQ/5Gu5CZmjetwGLWRA+PzeF5thlbOdbQldA==" + }, + "node_modules/socket.io-client": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.7.4.tgz", + "integrity": "sha512-vW9xr9XyTJejFS//7GNZmLTLkUSAcvOSxRXXhrojV+7wboTFB8CuvK1UBCW3NiB2kqyi0h9cTeyD7dXjdUd9jQ==", + "dependencies": { + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.3.3", + "engine.io-client": "~1.8.4", + "has-binary": "0.1.7", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseuri": "0.0.5", + "socket.io-parser": "2.3.1", + "to-array": "0.1.4" + } + }, + "node_modules/socket.io-client/node_modules/debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha512-dCHp4G+F11zb+RtEu7BE2U8R32AYmM/4bljQfut8LipH3PdwsVBVGh083MXvtKkB7HSQUzSwiXz53c4mzJvYfw==", + "dependencies": { + "ms": "0.7.2" + } + }, + "node_modules/socket.io-client/node_modules/ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha512-5NnE67nQSQDJHVahPJna1PQ/zCXMnQop3yUCxjKPNzCxuyPSKWTQ/5Gu5CZmjetwGLWRA+PzeF5thlbOdbQldA==" + }, + "node_modules/socket.io-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", + "integrity": "sha512-j6l4g/+yWQjmy1yByzg1DPFL4vxQw+NwCJatIxni/AE1wfm17FBtIKSWU4Ay+onrJwDxmC4eK4QS/04ZsqYwZQ==", + "dependencies": { + "component-emitter": "1.1.2", + "debug": "2.2.0", + "isarray": "0.0.1", + "json3": "3.3.2" + } + }, + "node_modules/socket.io-parser/node_modules/component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha512-YhIbp3PJiznERfjlIkK0ue4obZxt2S60+0W8z24ZymOHT8sHloOqWOqZRU2eN5OlY8U08VFsP02letcu26FilA==" + }, + "node_modules/socket.io-parser/node_modules/debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha512-X0rGvJcskG1c3TgSCPqHJ0XJgwlcvOC7elJ5Y0hYuKBZoVqWpAMfLOeIh2UI/DCQ5ruodIjvsugZtjUYUw2pUw==", + "dependencies": { + "ms": "0.7.1" + } + }, + "node_modules/socket.io-parser/node_modules/ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha512-lRLiIR9fSNpnP6TC4v8+4OU7oStC01esuNowdQ34L+Gk8e5Puoc88IqJ+XAY/B3Mn2ZKis8l8HX90oU8ivzUHg==" + }, + "node_modules/socket.io/node_modules/debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha512-dCHp4G+F11zb+RtEu7BE2U8R32AYmM/4bljQfut8LipH3PdwsVBVGh083MXvtKkB7HSQUzSwiXz53c4mzJvYfw==", + "dependencies": { + "ms": "0.7.2" + } + }, + "node_modules/socket.io/node_modules/ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha512-5NnE67nQSQDJHVahPJna1PQ/zCXMnQop3yUCxjKPNzCxuyPSKWTQ/5Gu5CZmjetwGLWRA+PzeF5thlbOdbQldA==" + }, + "node_modules/socket.io/node_modules/object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha512-Lbc7GfN7XFaK30bzUN3cDYLOkT0dH05S0ax1QikylHUD9+Z9PRF3G1iYwX3kcz+6AlzTFGkUgMxz6l3aUwbwTA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.10.tgz", + "integrity": "sha512-gGKOSat73z0V8wBKo9AGxZZyekczBireh1hHktbt+kb9acsCB5OfVCF2DCWlztcQ3r5oNN7f2BL0B2xOcoJ/DQ==", + "dev": true, + "dependencies": { + "source-map": "0.1.32" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.1.32", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.32.tgz", + "integrity": "sha512-htQyLrrRLkQ87Zfrir4/yN+vAUd6DNjVayEjTSHXu29AYQJw57I4/xEL/M6p6E/woPNJwvZt6rVlzc7gFEJccQ==", + "dev": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "deprecated": "Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility", + "dev": true + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-1.0.0.tgz", + "integrity": "sha512-e+V5xc4LlkOiRr64kZTUdb11exsbpSnwb9uwmXaHeDXCpfHg7vaefMJOxi21Pe74ZOqjZ87blBcqqpNAM4Ku0g==", + "dev": true, + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "^1.0.27-1" + } + }, + "node_modules/stream-combiner2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.0.2.tgz", + "integrity": "sha512-7DO1SfBVnyIyo9ytUjSyVojT5bp1ZY6h3pj7HUs6PwcRSd/r8mBOHbRwYC7nbHRakKzMKyNp5HWJRv4GgVherA==", + "dev": true, + "dependencies": { + "duplexer2": "~0.0.2", + "through2": "~0.5.1" + } + }, + "node_modules/stream-combiner2/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/stream-combiner2/node_modules/through2": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "integrity": "sha512-zexCrAOTbjkBCXGyozn7hhS3aEaqdrc59mAD2E3dKYzV1vFuEGQ1hEDJN2oQMQFwy4he2zyLqPZV+AlfS8ZWJA==", + "dev": true, + "dependencies": { + "readable-stream": "~1.0.17", + "xtend": "~3.0.0" + } + }, + "node_modules/stream-combiner2/node_modules/xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha512-sp/sT9OALMjRW1fKDlPeuSZlDQpkqReA0pyJukniWbTGoEKefHxhGJynE3PNhUMlcM8qWIjPwecwCw4LArS5Eg==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/stream-splicer": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-1.3.2.tgz", + "integrity": "sha512-nmUMEbdm/sZYqe9dZs7mqJvTYpunsDbIWI5FiBCMc/hMVd6vwzy+ITmo7C3gcLYqrn+uQ1w+EJwooWvJ997JAA==", + "dev": true, + "dependencies": { + "indexof": "0.0.1", + "inherits": "^2.0.1", + "isarray": "~0.0.1", + "readable-stream": "^1.1.13-1", + "readable-wrap": "^1.0.0", + "through2": "^1.0.0" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true + }, + "node_modules/stringmap": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/stringmap/-/stringmap-0.2.2.tgz", + "integrity": "sha512-mR1LEHDw6TsHa+LwJeeBc9ZqZqEOm7bHidgxMmDg8HB/rbA1HhDeT08gS67CCCG/xrgIfQx5tW42pd8vFpLUow==", + "dev": true + }, + "node_modules/stringset": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/stringset/-/stringset-0.2.1.tgz", + "integrity": "sha512-km3jeiRpmySChl1oLiBE2ESdG5k/4+6tjENVL6BB3mdmKBiUikI5ks4paad2WAKsxzpNiBqBBbXCC12QqlpLWA==", + "dev": true + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==", + "dev": true, + "dependencies": { + "minimist": "^1.1.0" + } + }, + "node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/syntax-error": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", + "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", + "dev": true, + "dependencies": { + "acorn-node": "^1.2.0" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "node_modules/through2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-1.1.1.tgz", + "integrity": "sha512-zEbpaeSMHxczpTzO1KkMHjBC1enTA68ojeaZGG4toqdASpb9t4xUZaYFBq2/9OHo5nTGFVSYd4c910OR+6wxbQ==", + "dev": true, + "dependencies": { + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" + } + }, + "node_modules/timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==", + "dev": true, + "dependencies": { + "process": "~0.11.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha512-LhVdShQD/4Mk4zXNroIQZJC+Ap3zgLcDuwEdcmLv9CCO73NWockQDwyUnW/m8VX/EElfL6FcYx7EeutN4HJA6A==" + }, + "node_modules/to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha512-WZGXGstmCWgeevgTL54hrCuw1dyMQIzWy7ZfqRJfSmJZBwklI15egmQytFP6bPidmw3M8d5yEowl1niq4vmqZw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/try-resolve": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/try-resolve/-/try-resolve-1.0.1.tgz", + "integrity": "sha512-yHeaPjCBzVaXwWl5IMUapTaTC2rn/eBYg2fsG2L+CvJd+ttFbk0ylDnpTO3wVhosmE1tQEvcebbBeKLCwScQSQ==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "dev": true + }, + "node_modules/tryor": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tryor/-/tryor-0.1.2.tgz", + "integrity": "sha512-2+ilNA00DGvbUYYbRrm3ux+snbo7I6uPXMw8I4p/QMl7HUOWBBZFbk+Mpr8/IAPDQE+LQ8vOdlI6xEzjc+e/BQ==", + "dev": true + }, + "node_modules/tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.7.tgz", + "integrity": "sha512-ueeb9YybpjhivjbHP2LdFDAjbS948fGEPj+ACAMs4xCMmh72OCOMQWBQKlaN4ZNQ04yfLSDLSx1tGRIoWimObQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha512-QMpnpVtYaWEeY+MwKDN/UdKlE/LsFZXM5lO1u7GaZzNgmIbGixHEmVMIKT+vqYOALu3m5GYQy9kz4Xu4IVn7Ow==" + }, + "node_modules/umd": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", + "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", + "dev": true, + "bin": { + "umd": "bin/cli.js" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==", + "dev": true, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==", + "dev": true + }, + "node_modules/user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha512-aggiKfEEubv3UwRNqTzLInZpAOmKzwdHqEBmW/hBA/mt99eg+b4VrX6i+IRLxU8+WJYfa33rGwRseg4eElUgsQ==", + "dev": true, + "bin": { + "user-home": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dev": true, + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha512-NyZNR3WDah+NPkjh/YmhuWSsT4a0mF0BJYgUmvrJ70zxjTXh5Y2Asobxlh0Nfs0PCFB5FVpRJft7NozAWFMwLQ==", + "dev": true, + "dependencies": { + "indexof": "0.0.1" + } + }, + "node_modules/window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha512-2thx4pB0cV3h+Bw7QmMXcEbdmOzv9t0HFplJH/Lz6yu60hXYy5RT8rUu+wlIreVxWsGN20mo+MHeCSfUpQBwPw==", + "dev": true, + "bin": { + "window-size": "cli.js" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha512-xSBsCeh+g+dinoBv3GAOWM4LcVVO68wLXRanibtBSdUvkGWQRGeE9P7IwU9EmDDi4jA6L44lz15CGMwdw9N5+Q==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", + "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", + "dependencies": { + "options": ">=0.0.5", + "ultron": "1.0.x" + } + }, + "node_modules/wtf-8": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", + "integrity": "sha512-qfR6ovmRRMxNHgUNYI9LRdVofApe/eYrv4ggNOvvCP+pPdEo9Ym93QN4jUceGD6PignBbp2zAzgoE7GibAdq2A==" + }, + "node_modules/xmlhttprequest-ssl": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz", + "integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", + "dev": true + }, + "node_modules/yargs": { + "version": "3.27.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.27.0.tgz", + "integrity": "sha512-6atYjGACjX/OYWico7LwdBx9eiGlkMnIw6OwqfBb+uJQpaT82tQ7oI+BI6Dvq62qZvSbzGzQCVLQdMd59tR2eA==", + "dev": true, + "dependencies": { + "camelcase": "^1.2.1", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "os-locale": "^1.4.0", + "window-size": "^0.1.2", + "y18n": "^3.2.0" + } + }, + "node_modules/yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg==" + } + } +} diff --git a/node_modules/Base64/.npmignore b/node_modules/Base64/.npmignore new file mode 100644 index 0000000..cba87a3 --- /dev/null +++ b/node_modules/Base64/.npmignore @@ -0,0 +1,2 @@ +/coverage/ +/node_modules/ diff --git a/node_modules/Base64/.travis.yml b/node_modules/Base64/.travis.yml new file mode 100644 index 0000000..fbde051 --- /dev/null +++ b/node_modules/Base64/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" +install: make setup +script: make test diff --git a/node_modules/Base64/LICENSE b/node_modules/Base64/LICENSE new file mode 100644 index 0000000..4832767 --- /dev/null +++ b/node_modules/Base64/LICENSE @@ -0,0 +1,14 @@ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (c) 2011..2012 David Chambers + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/node_modules/Base64/Makefile b/node_modules/Base64/Makefile new file mode 100644 index 0000000..5c475df --- /dev/null +++ b/node_modules/Base64/Makefile @@ -0,0 +1,42 @@ +ISTANBUL = node_modules/.bin/istanbul +UGLIFYJS = node_modules/.bin/uglifyjs +XYZ = node_modules/.bin/xyz --message X.Y.Z --tag X.Y.Z + +SRC = base64.js +MIN = $(patsubst %.js,%.min.js,$(SRC)) + + +.PHONY: all +all: $(MIN) + +%.min.js: %.js + $(UGLIFYJS) $< --compress --mangle > $@ + + +.PHONY: bytes +bytes: base64.min.js + gzip --best --stdout $< | wc -c | tr -d ' ' + + +.PHONY: clean +clean: + rm -f -- $(MIN) + + +.PHONY: release-major release-minor release-patch +release-major: + $(XYZ) --increment major +release-minor: + $(XYZ) --increment minor +release-patch: + $(XYZ) --increment patch + + +.PHONY: setup +setup: + npm install + + +.PHONY: test +test: + $(ISTANBUL) cover node_modules/.bin/_mocha -- --compilers coffee:coffee-script/register diff --git a/node_modules/Base64/README.md b/node_modules/Base64/README.md new file mode 100644 index 0000000..e5dafed --- /dev/null +++ b/node_modules/Base64/README.md @@ -0,0 +1,34 @@ +# Base64.js + +≈ 500 byte* polyfill for browsers which don't provide [`window.btoa`][1] and +[`window.atob`][2]. + +Although the script does no harm in browsers which do provide these functions, +a conditional script loader such as [yepnope][3] can prevent unnecessary HTTP +requests. + +```javascript +yepnope({ + test: window.btoa && window.atob, + nope: 'base64.js', + callback: function () { + // `btoa` and `atob` are now safe to use + } +}) +``` + +Base64.js stems from a [gist][4] by [yahiko][5]. + +### Running the test suite + + make setup + make test + +\* Minified and gzipped. Run `make bytes` to verify. + + +[1]: https://developer.mozilla.org/en/DOM/window.btoa +[2]: https://developer.mozilla.org/en/DOM/window.atob +[3]: http://yepnopejs.com/ +[4]: https://gist.github.com/229984 +[5]: https://github.com/yahiko diff --git a/node_modules/Base64/base64.js b/node_modules/Base64/base64.js new file mode 100644 index 0000000..15d3a8a --- /dev/null +++ b/node_modules/Base64/base64.js @@ -0,0 +1,60 @@ +;(function () { + + var object = typeof exports != 'undefined' ? exports : this; // #8: web workers + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function InvalidCharacterError(message) { + this.message = message; + } + InvalidCharacterError.prototype = new Error; + InvalidCharacterError.prototype.name = 'InvalidCharacterError'; + + // encoder + // [https://gist.github.com/999166] by [https://github.com/nignag] + object.btoa || ( + object.btoa = function (input) { + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars, output = ''; + // if the next input index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + input.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8) + ) { + charCode = input.charCodeAt(idx += 3/4); + if (charCode > 0xFF) { + throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + } + block = block << 8 | charCode; + } + return output; + }); + + // decoder + // [https://gist.github.com/1020396] by [https://github.com/atk] + object.atob || ( + object.atob = function (input) { + input = input.replace(/=+$/, ''); + if (input.length % 4 == 1) { + throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); + } + for ( + // initialize result and counters + var bc = 0, bs, buffer, idx = 0, output = ''; + // get next character + buffer = input.charAt(idx++); + // character found in table? initialize bit storage and add its ascii value; + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + // and if not first of each 4 characters, + // convert the first 8 bits to one ascii character + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + // try to find character in table (0-63, not found => -1) + buffer = chars.indexOf(buffer); + } + return output; + }); + +}()); diff --git a/node_modules/Base64/base64.min.js b/node_modules/Base64/base64.min.js new file mode 100644 index 0000000..33c7aa4 --- /dev/null +++ b/node_modules/Base64/base64.min.js @@ -0,0 +1 @@ +!function(){function t(t){this.message=t}var e="undefined"!=typeof exports?exports:this,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var o,n,a=0,i=r,c="";e.charAt(0|a)||(i="=",a%1);c+=i.charAt(63&o>>8-a%1*8)){if(n=e.charCodeAt(a+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return c}),e.atob||(e.atob=function(e){if(e=e.replace(/=+$/,""),e.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,n,a=0,i=0,c="";n=e.charAt(i++);~n&&(o=a%4?64*o+n:n,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)n=r.indexOf(n);return c})}(); \ No newline at end of file diff --git a/node_modules/Base64/package.json b/node_modules/Base64/package.json new file mode 100644 index 0000000..e453567 --- /dev/null +++ b/node_modules/Base64/package.json @@ -0,0 +1,24 @@ +{ + "name": "Base64", + "version": "0.2.1", + "description": "Base64 encoding and decoding", + "author": "David Chambers ", + "main": "./base64.js", + "licenses": [ + { + "type": "WTFPL", + "url": "https://raw.github.com/davidchambers/Base64.js/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/davidchambers/Base64.js.git" + }, + "devDependencies": { + "coffee-script": "1.7.x", + "istanbul": "0.2.x", + "mocha": "1.18.x", + "uglify-js": "2.4.x", + "xyz": "0.1.x" + } +} diff --git a/node_modules/Base64/test/base64.coffee b/node_modules/Base64/test/base64.coffee new file mode 100644 index 0000000..e25cf5c --- /dev/null +++ b/node_modules/Base64/test/base64.coffee @@ -0,0 +1,52 @@ +assert = require 'assert' + +{btoa, atob} = require '..' + + +describe 'Base64.js', -> + + it 'can encode ASCII input', -> + assert.strictEqual btoa(''), '' + assert.strictEqual btoa('f'), 'Zg==' + assert.strictEqual btoa('fo'), 'Zm8=' + assert.strictEqual btoa('foo'), 'Zm9v' + assert.strictEqual btoa('quux'), 'cXV1eA==' + assert.strictEqual btoa('!"#$%'), 'ISIjJCU=' + assert.strictEqual btoa("&'()*+"), 'JicoKSor' + assert.strictEqual btoa(',-./012'), 'LC0uLzAxMg==' + assert.strictEqual btoa('3456789:'), 'MzQ1Njc4OTo=' + assert.strictEqual btoa(';<=>?@ABC'), 'Ozw9Pj9AQUJD' + assert.strictEqual btoa('DEFGHIJKLM'), 'REVGR0hJSktMTQ==' + assert.strictEqual btoa('NOPQRSTUVWX'), 'Tk9QUVJTVFVWV1g=' + assert.strictEqual btoa('YZ[\\]^_`abc'), 'WVpbXF1eX2BhYmM=' + assert.strictEqual btoa('defghijklmnop'), 'ZGVmZ2hpamtsbW5vcA==' + assert.strictEqual btoa('qrstuvwxyz{|}~'), 'cXJzdHV2d3h5ent8fX4=' + + it 'cannot encode non-ASCII input', -> + assert.throws (-> btoa '✈'), (err) -> + err instanceof Error and + err.name is 'InvalidCharacterError' and + err.message is "'btoa' failed: The string to be encoded contains characters outside of the Latin1 range." + + it 'can decode Base64-encoded input', -> + assert.strictEqual atob(''), '' + assert.strictEqual atob('Zg=='), 'f' + assert.strictEqual atob('Zm8='), 'fo' + assert.strictEqual atob('Zm9v'), 'foo' + assert.strictEqual atob('cXV1eA=='), 'quux' + assert.strictEqual atob('ISIjJCU='), '!"#$%' + assert.strictEqual atob('JicoKSor'), "&'()*+" + assert.strictEqual atob('LC0uLzAxMg=='), ',-./012' + assert.strictEqual atob('MzQ1Njc4OTo='), '3456789:' + assert.strictEqual atob('Ozw9Pj9AQUJD'), ';<=>?@ABC' + assert.strictEqual atob('REVGR0hJSktMTQ=='), 'DEFGHIJKLM' + assert.strictEqual atob('Tk9QUVJTVFVWV1g='), 'NOPQRSTUVWX' + assert.strictEqual atob('WVpbXF1eX2BhYmM='), 'YZ[\\]^_`abc' + assert.strictEqual atob('ZGVmZ2hpamtsbW5vcA=='), 'defghijklmnop' + assert.strictEqual atob('cXJzdHV2d3h5ent8fX4='), 'qrstuvwxyz{|}~' + + it 'cannot decode invalid input', -> + assert.throws (-> atob 'a'), (err) -> + err instanceof Error and + err.name is 'InvalidCharacterError' and + err.message is "'atob' failed: The string to be decoded is not correctly encoded." diff --git a/node_modules/JSONStream/.travis.yml b/node_modules/JSONStream/.travis.yml new file mode 100644 index 0000000..5f30bb5 --- /dev/null +++ b/node_modules/JSONStream/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - 4 + - 5 + - 6 +sudo: false + + diff --git a/node_modules/JSONStream/LICENSE.APACHE2 b/node_modules/JSONStream/LICENSE.APACHE2 new file mode 100644 index 0000000..6366c04 --- /dev/null +++ b/node_modules/JSONStream/LICENSE.APACHE2 @@ -0,0 +1,15 @@ +Apache License, Version 2.0 + +Copyright (c) 2011 Dominic Tarr + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/node_modules/JSONStream/LICENSE.MIT b/node_modules/JSONStream/LICENSE.MIT new file mode 100644 index 0000000..6eafbd7 --- /dev/null +++ b/node_modules/JSONStream/LICENSE.MIT @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2011 Dominic Tarr + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/JSONStream/bin.js b/node_modules/JSONStream/bin.js new file mode 100644 index 0000000..af2b6ac --- /dev/null +++ b/node_modules/JSONStream/bin.js @@ -0,0 +1,12 @@ +#! /usr/bin/env node + +var JSONStream = require('./') + +if(!module.parent && process.title !== 'browser') { + process.stdin + .pipe(JSONStream.parse(process.argv[2])) + .pipe(JSONStream.stringify('[', ',\n', ']\n', 2)) + .pipe(process.stdout) +} + + diff --git a/node_modules/JSONStream/examples/all_docs.js b/node_modules/JSONStream/examples/all_docs.js new file mode 100644 index 0000000..fa87fe5 --- /dev/null +++ b/node_modules/JSONStream/examples/all_docs.js @@ -0,0 +1,13 @@ +var request = require('request') + , JSONStream = require('JSONStream') + , es = require('event-stream') + +var parser = JSONStream.parse(['rows', true]) //emit parts that match this path (any element of the rows array) + , req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) + , logger = es.mapSync(function (data) { //create a stream that logs to stderr, + console.error(data) + return data + }) + +req.pipe(parser) +parser.pipe(logger) diff --git a/node_modules/JSONStream/index.js b/node_modules/JSONStream/index.js new file mode 100644 index 0000000..f4ed901 --- /dev/null +++ b/node_modules/JSONStream/index.js @@ -0,0 +1,247 @@ +'use strict' + +var Parser = require('jsonparse') + , through = require('through') + +var bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from + +/* + + the value of this.stack that creationix's jsonparse has is weird. + + it makes this code ugly, but his problem is way harder that mine, + so i'll forgive him. + +*/ + +exports.parse = function (path, map) { + var header, footer + var parser = new Parser() + var stream = through(function (chunk) { + if('string' === typeof chunk) + chunk = bufferFrom ? Buffer.from(chunk) : new Buffer(chunk) + parser.write(chunk) + }, + function (data) { + if(data) + stream.write(data) + if (header) + stream.emit('header', header) + if (footer) + stream.emit('footer', footer) + stream.queue(null) + }) + + if('string' === typeof path) + path = path.split('.').map(function (e) { + if (e === '$*') + return {emitKey: true} + else if (e === '*') + return true + else if (e === '') // '..'.split('.') returns an empty string + return {recurse: true} + else + return e + }) + + + var count = 0, _key + if(!path || !path.length) + path = null + + parser.onValue = function (value) { + if (!this.root) + stream.root = value + + if(! path) return + + var i = 0 // iterates on path + var j = 0 // iterates on stack + var emitKey = false; + var emitPath = false; + while (i < path.length) { + var key = path[i] + var c + j++ + + if (key && !key.recurse) { + c = (j === this.stack.length) ? this : this.stack[j] + if (!c) return + if (! check(key, c.key)) { + setHeaderFooter(c.key, value) + return + } + emitKey = !!key.emitKey; + emitPath = !!key.emitPath; + i++ + } else { + i++ + var nextKey = path[i] + if (! nextKey) return + while (true) { + c = (j === this.stack.length) ? this : this.stack[j] + if (!c) return + if (check(nextKey, c.key)) { + i++; + if (!Object.isFrozen(this.stack[j])) + this.stack[j].value = null + break + } else { + setHeaderFooter(c.key, value) + } + j++ + } + } + + } + + // emit header + if (header) { + stream.emit('header', header); + header = false; + } + if (j !== this.stack.length) return + + count ++ + var actualPath = this.stack.slice(1).map(function(element) { return element.key }).concat([this.key]) + var data = value + if(null != data) + if(null != (data = map ? map(data, actualPath) : data)) { + if (emitKey || emitPath) { + data = { value: data }; + if (emitKey) + data["key"] = this.key; + if (emitPath) + data["path"] = actualPath; + } + + stream.queue(data) + } + if (this.value) delete this.value[this.key] + for(var k in this.stack) + if (!Object.isFrozen(this.stack[k])) + this.stack[k].value = null + } + parser._onToken = parser.onToken; + + parser.onToken = function (token, value) { + parser._onToken(token, value); + if (this.stack.length === 0) { + if (stream.root) { + if(!path) + stream.queue(stream.root) + count = 0; + stream.root = null; + } + } + } + + parser.onError = function (err) { + if(err.message.indexOf("at position") > -1) + err.message = "Invalid JSON (" + err.message + ")"; + stream.emit('error', err) + } + + return stream + + function setHeaderFooter(key, value) { + // header has not been emitted yet + if (header !== false) { + header = header || {} + header[key] = value + } + + // footer has not been emitted yet but header has + if (footer !== false && header === false) { + footer = footer || {} + footer[key] = value + } + } +} + +function check (x, y) { + if ('string' === typeof x) + return y == x + else if (x && 'function' === typeof x.exec) + return x.exec(y) + else if ('boolean' === typeof x || 'object' === typeof x) + return x + else if ('function' === typeof x) + return x(y) + return false +} + +exports.stringify = function (op, sep, cl, indent) { + indent = indent || 0 + if (op === false){ + op = '' + sep = '\n' + cl = '' + } else if (op == null) { + + op = '[\n' + sep = '\n,\n' + cl = '\n]\n' + + } + + //else, what ever you like + + var stream + , first = true + , anyData = false + stream = through(function (data) { + anyData = true + try { + var json = JSON.stringify(data, null, indent) + } catch (err) { + return stream.emit('error', err) + } + if(first) { first = false ; stream.queue(op + json)} + else stream.queue(sep + json) + }, + function (data) { + if(!anyData) + stream.queue(op) + stream.queue(cl) + stream.queue(null) + }) + + return stream +} + +exports.stringifyObject = function (op, sep, cl, indent) { + indent = indent || 0 + if (op === false){ + op = '' + sep = '\n' + cl = '' + } else if (op == null) { + + op = '{\n' + sep = '\n,\n' + cl = '\n}\n' + + } + + //else, what ever you like + + var first = true + var anyData = false + var stream = through(function (data) { + anyData = true + var json = JSON.stringify(data[0]) + ':' + JSON.stringify(data[1], null, indent) + if(first) { first = false ; this.queue(op + json)} + else this.queue(sep + json) + }, + function (data) { + if(!anyData) this.queue(op) + this.queue(cl) + + this.queue(null) + }) + + return stream +} + + diff --git a/node_modules/JSONStream/package.json b/node_modules/JSONStream/package.json new file mode 100644 index 0000000..f2350e8 --- /dev/null +++ b/node_modules/JSONStream/package.json @@ -0,0 +1,40 @@ +{ + "name": "JSONStream", + "version": "1.3.5", + "description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)", + "homepage": "http://github.com/dominictarr/JSONStream", + "repository": { + "type": "git", + "url": "git://github.com/dominictarr/JSONStream.git" + }, + "license": "(MIT OR Apache-2.0)", + "keywords": [ + "json", + "stream", + "streaming", + "parser", + "async", + "parsing" + ], + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "devDependencies": { + "it-is": "~1", + "assertions": "~2.2.2", + "render": "~0.1.1", + "trees": "~0.0.3", + "event-stream": "~0.7.0", + "tape": "~2.12.3" + }, + "bin": "./bin.js", + "author": "Dominic Tarr (http://bit.ly/dominictarr)", + "scripts": { + "test": "node test/run.js" + }, + "optionalDependencies": {}, + "engines": { + "node": "*" + } +} diff --git a/node_modules/JSONStream/readme.markdown b/node_modules/JSONStream/readme.markdown new file mode 100644 index 0000000..422c3df --- /dev/null +++ b/node_modules/JSONStream/readme.markdown @@ -0,0 +1,207 @@ +# JSONStream + +streaming JSON.parse and stringify + +![](https://secure.travis-ci.org/dominictarr/JSONStream.png?branch=master) + +## install +```npm install JSONStream``` + +## example + +``` js + +var request = require('request') + , JSONStream = require('JSONStream') + , es = require('event-stream') + +request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) + .pipe(JSONStream.parse('rows.*')) + .pipe(es.mapSync(function (data) { + console.error(data) + return data + })) +``` + +## JSONStream.parse(path) + +parse stream of values that match a path + +``` js + JSONStream.parse('rows.*.doc') +``` + +The `..` operator is the recursive descent operator from [JSONPath](http://goessner.net/articles/JsonPath/), which will match a child at any depth (see examples below). + +If your keys have keys that include `.` or `*` etc, use an array instead. +`['row', true, /^doc/]`. + +If you use an array, `RegExp`s, booleans, and/or functions. The `..` operator is also available in array representation, using `{recurse: true}`. +any object that matches the path will be emitted as 'data' (and `pipe`d down stream) + +If `path` is empty or null, no 'data' events are emitted. + +If you want to have keys emitted, you can prefix your `*` operator with `$`: `obj.$*` - in this case the data passed to the stream is an object with a `key` holding the key and a `value` property holding the data. + +### Examples + +query a couchdb view: + +``` bash +curl -sS localhost:5984/tests/_all_docs&include_docs=true +``` +you will get something like this: + +``` js +{"total_rows":129,"offset":0,"rows":[ + { "id":"change1_0.6995461115147918" + , "key":"change1_0.6995461115147918" + , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} + , "doc":{ + "_id": "change1_0.6995461115147918" + , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} + }, + { "id":"change2_0.6995461115147918" + , "key":"change2_0.6995461115147918" + , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} + , "doc":{ + "_id":"change2_0.6995461115147918" + , "_rev":"1-13677d36b98c0c075145bb8975105153" + , "hello":2 + } + }, +]} + +``` + +we are probably most interested in the `rows.*.doc` + +create a `Stream` that parses the documents from the feed like this: + +``` js +var stream = JSONStream.parse(['rows', true, 'doc']) //rows, ANYTHING, doc + +stream.on('data', function(data) { + console.log('received:', data); +}); +//emits anything from _before_ the first match +stream.on('header', function (data) { + console.log('header:', data) // => {"total_rows":129,"offset":0} +}) + +``` +awesome! + +In case you wanted the contents the doc emitted: + +``` js +var stream = JSONStream.parse(['rows', true, 'doc', {emitKey: true}]) //rows, ANYTHING, doc, items in docs with keys + +stream.on('data', function(data) { + console.log('key:', data.key); + console.log('value:', data.value); +}); + +``` + +You can also emit the path: + +``` js +var stream = JSONStream.parse(['rows', true, 'doc', {emitPath: true}]) //rows, ANYTHING, doc, items in docs with keys + +stream.on('data', function(data) { + console.log('path:', data.path); + console.log('value:', data.value); +}); + +``` + +### recursive patterns (..) + +`JSONStream.parse('docs..value')` +(or `JSONStream.parse(['docs', {recurse: true}, 'value'])` using an array) +will emit every `value` object that is a child, grand-child, etc. of the +`docs` object. In this example, it will match exactly 5 times at various depth +levels, emitting 0, 1, 2, 3 and 4 as results. + +```js +{ + "total": 5, + "docs": [ + { + "key": { + "value": 0, + "some": "property" + } + }, + {"value": 1}, + {"value": 2}, + {"blbl": [{}, {"a":0, "b":1, "value":3}, 10]}, + {"value": 4} + ] +} +``` + +## JSONStream.parse(pattern, map) + +provide a function that can be used to map or filter +the json output. `map` is passed the value at that node of the pattern, +if `map` return non-nullish (anything but `null` or `undefined`) +that value will be emitted in the stream. If it returns a nullish value, +nothing will be emitted. + +`JSONStream` also emits `'header'` and `'footer'` events, +the `'header'` event contains anything in the output that was before +the first match, and the `'footer'`, is anything after the last match. + +## JSONStream.stringify(open, sep, close) + +Create a writable stream. + +you may pass in custom `open`, `close`, and `seperator` strings. +But, by default, `JSONStream.stringify()` will create an array, +(with default options `open='[\n', sep='\n,\n', close='\n]\n'`) + +If you call `JSONStream.stringify(false)` +the elements will only be seperated by a newline. + +If you only write one item this will be valid JSON. + +If you write many items, +you can use a `RegExp` to split it into valid chunks. + +## JSONStream.stringifyObject(open, sep, close) + +Very much like `JSONStream.stringify`, +but creates a writable stream for objects instead of arrays. + +Accordingly, `open='{\n', sep='\n,\n', close='\n}\n'`. + +When you `.write()` to the stream you must supply an array with `[ key, data ]` +as the first argument. + +## unix tool + +query npm to see all the modules that browserify has ever depended on. + +``` bash +curl https://registry.npmjs.org/browserify | JSONStream 'versions.*.dependencies' +``` + +## numbers + +numbers will be emitted as numbers. +huge numbers that cannot be represented in memory as javascript numbers will be emitted as strings. +cf https://github.com/creationix/jsonparse/commit/044b268f01c4b8f97fb936fc85d3bcfba179e5bb for details. + +## Acknowlegements + +this module depends on https://github.com/creationix/jsonparse +by Tim Caswell +and also thanks to Florent Jaby for teaching me about parsing with: +https://github.com/Floby/node-json-streams + +## license + +Dual-licensed under the MIT License or the Apache License, version 2.0 + diff --git a/node_modules/JSONStream/test/bool.js b/node_modules/JSONStream/test/bool.js new file mode 100644 index 0000000..6c386d6 --- /dev/null +++ b/node_modules/JSONStream/test/bool.js @@ -0,0 +1,41 @@ + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is').style('colour') + + function randomObj () { + return ( + Math.random () < 0.4 + ? {hello: 'eonuhckmqjk', + whatever: 236515, + lies: true, + nothing: [null], +// stuff: [Math.random(),Math.random(),Math.random()] + } + : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] + ) + } + +var expected = [] + , stringify = JSONStream.stringify() + , es = require('event-stream') + , stringified = '' + , called = 0 + , count = 10 + , ended = false + +while (count --) + expected.push(randomObj()) + + es.connect( + es.readArray(expected), + stringify, + JSONStream.parse([true]), + es.writeArray(function (err, lines) { + + it(lines).has(expected) + console.error('PASSED') + }) + ) diff --git a/node_modules/JSONStream/test/browser.js b/node_modules/JSONStream/test/browser.js new file mode 100644 index 0000000..3c28d49 --- /dev/null +++ b/node_modules/JSONStream/test/browser.js @@ -0,0 +1,18 @@ +var test = require('tape') +var JSONStream = require('../') +var testData = '{"rows":[{"hello":"world"}, {"foo": "bar"}]}' + +test('basic parsing', function (t) { + t.plan(2) + var parsed = JSONStream.parse("rows.*") + var parsedKeys = {} + parsed.on('data', function(match) { + parsedKeys[Object.keys(match)[0]] = true + }) + parsed.on('end', function() { + t.equal(!!parsedKeys['hello'], true) + t.equal(!!parsedKeys['foo'], true) + }) + parsed.write(testData) + parsed.end() +}) \ No newline at end of file diff --git a/node_modules/JSONStream/test/destroy_missing.js b/node_modules/JSONStream/test/destroy_missing.js new file mode 100644 index 0000000..315fdc8 --- /dev/null +++ b/node_modules/JSONStream/test/destroy_missing.js @@ -0,0 +1,27 @@ +var fs = require ('fs'); +var net = require('net'); +var join = require('path').join; +var file = join(__dirname, 'fixtures','all_npm.json'); +var JSONStream = require('../'); + + +var server = net.createServer(function(client) { + var parser = JSONStream.parse([]); + parser.on('end', function() { + console.log('close') + console.error('PASSED'); + server.close(); + }); + client.pipe(parser); + var n = 4 + client.on('data', function () { + if(--n) return + client.end(); + }) +}); +server.listen(9999); + + +var client = net.connect({ port : 9999 }, function() { + fs.createReadStream(file).pipe(client).on('data', console.log) //.resume(); +}); diff --git a/node_modules/JSONStream/test/doubledot1.js b/node_modules/JSONStream/test/doubledot1.js new file mode 100644 index 0000000..78149b9 --- /dev/null +++ b/node_modules/JSONStream/test/doubledot1.js @@ -0,0 +1,29 @@ +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is') + +var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse('rows..rev') + , called = 0 + , ended = false + , parsed = [] + +fs.createReadStream(file).pipe(parser) + +parser.on('data', function (data) { + called ++ + parsed.push(data) +}) + +parser.on('end', function () { + ended = true +}) + +process.on('exit', function () { + it(called).equal(expected.rows.length) + for (var i = 0 ; i < expected.rows.length ; i++) + it(parsed[i]).deepEqual(expected.rows[i].value.rev) + console.error('PASSED') +}) diff --git a/node_modules/JSONStream/test/doubledot2.js b/node_modules/JSONStream/test/doubledot2.js new file mode 100644 index 0000000..b0bc5b1 --- /dev/null +++ b/node_modules/JSONStream/test/doubledot2.js @@ -0,0 +1,30 @@ + var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','depth.json') + , JSONStream = require('../') + , it = require('it-is') + + var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse(['docs', {recurse: true}, 'value']) + , called = 0 + , ended = false + , parsed = [] + + fs.createReadStream(file).pipe(parser) + + parser.on('data', function (data) { + called ++ + parsed.push(data) + }) + + parser.on('end', function () { + ended = true + }) + + process.on('exit', function () { + var expectedValues = [0, [1], {"a": 2}, "3", 4] + it(called).equal(expectedValues.length) + for (var i = 0 ; i < 5 ; i++) + it(parsed[i]).deepEqual(expectedValues[i]) + console.error('PASSED') + }) diff --git a/node_modules/JSONStream/test/empty.js b/node_modules/JSONStream/test/empty.js new file mode 100644 index 0000000..19e888c --- /dev/null +++ b/node_modules/JSONStream/test/empty.js @@ -0,0 +1,44 @@ +var JSONStream = require('../') + , stream = require('stream') + , it = require('it-is') + +var output = [ [], [] ] + +var parser1 = JSONStream.parse(['docs', /./]) +parser1.on('data', function(data) { + output[0].push(data) +}) + +var parser2 = JSONStream.parse(['docs', /./]) +parser2.on('data', function(data) { + output[1].push(data) +}) + +var pending = 2 +function onend () { + if (--pending > 0) return + it(output).deepEqual([ + [], [{hello: 'world'}] + ]) + console.error('PASSED') +} +parser1.on('end', onend) +parser2.on('end', onend) + +function makeReadableStream() { + var readStream = new stream.Stream() + readStream.readable = true + readStream.write = function (data) { this.emit('data', data) } + readStream.end = function (data) { this.emit('end') } + return readStream +} + +var emptyArray = makeReadableStream() +emptyArray.pipe(parser1) +emptyArray.write('{"docs":[]}') +emptyArray.end() + +var objectArray = makeReadableStream() +objectArray.pipe(parser2) +objectArray.write('{"docs":[{"hello":"world"}]}') +objectArray.end() diff --git a/node_modules/JSONStream/test/error_contents.js b/node_modules/JSONStream/test/error_contents.js new file mode 100644 index 0000000..13c27ae --- /dev/null +++ b/node_modules/JSONStream/test/error_contents.js @@ -0,0 +1,45 @@ + + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','error.json') + , JSONStream = require('../') + , it = require('it-is') + +var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse(['rows']) + , called = 0 + , headerCalled = 0 + , footerCalled = 0 + , ended = false + , parsed = [] + +fs.createReadStream(file).pipe(parser) + +parser.on('header', function (data) { + headerCalled ++ + it(data).deepEqual({ + error: 'error_code', + message: 'this is an error message' + }) +}) + +parser.on('footer', function (data) { + footerCalled ++ +}) + +parser.on('data', function (data) { + called ++ + parsed.push(data) +}) + +parser.on('end', function () { + ended = true +}) + +process.on('exit', function () { + it(called).equal(0) + it(headerCalled).equal(1) + it(footerCalled).equal(0) + console.error('PASSED') +}) diff --git a/node_modules/JSONStream/test/fixtures/all_npm.json b/node_modules/JSONStream/test/fixtures/all_npm.json new file mode 100644 index 0000000..2ada039 --- /dev/null +++ b/node_modules/JSONStream/test/fixtures/all_npm.json @@ -0,0 +1,4030 @@ +{"total_rows":4028,"offset":0,"rows":[ +{"id":"","key":"","value":{"rev":"1-2f11e026763c10730d8b19ba5dce7565"}}, +{"id":"3scale","key":"3scale","value":{"rev":"3-db3d574bf0ecdfdf627afeaa21b4bdaa"}}, +{"id":"7digital-api","key":"7digital-api","value":{"rev":"20-21d11832780e2368aabc946598a41dd5"}}, +{"id":"AMD","key":"AMD","value":{"rev":"7-3b4305a9c786ab4c5ce611e7f0de0aca"}}, +{"id":"AriesNode","key":"AriesNode","value":{"rev":"3-9d88392bca6582c5c54784927dbfdee6"}}, +{"id":"Array.prototype.forEachAsync","key":"Array.prototype.forEachAsync","value":{"rev":"3-85696441ba6bef77cc1e7de7b073110e"}}, +{"id":"Babel","key":"Babel","value":{"rev":"5-9d8370c6ac6fd9cd3d530f26a9379814"}}, +{"id":"Blaggie-System","key":"Blaggie-System","value":{"rev":"3-47782b1e5cbfa425170192799510e148"}}, +{"id":"Blob","key":"Blob","value":{"rev":"3-cf5fb5d69da4dd00bc4f2be8870ca698"}}, +{"id":"BlobBuilder","key":"BlobBuilder","value":{"rev":"3-eb977ff1713a915384fac994f9d8fa7c"}}, +{"id":"Buffer","key":"Buffer","value":{"rev":"3-549594b58e83d6d07bb219e73de558e5"}}, +{"id":"CLI-UI","key":"CLI-UI","value":{"rev":"5-5912625f27b4bdfb4d3eed16726c48a8"}}, +{"id":"CLoader","key":"CLoader","value":{"rev":"1-ad3c317ddf3497e73ab41cb1ddbc6ba8"}}, +{"id":"CM1","key":"CM1","value":{"rev":"15-a325a2dc28bc6967a1a14beed86f3b80"}}, +{"id":"CONFIGURATOR","key":"CONFIGURATOR","value":{"rev":"3-c76bf9282a75cc4d3fb349e831ccb8a5"}}, +{"id":"Cashew","key":"Cashew","value":{"rev":"7-6a74dc51dbecc47d2c15bfb7d056a20f"}}, +{"id":"Class","key":"Class","value":{"rev":"5-958c6365f76a60a8b3dafbbd9730ac7e"}}, +{"id":"ClassLoader","key":"ClassLoader","value":{"rev":"3-27fe8faa8a1d60d639f87af52826ed47"}}, +{"id":"ClearSilver","key":"ClearSilver","value":{"rev":"3-f3e54eb9ce64fc6a090186e61f15ed0b"}}, +{"id":"Couch-cleaner","key":"Couch-cleaner","value":{"rev":"3-fc77270917d967a4e2e8637cfa9f0fe0"}}, +{"id":"CouchCover","key":"CouchCover","value":{"rev":"15-3b2d87d314f57272a5c27c42bbb3eaf9"}}, +{"id":"DOM-js","key":"DOM-js","value":{"rev":"8-748cdc96566a7b65bbd0b12be2eeb386"}}, +{"id":"DOMBuilder","key":"DOMBuilder","value":{"rev":"19-41a518f2ce16fabc0241535ccd967300"}}, +{"id":"DateZ","key":"DateZ","value":{"rev":"15-69d8115a9bd521e614eaad3cf2611264"}}, +{"id":"Dateselect","key":"Dateselect","value":{"rev":"3-6511567a876d8fe15724bbc7f247214c"}}, +{"id":"Deferred","key":"Deferred","value":{"rev":"3-c61dfc4a0d1bd3e9f35c7182f161f1f2"}}, +{"id":"DeskSet","key":"DeskSet","value":{"rev":"5-359bf760718898ff3591eb366e336cf9"}}, +{"id":"Estro","key":"Estro","value":{"rev":"11-97192e2d0327469bb30f814963db6dff"}}, +{"id":"EventProxy.js","key":"EventProxy.js","value":{"rev":"5-106696b56c6959cec4bfd37f406ee60a"}}, +{"id":"EventServer","key":"EventServer","value":{"rev":"3-59d174119435e99e2affe0c4ba7caae0"}}, +{"id":"Expressive","key":"Expressive","value":{"rev":"3-7eae0ea010eb9014b28108e814918eac"}}, +{"id":"F","key":"F","value":{"rev":"12-91a3db69527b46cf43e36b7ec64a4336"}}, +{"id":"Faker","key":"Faker","value":{"rev":"9-77951c352cb6f9a0b824be620a8fa40d"}}, +{"id":"FastLegS","key":"FastLegS","value":{"rev":"27-4399791981235021a36c94bb9e9b52b5"}}, +{"id":"Fayer","key":"Fayer","value":{"rev":"7-7e4974ff2716329375f9711bcabef701"}}, +{"id":"File","key":"File","value":{"rev":"3-45e353a984038bc48248dfc32b18f9a8"}}, +{"id":"FileError","key":"FileError","value":{"rev":"3-bb4b03a2548e3c229e2c7e92242946c3"}}, +{"id":"FileList","key":"FileList","value":{"rev":"3-ec4a3fc91794ef7fdd3fe88b19cec7b0"}}, +{"id":"FileReader","key":"FileReader","value":{"rev":"7-e81b58a2d8a765ae4781b41bbfadb4cb"}}, +{"id":"FileSaver","key":"FileSaver","value":{"rev":"3-476dcb3f63f4d10feee08d41a8128cb8"}}, +{"id":"FileWriter","key":"FileWriter","value":{"rev":"3-f2fcdbc4938de480cce2e8e8416a93dd"}}, +{"id":"FileWriterSync","key":"FileWriterSync","value":{"rev":"3-9494c3fe7a1230238f37a724ec10895b"}}, +{"id":"FormData","key":"FormData","value":{"rev":"3-8872d717575f7090107a96d81583f6fe"}}, +{"id":"Frenchpress","key":"Frenchpress","value":{"rev":"3-6d916fc15b9e77535771578f96c47c52"}}, +{"id":"FreshDocs","key":"FreshDocs","value":{"rev":"5-f1f3e76c85267faf21d06d911cc6c203"}}, +{"id":"Google_Plus_API","key":"Google_Plus_API","value":{"rev":"3-3302bc9846726d996a45daee3dc5922c"}}, +{"id":"Gord","key":"Gord","value":{"rev":"11-32fddef1453773ac7270ba0e7c83f727"}}, +{"id":"Graph","key":"Graph","value":{"rev":"7-c346edea4f90e3e18d50a62473868cf4"}}, +{"id":"GridFS","key":"GridFS","value":{"rev":"27-4fc649aaa007fddec4947bdb7111560f"}}, +{"id":"Haraka","key":"Haraka","value":{"rev":"39-ee8f890521c1579b3cc779c8ebe03480"}}, +{"id":"Index","key":"Index","value":{"rev":"29-d8f4881c1544bf51dea1927e87ebb3f3"}}, +{"id":"JS-Entities","key":"JS-Entities","value":{"rev":"7-905636d8b46f273210233b60063d079b"}}, +{"id":"JSLint-commonJS","key":"JSLint-commonJS","value":{"rev":"3-759a81f82af7055e85ee89c9707c9609"}}, +{"id":"JSON","key":"JSON","value":{"rev":"3-7966a79067c34fb5de2e62c796f67341"}}, +{"id":"JSONPath","key":"JSONPath","value":{"rev":"7-58789d57ae366a5b0ae4b36837f15d59"}}, +{"id":"JSONSelect","key":"JSONSelect","value":{"rev":"9-5b0730da91eeb52e8f54da516367dc0f"}}, +{"id":"JSONloops","key":"JSONloops","value":{"rev":"3-3d4a1f8bfcfd778ab7def54155324331"}}, +{"id":"JSPP","key":"JSPP","value":{"rev":"7-af09a2bb193b3ff44775e8fbb7d4f522"}}, +{"id":"JSV","key":"JSV","value":{"rev":"3-41a7af86909046111be8ee9b56b077c8"}}, +{"id":"Jody","key":"Jody","value":{"rev":"43-70c1cf40e93cd8ce53249e5295d6b159"}}, +{"id":"Journaling-Hash","key":"Journaling-Hash","value":{"rev":"3-ac676eecb40a4dff301c671fa4bb6be9"}}, +{"id":"Kahana","key":"Kahana","value":{"rev":"33-1cb7e291ae02cee4e8105509571223f5"}}, +{"id":"LazyBoy","key":"LazyBoy","value":{"rev":"13-20a8894e3a957f184f5ae2a3e709551c"}}, +{"id":"Lingo","key":"Lingo","value":{"rev":"9-1af9a6df616e601f09c8cec07ccad1ae"}}, +{"id":"Loggy","key":"Loggy","value":{"rev":"33-e115c25163ab468314eedbe497d1c51e"}}, +{"id":"MeCab","key":"MeCab","value":{"rev":"4-2687176c7b878930e812a534976a6988"}}, +{"id":"Mercury","key":"Mercury","value":{"rev":"3-09a6bff1332ed829bd2c37bfec244a41"}}, +{"id":"Mu","key":"Mu","value":{"rev":"7-28e6ab82c402c3a75fe0f79dea846b97"}}, +{"id":"N","key":"N","value":{"rev":"7-e265046b5bdd299b2cad1584083ce2d5"}}, +{"id":"NORRIS","key":"NORRIS","value":{"rev":"3-4b5b23b09118582c44414f8d480619e6"}}, +{"id":"NetOS","key":"NetOS","value":{"rev":"3-3f943f87a24c11e6dd8c265469914e80"}}, +{"id":"NewBase60","key":"NewBase60","value":{"rev":"3-fd84758db79870e82917d358c6673f32"}}, +{"id":"NoCR","key":"NoCR","value":{"rev":"3-8f6cddd528f2d6045e3dda6006fb6948"}}, +{"id":"NodObjC","key":"NodObjC","value":{"rev":"15-ea6ab2df532c90fcefe5a428950bfdbb"}}, +{"id":"Node-JavaScript-Preprocessor","key":"Node-JavaScript-Preprocessor","value":{"rev":"13-4662b5ad742caaa467ec5d6c8e77b1e5"}}, +{"id":"NodeInterval","key":"NodeInterval","value":{"rev":"3-dc3446db2e0cd5be29a3c07942dba66d"}}, +{"id":"NodeSSH","key":"NodeSSH","value":{"rev":"3-45530fae5a69c44a6dd92357910f4212"}}, +{"id":"Nonsense","key":"Nonsense","value":{"rev":"3-9d86191475bc76dc3dd496d4dfe5d94e"}}, +{"id":"NormAndVal","key":"NormAndVal","value":{"rev":"9-d3b3d6ffd046292f4733aa5f3eb7be61"}}, +{"id":"Olive","key":"Olive","value":{"rev":"5-67f3057f09cae5104f09472db1d215aa"}}, +{"id":"OnCollect","key":"OnCollect","value":{"rev":"16-6dbe3afd04f123dda87bb1e21cdfd776"}}, +{"id":"PJsonCouch","key":"PJsonCouch","value":{"rev":"3-be9588f49d85094c36288eb63f8236b3"}}, +{"id":"PMInject","key":"PMInject","value":{"rev":"5-da518047d8273dbf3b3c05ea25e77836"}}, +{"id":"PanPG","key":"PanPG","value":{"rev":"13-beb54225a6b1be4c157434c28adca016"}}, +{"id":"PerfDriver","key":"PerfDriver","value":{"rev":"2-b448fb2f407f341b8df7032f29e4920f"}}, +{"id":"PostgresClient","key":"PostgresClient","value":{"rev":"8-2baec6847f8ad7dcf24b7d61a4034163"}}, +{"id":"QuickWeb","key":"QuickWeb","value":{"rev":"13-d388df9c484021ecd75bc9650d659a67"}}, +{"id":"R.js","key":"R.js","value":{"rev":"3-3f154b95ec6fc744f95a29750f16667e"}}, +{"id":"R2","key":"R2","value":{"rev":"11-f5ccff6f108f6b928caafb62b80d1056"}}, +{"id":"Reston","key":"Reston","value":{"rev":"5-9d234010f32f593edafc04620f3cf2bd"}}, +{"id":"Sardines","key":"Sardines","value":{"rev":"5-d7d3d2269420e21c2c62b86ff5a0021e"}}, +{"id":"SessionWebSocket","key":"SessionWebSocket","value":{"rev":"8-d9fc9beaf90057aefeb701addd7fc845"}}, +{"id":"Sheet","key":"Sheet","value":{"rev":"8-c827c713564e4ae5a17988ffea520d0d"}}, +{"id":"Spec_My_Node","key":"Spec_My_Node","value":{"rev":"8-fa58408e9d9736d9c6fa8daf5d632106"}}, +{"id":"Spot","key":"Spot","value":{"rev":"3-6b6c2131451fed28fb57c924c4fa44cc"}}, +{"id":"Sslac","key":"Sslac","value":{"rev":"3-70a2215cc7505729254aa6fa1d9a25d9"}}, +{"id":"StaticServer","key":"StaticServer","value":{"rev":"3-6f5433177ef4d76a52f01c093117a532"}}, +{"id":"StringScanner","key":"StringScanner","value":{"rev":"3-e85d0646c25ec477c1c45538712d3a38"}}, +{"id":"Structr","key":"Structr","value":{"rev":"3-449720001801cff5831c2cc0e0f1fcf8"}}, +{"id":"Templ8","key":"Templ8","value":{"rev":"11-4e6edb250bc250df20b2d557ca7f6589"}}, +{"id":"Template","key":"Template","value":{"rev":"6-1f055c73524d2b7e82eb6c225bd4b8e0"}}, +{"id":"Thimble","key":"Thimble","value":{"rev":"3-8499b261206f2f2e9acf92d8a4e54afb"}}, +{"id":"Toji","key":"Toji","value":{"rev":"96-511e171ad9f32a9264c2cdf01accacfb"}}, +{"id":"TwigJS","key":"TwigJS","value":{"rev":"3-1aaefc6d6895d7d4824174d410a747b9"}}, +{"id":"UkGeoTool","key":"UkGeoTool","value":{"rev":"5-e84291128e12f66cebb972a60c1d710f"}}, +{"id":"Vector","key":"Vector","value":{"rev":"3-bf5dc97abe7cf1057260b70638175a96"}}, +{"id":"_design/app","key":"_design/app","value":{"rev":"421-b1661d854599a58d0904d68aa44d8b63"}}, +{"id":"_design/ui","key":"_design/ui","value":{"rev":"78-db00aeb91a59a326e38e2bef7f1126cf"}}, +{"id":"aaronblohowiak-plugify-js","key":"aaronblohowiak-plugify-js","value":{"rev":"3-0272c269eacd0c86bfc1711566922577"}}, +{"id":"aaronblohowiak-uglify-js","key":"aaronblohowiak-uglify-js","value":{"rev":"3-77844a6def6ec428d75caa0846c95502"}}, +{"id":"aasm-js","key":"aasm-js","value":{"rev":"3-01a48108d55909575440d9e0ef114f37"}}, +{"id":"abbrev","key":"abbrev","value":{"rev":"16-e17a2b6c7360955b950edf2cb2ef1602"}}, +{"id":"abhispeak","key":"abhispeak","value":{"rev":"5-9889431f68ec10212db3be91796608e2"}}, +{"id":"ace","key":"ace","value":{"rev":"3-e8d267de6c17ebaa82c2869aff983c74"}}, +{"id":"acl","key":"acl","value":{"rev":"13-87c131a1801dc50840a177be73ce1c37"}}, +{"id":"active-client","key":"active-client","value":{"rev":"5-0ca16ae2e48a3ba9de2f6830a8c2d3a0"}}, +{"id":"activenode-monitor","key":"activenode-monitor","value":{"rev":"9-2634fa446379c39475d0ce4183fb92f2"}}, +{"id":"activeobject","key":"activeobject","value":{"rev":"43-6d73e28412612aaee37771e3ab292c3d"}}, +{"id":"actor","key":"actor","value":{"rev":"3-f6b84acd7d2e689b860e3142a18cd460"}}, +{"id":"actors","key":"actors","value":{"rev":"3-6df913bbe5b99968a2e71ae4ef07b2d2"}}, +{"id":"addTimeout","key":"addTimeout","value":{"rev":"15-e5170f0597fe8cf5ed0b54b7e6f2cde1"}}, +{"id":"addressable","key":"addressable","value":{"rev":"27-0c74fde458d92e4b93a29317da15bb3c"}}, +{"id":"aejs","key":"aejs","value":{"rev":"7-4928e2ce6151067cd6c585c0ba3e0bc3"}}, +{"id":"aenoa-supervisor","key":"aenoa-supervisor","value":{"rev":"7-6d399675981e76cfdfb9144bc2f7fb6d"}}, +{"id":"after","key":"after","value":{"rev":"9-baee7683ff54182cf7544cc05b0a4ad7"}}, +{"id":"ahr","key":"ahr","value":{"rev":"27-4ed272c516f3f2f9310e4f0ef28254e9"}}, +{"id":"ahr.browser","key":"ahr.browser","value":{"rev":"3-f7226aab4a1a3ab5f77379f92aae87f9"}}, +{"id":"ahr.browser.jsonp","key":"ahr.browser.jsonp","value":{"rev":"3-abed17143cf5e3c451c3d7da457e6f5b"}}, +{"id":"ahr.browser.request","key":"ahr.browser.request","value":{"rev":"7-fafd7b079d0415f388b64a20509a270b"}}, +{"id":"ahr.node","key":"ahr.node","value":{"rev":"17-f487a4a9896bd3876a11f9dfa1c639a7"}}, +{"id":"ahr.options","key":"ahr.options","value":{"rev":"13-904a4cea763a4455f7b2ae0abba18b8d"}}, +{"id":"ahr.utils","key":"ahr.utils","value":{"rev":"3-5f7b4104ea280d1fd36370c8f3356ead"}}, +{"id":"ahr2","key":"ahr2","value":{"rev":"87-ddf57f3ee158dcd23b2df330e2883a1d"}}, +{"id":"ain","key":"ain","value":{"rev":"7-d840736668fb36e9be3c26a68c5cd411"}}, +{"id":"ain-tcp","key":"ain-tcp","value":{"rev":"11-d18a1780bced8981d1d9dbd262ac4045"}}, +{"id":"ain2","key":"ain2","value":{"rev":"5-0b67879174f5f0a06448c7c737d98b5e"}}, +{"id":"airbrake","key":"airbrake","value":{"rev":"33-4bb9f822162e0c930c31b7f961938dc9"}}, +{"id":"ajaxrunner","key":"ajaxrunner","value":{"rev":"2-17e6a5de4f0339f4e6ce0b7681d0ba0c"}}, +{"id":"ajs","key":"ajs","value":{"rev":"13-063a29dec829fdaf4ca63d622137d1c6"}}, +{"id":"ajs-xgettext","key":"ajs-xgettext","value":{"rev":"3-cd4bbcc1c9d87fa7119d3bbbca99b793"}}, +{"id":"akismet","key":"akismet","value":{"rev":"13-a144e15dd6c2b13177572e80a526edd1"}}, +{"id":"alfred","key":"alfred","value":{"rev":"45-9a69041b18d2587c016b1b1deccdb2ce"}}, +{"id":"alfred-bcrypt","key":"alfred-bcrypt","value":{"rev":"11-7ed10ef318e5515d1ef7c040818ddb22"}}, +{"id":"algorithm","key":"algorithm","value":{"rev":"3-9ec0b38298cc15b0f295152de8763358"}}, +{"id":"algorithm-js","key":"algorithm-js","value":{"rev":"9-dd7496b7ec2e3b23cc7bb182ae3aac6d"}}, +{"id":"alists","key":"alists","value":{"rev":"5-22cc13c86d84081a826ac79a0ae5cda3"}}, +{"id":"altshift","key":"altshift","value":{"rev":"53-1c51d8657f271f390503a6fe988d09db"}}, +{"id":"amazon-ses","key":"amazon-ses","value":{"rev":"5-c175d60de2232a5664666a80832269e5"}}, +{"id":"ambrosia","key":"ambrosia","value":{"rev":"3-8c648ec7393cf842838c20e2c5d9bce4"}}, +{"id":"amd","key":"amd","value":{"rev":"3-d78c4df97a577af598a7def2a38379fa"}}, +{"id":"amionline","key":"amionline","value":{"rev":"3-a62887a632523700402b0f4ebb896812"}}, +{"id":"amo-version-reduce","key":"amo-version-reduce","value":{"rev":"3-05f6956269e5e921ca3486d3d6ea74b0"}}, +{"id":"amqp","key":"amqp","value":{"rev":"17-ee62d2b8248f8eb13f3369422d66df26"}}, +{"id":"amqpsnoop","key":"amqpsnoop","value":{"rev":"3-36a1c45647bcfb2f56cf68dbc24b0426"}}, +{"id":"ams","key":"ams","value":{"rev":"40-1c0cc53ad942d2fd23c89618263befc8"}}, +{"id":"amulet","key":"amulet","value":{"rev":"7-d1ed71811e45652799982e4f2e9ffb36"}}, +{"id":"anachronism","key":"anachronism","value":{"rev":"11-468bdb40f9a5aa146bae3c1c6253d0e1"}}, +{"id":"analytics","key":"analytics","value":{"rev":"3-a143ccdd863b5f7dbee4d2f7732390b3"}}, +{"id":"ann","key":"ann","value":{"rev":"9-41f00594d6216c439f05f7116a697cac"}}, +{"id":"ansi-color","key":"ansi-color","value":{"rev":"6-d6f02b32525c1909d5134afa20f470de"}}, +{"id":"ansi-font","key":"ansi-font","value":{"rev":"3-b039661ad9b6aa7baf34741b449c4420"}}, +{"id":"ant","key":"ant","value":{"rev":"3-35a64e0b7f6eb63a90c32971694b0d93"}}, +{"id":"anvil.js","key":"anvil.js","value":{"rev":"19-290c82075f0a9ad764cdf6dc5c558e0f"}}, +{"id":"aop","key":"aop","value":{"rev":"7-5963506c9e7912aa56fda065c56fd472"}}, +{"id":"ap","key":"ap","value":{"rev":"3-f525b5b490a1ada4452f46307bf92d08"}}, +{"id":"apac","key":"apac","value":{"rev":"12-945d0313a84797b4c3df19da4bec14d4"}}, +{"id":"aparser","key":"aparser","value":{"rev":"5-cb35cfc9184ace6642413dad97e49dca"}}, +{"id":"api-easy","key":"api-easy","value":{"rev":"15-2ab5eefef1377ff217cb020e80343d65"}}, +{"id":"api.js","key":"api.js","value":{"rev":"5-a14b8112fbda17022c80356a010de59a"}}, +{"id":"api_request","key":"api_request","value":{"rev":"3-8531e71f5cf2f3f811684269132d72d4"}}, +{"id":"apimaker","key":"apimaker","value":{"rev":"3-bdbd4a2ebf5b67276d89ea73eaa20025"}}, +{"id":"apn","key":"apn","value":{"rev":"30-0513d27341f587b39db54300c380921f"}}, +{"id":"app","key":"app","value":{"rev":"3-d349ddb47167f60c03d259649569e002"}}, +{"id":"app.js","key":"app.js","value":{"rev":"3-bff3646634daccfd964b4bbe510acb25"}}, +{"id":"append","key":"append","value":{"rev":"7-53e2f4ab2a69dc0c5e92f10a154998b6"}}, +{"id":"applescript","key":"applescript","value":{"rev":"10-ef5ab30ccd660dc71fb89e173f30994a"}}, +{"id":"appzone","key":"appzone","value":{"rev":"21-fb27e24d460677fe9c7eda0d9fb1fead"}}, +{"id":"apricot","key":"apricot","value":{"rev":"14-b55361574a0715f78afc76ddf6125845"}}, +{"id":"arcane","key":"arcane","value":{"rev":"3-f846c96e890ed6150d4271c93cc05a24"}}, +{"id":"archetype","key":"archetype","value":{"rev":"3-441336def3b7aade89c8c1c19a84f56d"}}, +{"id":"ardrone","key":"ardrone","value":{"rev":"8-540e95b796da734366a89bb06dc430c5"}}, +{"id":"ardrone-web","key":"ardrone-web","value":{"rev":"3-8a53cc85a95be20cd44921347e82bbe4"}}, +{"id":"arduino","key":"arduino","value":{"rev":"3-22f6359c47412d086d50dc7f1a994139"}}, +{"id":"argon","key":"argon","value":{"rev":"3-ba12426ce67fac01273310cb3909b855"}}, +{"id":"argparse","key":"argparse","value":{"rev":"8-5e841e38cca6cfc3fe1d1f507a7f47ee"}}, +{"id":"argparser","key":"argparser","value":{"rev":"19-b8793bfc005dd84e1213ee53ae56206d"}}, +{"id":"argsparser","key":"argsparser","value":{"rev":"26-d31eca2f41546172763af629fc50631f"}}, +{"id":"argtype","key":"argtype","value":{"rev":"10-96a7d23e571d56cf598472115bcac571"}}, +{"id":"arguments","key":"arguments","value":{"rev":"7-767de2797f41702690bef5928ec7c6e9"}}, +{"id":"armory","key":"armory","value":{"rev":"41-ea0f7bd0868c11fc9986fa708e11e071"}}, +{"id":"armrest","key":"armrest","value":{"rev":"3-bbe40b6320b6328211be33425bed20c8"}}, +{"id":"arnold","key":"arnold","value":{"rev":"3-4896fc8d02b8623f47a024f0dbfa44bf"}}, +{"id":"arouter","key":"arouter","value":{"rev":"7-55cab1f7128df54f27be94039a8d8dc5"}}, +{"id":"array-promise","key":"array-promise","value":{"rev":"3-e2184561ee65de64c2dfeb57955c758f"}}, +{"id":"arrayemitter","key":"arrayemitter","value":{"rev":"3-d64c917ac1095bfcbf173dac88d3d148"}}, +{"id":"asEvented","key":"asEvented","value":{"rev":"3-2ad3693b49d4d9dc9a11c669033a356e"}}, +{"id":"asciimo","key":"asciimo","value":{"rev":"12-50130f5ac2ef4d95df190be2c8ede893"}}, +{"id":"asereje","key":"asereje","value":{"rev":"15-84853499f89a87109ddf47ba692323ba"}}, +{"id":"ash","key":"ash","value":{"rev":"6-3697a3aee708bece8a08c7e0d1010476"}}, +{"id":"ask","key":"ask","value":{"rev":"3-321bbc3837d749b5d97bff251693a825"}}, +{"id":"asn1","key":"asn1","value":{"rev":"13-e681a814a4a1439a22b19e141b45006f"}}, +{"id":"aspsms","key":"aspsms","value":{"rev":"9-7b82d722bdac29a4da8c88b642ad64f2"}}, +{"id":"assert","key":"assert","value":{"rev":"3-85480762f5cb0be2cb85f80918257189"}}, +{"id":"assertions","key":"assertions","value":{"rev":"9-d797d4c09aa994556c7d5fdb4e86fe1b"}}, +{"id":"assertn","key":"assertn","value":{"rev":"6-080a4fb5d2700a6850d56b58c6f6ee9e"}}, +{"id":"assertvanish","key":"assertvanish","value":{"rev":"13-3b0b555ff77c1bfc2fe2642d50879648"}}, +{"id":"asset","key":"asset","value":{"rev":"33-cb70b68e0e05e9c9a18b3d89f1bb43fc"}}, +{"id":"assetgraph","key":"assetgraph","value":{"rev":"82-7853d644e64741b46fdd29a997ec4852"}}, +{"id":"assetgraph-builder","key":"assetgraph-builder","value":{"rev":"61-1ed98d95f3589050037851edde760a01"}}, +{"id":"assetgraph-sprite","key":"assetgraph-sprite","value":{"rev":"15-351b5fd9e50a3dda8580d014383423e0"}}, +{"id":"assets-expander","key":"assets-expander","value":{"rev":"11-f9e1197b773d0031dd015f1d871b87c6"}}, +{"id":"assets-packager","key":"assets-packager","value":{"rev":"13-51f7d2d57ed35be6aff2cc2aa2fa74db"}}, +{"id":"assoc","key":"assoc","value":{"rev":"9-07098388f501da16bf6afe6c9babefd5"}}, +{"id":"ast-inlining","key":"ast-inlining","value":{"rev":"5-02e7e2c3a06ed81ddc61980f778ac413"}}, +{"id":"ast-transformer","key":"ast-transformer","value":{"rev":"5-b4020bb763b8839afa8d3ac0d54a6f26"}}, +{"id":"astar","key":"astar","value":{"rev":"3-3df8c56c64c3863ef0650c0c74e2801b"}}, +{"id":"aster","key":"aster","value":{"rev":"7-b187c1270d3924f5ee04044e579d2df9"}}, +{"id":"asterisk-manager","key":"asterisk-manager","value":{"rev":"3-7fbf4294dafee04cc17cca4692c09c33"}}, +{"id":"astrolin","key":"astrolin","value":{"rev":"3-30ac515a2388e7dc22b25c15346f6d7e"}}, +{"id":"asyn","key":"asyn","value":{"rev":"3-51996b0197c21e85858559045c1481b7"}}, +{"id":"async","key":"async","value":{"rev":"26-73aea795f46345a7e65d89ec75dff2f1"}}, +{"id":"async-array","key":"async-array","value":{"rev":"17-3ef5faff03333aa5b2a733ef36118066"}}, +{"id":"async-chain","key":"async-chain","value":{"rev":"9-10ec3e50b01567390d55973494e36d43"}}, +{"id":"async-ejs","key":"async-ejs","value":{"rev":"19-6f0e6e0eeb3cdb4c816ea427d8288d7d"}}, +{"id":"async-fs","key":"async-fs","value":{"rev":"3-b96906283d345604f784dfcdbeb21a63"}}, +{"id":"async-it","key":"async-it","value":{"rev":"7-6aed4439df25989cfa040fa4b5dd4ff2"}}, +{"id":"async-json","key":"async-json","value":{"rev":"5-589d5b6665d00c5bffb99bb142cac5d0"}}, +{"id":"async-memoizer","key":"async-memoizer","value":{"rev":"9-01d56f4dff95e61a39dab5ebee49d5dc"}}, +{"id":"async-object","key":"async-object","value":{"rev":"21-1bf28b0f8a7d875b54126437f3539f9b"}}, +{"id":"asyncEJS","key":"asyncEJS","value":{"rev":"3-28b1c94255381f23a4d4f52366255937"}}, +{"id":"async_testing","key":"async_testing","value":{"rev":"14-0275d8b608d8644dfe8d68a81fa07e98"}}, +{"id":"asyncevents","key":"asyncevents","value":{"rev":"3-de104847994365dcab5042db2b46fb84"}}, +{"id":"asyncify","key":"asyncify","value":{"rev":"3-3f6deb82ee1c6cb25e83a48fe6379b75"}}, +{"id":"asyncjs","key":"asyncjs","value":{"rev":"27-15903d7351f80ed37cb069aedbfc26cc"}}, +{"id":"asynct","key":"asynct","value":{"rev":"5-6be002b3e005d2d53b80fff32ccbd2ac"}}, +{"id":"at_scheduler","key":"at_scheduler","value":{"rev":"3-5587061c90218d2e99b6e22d5b488b0b"}}, +{"id":"atbar","key":"atbar","value":{"rev":"19-e9e906d4874afd4d8bf2d8349ed46dff"}}, +{"id":"atob","key":"atob","value":{"rev":"3-bc907d10dd2cfc940de586dc090451da"}}, +{"id":"audiolib","key":"audiolib","value":{"rev":"17-cb2f55ff50061081b440f0605cf0450c"}}, +{"id":"audit_couchdb","key":"audit_couchdb","value":{"rev":"24-6e620895b454b345b2aed13db847c237"}}, +{"id":"auditor","key":"auditor","value":{"rev":"11-c4df509d40650c015943dd90315a12c0"}}, +{"id":"authnet_cim","key":"authnet_cim","value":{"rev":"7-f02bbd206ac2b8c05255bcd8171ac1eb"}}, +{"id":"autocomplete","key":"autocomplete","value":{"rev":"3-f2773bca040d5abcd0536dbebe5847bf"}}, +{"id":"autodafe","key":"autodafe","value":{"rev":"7-a75262b53a9dd1a25693adecde7206d7"}}, +{"id":"autolint","key":"autolint","value":{"rev":"7-07f885902d72b52678fcc57aa4b9c592"}}, +{"id":"autoload","key":"autoload","value":{"rev":"5-9247704d9a992a175e3ae49f4af757d0"}}, +{"id":"autoloader","key":"autoloader","value":{"rev":"11-293c20c34d0c81fac5c06b699576b1fe"}}, +{"id":"auton","key":"auton","value":{"rev":"25-4fcb7a62b607b7929b62a9b792afef55"}}, +{"id":"autoreleasepool","key":"autoreleasepool","value":{"rev":"5-5d2798bf74bbec583cc6f19127e3c89e"}}, +{"id":"autorequire","key":"autorequire","value":{"rev":"9-564a46b355532fcec24db0afc99daed5"}}, +{"id":"autotest","key":"autotest","value":{"rev":"7-e319995dd0e1fbd935c14c46b1234f77"}}, +{"id":"awesome","key":"awesome","value":{"rev":"15-4458b746e4722214bd26ea15e453288e"}}, +{"id":"aws","key":"aws","value":{"rev":"14-9a8f0989be29034d3fa5c66c594b649b"}}, +{"id":"aws-js","key":"aws-js","value":{"rev":"6-c61d87b8ad948cd065d2ca222808c209"}}, +{"id":"aws-lib","key":"aws-lib","value":{"rev":"36-9733e215c03d185a860574600a8feb14"}}, +{"id":"aws2js","key":"aws2js","value":{"rev":"35-42498f44a5ae7d4f3c84096b435d0e0b"}}, +{"id":"azure","key":"azure","value":{"rev":"5-2c4e05bd842d3dcfa419f4d2b67121e2"}}, +{"id":"b64","key":"b64","value":{"rev":"3-e5e727a46df4c8aad38acd117d717140"}}, +{"id":"b64url","key":"b64url","value":{"rev":"9-ab3b017f00a53b0078261254704c30ba"}}, +{"id":"ba","key":"ba","value":{"rev":"11-3cec7ec9a566fe95fbeb34271538d60a"}}, +{"id":"babelweb","key":"babelweb","value":{"rev":"11-8e6a2fe00822cec15573cdda48b6d0a0"}}, +{"id":"backbone","key":"backbone","value":{"rev":"37-79b95355f8af59bf9131e14d52b68edc"}}, +{"id":"backbone-browserify","key":"backbone-browserify","value":{"rev":"3-f25dac0b05a7f7aa5dbc0f4a1ad97969"}}, +{"id":"backbone-celtra","key":"backbone-celtra","value":{"rev":"3-775a5ebb25c1cd84723add52774ece84"}}, +{"id":"backbone-couch","key":"backbone-couch","value":{"rev":"8-548327b3cd7ee7a4144c9070377be5f6"}}, +{"id":"backbone-cradle","key":"backbone-cradle","value":{"rev":"3-b9bc220ec48b05eed1d4d77a746b10db"}}, +{"id":"backbone-dirty","key":"backbone-dirty","value":{"rev":"21-fa0f688cc95a85c0fc440733f09243b5"}}, +{"id":"backbone-dnode","key":"backbone-dnode","value":{"rev":"65-3212d3aa3284efb3bc0732bac71b5a2e"}}, +{"id":"backbone-proxy","key":"backbone-proxy","value":{"rev":"3-3602cb984bdd266516a3145663f9a5c6"}}, +{"id":"backbone-redis","key":"backbone-redis","value":{"rev":"9-2e3f6a9e095b00ccec9aa19b3fbc65eb"}}, +{"id":"backbone-rel","key":"backbone-rel","value":{"rev":"5-f9773dc85f1c502e61c163a22d2f74aa"}}, +{"id":"backbone-simpledb","key":"backbone-simpledb","value":{"rev":"5-a815128e1e3593696f666f8b3da36d78"}}, +{"id":"backbone-stash","key":"backbone-stash","value":{"rev":"19-8d3cc5f9ed28f9a56856154e2b4e7f78"}}, +{"id":"backplane","key":"backplane","value":{"rev":"7-f69188dac21e007b09efe1b5b3575087"}}, +{"id":"backport-0.4","key":"backport-0.4","value":{"rev":"11-25e15f01f1ef9e626433a82284bc00d6"}}, +{"id":"backuptweets","key":"backuptweets","value":{"rev":"3-68712682aada41082d3ae36c03c8f899"}}, +{"id":"bake","key":"bake","value":{"rev":"113-ce13508ba2b4f15aa4df06d796aa4573"}}, +{"id":"bal-util","key":"bal-util","value":{"rev":"31-b818725a5af131c89ec66b9fdebf2122"}}, +{"id":"balancer","key":"balancer","value":{"rev":"7-63dcb4327081a8ec4d6c51a21253cb4b"}}, +{"id":"bancroft","key":"bancroft","value":{"rev":"11-8fa3370a4615a0ed4ba411b05c0285f4"}}, +{"id":"bandcamp","key":"bandcamp","value":{"rev":"41-f2fee472d63257fdba9e5fa8ad570ee8"}}, +{"id":"banner","key":"banner","value":{"rev":"19-89a447e2136b2fabddbad84abcd63a27"}}, +{"id":"banzai-docstore-couchdb","key":"banzai-docstore-couchdb","value":{"rev":"5-950c115737d634e2f48ee1c772788321"}}, +{"id":"banzai-redis","key":"banzai-redis","value":{"rev":"3-446f29e0819fd79c810fdfa8ce05bdcf"}}, +{"id":"banzai-statestore-couchdb","key":"banzai-statestore-couchdb","value":{"rev":"5-c965442821741ce6f20e266fe43aea4a"}}, +{"id":"banzai-statestore-mem","key":"banzai-statestore-mem","value":{"rev":"3-a0891a1a2344922d91781c332ed26528"}}, +{"id":"bar","key":"bar","value":{"rev":"7-fbb44a76cb023e6a8941f15576cf190b"}}, +{"id":"barc","key":"barc","value":{"rev":"7-dfe352b410782543d6b1aea292f123eb"}}, +{"id":"barista","key":"barista","value":{"rev":"9-d3f3c776453ba69a81947f34d7cc3cbf"}}, +{"id":"bark","key":"bark","value":{"rev":"20-fc1a94f80cfa199c16aa075e940e06dc"}}, +{"id":"barricane-db","key":"barricane-db","value":{"rev":"3-450947b9a05047fe195f76a69a3144e8"}}, +{"id":"base-converter","key":"base-converter","value":{"rev":"7-1b49b01df111176b89343ad56ac68d5c"}}, +{"id":"base32","key":"base32","value":{"rev":"11-d686c54c9de557681356e74b83d916e8"}}, +{"id":"base64","key":"base64","value":{"rev":"24-bd713c3d7e96fad180263ed7563c595e"}}, +{"id":"bash","key":"bash","value":{"rev":"3-86a1c61babfa47da0ebc14c2f4e59a6a"}}, +{"id":"basic-auth","key":"basic-auth","value":{"rev":"3-472a87af27264ae81bd4394d70792e55"}}, +{"id":"basicFFmpeg","key":"basicFFmpeg","value":{"rev":"15-3e87a41c543bde1e6f7c49d021fda62f"}}, +{"id":"basicauth","key":"basicauth","value":{"rev":"3-15d95a05b6f5e7b6d7261f87c4eb73de"}}, +{"id":"basil-cookie","key":"basil-cookie","value":{"rev":"11-fff96b263f31b9d017e3cf59bf6fb23f"}}, +{"id":"batik","key":"batik","value":{"rev":"7-a19ce28cbbf54649fa225ed5474eff02"}}, +{"id":"batman","key":"batman","value":{"rev":"15-6af5469bf143790cbb4af196824c9e95"}}, +{"id":"batteries","key":"batteries","value":{"rev":"13-656c68fe887f4af3ef1e720e64275f4e"}}, +{"id":"bbcode","key":"bbcode","value":{"rev":"5-e79a8b62125f8a3a1751bf7bd8875f33"}}, +{"id":"bcrypt","key":"bcrypt","value":{"rev":"31-db8496d1239362a97a26f1e5eeb8a733"}}, +{"id":"beaconpush","key":"beaconpush","value":{"rev":"3-956fcd87a6d3f9d5b9775d47e36aa3e5"}}, +{"id":"bean","key":"bean","value":{"rev":"56-151c1558e15016205e65bd515eab9ee0"}}, +{"id":"bean.database.mongo","key":"bean.database.mongo","value":{"rev":"3-ede73166710137cbf570385b7e8f17fe"}}, +{"id":"beandocs","key":"beandocs","value":{"rev":"3-9f7492984c95b69ca1ad30d40223f117"}}, +{"id":"beanpole","key":"beanpole","value":{"rev":"53-565a78a2304405cdc9f4a6b6101160fa"}}, +{"id":"beanprep","key":"beanprep","value":{"rev":"3-bd387f0072514b8e44131671f9aad1b0"}}, +{"id":"beans","key":"beans","value":{"rev":"54-7f6d40a2a5bf228fe3547cce43edaa63"}}, +{"id":"beanstalk_client","key":"beanstalk_client","value":{"rev":"6-13c8c80aa6469b5dcf20d65909289383"}}, +{"id":"beanstalk_worker","key":"beanstalk_worker","value":{"rev":"6-45500991db97ed5a18ea96f3621bf99f"}}, +{"id":"beantest","key":"beantest","value":{"rev":"7-52d8160a0c0420c7d659b2ee10f26644"}}, +{"id":"beatit","key":"beatit","value":{"rev":"7-c0ba5f95b0601dcb628e4820555cc252"}}, +{"id":"beatport","key":"beatport","value":{"rev":"5-3b186b633ceea7f047e1df91e7b683a5"}}, +{"id":"beautifyjs","key":"beautifyjs","value":{"rev":"3-89ce050152aca0727c099060229ddc73"}}, +{"id":"beaver","key":"beaver","value":{"rev":"17-3b56116e8e40205e8efcedefee0319e3"}}, +{"id":"beeline","key":"beeline","value":{"rev":"11-92a4bd9524cc7aec3106efcacff6faed"}}, +{"id":"beet","key":"beet","value":{"rev":"95-3c9d9de63c363319b2201ac83bc0ee7d"}}, +{"id":"begin","key":"begin","value":{"rev":"3-b32a5eb1b9475353b37f90813ed89dce"}}, +{"id":"begin.js","key":"begin.js","value":{"rev":"7-9156869392a448595bf3e5723fcb7b57"}}, +{"id":"bejesus-api","key":"bejesus-api","value":{"rev":"11-6b42f8ffc370c494d01481b64536e91e"}}, +{"id":"bejesus-cli","key":"bejesus-cli","value":{"rev":"31-5fbbfe5ec1f6a0a7a3fafdf69230434a"}}, +{"id":"bem","key":"bem","value":{"rev":"22-c0e0f8d9e92b355246fd15058199b73c"}}, +{"id":"ben","key":"ben","value":{"rev":"3-debe52552a86f1e71895dd5d32add585"}}, +{"id":"bench","key":"bench","value":{"rev":"14-20987e1becf3acd1bd1833b04712c87c"}}, +{"id":"bencher","key":"bencher","value":{"rev":"3-08866a8fdcf180582b43690bbbf21087"}}, +{"id":"benchmark","key":"benchmark","value":{"rev":"219-0669bc24f3f2918d93369bb0d801abf3"}}, +{"id":"bencode","key":"bencode","value":{"rev":"8-7b9eff4c1658fb3a054ebc6f50e6edcd"}}, +{"id":"beseda","key":"beseda","value":{"rev":"49-5cc8c4e9bb3e836de7db58c3adf9a5bb"}}, +{"id":"bf","key":"bf","value":{"rev":"14-d81312e1bf4f7202b801b4343199aa55"}}, +{"id":"biggie-router","key":"biggie-router","value":{"rev":"42-56a546a78d5abd4402183b3d300d563e"}}, +{"id":"bigint","key":"bigint","value":{"rev":"58-02f368567849596219d6a0e87d9bc6b9"}}, +{"id":"bignumber","key":"bignumber","value":{"rev":"3-6e372428992a767e0a991ec3f39b8343"}}, +{"id":"binary","key":"binary","value":{"rev":"47-947aa2f5238a68e34b164ef7e50ece28"}}, +{"id":"binarySearch","key":"binarySearch","value":{"rev":"15-93a3d2f9c2690457023b5ae5f3d00446"}}, +{"id":"bind","key":"bind","value":{"rev":"9-b74d0af83e90a2655e564ab64bf1d27d"}}, +{"id":"binpack","key":"binpack","value":{"rev":"7-3dc67a64e0ef01f3aa59441c5150e04f"}}, +{"id":"bintrees","key":"bintrees","value":{"rev":"12-507fcd92f447f81842cba08cacb425cf"}}, +{"id":"bisection","key":"bisection","value":{"rev":"5-f785ea3bbd8fcc7cd9381d20417b87bb"}}, +{"id":"bison","key":"bison","value":{"rev":"12-e663b2ef96650b3b5a0cc36524e1b94a"}}, +{"id":"bitcoder","key":"bitcoder","value":{"rev":"8-19c957d6b845f4d7ad531951c971e03d"}}, +{"id":"bitcoin","key":"bitcoin","value":{"rev":"13-af88a28c02ab146622743c4c1c32e87b"}}, +{"id":"bitcoin-impl","key":"bitcoin-impl","value":{"rev":"8-99068f1d259e3c75209a6bd08e3e06a2"}}, +{"id":"bitcoin-p2p","key":"bitcoin-p2p","value":{"rev":"25-6df0283eb6e419bc3a1571f17721b100"}}, +{"id":"bitcoinjs-mongoose","key":"bitcoinjs-mongoose","value":{"rev":"3-57e239b31e218693f8cf3cf1cf098437"}}, +{"id":"bitly","key":"bitly","value":{"rev":"8-d6bfac8338e223fe62538954d2e9246a"}}, +{"id":"bitly.node","key":"bitly.node","value":{"rev":"3-15329b7a77633e0dae2c720e592420fb"}}, +{"id":"biwascheme","key":"biwascheme","value":{"rev":"3-37a85eed1bd2d4ee85ef1e100e7ebe8f"}}, +{"id":"black","key":"black","value":{"rev":"3-e07ae2273357da5894f4b7cdf1b20560"}}, +{"id":"black_coffee","key":"black_coffee","value":{"rev":"3-c5c764cf550ad3c831a085509f64cdfb"}}, +{"id":"bleach","key":"bleach","value":{"rev":"5-ef3ab7e761a6903eb70da1550a07e53d"}}, +{"id":"blend","key":"blend","value":{"rev":"16-c5dd075b3ede45f91056b4b768b2bfe8"}}, +{"id":"bless","key":"bless","value":{"rev":"29-1b9bc6f17acd144f51a297e4bdccfe0e"}}, +{"id":"blitz","key":"blitz","value":{"rev":"5-8bf6786f6fd7dbc0570ba21f803f35e6"}}, +{"id":"blo","key":"blo","value":{"rev":"5-9e752ea37438ea026e88a7aa7e7a91ba"}}, +{"id":"blog","key":"blog","value":{"rev":"13-80fc7b11d73e23ca7e518d271d1836ee"}}, +{"id":"blogmate","key":"blogmate","value":{"rev":"11-e503081be9290647c841aa8c04eb6e70"}}, +{"id":"bloodmoney","key":"bloodmoney","value":{"rev":"3-859b0235de3a29bf241323a31f9aa730"}}, +{"id":"bloom","key":"bloom","value":{"rev":"15-c609882b29d61a771d7dbf17f43016ad"}}, +{"id":"blue","key":"blue","value":{"rev":"6-e84221f7286dffbfda6f8abc6306064c"}}, +{"id":"bluemold","key":"bluemold","value":{"rev":"11-f48528b642b5d38d7c02b03622117fa7"}}, +{"id":"bn-lang","key":"bn-lang","value":{"rev":"3-266f186334f69448a940081589e82b04"}}, +{"id":"bn-lang-util","key":"bn-lang-util","value":{"rev":"3-0bc44f1d7d3746120dd835bfb685e229"}}, +{"id":"bn-log","key":"bn-log","value":{"rev":"5-db81a8a978071efd24b45e350e8b8954"}}, +{"id":"bn-template","key":"bn-template","value":{"rev":"3-604e77465ab1dc7e17f3b325089651ec"}}, +{"id":"bn-time","key":"bn-time","value":{"rev":"3-9c33587e783a98e1ccea409cacd5bbfb"}}, +{"id":"bn-unit","key":"bn-unit","value":{"rev":"3-5f35e3fd446241f682231bedcf846c0a"}}, +{"id":"bncode","key":"bncode","value":{"rev":"7-915a1759135a9837954c0ead58bf8e5a"}}, +{"id":"bnf","key":"bnf","value":{"rev":"5-4fe80fcafcc7a263f28b8dc62093bd8d"}}, +{"id":"bob","key":"bob","value":{"rev":"9-9ceeb581263c04793a2231b3726ab22b"}}, +{"id":"bogart","key":"bogart","value":{"rev":"30-70aed6f0827d2bd09963afddcad7a34a"}}, +{"id":"boil","key":"boil","value":{"rev":"3-7ab0fc3b831c591fd15711c27a6f5de0"}}, +{"id":"bolt","key":"bolt","value":{"rev":"3-138dfbdea2ab53ca714ca51494d32610"}}, +{"id":"bones","key":"bones","value":{"rev":"70-c74f0845c167cd755250fc7b4b9b40c2"}}, +{"id":"bones-admin","key":"bones-admin","value":{"rev":"11-2cdfe738d66aacff8569712a279c041d"}}, +{"id":"bones-auth","key":"bones-auth","value":{"rev":"35-2224f95bf3521809ce805ff215d2856c"}}, +{"id":"bones-document","key":"bones-document","value":{"rev":"13-95971fed1f47005c282e0fa60498e31c"}}, +{"id":"bonsai","key":"bonsai","value":{"rev":"3-67eb8935492d4ae9182a7ec74c1f36a6"}}, +{"id":"bonzo","key":"bonzo","value":{"rev":"142-7c5680b0f841c2263f06e96eb5237825"}}, +{"id":"bookbu","key":"bookbu","value":{"rev":"3-d9a104bccc67eae8a5dc6f0f4c3ba5fc"}}, +{"id":"bootstrap","key":"bootstrap","value":{"rev":"17-7a62dbe5e3323beb47165f13265f1a96"}}, +{"id":"borschik","key":"borschik","value":{"rev":"7-2570b5d6555a031394a55ff054797cb9"}}, +{"id":"bots","key":"bots","value":{"rev":"9-df43539c13d2996d9e32dff848615e8a"}}, +{"id":"bounce","key":"bounce","value":{"rev":"8-a3e424b2be1379743e9628c726facaa8"}}, +{"id":"bowser","key":"bowser","value":{"rev":"11-23ecc98edf5fde63fda626bb03da597f"}}, +{"id":"box2d","key":"box2d","value":{"rev":"6-5c920e9829764cbf904b9a59474c1672"}}, +{"id":"box2dnode","key":"box2dnode","value":{"rev":"3-12ffe24dcc1478ea0008c60c4ef7118f"}}, +{"id":"boxcar","key":"boxcar","value":{"rev":"5-a9ba953c547585285559d0e05c16e29e"}}, +{"id":"boxer","key":"boxer","value":{"rev":"8-60c49ff8574d5a47616796ad991463ad"}}, +{"id":"bracket-matcher","key":"bracket-matcher","value":{"rev":"27-a01c946c69665629e212a0f702be1b38"}}, +{"id":"brain","key":"brain","value":{"rev":"24-3aba33914e0f823505c69ef01361681b"}}, +{"id":"brainfuck","key":"brainfuck","value":{"rev":"7-adf33477ffe8640c9fdd6a0f8b349953"}}, +{"id":"brains","key":"brains","value":{"rev":"3-d7e7a95ea742f9b42fefb594c67c726a"}}, +{"id":"braintree","key":"braintree","value":{"rev":"14-eabe1c3e4e7cfd1f521f4bfd337611f7"}}, +{"id":"brazilnut","key":"brazilnut","value":{"rev":"3-4163b5a5598a8905c1283db9d260e5cc"}}, +{"id":"brazln","key":"brazln","value":{"rev":"29-15895bb5b193552826c196efe084caf2"}}, +{"id":"bread","key":"bread","value":{"rev":"9-093c9dd71fffb9a5b1c9eb8ac3e2a9b0"}}, +{"id":"breakfast","key":"breakfast","value":{"rev":"3-231e3046ede5e35e272dfab4a379015d"}}, +{"id":"brequire","key":"brequire","value":{"rev":"18-58b386e08541b222238aa12a13119fd9"}}, +{"id":"bricks","key":"bricks","value":{"rev":"15-f72e6c858c5bceb00cc34a16d52a7b59"}}, +{"id":"bricks-analytics","key":"bricks-analytics","value":{"rev":"3-dc2b6d2157c5039a4c36ceda46761b37"}}, +{"id":"bricks-compress","key":"bricks-compress","value":{"rev":"5-580eeecaa30c210502f42c5e184344a3"}}, +{"id":"bricks-rewrite","key":"bricks-rewrite","value":{"rev":"5-7a141aacaa3fd706b97847c6e8f9830a"}}, +{"id":"brokenbin","key":"brokenbin","value":{"rev":"5-bbc7a1c9628ed9f49b6d23e80c242852"}}, +{"id":"broker","key":"broker","value":{"rev":"9-756a097b948756e4bd7609b6f83a0847"}}, +{"id":"browscap","key":"browscap","value":{"rev":"12-c6fed16796d1ad84913f2617c66f0c7b"}}, +{"id":"browser-require","key":"browser-require","value":{"rev":"27-99f61fb3036ebc643282625649cc674f"}}, +{"id":"browserify","key":"browserify","value":{"rev":"163-c307ee153caf2160e5c32abd58898139"}}, +{"id":"browserjet","key":"browserjet","value":{"rev":"3-a386ab8911c410362eb8fceab5a998fe"}}, +{"id":"brt","key":"brt","value":{"rev":"3-b8452659a92039571ff1f877c8f874c7"}}, +{"id":"brunch","key":"brunch","value":{"rev":"113-64ae44857425c5d860d36f38ab3cf797"}}, +{"id":"brushes.js","key":"brushes.js","value":{"rev":"3-e28bd6597b949d84965a788928738f53"}}, +{"id":"bson","key":"bson","value":{"rev":"50-9d9db515dd9d2a4d873d186f324767a5"}}, +{"id":"btc-ex-api","key":"btc-ex-api","value":{"rev":"3-cabbf284cb01af79ee183d8023106762"}}, +{"id":"btoa","key":"btoa","value":{"rev":"3-b4a124b3650a746b8da9c9f93f386bac"}}, +{"id":"btoa-atob","key":"btoa-atob","value":{"rev":"3-baac60a3f04487333cc0364301220a53"}}, +{"id":"bucket","key":"bucket","value":{"rev":"3-5c2da8f67e29de1c29adbf51ad7d7299"}}, +{"id":"buffalo","key":"buffalo","value":{"rev":"9-6c763d939d775a255c65ba8dcf0d5372"}}, +{"id":"bufferjs","key":"bufferjs","value":{"rev":"13-b6e09e35ec822714d3ec485ac2010272"}}, +{"id":"bufferlib","key":"bufferlib","value":{"rev":"16-d48d96815fc7709d6b7d0a8bfc67f053"}}, +{"id":"bufferlist","key":"bufferlist","value":{"rev":"18-6fcedc10ffbca1afdc866e208d2f906a"}}, +{"id":"buffers","key":"buffers","value":{"rev":"11-3a70ec2da112befdc65b8c02772b8c44"}}, +{"id":"bufferstream","key":"bufferstream","value":{"rev":"82-6f82c5affb3906ebbaa0b116baf73c54"}}, +{"id":"buffertools","key":"buffertools","value":{"rev":"20-68f90e224f81fab81295f9079dc3c0fc"}}, +{"id":"buffoon","key":"buffoon","value":{"rev":"9-1cdc1cbced94691e836d4266eed7c143"}}, +{"id":"builder","key":"builder","value":{"rev":"25-b9679e2aaffec1ac6d59fdd259d9590c"}}, +{"id":"buildr","key":"buildr","value":{"rev":"69-cb3a756903a6322c6f9f4dd1c384a607"}}, +{"id":"bumper","key":"bumper","value":{"rev":"3-1e8d17aa3b29815e4069294cc9ce572c"}}, +{"id":"bundle","key":"bundle","value":{"rev":"39-46fde9cd841bce1fbdd92f6a1235c308"}}, +{"id":"bunker","key":"bunker","value":{"rev":"7-ed993a296fa0b8d3c3a7cd759d6f371e"}}, +{"id":"burari","key":"burari","value":{"rev":"11-08b61073d6ad0ef0c7449a574dc8f54b"}}, +{"id":"burrito","key":"burrito","value":{"rev":"38-3f3b109972720647f5412f3a2478859b"}}, +{"id":"busbuddy","key":"busbuddy","value":{"rev":"5-298ec29f6307351cf7a19bceebe957c7"}}, +{"id":"buster","key":"buster","value":{"rev":"9-870a6e9638806adde2f40105900cd4b3"}}, +{"id":"buster-args","key":"buster-args","value":{"rev":"7-9b189c602e437a505625dbf7fef5dead"}}, +{"id":"buster-assertions","key":"buster-assertions","value":{"rev":"5-fa34a8a5e7cf4dd08c2d02c39de3b563"}}, +{"id":"buster-cli","key":"buster-cli","value":{"rev":"5-b1a85006e41dbf74313253c571e63874"}}, +{"id":"buster-client","key":"buster-client","value":{"rev":"5-340637ec63b54bb01c1313a78db01945"}}, +{"id":"buster-configuration","key":"buster-configuration","value":{"rev":"3-a12e7ff172562b513534fc26be00aaed"}}, +{"id":"buster-core","key":"buster-core","value":{"rev":"5-871df160645e6684111a8fd02ff0eee9"}}, +{"id":"buster-evented-logger","key":"buster-evented-logger","value":{"rev":"5-c46681e6275a76723e3bc834555dbe32"}}, +{"id":"buster-format","key":"buster-format","value":{"rev":"5-e193e90436c7f941739b82adad86bdd8"}}, +{"id":"buster-module-loader","key":"buster-module-loader","value":{"rev":"5-4148b61f8b718e6181aa6054664a7c44"}}, +{"id":"buster-multicast","key":"buster-multicast","value":{"rev":"3-79480b5be761d243b274cb1e77375afc"}}, +{"id":"buster-promise","key":"buster-promise","value":{"rev":"5-b50030957fbd70e65576faa9c541b739"}}, +{"id":"buster-script-loader","key":"buster-script-loader","value":{"rev":"3-85af28b5bc4e647f27514fede19a144e"}}, +{"id":"buster-server","key":"buster-server","value":{"rev":"7-57b8b43047504818322018d2bbfee1f1"}}, +{"id":"buster-static","key":"buster-static","value":{"rev":"3-018c89d1524f7823934087f18dab9047"}}, +{"id":"buster-terminal","key":"buster-terminal","value":{"rev":"5-2c54c30ffa4a2d4b061e4c38e6b9b0e7"}}, +{"id":"buster-test","key":"buster-test","value":{"rev":"5-f7ee9c9f3b379e0ad5aa03d07581ad6f"}}, +{"id":"buster-test-cli","key":"buster-test-cli","value":{"rev":"9-c207974d20e95029cad5fa4c9435d152"}}, +{"id":"buster-user-agent-parser","key":"buster-user-agent-parser","value":{"rev":"5-7883085a203b3047b28ad08361219d1d"}}, +{"id":"buster-util","key":"buster-util","value":{"rev":"3-81977275a9c467ad79bb7e3f2b1caaa8"}}, +{"id":"butler","key":"butler","value":{"rev":"7-c964c4d213da6b0de2492ee57514d0f8"}}, +{"id":"byline","key":"byline","value":{"rev":"9-0b236ed5986c20136c0d581a244d52ac"}}, +{"id":"bz","key":"bz","value":{"rev":"7-d2a463b259c4e09dc9a79ddee9575ca0"}}, +{"id":"c2dm","key":"c2dm","value":{"rev":"11-a1e6a6643506bed3e1443155706aa5fe"}}, +{"id":"cabin","key":"cabin","value":{"rev":"7-df81ef56f0bb085d381c36600496dc57"}}, +{"id":"caboose","key":"caboose","value":{"rev":"49-7226441f91b63fb5c3ac240bd99d142a"}}, +{"id":"caboose-authentication","key":"caboose-authentication","value":{"rev":"3-9c71a9d7315fdea7d5f52fe52ecef118"}}, +{"id":"caboose-model","key":"caboose-model","value":{"rev":"3-967426d5acb8bb70e133f0052075dc1b"}}, +{"id":"cache2file","key":"cache2file","value":{"rev":"17-ac9caec611a38e1752d91f8cc80cfb04"}}, +{"id":"caching","key":"caching","value":{"rev":"11-06041aaaa46b63ed36843685cac63245"}}, +{"id":"calais","key":"calais","value":{"rev":"11-f8ac2064ca45dd5b7db7ea099cd61dfb"}}, +{"id":"calc","key":"calc","value":{"rev":"3-bead9c5b0bee34e44e7c04aa2bf9cd68"}}, +{"id":"calipso","key":"calipso","value":{"rev":"87-b562676045a66a3ec702591c67a9635e"}}, +{"id":"caman","key":"caman","value":{"rev":"15-4b97c73f0ac101c68335de2937483893"}}, +{"id":"camanjs","key":"camanjs","value":{"rev":"3-2856bbdf7a1d454929b4a80b119e3da0"}}, +{"id":"camelot","key":"camelot","value":{"rev":"7-8e257c5213861ecbd229ee737a3a8bb4"}}, +{"id":"campusbooks","key":"campusbooks","value":{"rev":"18-489be33c6ac2d6cbcf93355f2b129389"}}, +{"id":"canvas","key":"canvas","value":{"rev":"78-27dbf5b6e0a25ba5886d485fd897d701"}}, +{"id":"canvasutil","key":"canvasutil","value":{"rev":"7-0b87a370d673886efb7763aaf500b744"}}, +{"id":"capoo","key":"capoo","value":{"rev":"9-136a3ddf489228d5f4b504b1da619447"}}, +{"id":"capsule","key":"capsule","value":{"rev":"19-ad3c9ba0af71a84228e6dd360017f379"}}, +{"id":"capt","key":"capt","value":{"rev":"13-0805d789000fb2e361103a5e62379196"}}, +{"id":"carena","key":"carena","value":{"rev":"10-d38e8c336a0dbb8091514f638b22b96b"}}, +{"id":"carrier","key":"carrier","value":{"rev":"20-b2b4a0560d40eeac617000e9e22a9e9d"}}, +{"id":"cart","key":"cart","value":{"rev":"12-493e79c6fa0b099626e90da79a69f1e5"}}, +{"id":"carto","key":"carto","value":{"rev":"45-8eab07e2fac57396dd62af5805062387"}}, +{"id":"caruso","key":"caruso","value":{"rev":"5-d58e22212b0bcebbab4b42adc68799aa"}}, +{"id":"cas","key":"cas","value":{"rev":"3-82a93160eb9add99bde1599e55d18fd8"}}, +{"id":"cas-auth","key":"cas-auth","value":{"rev":"3-b02f77c198050b99f1df18f637e77c10"}}, +{"id":"cas-client","key":"cas-client","value":{"rev":"3-ca69e32a3053bc680d1dddc57271483b"}}, +{"id":"cashew","key":"cashew","value":{"rev":"7-9e81cde34263adad6949875c4b33ee99"}}, +{"id":"cassandra","key":"cassandra","value":{"rev":"3-8617ef73fdc73d02ecec74d31f98e463"}}, +{"id":"cassandra-client","key":"cassandra-client","value":{"rev":"19-aa1aef5d203be5b0eac678284f1a979f"}}, +{"id":"casset","key":"casset","value":{"rev":"3-2052c7feb5b89c77aaa279c8b50126ce"}}, +{"id":"castaneum","key":"castaneum","value":{"rev":"26-4dc55ba2482cca4230b4bc77ecb5b70d"}}, +{"id":"cat","key":"cat","value":{"rev":"3-75f20119b363b85c1a8433e26b86c943"}}, +{"id":"catchjs","key":"catchjs","value":{"rev":"3-ffda7eff7613de37f629dc7a831ffda1"}}, +{"id":"caterpillar","key":"caterpillar","value":{"rev":"5-bc003e3af33240e67b4c3042f308b7da"}}, +{"id":"causeeffect","key":"causeeffect","value":{"rev":"9-7e4e25bff656170c97cb0cce1b2ab6ca"}}, +{"id":"cayenne","key":"cayenne","value":{"rev":"5-2797f561467b41cc45804e5498917800"}}, +{"id":"ccn4bnode","key":"ccn4bnode","value":{"rev":"17-96f55189e5c98f0fa8200e403a04eb39"}}, +{"id":"ccnq3_config","key":"ccnq3_config","value":{"rev":"21-40345771769a9cadff4af9113b8124c2"}}, +{"id":"ccnq3_logger","key":"ccnq3_logger","value":{"rev":"5-4aa168dc24425938a29cf9ac456158d7"}}, +{"id":"ccnq3_portal","key":"ccnq3_portal","value":{"rev":"17-84e629ec1eaba1722327ccb9dddb05cf"}}, +{"id":"ccnq3_roles","key":"ccnq3_roles","value":{"rev":"43-97de74b08b1af103da8905533a84b749"}}, +{"id":"ccss","key":"ccss","value":{"rev":"11-b9beb506410ea81581ba4c7dfe9b2a7d"}}, +{"id":"cdb","key":"cdb","value":{"rev":"13-d7b6f609f069dc738912b405aac558ab"}}, +{"id":"cdb_changes","key":"cdb_changes","value":{"rev":"13-1dc99b096cb91c276332b651396789e8"}}, +{"id":"celeri","key":"celeri","value":{"rev":"17-b19294619ef6c2056f3bf6641e8945c2"}}, +{"id":"celery","key":"celery","value":{"rev":"5-bdfccd483cf30c4c10c5ec0963de1248"}}, +{"id":"cempl8","key":"cempl8","value":{"rev":"21-bb9547b78a1548fe11dc1d5b816b6da1"}}, +{"id":"cfg","key":"cfg","value":{"rev":"3-85c7651bb8f16b057e60a46946eb95af"}}, +{"id":"cgi","key":"cgi","value":{"rev":"17-7ceac458c7f141d4fbbf05d267a72aa8"}}, +{"id":"chain","key":"chain","value":{"rev":"9-b0f175c5ad0173bcb7e11e58b02a7394"}}, +{"id":"chain-gang","key":"chain-gang","value":{"rev":"22-b0e6841a344b65530ea2a83a038e5aa6"}}, +{"id":"chainer","key":"chainer","value":{"rev":"15-8c6a565035225a1dcca0177e92ccf42d"}}, +{"id":"chainify","key":"chainify","value":{"rev":"3-0926790f18a0016a9943cfb4830e0187"}}, +{"id":"chains","key":"chains","value":{"rev":"5-d9e1ac38056e2638e38d9a7c415929c6"}}, +{"id":"chainsaw","key":"chainsaw","value":{"rev":"24-82e078efbbc59f798d29a0259481012e"}}, +{"id":"changelog","key":"changelog","value":{"rev":"27-317e473de0bf596b273a9dadecea126d"}}, +{"id":"channel-server","key":"channel-server","value":{"rev":"3-3c882f7e61686e8a124b5198c638a18e"}}, +{"id":"channels","key":"channels","value":{"rev":"5-0b532f054886d9094cb98493ee0a7a16"}}, +{"id":"chaos","key":"chaos","value":{"rev":"40-7caa4459d398f5ec30fea91d087f0d71"}}, +{"id":"chard","key":"chard","value":{"rev":"3-f2de35f7a390ea86ac0eb78bf720d0de"}}, +{"id":"charenc","key":"charenc","value":{"rev":"3-092036302311a8f5779b800c98170b5b"}}, +{"id":"chargify","key":"chargify","value":{"rev":"5-e3f29f2816b04c26ca047d345928e2c1"}}, +{"id":"charm","key":"charm","value":{"rev":"13-3e7e7b5babc1efc472e3ce62eec2c0c7"}}, +{"id":"chat-server","key":"chat-server","value":{"rev":"7-c73b785372474e083fb8f3e9690761da"}}, +{"id":"chatroom","key":"chatroom","value":{"rev":"3-f4fa8330b7eb277d11407f968bffb6a2"}}, +{"id":"chatspire","key":"chatspire","value":{"rev":"3-081e167e3f7c1982ab1b7fc3679cb87c"}}, +{"id":"checkip","key":"checkip","value":{"rev":"3-b31d58a160a4a3fe2f14cfbf2217949e"}}, +{"id":"cheddar-getter","key":"cheddar-getter","value":{"rev":"3-d675ec138ea704df127fabab6a52a8dc"}}, +{"id":"chess","key":"chess","value":{"rev":"3-8b15268c8b0fb500dcbc83b259e7fb88"}}, +{"id":"chessathome-worker","key":"chessathome-worker","value":{"rev":"7-cdfd411554c35ba7a52e54f7744bed35"}}, +{"id":"chirkut.js","key":"chirkut.js","value":{"rev":"3-c0e515eee0f719c5261a43e692a3585c"}}, +{"id":"chiron","key":"chiron","value":{"rev":"6-ccb575e432c1c1981fc34b4e27329c85"}}, +{"id":"chopper","key":"chopper","value":{"rev":"5-168681c58c2a50796676dea73dc5398b"}}, +{"id":"choreographer","key":"choreographer","value":{"rev":"14-b0159823becdf0b4552967293968b2a8"}}, +{"id":"chromic","key":"chromic","value":{"rev":"3-c4ca0bb1f951db96c727241092afa9cd"}}, +{"id":"chrono","key":"chrono","value":{"rev":"9-6399d715df1a2f4696f89f2ab5d4d83a"}}, +{"id":"chuck","key":"chuck","value":{"rev":"3-71f2ee071d4b6fb2af3b8b828c51d8ab"}}, +{"id":"chunkedstream","key":"chunkedstream","value":{"rev":"3-b145ed7d1abd94ac44343413e4f823e7"}}, +{"id":"cider","key":"cider","value":{"rev":"10-dc20cd3eac9470e96911dcf75ac6492b"}}, +{"id":"cinch","key":"cinch","value":{"rev":"5-086af7f72caefb57284e4101cbe3c905"}}, +{"id":"cipherpipe","key":"cipherpipe","value":{"rev":"5-0b5590f808415a7297de6d45947d911f"}}, +{"id":"cjson","key":"cjson","value":{"rev":"25-02e3d327b48e77dc0f9e070ce9454ac2"}}, +{"id":"ck","key":"ck","value":{"rev":"3-f482385f5392a49353d8ba5eb9c7afef"}}, +{"id":"ckup","key":"ckup","value":{"rev":"26-90a76ec0cdf951dc2ea6058098407ee2"}}, +{"id":"class","key":"class","value":{"rev":"6-e2805f7d87586a66fb5fd170cf74b3b0"}}, +{"id":"class-42","key":"class-42","value":{"rev":"3-14c988567a2c78a857f15c9661bd6430"}}, +{"id":"class-js","key":"class-js","value":{"rev":"5-792fd04288a651dad87bc47eb91c2042"}}, +{"id":"classify","key":"classify","value":{"rev":"23-35eb336c350446f5ed49069df151dbb7"}}, +{"id":"clean-css","key":"clean-css","value":{"rev":"13-e30ea1007f6c5bb49e07276228b8a960"}}, +{"id":"clearInterval","key":"clearInterval","value":{"rev":"3-a49fa235d3dc14d28a3d15f8db291986"}}, +{"id":"clearTimeout","key":"clearTimeout","value":{"rev":"3-e838bd25adc825112922913c1a35b934"}}, +{"id":"cli","key":"cli","value":{"rev":"65-9e79c37c12d21b9b9114093de0773c54"}}, +{"id":"cli-color","key":"cli-color","value":{"rev":"9-0a8e775e713b1351f6a6648748dd16ec"}}, +{"id":"cli-table","key":"cli-table","value":{"rev":"3-9e447a8bb392fb7d9c534445a650e328"}}, +{"id":"clickatell","key":"clickatell","value":{"rev":"3-31f1a66d08a789976919df0c9280de88"}}, +{"id":"clicktime","key":"clicktime","value":{"rev":"9-697a99f5f704bfebbb454df47c9c472a"}}, +{"id":"clientexpress","key":"clientexpress","value":{"rev":"3-9b07041cd7b0c3967c4625ac74c9b50c"}}, +{"id":"cliff","key":"cliff","value":{"rev":"15-ef9ef25dbad08c0e346388522d94c5c3"}}, +{"id":"clip","key":"clip","value":{"rev":"21-c3936e566feebfe0beddb0bbb686c00d"}}, +{"id":"clock","key":"clock","value":{"rev":"5-19bc51841d41408b4446c0862487dc5e"}}, +{"id":"clog","key":"clog","value":{"rev":"5-1610fe2c0f435d2694a1707ee15cd11e"}}, +{"id":"clone","key":"clone","value":{"rev":"11-099d07f38381b54902c4cf5b93671ed4"}}, +{"id":"closure","key":"closure","value":{"rev":"7-9c2ac6b6ec9f14d12d10bfbfad58ec14"}}, +{"id":"closure-compiler","key":"closure-compiler","value":{"rev":"8-b3d2f9e3287dd33094a35d797d6beaf2"}}, +{"id":"cloud","key":"cloud","value":{"rev":"27-407c7aa77d3d4a6cc903d18b383de8b8"}}, +{"id":"cloud9","key":"cloud9","value":{"rev":"71-4af631e3fa2eb28058cb0d18ef3a6a3e"}}, +{"id":"cloudcontrol","key":"cloudcontrol","value":{"rev":"15-2df57385aa9bd92f7ed81e6892e23696"}}, +{"id":"cloudfiles","key":"cloudfiles","value":{"rev":"30-01f84ebda1d8f151b3e467590329960c"}}, +{"id":"cloudfoundry","key":"cloudfoundry","value":{"rev":"3-66fafd3d6b1353b1699d35e634686ab6"}}, +{"id":"cloudmailin","key":"cloudmailin","value":{"rev":"3-a4e3e4d457f5a18261bb8df145cfb418"}}, +{"id":"cloudnode-cli","key":"cloudnode-cli","value":{"rev":"17-3a80f7855ce618f7aee68bd693ed485b"}}, +{"id":"cloudservers","key":"cloudservers","value":{"rev":"42-6bc34f7e34f84a24078b43a609e96c59"}}, +{"id":"clucene","key":"clucene","value":{"rev":"37-3d613f12a857b8fe22fbf420bcca0dc3"}}, +{"id":"cluster","key":"cluster","value":{"rev":"83-63fb7a468d95502f94ea45208ba0a890"}}, +{"id":"cluster-isolatable","key":"cluster-isolatable","value":{"rev":"5-6af883cea9ab1c90bb126d8b3be2d156"}}, +{"id":"cluster-live","key":"cluster-live","value":{"rev":"7-549d19e9727f460c7de48f93b92e9bb3"}}, +{"id":"cluster-log","key":"cluster-log","value":{"rev":"7-9c47854df8ec911e679743185668a5f7"}}, +{"id":"cluster-loggly","key":"cluster-loggly","value":{"rev":"3-e1f7e331282d7b8317ce55e0fce7f934"}}, +{"id":"cluster-mail","key":"cluster-mail","value":{"rev":"9-dc18c5c1b2b265f3d531b92467b6cc35"}}, +{"id":"cluster-responsetimes","key":"cluster-responsetimes","value":{"rev":"3-c9e16daee15eb84910493264e973275c"}}, +{"id":"cluster-socket.io","key":"cluster-socket.io","value":{"rev":"7-29032f0b42575e9fe183a0af92191132"}}, +{"id":"cluster.exception","key":"cluster.exception","value":{"rev":"3-10856526e2f61e3000d62b12abd750e3"}}, +{"id":"clutch","key":"clutch","value":{"rev":"8-50283f7263c430cdd1d293c033571012"}}, +{"id":"cm1-route","key":"cm1-route","value":{"rev":"13-40e72b5a4277b500c98c966bcd2a8a86"}}, +{"id":"cmd","key":"cmd","value":{"rev":"9-9168fcd96fb1ba9449050162023f3570"}}, +{"id":"cmdopt","key":"cmdopt","value":{"rev":"3-85677533e299bf195e78942929cf9839"}}, +{"id":"cmp","key":"cmp","value":{"rev":"5-b10f873b78eb64e406fe55bd001ae0fa"}}, +{"id":"cmudict","key":"cmudict","value":{"rev":"3-cd028380bba917d5ed2be7a8d3b3b0b7"}}, +{"id":"cnlogger","key":"cnlogger","value":{"rev":"9-dbe7e0e50d25ca5ae939fe999c3c562b"}}, +{"id":"coa","key":"coa","value":{"rev":"11-ff4e634fbebd3f80b9461ebe58b3f64e"}}, +{"id":"cobra","key":"cobra","value":{"rev":"5-a3e0963830d350f4a7e91b438caf9117"}}, +{"id":"cockpit","key":"cockpit","value":{"rev":"3-1757b37245ee990999e4456b9a6b963e"}}, +{"id":"coco","key":"coco","value":{"rev":"104-eabc4d7096295c2156144a7581d89b35"}}, +{"id":"cocos2d","key":"cocos2d","value":{"rev":"19-88a5c75ceb6e7667665c056d174f5f1a"}}, +{"id":"codem-transcode","key":"codem-transcode","value":{"rev":"9-1faa2657d53271ccc44cce27de723e99"}}, +{"id":"codepad","key":"codepad","value":{"rev":"5-094ddce74dc057dc0a4d423d6d2fbc3a"}}, +{"id":"codetube","key":"codetube","value":{"rev":"3-819794145f199330e724864db70da53b"}}, +{"id":"coerce","key":"coerce","value":{"rev":"3-e7d392d497c0b8491b89fcbbd1a5a89f"}}, +{"id":"coffee-conf","key":"coffee-conf","value":{"rev":"3-883bc4767d70810ece2fdf1ccae883de"}}, +{"id":"coffee-css","key":"coffee-css","value":{"rev":"11-66ca197173751389b24945f020f198f9"}}, +{"id":"coffee-echonest","key":"coffee-echonest","value":{"rev":"3-3cd0e2b77103e334eccf6cf4168f39b2"}}, +{"id":"coffee-machine","key":"coffee-machine","value":{"rev":"9-02deb4d27fd5d56002ead122e9bb213e"}}, +{"id":"coffee-new","key":"coffee-new","value":{"rev":"67-0664b0f289030c38d113070fd26f4f71"}}, +{"id":"coffee-resque","key":"coffee-resque","value":{"rev":"22-5b022809317d3a873be900f1a697c5eb"}}, +{"id":"coffee-resque-retry","key":"coffee-resque-retry","value":{"rev":"29-1fb64819a4a21ebb4d774d9d4108e419"}}, +{"id":"coffee-revup","key":"coffee-revup","value":{"rev":"3-23aafa258bcdcf2bb68d143d61383551"}}, +{"id":"coffee-script","key":"coffee-script","value":{"rev":"60-a6c3739655f43953bd86283776586b95"}}, +{"id":"coffee-son","key":"coffee-son","value":{"rev":"3-84a81e7e24c8cb23293940fc1b87adfe"}}, +{"id":"coffee-toaster","key":"coffee-toaster","value":{"rev":"17-d43d7276c08b526c229c78b7d5acd6cc"}}, +{"id":"coffee-watcher","key":"coffee-watcher","value":{"rev":"3-3d861a748f0928c789cbdb8ff62b6091"}}, +{"id":"coffee-world","key":"coffee-world","value":{"rev":"15-46dc320f94fa64c39e183224ec59f47a"}}, +{"id":"coffee4clients","key":"coffee4clients","value":{"rev":"15-58fba7dd10bced0411cfe546b9336145"}}, +{"id":"coffeeapp","key":"coffeeapp","value":{"rev":"48-bece0a26b78afc18cd37d577f90369d9"}}, +{"id":"coffeebot","key":"coffeebot","value":{"rev":"3-a9007053f25a4c13b324f0ac7066803e"}}, +{"id":"coffeedoc","key":"coffeedoc","value":{"rev":"21-a955faafafd10375baf3101ad2c142d0"}}, +{"id":"coffeegrinder","key":"coffeegrinder","value":{"rev":"9-6e725aad7fd39cd38f41c743ef8a7563"}}, +{"id":"coffeekup","key":"coffeekup","value":{"rev":"35-9b1eecdb7b13d3e75cdc7b1045cf910a"}}, +{"id":"coffeemaker","key":"coffeemaker","value":{"rev":"9-4c5e665aa2a5b4efa2b7d077d0a4f9c1"}}, +{"id":"coffeemate","key":"coffeemate","value":{"rev":"71-03d0221fb495f2dc6732009884027b47"}}, +{"id":"coffeepack","key":"coffeepack","value":{"rev":"3-bbf0e27cb4865392164e7ab33f131d58"}}, +{"id":"coffeeq","key":"coffeeq","value":{"rev":"9-4e38e9742a0b9d7b308565729fbfd123"}}, +{"id":"coffeescript-growl","key":"coffeescript-growl","value":{"rev":"7-2bc1f93c4aad5fa8fb4bcfd1b3ecc279"}}, +{"id":"coffeescript-notify","key":"coffeescript-notify","value":{"rev":"3-8aeb31f8e892d3fefa421ff28a1b3de9"}}, +{"id":"collectd","key":"collectd","value":{"rev":"5-3d4c84b0363aa9c078157d82695557a1"}}, +{"id":"collection","key":"collection","value":{"rev":"3-a47e1fe91b9eebb3e75954e350ec2ca3"}}, +{"id":"collection_functions","key":"collection_functions","value":{"rev":"3-7366c721008062373ec924a409415189"}}, +{"id":"collections","key":"collections","value":{"rev":"3-0237a40d08a0da36c2dd01ce73a89bb2"}}, +{"id":"color","key":"color","value":{"rev":"15-4898b2cd9744feb3249ba10828c186f8"}}, +{"id":"color-convert","key":"color-convert","value":{"rev":"7-2ccb47c7f07a47286d9a2f39383d28f0"}}, +{"id":"color-string","key":"color-string","value":{"rev":"5-9a6336f420e001e301a15b88b0103696"}}, +{"id":"colorize","key":"colorize","value":{"rev":"3-ff380385edacc0c46e4c7b5c05302576"}}, +{"id":"colors","key":"colors","value":{"rev":"8-7c7fb9c5af038c978f0868c7706fe145"}}, +{"id":"colour-extractor","key":"colour-extractor","value":{"rev":"3-62e96a84c6adf23f438b5aac76c7b257"}}, +{"id":"coloured","key":"coloured","value":{"rev":"8-c5295f2d5a8fc08e93d180a4e64f8d38"}}, +{"id":"coloured-log","key":"coloured-log","value":{"rev":"14-8627a3625959443acad71e2c23dfc582"}}, +{"id":"comb","key":"comb","value":{"rev":"5-7f201b621ae9a890c7f5a31867eba3e9"}}, +{"id":"combine","key":"combine","value":{"rev":"14-bed33cd4389a2e4bb826a0516c6ae307"}}, +{"id":"combined-stream","key":"combined-stream","value":{"rev":"13-678f560200ac2835b9026e9e2b955cb0"}}, +{"id":"combiner","key":"combiner","value":{"rev":"3-5e7f133c8c14958eaf9e92bd79ae8ee1"}}, +{"id":"combohandler","key":"combohandler","value":{"rev":"7-d7e1a402f0066caa6756a8866de81dd9"}}, +{"id":"combyne","key":"combyne","value":{"rev":"23-05ebee9666a769e32600bc5548d10ce9"}}, +{"id":"comfy","key":"comfy","value":{"rev":"5-8bfe55bc16611dfe51a184b8f3eb31c1"}}, +{"id":"command-parser","key":"command-parser","value":{"rev":"5-8a5c3ed6dfa0fa55cc71b32cf52332fc"}}, +{"id":"commander","key":"commander","value":{"rev":"11-9dd16c00844d464bf66c101a57075401"}}, +{"id":"commando","key":"commando","value":{"rev":"3-e159f1890f3771dfd6e04f4d984f26f3"}}, +{"id":"common","key":"common","value":{"rev":"16-94eafcf104c0c7d1090e668ddcc12a5f"}}, +{"id":"common-exception","key":"common-exception","value":{"rev":"7-bd46358014299da814691c835548ef21"}}, +{"id":"common-node","key":"common-node","value":{"rev":"5-b2c4bef0e7022d5d453661a9c43497a8"}}, +{"id":"common-pool","key":"common-pool","value":{"rev":"5-c495fa945361ba4fdfb2ee8733d791b4"}}, +{"id":"common-utils","key":"common-utils","value":{"rev":"3-e5a047f118fc304281d2bc5e9ab18e62"}}, +{"id":"commondir","key":"commondir","value":{"rev":"3-ea49874d12eeb9adf28ca28989dfb5a9"}}, +{"id":"commonjs","key":"commonjs","value":{"rev":"6-39fcd0de1ec265890cf063effd0672e3"}}, +{"id":"commonjs-utils","key":"commonjs-utils","value":{"rev":"6-c0266a91dbd0a43effb7d30da5d9f35c"}}, +{"id":"commonkv","key":"commonkv","value":{"rev":"3-90b2fe4c79e263b044303706c4d5485a"}}, +{"id":"commons","key":"commons","value":{"rev":"6-0ecb654aa2bd17cf9519f86d354f8a50"}}, +{"id":"complete","key":"complete","value":{"rev":"7-acde8cba7677747d09c3d53ff165754e"}}, +{"id":"complex-search","key":"complex-search","value":{"rev":"5-c80b2c7f049f333bde89435f3de497ca"}}, +{"id":"compose","key":"compose","value":{"rev":"1-cf8a97d6ead3bef056d85daec5d36c70"}}, +{"id":"composer","key":"composer","value":{"rev":"6-1deb43725051f845efd4a7c8e68aa6d6"}}, +{"id":"compress","key":"compress","value":{"rev":"17-f0aacce1356f807b51e083490fb353bd"}}, +{"id":"compress-buffer","key":"compress-buffer","value":{"rev":"12-2886014c7f2541f4ddff9f0f55f4c171"}}, +{"id":"compress-ds","key":"compress-ds","value":{"rev":"5-9e4c6931edf104443353594ef50aa127"}}, +{"id":"compressor","key":"compressor","value":{"rev":"3-ee8ad155a98e1483d899ebcf82d5fb63"}}, +{"id":"concrete","key":"concrete","value":{"rev":"5-bc70bbffb7c6fe9e8c399db578fb3bae"}}, +{"id":"condo","key":"condo","value":{"rev":"9-5f03d58ee7dc29465defa3758f3b138a"}}, +{"id":"conductor","key":"conductor","value":{"rev":"8-1878afadcda7398063de6286c2d2c5c1"}}, +{"id":"conf","key":"conf","value":{"rev":"11-dcf0f6a93827d1b143cb1d0858f2be4a"}}, +{"id":"config","key":"config","value":{"rev":"37-2b741a1e6951a74b7f1de0d0547418a0"}}, +{"id":"config-loader","key":"config-loader","value":{"rev":"3-708cc96d1206de46fb450eb57ca07b0d"}}, +{"id":"configurator","key":"configurator","value":{"rev":"5-b31ad9731741d19f28241f6af5b41fee"}}, +{"id":"confu","key":"confu","value":{"rev":"7-c46f82c4aa9a17db6530b00669461eaf"}}, +{"id":"confy","key":"confy","value":{"rev":"3-893b33743830a0318dc99b1788aa92ee"}}, +{"id":"connect","key":"connect","value":{"rev":"151-8b5617fc6ece6c125b5f628936159bd6"}}, +{"id":"connect-access-control","key":"connect-access-control","value":{"rev":"3-ccf5fb09533d41eb0b564eb1caecf910"}}, +{"id":"connect-airbrake","key":"connect-airbrake","value":{"rev":"5-19db5e5828977540814d09f9eb7f028f"}}, +{"id":"connect-analytics","key":"connect-analytics","value":{"rev":"3-6f71c8b08ed9f5762c1a4425c196fb2a"}}, +{"id":"connect-app-cache","key":"connect-app-cache","value":{"rev":"27-3e69452dfe51cc907f8b188aede1bda8"}}, +{"id":"connect-assetmanager","key":"connect-assetmanager","value":{"rev":"46-f2a8834d2749e0c069cee06244e7501c"}}, +{"id":"connect-assetmanager-handlers","key":"connect-assetmanager-handlers","value":{"rev":"38-8b93821fcf46f20bbad4319fb39302c1"}}, +{"id":"connect-assets","key":"connect-assets","value":{"rev":"33-7ec2940217e29a9514d20cfd49af10f5"}}, +{"id":"connect-auth","key":"connect-auth","value":{"rev":"36-5640e82f3e2773e44ce47b0687436305"}}, +{"id":"connect-cache","key":"connect-cache","value":{"rev":"11-efe1f0ab00c181b1a4dece446ef13a90"}}, +{"id":"connect-coffee","key":"connect-coffee","value":{"rev":"3-3d4ebcfe083c9e5a5d587090f1bb4d65"}}, +{"id":"connect-conneg","key":"connect-conneg","value":{"rev":"3-bc3e04e65cf1f5233a38cc846e9a4a75"}}, +{"id":"connect-cookie-session","key":"connect-cookie-session","value":{"rev":"3-f48ca73aa1ce1111a2c962d219b59c1a"}}, +{"id":"connect-cors","key":"connect-cors","value":{"rev":"10-5bc9e3759671a0157fdc307872d38844"}}, +{"id":"connect-couchdb","key":"connect-couchdb","value":{"rev":"9-9adb6d24c7fb6de58bafe6d06fb4a230"}}, +{"id":"connect-cradle","key":"connect-cradle","value":{"rev":"5-0e5e32e00a9b98eff1ab010173d26ffb"}}, +{"id":"connect-docco","key":"connect-docco","value":{"rev":"9-c8e379f9a89db53f8921895ac4e87ed6"}}, +{"id":"connect-dojo","key":"connect-dojo","value":{"rev":"17-f323c634536b9b948ad9607f4ca0847f"}}, +{"id":"connect-esi","key":"connect-esi","value":{"rev":"45-01de7506d405856586ea77cb14022192"}}, +{"id":"connect-facebook","key":"connect-facebook","value":{"rev":"3-bf77eb01c0476e607b25bc9d93416b7e"}}, +{"id":"connect-force-domain","key":"connect-force-domain","value":{"rev":"5-a65755f93aaea8a21c7ce7dd4734dca0"}}, +{"id":"connect-form","key":"connect-form","value":{"rev":"16-fa786af79f062a05ecdf3e7cf48317e2"}}, +{"id":"connect-geoip","key":"connect-geoip","value":{"rev":"3-d87f93bcac58aa7904886a8fb6c45899"}}, +{"id":"connect-googleapps","key":"connect-googleapps","value":{"rev":"13-49c5c6c6724b21eea9a8eaae2165978d"}}, +{"id":"connect-gzip","key":"connect-gzip","value":{"rev":"7-2e1d4bb887c1ddda278fc8465ee5645b"}}, +{"id":"connect-heroku-redis","key":"connect-heroku-redis","value":{"rev":"13-92da2be67451e5f55f6fbe3672c86dc4"}}, +{"id":"connect-i18n","key":"connect-i18n","value":{"rev":"8-09d47d7c220770fc80d1b6fd87ffcd07"}}, +{"id":"connect-identity","key":"connect-identity","value":{"rev":"8-8eb9e21bbf80045e0243720955d6070f"}}, +{"id":"connect-image-resizer","key":"connect-image-resizer","value":{"rev":"7-5f82563f87145f3cc06086afe3a14a62"}}, +{"id":"connect-index","key":"connect-index","value":{"rev":"3-8b8373334079eb26c8735b39483889a0"}}, +{"id":"connect-jsonp","key":"connect-jsonp","value":{"rev":"16-9e80af455e490710f06039d3c0025840"}}, +{"id":"connect-jsonrpc","key":"connect-jsonrpc","value":{"rev":"6-6556800f0bef6ae5eb10496d751048e7"}}, +{"id":"connect-kyoto","key":"connect-kyoto","value":{"rev":"5-8f6a9e9b24d1a71c786645402f509645"}}, +{"id":"connect-less","key":"connect-less","value":{"rev":"3-461ed9a80b462b978a81d5bcee6f3665"}}, +{"id":"connect-load-balance","key":"connect-load-balance","value":{"rev":"3-e74bff5fb47d1490c05a9cc4339af347"}}, +{"id":"connect-memcached","key":"connect-memcached","value":{"rev":"3-5fc92b7f9fb5bcfb364a27e6f052bcc7"}}, +{"id":"connect-mongo","key":"connect-mongo","value":{"rev":"13-c3869bc7337b2f1ee6b9b3364993f321"}}, +{"id":"connect-mongodb","key":"connect-mongodb","value":{"rev":"30-30cb932839ce16e4e496f5a33fdd720a"}}, +{"id":"connect-mongoose","key":"connect-mongoose","value":{"rev":"3-48a5b329e4cfa885442d43bbd1d0db46"}}, +{"id":"connect-mongoose-session","key":"connect-mongoose-session","value":{"rev":"3-6692b8e1225d5cd6a2daabd61cecb1cd"}}, +{"id":"connect-mysql-session","key":"connect-mysql-session","value":{"rev":"9-930abd0279ef7f447e75c95b3e71be12"}}, +{"id":"connect-no-www","key":"connect-no-www","value":{"rev":"3-33bed7417bc8a5e8efc74ce132c33158"}}, +{"id":"connect-notifo","key":"connect-notifo","value":{"rev":"3-4681f8c5a7dfd35aee9634e809c41804"}}, +{"id":"connect-parameter-router","key":"connect-parameter-router","value":{"rev":"3-f435f06d556c208d43ef05c64bcddceb"}}, +{"id":"connect-pg","key":"connect-pg","value":{"rev":"11-d84c53d8f1c24adfc266e7a031dddf0d"}}, +{"id":"connect-proxy","key":"connect-proxy","value":{"rev":"7-a691ff57a9affeab47c54d17dbe613cb"}}, +{"id":"connect-queryparser","key":"connect-queryparser","value":{"rev":"3-bb35a7f3f75297a63bf942a63b842698"}}, +{"id":"connect-redis","key":"connect-redis","value":{"rev":"40-4faa12962b14da49380de2bb183176f9"}}, +{"id":"connect-restreamer","key":"connect-restreamer","value":{"rev":"3-08e637ca685cc63b2b4f9722c763c105"}}, +{"id":"connect-riak","key":"connect-riak","value":{"rev":"5-3268c29a54e430a3f8adb33570afafdb"}}, +{"id":"connect-rpx","key":"connect-rpx","value":{"rev":"28-acc7bb4200c1d30f359151f0a715162c"}}, +{"id":"connect-security","key":"connect-security","value":{"rev":"16-fecd20f486a8ea4d557119af5b5a2960"}}, +{"id":"connect-select","key":"connect-select","value":{"rev":"5-5ca28ec800419e4cb3e97395a6b96153"}}, +{"id":"connect-session-mongo","key":"connect-session-mongo","value":{"rev":"9-9e6a26dfbb9c13a9d6f4060a1895730a"}}, +{"id":"connect-session-redis-store","key":"connect-session-redis-store","value":{"rev":"8-fecfed6e17476eaada5cfe7740d43893"}}, +{"id":"connect-sessionvoc","key":"connect-sessionvoc","value":{"rev":"13-57b6e6ea2158e3b7136054839662ea3d"}}, +{"id":"connect-spdy","key":"connect-spdy","value":{"rev":"11-f9eefd7303295d77d317cba78d299130"}}, +{"id":"connect-sts","key":"connect-sts","value":{"rev":"9-8e3fd563c04ce14b824fc4da42efb70e"}}, +{"id":"connect-timeout","key":"connect-timeout","value":{"rev":"4-6f5f8d97480c16c7acb05fe82400bbc7"}}, +{"id":"connect-unstable","key":"connect-unstable","value":{"rev":"3-1d3a4edc52f005d8cb4d557485095314"}}, +{"id":"connect-wormhole","key":"connect-wormhole","value":{"rev":"3-f33b15acc686bd9ad0c6df716529009f"}}, +{"id":"connect-xcors","key":"connect-xcors","value":{"rev":"7-f8e1cd6805a8779bbd6bb2c1000649fb"}}, +{"id":"connect_facebook","key":"connect_facebook","value":{"rev":"3-b3001d71f619836a009c53c816ce36ed"}}, +{"id":"connect_json","key":"connect_json","value":{"rev":"3-dd0df74291f80f45b4314d56192c19c5"}}, +{"id":"connectables","key":"connectables","value":{"rev":"3-f6e9f8f13883a523b4ea6035281f541b"}}, +{"id":"conseq","key":"conseq","value":{"rev":"3-890d340704322630e7a724333f394c70"}}, +{"id":"consistent-hashing","key":"consistent-hashing","value":{"rev":"3-fcef5d4479d926560cf1bc900f746f2a"}}, +{"id":"console","key":"console","value":{"rev":"3-1e0449b07c840eeac6b536e2552844f4"}}, +{"id":"console.log","key":"console.log","value":{"rev":"9-d608afe50e732ca453365befcb87bad5"}}, +{"id":"consolemark","key":"consolemark","value":{"rev":"13-320f003fc2c3cec909ab3e9c3bce9743"}}, +{"id":"construct","key":"construct","value":{"rev":"3-75bdc809ee0572172e6acff537af7d9b"}}, +{"id":"context","key":"context","value":{"rev":"3-86b1a6a0f77ef86d4d9ccfff47ceaf6a"}}, +{"id":"contextify","key":"contextify","value":{"rev":"9-547b8019ef66e0d1c84fe00be832e750"}}, +{"id":"contract","key":"contract","value":{"rev":"3-d09e775c2c1e297b6cbbfcd5efbae3c7"}}, +{"id":"contracts","key":"contracts","value":{"rev":"13-3fd75c77e688937734f51cf97f10dd7d"}}, +{"id":"control","key":"control","value":{"rev":"31-7abf0cb81d19761f3ff59917e56ecedf"}}, +{"id":"controljs","key":"controljs","value":{"rev":"3-a8e80f93e389ca07509fa7addd6cb805"}}, +{"id":"convert","key":"convert","value":{"rev":"3-6c962b92274bcbe82b82a30806559d47"}}, +{"id":"conway","key":"conway","value":{"rev":"5-93ce24976e7dd5ba02fe4addb2b44267"}}, +{"id":"cookie","key":"cookie","value":{"rev":"14-946d98bf46e940d13ca485148b1bd609"}}, +{"id":"cookie-sessions","key":"cookie-sessions","value":{"rev":"8-4b399ac8cc4baea15f6c5e7ac94399f0"}}, +{"id":"cookiejar","key":"cookiejar","value":{"rev":"20-220b41a4c2a8f2b7b14aafece7dcc1b5"}}, +{"id":"cookies","key":"cookies","value":{"rev":"15-b3b35c32a99ed79accc724685d131d18"}}, +{"id":"cool","key":"cool","value":{"rev":"3-007d1123eb2dc52cf845d625f7ccf198"}}, +{"id":"coolmonitor","key":"coolmonitor","value":{"rev":"3-69c3779c596527f63e49c5e507dff1e1"}}, +{"id":"coop","key":"coop","value":{"rev":"9-39dee3260858cf8c079f31bdf02cea1d"}}, +{"id":"coordinator","key":"coordinator","value":{"rev":"32-9d92f2033a041d5c40f8e1018d512755"}}, +{"id":"core-utils","key":"core-utils","value":{"rev":"9-98f2412938a67d83e53e76a26b5601e0"}}, +{"id":"cornify","key":"cornify","value":{"rev":"6-6913172d09c52f9e8dc0ea19ec49972c"}}, +{"id":"corpus","key":"corpus","value":{"rev":"3-a357e7779f8d4ec020b755c71dd1e57b"}}, +{"id":"corrector","key":"corrector","value":{"rev":"3-ef3cf99fc59a581aee3590bdb8615269"}}, +{"id":"cosmos","key":"cosmos","value":{"rev":"3-3eb292c59758fb5215f22739fa9531ce"}}, +{"id":"couch-ar","key":"couch-ar","value":{"rev":"25-f106d2965ab74b25b18328ca44ca4a02"}}, +{"id":"couch-cleaner","key":"couch-cleaner","value":{"rev":"15-74e61ef98a770d76be4c7e7571d18381"}}, +{"id":"couch-client","key":"couch-client","value":{"rev":"10-94945ebd3e17f509fcc71fb6c6ef5d35"}}, +{"id":"couch-session","key":"couch-session","value":{"rev":"4-c73dea41ceed26a2a0bde9a9c8ffffc4"}}, +{"id":"couch-sqlite","key":"couch-sqlite","value":{"rev":"3-3e420fe6623542475595aa7e55a4e4bd"}}, +{"id":"couch-stream","key":"couch-stream","value":{"rev":"5-911704fc984bc49acce1e10adefff7ff"}}, +{"id":"couchapp","key":"couchapp","value":{"rev":"16-ded0f4742bb3f5fd42ec8f9c6b21ae8e"}}, +{"id":"couchcmd","key":"couchcmd","value":{"rev":"3-651ea2b435e031481b5d3d968bd3d1eb"}}, +{"id":"couchdb","key":"couchdb","value":{"rev":"12-8abcfd649751226c10edf7cf0508a09f"}}, +{"id":"couchdb-api","key":"couchdb-api","value":{"rev":"23-f2c82f08f52f266df7ac2aa709615244"}}, +{"id":"couchdb-tmp","key":"couchdb-tmp","value":{"rev":"3-9a695fb4ba352f3be2d57c5995718520"}}, +{"id":"couchdev","key":"couchdev","value":{"rev":"3-50a0ca3ed0395dd72de62a1b96619e66"}}, +{"id":"couchlegs","key":"couchlegs","value":{"rev":"5-be78e7922ad4ff86dbe5c17a87fdf4f1"}}, +{"id":"couchtato","key":"couchtato","value":{"rev":"11-15a1ce8de9a8cf1e81d96de6afbb4f45"}}, +{"id":"couchy","key":"couchy","value":{"rev":"13-0a52b2712fb8447f213866612e3ccbf7"}}, +{"id":"courier","key":"courier","value":{"rev":"17-eb94fe01aeaad43805f4bce21d23bcba"}}, +{"id":"coverage","key":"coverage","value":{"rev":"10-a333448996d0b0d420168d1b5748db32"}}, +{"id":"coverage_testing","key":"coverage_testing","value":{"rev":"3-62834678206fae7911401aa86ec1a85e"}}, +{"id":"cqs","key":"cqs","value":{"rev":"6-0dad8b969c70abccc27a146a99399533"}}, +{"id":"crab","key":"crab","value":{"rev":"9-599fc7757f0c9efbe3889f30981ebe93"}}, +{"id":"cradle","key":"cradle","value":{"rev":"60-8fb414b66cb07b4bae59c0316d5c45b4"}}, +{"id":"cradle-fixed","key":"cradle-fixed","value":{"rev":"4-589afffa26fca22244ad2038abb77dc5"}}, +{"id":"cradle-init","key":"cradle-init","value":{"rev":"13-499d63592141f1e200616952bbdea015"}}, +{"id":"crawler","key":"crawler","value":{"rev":"5-ec4a8d77f90d86d17d6d14d631360188"}}, +{"id":"crc","key":"crc","value":{"rev":"3-25ab83f8b1333e6d4e4e5fb286682422"}}, +{"id":"creatary","key":"creatary","value":{"rev":"3-770ad84ecb2e2a3994637d419384740d"}}, +{"id":"createsend","key":"createsend","value":{"rev":"7-19885346e4d7a01ac2e9ad70ea0e822a"}}, +{"id":"creationix","key":"creationix","value":{"rev":"61-7ede1759afbd41e8b4dedc348b72202e"}}, +{"id":"creek","key":"creek","value":{"rev":"33-4f511aa4dd379e04bba7ac333744325e"}}, +{"id":"cron","key":"cron","value":{"rev":"12-8d794edb5f9b7cb6322acaef1c848043"}}, +{"id":"cron2","key":"cron2","value":{"rev":"13-bae2f1b02ffcbb0e77bde6c33b566f80"}}, +{"id":"crontab","key":"crontab","value":{"rev":"36-14d26bf316289fb4841940eee2932f37"}}, +{"id":"crossroads","key":"crossroads","value":{"rev":"7-d73d51cde30f24caad91e6a3c5b420f2"}}, +{"id":"crowdflower","key":"crowdflower","value":{"rev":"3-16c2dfc9fd505f75068f75bd19e3d227"}}, +{"id":"cruvee","key":"cruvee","value":{"rev":"3-979ccf0286b1701e9e7483a10451d975"}}, +{"id":"crypt","key":"crypt","value":{"rev":"3-031b338129bebc3749b42fb3d442fc4b"}}, +{"id":"crypto","key":"crypto","value":{"rev":"3-66a444b64481c85987dd3f22c32e0630"}}, +{"id":"csj","key":"csj","value":{"rev":"3-bc3133c7a0a8827e89aa03897b81d177"}}, +{"id":"cson","key":"cson","value":{"rev":"7-3ac3e1e10572e74e58874cfe3200eb87"}}, +{"id":"csrf-express","key":"csrf-express","value":{"rev":"3-4cc36d88e8ad10b9c2cc8a7318f0abd3"}}, +{"id":"css-crawler","key":"css-crawler","value":{"rev":"13-4739c7bf1decc72d7682b53303f93ec6"}}, +{"id":"css-smasher","key":"css-smasher","value":{"rev":"3-631128f966135c97d648efa3eadf7bfb"}}, +{"id":"css-sourcery","key":"css-sourcery","value":{"rev":"3-571343da3a09af7de473d29ed7dd788b"}}, +{"id":"css2json","key":"css2json","value":{"rev":"5-fb6d84c1da4a9391fa05d782860fe7c4"}}, +{"id":"csskeeper","key":"csskeeper","value":{"rev":"5-ea667a572832ea515b044d4b87ea7d98"}}, +{"id":"csslike","key":"csslike","value":{"rev":"3-6e957cce81f6e790f8562526d907ad94"}}, +{"id":"csslint","key":"csslint","value":{"rev":"19-b1e973274a0a6b8eb81b4d715a249612"}}, +{"id":"cssmin","key":"cssmin","value":{"rev":"10-4bb4280ec56f110c43abe01189f95818"}}, +{"id":"csso","key":"csso","value":{"rev":"17-ccfe2a72d377919b07973bbb1d19b8f2"}}, +{"id":"cssom","key":"cssom","value":{"rev":"3-f96b884b63b4c04bac18b8d9c0a4c4cb"}}, +{"id":"cssp","key":"cssp","value":{"rev":"5-abf69f9ff99b7d0bf2731a5b5da0897c"}}, +{"id":"cssunminifier","key":"cssunminifier","value":{"rev":"3-7bb0c27006af682af92d1969fcb4fa73"}}, +{"id":"cssutils","key":"cssutils","value":{"rev":"3-4759f9db3b8eac0964e36f5229260526"}}, +{"id":"csv","key":"csv","value":{"rev":"21-0420554e9c08e001063cfb0a69a48255"}}, +{"id":"csv2mongo","key":"csv2mongo","value":{"rev":"9-373f11c05e5d1744c3187d9aaeaae0ab"}}, +{"id":"csvutils","key":"csvutils","value":{"rev":"15-84aa82e56b49cd425a059c8f0735a23c"}}, +{"id":"ctrlflow","key":"ctrlflow","value":{"rev":"33-0b817baf6c744dc17b83d5d8ab1ba74e"}}, +{"id":"ctrlflow_tests","key":"ctrlflow_tests","value":{"rev":"3-d9ed35503d27b0736c59669eecb4c4fe"}}, +{"id":"ctype","key":"ctype","value":{"rev":"9-c5cc231475f23a01682d0b1a3b6e49c2"}}, +{"id":"cube","key":"cube","value":{"rev":"5-40320a20d260e082f5c4ca508659b4d1"}}, +{"id":"cucumber","key":"cucumber","value":{"rev":"11-8489af0361b6981cf9001a0403815936"}}, +{"id":"cucumis","key":"cucumis","value":{"rev":"33-6dc38f1161fae3efa2a89c8288b6e040"}}, +{"id":"cucumis-rm","key":"cucumis-rm","value":{"rev":"3-6179249ad15166f8d77eb136b3fa87ca"}}, +{"id":"cupcake","key":"cupcake","value":{"rev":"15-1dd13a85415a366942e7f0a3de06aa2a"}}, +{"id":"curator","key":"curator","value":{"rev":"19-d798ab7fbca11ba0e9c6c40c0a2f9440"}}, +{"id":"curl","key":"curl","value":{"rev":"11-ac7143ac07c64ea169ba7d4e58be232a"}}, +{"id":"curly","key":"curly","value":{"rev":"30-0248a5563b6e96457315ad0cc2fe22c1"}}, +{"id":"curry","key":"curry","value":{"rev":"11-ce13fa80e84eb25d9cf76cf4162a634e"}}, +{"id":"cursory","key":"cursory","value":{"rev":"3-ea2f4b1b47caf38460402d1a565c18b8"}}, +{"id":"d-utils","key":"d-utils","value":{"rev":"37-699ad471caa28183d75c06f0f2aab41c"}}, +{"id":"d3","key":"d3","value":{"rev":"5-4d867844bd7dce21b34cd7283bb9cad4"}}, +{"id":"d3bench","key":"d3bench","value":{"rev":"3-617cc625bfd91c175d037bfcace9c4e9"}}, +{"id":"daemon","key":"daemon","value":{"rev":"11-8654f90bc609ca2c3ec260c7d6b7793e"}}, +{"id":"daemon-tools","key":"daemon-tools","value":{"rev":"18-8197fce2054de67925e6f2c3fa3cd90a"}}, +{"id":"daimyo","key":"daimyo","value":{"rev":"25-531b0b0afdc5ae3d41b4131da40af6cf"}}, +{"id":"daleth","key":"daleth","value":{"rev":"7-4824619205289ba237ef2a4dc1fba1ec"}}, +{"id":"dali","key":"dali","value":{"rev":"9-037c4c76f739ecb537a064c07d3c63e3"}}, +{"id":"damncomma","key":"damncomma","value":{"rev":"3-b1472eada01efb8a12d521e5a248834b"}}, +{"id":"dana","key":"dana","value":{"rev":"3-2a3c0ff58a6d13fedd17e1d192080e59"}}, +{"id":"dandy","key":"dandy","value":{"rev":"9-f4ae43659dd812a010b0333bf8e5a282"}}, +{"id":"dash","key":"dash","value":{"rev":"5-698513f86165f429a5f55320d5a700f0"}}, +{"id":"dash-fu","key":"dash-fu","value":{"rev":"3-848e99a544f9f78f311c7ebfc5a172c4"}}, +{"id":"dashboard","key":"dashboard","value":{"rev":"3-71844d1fc1140b7533f9e57740d2b666"}}, +{"id":"data","key":"data","value":{"rev":"23-b594e2bd1ffef1cda8b7e94dbf15ad5b"}}, +{"id":"data-layer","key":"data-layer","value":{"rev":"9-9205d35cc6eaf1067ee0cec1b421d749"}}, +{"id":"data-page","key":"data-page","value":{"rev":"3-d7a3346a788a0c07132e50585db11c99"}}, +{"id":"data-section","key":"data-section","value":{"rev":"9-d3fff313977667c53cbadb134d993412"}}, +{"id":"data-uuid","key":"data-uuid","value":{"rev":"8-24001fe9f37c4cc7ac01079ee4767363"}}, +{"id":"data-visitor","key":"data-visitor","value":{"rev":"6-7fe5da9d118fab27157dba97050c6487"}}, +{"id":"database-cleaner","key":"database-cleaner","value":{"rev":"19-4bdfc8b324e95e6da9f72e7b7b708b98"}}, +{"id":"datapool","key":"datapool","value":{"rev":"3-f99c93ca812d2f4725bbaea99122832c"}}, +{"id":"datasift","key":"datasift","value":{"rev":"3-6de3ae25c9a99f651101e191595bcf64"}}, +{"id":"date","key":"date","value":{"rev":"9-b334fc6450d093de40a664a4a835cfc4"}}, +{"id":"date-utils","key":"date-utils","value":{"rev":"31-7be8fcf1919564a8fb7223a86a5954ac"}}, +{"id":"dateformat","key":"dateformat","value":{"rev":"11-5b924e1d29056a0ef9b89b9d7984d5c4"}}, +{"id":"dateformatjs","key":"dateformatjs","value":{"rev":"3-4c50a38ecc493535ee2570a838673937"}}, +{"id":"datejs","key":"datejs","value":{"rev":"5-f47e3e6532817f822aa910b59a45717c"}}, +{"id":"dateselect","key":"dateselect","value":{"rev":"3-ce58def02fd8c8feda8c6f2004726f97"}}, +{"id":"datetime","key":"datetime","value":{"rev":"7-14227b0677eb93b8eb519db47f46bf36"}}, +{"id":"db","key":"db","value":{"rev":"3-636e9ea922a85c92bc11aa9691a2e67f"}}, +{"id":"db-drizzle","key":"db-drizzle","value":{"rev":"157-955f74f49ac4236df317e227c08afaa3"}}, +{"id":"db-mysql","key":"db-mysql","value":{"rev":"224-e596a18d9af33ff1fbcf085a9f4f56fd"}}, +{"id":"db-oracle","key":"db-oracle","value":{"rev":"13-a1e2924d87b4badfddeccf6581525b08"}}, +{"id":"dcrypt","key":"dcrypt","value":{"rev":"29-a144a609bef5004781df901440d67b2d"}}, +{"id":"decafscript","key":"decafscript","value":{"rev":"3-f3a239dc7d503c900fc9854603d716e6"}}, +{"id":"decimal","key":"decimal","value":{"rev":"3-614ed56d4d6c5eb7883d8fd215705a12"}}, +{"id":"decimaljson","key":"decimaljson","value":{"rev":"9-7cb23f4b2b1168b1a213f1eefc85fa51"}}, +{"id":"deck","key":"deck","value":{"rev":"7-da422df97f13c7d84e8f3690c1e1ca32"}}, +{"id":"deckard","key":"deckard","value":{"rev":"3-85e0cd76cdd88ff60a617239060d6f46"}}, +{"id":"deckem","key":"deckem","value":{"rev":"9-03ca75ea35960ccd5779b4cfa8cfb9f9"}}, +{"id":"defensio","key":"defensio","value":{"rev":"5-0ad0ae70b4e184626d914cc4005ee34c"}}, +{"id":"defer","key":"defer","value":{"rev":"3-8d003c96f4263a26b7955e251cddbd95"}}, +{"id":"deferrable","key":"deferrable","value":{"rev":"8-3ae57ce4391105962d09ad619d4c4670"}}, +{"id":"deferred","key":"deferred","value":{"rev":"17-9cee7948dbdf7b6dcc00bbdc60041dd0"}}, +{"id":"define","key":"define","value":{"rev":"45-9d422f2ac5ab693f881df85898d68e3a"}}, +{"id":"deflate","key":"deflate","value":{"rev":"10-3ebe2b87e09f4ae51857cae02e1af788"}}, +{"id":"degrees","key":"degrees","value":{"rev":"5-707c57cfa3e589e8059fe9860cc0c10b"}}, +{"id":"deimos","key":"deimos","value":{"rev":"11-6481696be774d14254fe7c427107dc2a"}}, +{"id":"deja","key":"deja","value":{"rev":"47-bde4457402db895aad46198433842668"}}, +{"id":"delayed-stream","key":"delayed-stream","value":{"rev":"13-f6ca393b08582350f78c5c66f183489b"}}, +{"id":"delegator","key":"delegator","value":{"rev":"3-650651749c1df44ef544c919fae74f82"}}, +{"id":"dep-graph","key":"dep-graph","value":{"rev":"3-e404af87822756da52754e2cc5c576b1"}}, +{"id":"dependency-promise","key":"dependency-promise","value":{"rev":"11-1cc2be8465d736ec8f3cc8940ab22823"}}, +{"id":"depends","key":"depends","value":{"rev":"30-adc9604bbd8117592f82eee923d8703e"}}, +{"id":"deploy","key":"deploy","value":{"rev":"3-82020957528bd0bdd675bed9ac4e4cc5"}}, +{"id":"deployjs","key":"deployjs","value":{"rev":"5-a3e99a5ed81d4b1ad44b6477e6a5a985"}}, +{"id":"deputy-client","key":"deputy-client","value":{"rev":"3-31fd224b301ec0f073df7afa790050ec"}}, +{"id":"deputy-server","key":"deputy-server","value":{"rev":"3-0d790cce82aadfd2b8f39a6b056f2792"}}, +{"id":"derby","key":"derby","value":{"rev":"40-b642048a1a639d77ab139160a4da0fd2"}}, +{"id":"des","key":"des","value":{"rev":"24-fcbdc086e657aef356b75433b3e65ab6"}}, +{"id":"descent","key":"descent","value":{"rev":"7-9cc259b25fc688597fc7efaa516d03c6"}}, +{"id":"describe","key":"describe","value":{"rev":"6-788c7f2feaf2e88f4b1179976b273744"}}, +{"id":"deserver","key":"deserver","value":{"rev":"5-da8083694e89b8434123fe7482a3cc7e"}}, +{"id":"detect","key":"detect","value":{"rev":"3-c27f258d39d7905c2b92383809bb5988"}}, +{"id":"detective","key":"detective","value":{"rev":"9-d6cfa0c6389783cdc9c9ffa9e4082c64"}}, +{"id":"dev","key":"dev","value":{"rev":"23-5c2ce4a4f6a4f24d3cff3b7db997d8bc"}}, +{"id":"dev-warnings","key":"dev-warnings","value":{"rev":"5-5a7d7f36d09893df96441be8b09e41d6"}}, +{"id":"dhcpjs","key":"dhcpjs","value":{"rev":"3-1bc01bd612f3ab1fce178c979aa34e43"}}, +{"id":"dht","key":"dht","value":{"rev":"3-40c0b909b6c0e2305e19d10cea1881b0"}}, +{"id":"dht-bencode","key":"dht-bencode","value":{"rev":"5-88a1da8de312a54097507d72a049f0f3"}}, +{"id":"dialect","key":"dialect","value":{"rev":"18-db7928ce4756eea35db1732d4f2ebc88"}}, +{"id":"dialect-http","key":"dialect-http","value":{"rev":"19-23a927d28cb43733dbd05294134a5b8c"}}, +{"id":"dicks","key":"dicks","value":{"rev":"11-ba64897899e336d366ffd4b68cac99f5"}}, +{"id":"diff","key":"diff","value":{"rev":"13-1a88acb0369ab8ae096a2323d65a2811"}}, +{"id":"diff_match_patch","key":"diff_match_patch","value":{"rev":"8-2f6f467e483b23b217a2047e4aded850"}}, +{"id":"diffbot","key":"diffbot","value":{"rev":"3-8cb8e34af89cb477a5da52e3fd9a13f7"}}, +{"id":"digest","key":"digest","value":{"rev":"7-bc6fb9e68c83197381b0d9ac7db16c1c"}}, +{"id":"dir","key":"dir","value":{"rev":"7-574462bb241a39eeffe6c5184d40c57a"}}, +{"id":"dir-watcher","key":"dir-watcher","value":{"rev":"31-1a3ca4d6aa8aa32c619efad5fbfce494"}}, +{"id":"dir2html","key":"dir2html","value":{"rev":"5-b4bfb2916c2d94c85aa75ffa29ad1af4"}}, +{"id":"directive","key":"directive","value":{"rev":"3-3373f02b8762cb1505c8f8cbcc50d3d4"}}, +{"id":"dirsum","key":"dirsum","value":{"rev":"5-8545445faaa41d2225ec7ff226a10750"}}, +{"id":"dirty","key":"dirty","value":{"rev":"13-d636ea0d1ed35560c0bc7272965c1a6f"}}, +{"id":"dirty-uuid","key":"dirty-uuid","value":{"rev":"5-65acdfda886afca65ae52f0ac21ce1b2"}}, +{"id":"discogs","key":"discogs","value":{"rev":"21-839410e6bf3bee1435ff837daaeaf9f8"}}, +{"id":"discount","key":"discount","value":{"rev":"13-a8fb2a8f668ac0a55fffada1ea94a4b7"}}, +{"id":"discovery","key":"discovery","value":{"rev":"3-46f4496224d132e56cbc702df403219d"}}, +{"id":"diskcache","key":"diskcache","value":{"rev":"23-7b14ad41fc199184fb939828e9122099"}}, +{"id":"dispatch","key":"dispatch","value":{"rev":"6-e72cc7b2bcc97faf897ae4e4fa3ec681"}}, +{"id":"distribute.it","key":"distribute.it","value":{"rev":"12-0978757eb25d22117af675806cf6eef2"}}, +{"id":"dive","key":"dive","value":{"rev":"21-9cbd1281c5a3c2dae0cc0407863f3336"}}, +{"id":"diveSync","key":"diveSync","value":{"rev":"3-015ec4803903106bf24cb4f17cedee68"}}, +{"id":"dk-assets","key":"dk-assets","value":{"rev":"3-25d9b6ac727caf1e227e6436af835d03"}}, +{"id":"dk-core","key":"dk-core","value":{"rev":"3-0b6a2f4dfc0484a3908159a897920bae"}}, +{"id":"dk-couchdb","key":"dk-couchdb","value":{"rev":"3-cc9ef511f9ed46be9d7099f10b1ee776"}}, +{"id":"dk-model","key":"dk-model","value":{"rev":"3-3a61006be57d304724c049e4dcf2fc9b"}}, +{"id":"dk-model-couchdb","key":"dk-model-couchdb","value":{"rev":"3-5163def21660db8428e623909bbfcb4d"}}, +{"id":"dk-routes","key":"dk-routes","value":{"rev":"3-4563357f850248d7d0fb37f9bdcb893b"}}, +{"id":"dk-server","key":"dk-server","value":{"rev":"3-9aef13fc5814785c9805b26828e8d114"}}, +{"id":"dk-template","key":"dk-template","value":{"rev":"3-809c94776252441129705fbe1d93e752"}}, +{"id":"dk-transport","key":"dk-transport","value":{"rev":"3-9271da6f86079027535179b743d0d4c3"}}, +{"id":"dk-websockets","key":"dk-websockets","value":{"rev":"3-426b44c04180d6caf7cf765f03fc52c2"}}, +{"id":"dnet-index-proxy","key":"dnet-index-proxy","value":{"rev":"51-1f3cf4f534c154369d5e774a8f599106"}}, +{"id":"dnode","key":"dnode","value":{"rev":"129-68db10c25c23d635dc828aa698d1279e"}}, +{"id":"dnode-ez","key":"dnode-ez","value":{"rev":"17-75877eab5cf3976b8876c49afd2f7e38"}}, +{"id":"dnode-protocol","key":"dnode-protocol","value":{"rev":"23-fb28f8e1180e6aa44fa564e0d55b3d1e"}}, +{"id":"dnode-smoothiecharts","key":"dnode-smoothiecharts","value":{"rev":"3-d1483028e5768527c2786b9ed5d76463"}}, +{"id":"dnode-stack","key":"dnode-stack","value":{"rev":"9-c1ad8ce01282ce4fa72b5993c580e58e"}}, +{"id":"dnode-worker","key":"dnode-worker","value":{"rev":"3-4c73c0d7ed225197fd8fb0555eaf1152"}}, +{"id":"dns-server","key":"dns-server","value":{"rev":"3-4858a1773da514fea68eac6d9d39f69e"}}, +{"id":"dns-srv","key":"dns-srv","value":{"rev":"12-867c769437fa0ad8a83306aa9e2a158e"}}, +{"id":"doc","key":"doc","value":{"rev":"5-2c077b3fd3b6efa4e927b66f1390e4ea"}}, +{"id":"doc.md","key":"doc.md","value":{"rev":"7-8e8e51be4956550388699222b2e039e7"}}, +{"id":"docco","key":"docco","value":{"rev":"18-891bde1584809c3b1f40fef9961b4f28"}}, +{"id":"docdown","key":"docdown","value":{"rev":"5-fcf5be2ab6ceaed76c1980b462359057"}}, +{"id":"docket","key":"docket","value":{"rev":"13-a4969e0fb17af8dba7df178e364161c2"}}, +{"id":"docpad","key":"docpad","value":{"rev":"77-a478ac8c7ac86e304f9213380ea4b550"}}, +{"id":"docs","key":"docs","value":{"rev":"3-6b1fae9738a3327a3a3be826c0981c3a"}}, +{"id":"dojo-node","key":"dojo-node","value":{"rev":"13-e0dc12e9ce8ab3f40b228c2af8c41064"}}, +{"id":"dom","key":"dom","value":{"rev":"3-cecd9285d0d5b1cab0f18350aac1b2b0"}}, +{"id":"dom-js","key":"dom-js","value":{"rev":"8-dd20e8b23028f4541668501650b52a71"}}, +{"id":"dom-js-ns","key":"dom-js-ns","value":{"rev":"3-787567fc1d6f4ca7e853215a4307b593"}}, +{"id":"domjs","key":"domjs","value":{"rev":"3-d2d05a20dccb57fb6db7da08916c6c0f"}}, +{"id":"doml","key":"doml","value":{"rev":"11-c3b49c50906d9875b546413e4acd1b38"}}, +{"id":"domo","key":"domo","value":{"rev":"3-a4321e6c0c688f773068365b44b08b6b"}}, +{"id":"domready","key":"domready","value":{"rev":"46-21c6b137bbed79ddbff31fdf0ef7d61f"}}, +{"id":"donkey","key":"donkey","value":{"rev":"3-1454aa878654886e8495ebb060aa10f7"}}, +{"id":"dot","key":"dot","value":{"rev":"19-b6d2d53cb9ae1a608a0956aeb8092578"}}, +{"id":"dotaccess","key":"dotaccess","value":{"rev":"13-63ddef6740e84f4517f7dd1bb0d68c56"}}, +{"id":"douche","key":"douche","value":{"rev":"3-6a200f908ccfc9ae549e80209e117cbf"}}, +{"id":"dox","key":"dox","value":{"rev":"10-856cc6bf3dc7c44e028173fea8323c24"}}, +{"id":"drag","key":"drag","value":{"rev":"9-00f27e241269c3df1d71e45b698e9b3b"}}, +{"id":"drain","key":"drain","value":{"rev":"3-8827a0ee7ed74b948bf56d5a33455fc8"}}, +{"id":"drawback","key":"drawback","value":{"rev":"74-dd356b3e55175525317e53c24979a431"}}, +{"id":"drev","key":"drev","value":{"rev":"9-43529419a69529dd7af9a83985aab1f2"}}, +{"id":"drews-mixins","key":"drews-mixins","value":{"rev":"17-63373bae6525859bddfc8d6ad19bdb06"}}, +{"id":"drnu","key":"drnu","value":{"rev":"3-b9b14b2241ded1e52a92fc4225b4ddc5"}}, +{"id":"dropbox","key":"dropbox","value":{"rev":"19-2cb7a40d253621fdfa96f23b96e42ecb"}}, +{"id":"drtoms-nodehelpers","key":"drtoms-nodehelpers","value":{"rev":"3-be0a75cdd7c2d49b1ec4ad1d2c3bc911"}}, +{"id":"drty","key":"drty","value":{"rev":"3-56eabd39b9badfa0af601c5cc64cee2c"}}, +{"id":"drty-facebook","key":"drty-facebook","value":{"rev":"3-fd07af7fb87d7f1d35e13f458a02c127"}}, +{"id":"drumkit","key":"drumkit","value":{"rev":"3-f3cdacef51453d3ac630759aff2a8b58"}}, +{"id":"drupal","key":"drupal","value":{"rev":"13-13835b1e1c8a0e8f0b0e8479640a8d7e"}}, +{"id":"dryice","key":"dryice","value":{"rev":"15-9990fdbde5475a8dbdcc055cb08d654d"}}, +{"id":"dryml","key":"dryml","value":{"rev":"33-483ff8cc3ab1431790cc2587c0bce989"}}, +{"id":"ds","key":"ds","value":{"rev":"9-743274a1d0143927851af07ff0f86d8d"}}, +{"id":"dt","key":"dt","value":{"rev":"3-ab59016f28e182c763b78ba49a59191c"}}, +{"id":"dtl","key":"dtl","value":{"rev":"11-415b4aeec93f096523569615e80f1be1"}}, +{"id":"dtrace-provider","key":"dtrace-provider","value":{"rev":"12-7f01510bd2b1d543f11e3dc02d98ab69"}}, +{"id":"dtrejo","key":"dtrejo","value":{"rev":"3-85f5bb2b9faec499e6aa77fe22e6e3ec"}}, +{"id":"dude","key":"dude","value":{"rev":"3-006528c1efd98312991273ba6ee45f7b"}}, +{"id":"dunce","key":"dunce","value":{"rev":"3-fa4fa5cafdfd1d86c650746f60b7bc0e"}}, +{"id":"duostack","key":"duostack","value":{"rev":"15-47824bdf6e32f49f64014e75421dc42e"}}, +{"id":"duplex-stream","key":"duplex-stream","value":{"rev":"3-2d0e12876e7ad4e5d3ea5520dcbad861"}}, +{"id":"durilka","key":"durilka","value":{"rev":"15-54400496515c8625e8bedf19f8a41cad"}}, +{"id":"dust","key":"dust","value":{"rev":"18-9bc9cae2e48c54f4389e9fce5dfc021e"}}, +{"id":"dustfs","key":"dustfs","value":{"rev":"5-944770c24f06989f3fc62427f2ddebc4"}}, +{"id":"dx","key":"dx","value":{"rev":"3-6000afd60be07d9ff91e7231a388f22f"}}, +{"id":"dynamic","key":"dynamic","value":{"rev":"3-33b83464ed56eb33c052a13dfb709c9c"}}, +{"id":"dynobj","key":"dynobj","value":{"rev":"5-3eb168dae1f9c20369fa1d5ae45f9021"}}, +{"id":"each","key":"each","value":{"rev":"3-5063799b0afcbb61378b1d605660a864"}}, +{"id":"ears","key":"ears","value":{"rev":"11-e77cd2b865409be7ba2e072e98b1c8a1"}}, +{"id":"easey","key":"easey","value":{"rev":"3-a380d8d945e03f55732ae8769cd6dbbf"}}, +{"id":"easy","key":"easy","value":{"rev":"3-73b836a34beafa31cdd8129fe158bf6e"}}, +{"id":"easy-oauth","key":"easy-oauth","value":{"rev":"5-2c1db698e61d77f99633042113099528"}}, +{"id":"easyfs","key":"easyfs","value":{"rev":"3-b807671a77c2a8cc27a9f1aa20ff74c0"}}, +{"id":"easyhash","key":"easyhash","value":{"rev":"3-2eeb24098bc4d201766dcc92dc7325f7"}}, +{"id":"easyrss","key":"easyrss","value":{"rev":"9-1687a54348670ef9ca387ea7ec87f0be"}}, +{"id":"ebnf-diagram","key":"ebnf-diagram","value":{"rev":"3-704e4605bf933b281a6821259a531055"}}, +{"id":"ec2","key":"ec2","value":{"rev":"22-25e562ae8898807c7b4c696c809cf387"}}, +{"id":"echo","key":"echo","value":{"rev":"19-75c2421f623ecc9fe2771f3658589ce8"}}, +{"id":"eco","key":"eco","value":{"rev":"14-b4db836928c91cbf22628cc65ca94f56"}}, +{"id":"ed","key":"ed","value":{"rev":"3-bed9b8225e83a02241d48254077a7df4"}}, +{"id":"edate","key":"edate","value":{"rev":"3-5ec1441ffe3b56d5d01561003b9844f2"}}, +{"id":"eden","key":"eden","value":{"rev":"35-9aa2ff880c2d4f45e3da881b15e58d0a"}}, +{"id":"eio","key":"eio","value":{"rev":"5-e6dd895635596d826ccdf4439761d5fa"}}, +{"id":"ejs","key":"ejs","value":{"rev":"30-c7b020b6cb8ee2626f47db21fc5fedb4"}}, +{"id":"ejs-ext","key":"ejs-ext","value":{"rev":"15-820393685191bbed37938acb7af5885e"}}, +{"id":"elastical","key":"elastical","value":{"rev":"3-c652af043bc4256a29a87e3de9b78093"}}, +{"id":"elasticsearchclient","key":"elasticsearchclient","value":{"rev":"33-bcb59deb7d9d56737a6946c56830ae6b"}}, +{"id":"elastiseahclient","key":"elastiseahclient","value":{"rev":"3-c4e525605859e249f04fb07d31739002"}}, +{"id":"elementtree","key":"elementtree","value":{"rev":"3-ef2017fe67ae425253de911c2f219d31"}}, +{"id":"elf-logger","key":"elf-logger","value":{"rev":"6-98d61588cfc171611568cf86004aa2e1"}}, +{"id":"elk","key":"elk","value":{"rev":"25-8b92241d0218c6593a7dc8a8cc69b7ce"}}, +{"id":"elucidata-build-tools","key":"elucidata-build-tools","value":{"rev":"7-0ad3de708aaac2eebfcfce273bfe6edf"}}, +{"id":"email","key":"email","value":{"rev":"16-110ae6a99ab3e37f4edd9357c03d78c2"}}, +{"id":"email-verificationtoken","key":"email-verificationtoken","value":{"rev":"7-ef37672bc6e9ee806ecc22fd5257ae03"}}, +{"id":"emailjs","key":"emailjs","value":{"rev":"31-0dd24f9aba8d96e9493e55e8345f3d21"}}, +{"id":"embedly","key":"embedly","value":{"rev":"21-47838d8015e9b927c56a7bd52c52e4fc"}}, +{"id":"emile","key":"emile","value":{"rev":"11-05d4715964b5bf2e1fd98096cb7ccc83"}}, +{"id":"emit.io","key":"emit.io","value":{"rev":"3-faacb1c30bb92c06a55a44bb027a9475"}}, +{"id":"emre","key":"emre","value":{"rev":"3-5686f4782f1f5171fff83b662ce68802"}}, +{"id":"encrypt","key":"encrypt","value":{"rev":"3-77e2e2007b452f7fcdfa9e8696a188f5"}}, +{"id":"ender","key":"ender","value":{"rev":"95-89b8c6ccfcaf3eb56f5dbe48bf3c2e24"}}, +{"id":"ender-dragdealer","key":"ender-dragdealer","value":{"rev":"9-e12bb3492614f20fe5781f20e3bb17dc"}}, +{"id":"ender-fermata","key":"ender-fermata","value":{"rev":"3-e52d772042852408ae070b361c247068"}}, +{"id":"ender-fittext","key":"ender-fittext","value":{"rev":"5-e46f5a384d790ea6f65a5f8b9e43bac6"}}, +{"id":"ender-flowplayer","key":"ender-flowplayer","value":{"rev":"3-87267072fb566112315254fdf6547500"}}, +{"id":"ender-js","key":"ender-js","value":{"rev":"80-aa18576f782e3aa14c2ba7ba05658a30"}}, +{"id":"ender-json","key":"ender-json","value":{"rev":"3-5606608389aef832e4d4ecaa6c088a94"}}, +{"id":"ender-lettering","key":"ender-lettering","value":{"rev":"3-6fc6ad3869fad6374a1de69ba4e9301d"}}, +{"id":"ender-modules","key":"ender-modules","value":{"rev":"5-2bbb354d6219b5e13e6c897c562b8c83"}}, +{"id":"ender-poke","key":"ender-poke","value":{"rev":"5-3afa2fd690ebc4f2d75125b2c57e2a43"}}, +{"id":"ender-test","key":"ender-test","value":{"rev":"5-f8e90a951e5ad58199e53645067fad0c"}}, +{"id":"ender-tipsy","key":"ender-tipsy","value":{"rev":"5-cefd04c5d89707dfe31023702328d417"}}, +{"id":"ender-tween","key":"ender-tween","value":{"rev":"13-035312bb47bb3d29e7157932d4d29dcb"}}, +{"id":"ender-vows","key":"ender-vows","value":{"rev":"5-d48e088816d71779a80a74c43cd61b80"}}, +{"id":"ender-wallet","key":"ender-wallet","value":{"rev":"21-93723cd24fbf14d0f58f2ee41df9910d"}}, +{"id":"endtable","key":"endtable","value":{"rev":"36-8febf1be0120d867f9ff90e5c5058ef9"}}, +{"id":"enhance-css","key":"enhance-css","value":{"rev":"7-ae1cf6dee7d3116103781edaa7d47ba4"}}, +{"id":"ensure","key":"ensure","value":{"rev":"27-47e0874d1823188965a02a41abb61739"}}, +{"id":"ent","key":"ent","value":{"rev":"9-51924cd76fabcc4a244db66d65d48eff"}}, +{"id":"entropy","key":"entropy","value":{"rev":"17-84bfbbc0689b3b55e4fa3881888f0c12"}}, +{"id":"enumerable","key":"enumerable","value":{"rev":"3-d31bfcaca3b53eacc9ce09983efffe35"}}, +{"id":"envious","key":"envious","value":{"rev":"3-08d1e6d9c25c4e2350a0dd6759a27426"}}, +{"id":"environ","key":"environ","value":{"rev":"5-6f78def4743dfbeb77c1cb62d41eb671"}}, +{"id":"epub","key":"epub","value":{"rev":"3-5c3604eab851bce0a6ac66db6a6ce77a"}}, +{"id":"erlang","key":"erlang","value":{"rev":"3-3bd8e8e8ed416a32567475d984028b65"}}, +{"id":"err","key":"err","value":{"rev":"11-61d11f26b47d29ef819136214830f24c"}}, +{"id":"errbacker","key":"errbacker","value":{"rev":"5-0ad6d62207abb9822118ae69d0b9181d"}}, +{"id":"es5","key":"es5","value":{"rev":"3-5497cb0c821f3e17234c09ab0e67e1de"}}, +{"id":"es5-basic","key":"es5-basic","value":{"rev":"9-2ff708ae54ae223923cb810f799bfb2d"}}, +{"id":"es5-ext","key":"es5-ext","value":{"rev":"21-04537d704412a631596beeba4d534b33"}}, +{"id":"es5-shim","key":"es5-shim","value":{"rev":"34-3c4c40a6dab9ff137d1a7d4349d72c5b"}}, +{"id":"es5-shimify","key":"es5-shimify","value":{"rev":"3-f85700407e9c129d22b45c15700c82f1"}}, +{"id":"esc","key":"esc","value":{"rev":"5-42911775f391330f361105b8a0cefe47"}}, +{"id":"escaperoute","key":"escaperoute","value":{"rev":"18-e1372f35e6dcdb353b8c11e3c7e2f3b4"}}, +{"id":"escort","key":"escort","value":{"rev":"27-bf43341e15d565c9f67dd3300dc57734"}}, +{"id":"escrito","key":"escrito","value":{"rev":"5-c39d5b373486327b2e13670f921a2c7b"}}, +{"id":"esl","key":"esl","value":{"rev":"9-562ff6239a3b9910989bdf04746fa9d1"}}, +{"id":"espresso","key":"espresso","value":{"rev":"75-4c3692f1e92ea841e2d04338f4f2432e"}}, +{"id":"esproxy","key":"esproxy","value":{"rev":"7-be629dc6e1428f0fdb22fdbe7ab2ee99"}}, +{"id":"etch-a-sketch","key":"etch-a-sketch","value":{"rev":"3-a4e23b8e9f298d4844d6bff0a9688e53"}}, +{"id":"etherpad-lite-client","key":"etherpad-lite-client","value":{"rev":"55-58ca439a697db64ee66652da2d327fcb"}}, +{"id":"etsy","key":"etsy","value":{"rev":"5-1b795b360c28261f11c07d849637047c"}}, +{"id":"eve","key":"eve","value":{"rev":"3-16e72b336a1f354f4dfc8fa783fa2e72"}}, +{"id":"event-emitter","key":"event-emitter","value":{"rev":"5-15fe3e2e19b206929b815909737b15ac"}}, +{"id":"event-queue","key":"event-queue","value":{"rev":"12-200cd3bcd8e0b35bc4b15c1d8b6161e2"}}, +{"id":"event-stream","key":"event-stream","value":{"rev":"15-811a6329b5820d998731a604accf83db"}}, +{"id":"eventable","key":"eventable","value":{"rev":"3-08e9cd94a9aae280f406d043039e545e"}}, +{"id":"eventbrite","key":"eventbrite","value":{"rev":"13-cac3c9bda2da1c7b115de04264bb440f"}}, +{"id":"evented","key":"evented","value":{"rev":"6-ade6271c40a19aab6c4e3bb18b0987b6"}}, +{"id":"evented-twitter","key":"evented-twitter","value":{"rev":"6-3ebb7327022d6d6a8c49d684febb236b"}}, +{"id":"eventedsocket","key":"eventedsocket","value":{"rev":"59-cd2158c47b676a58ca3064a42c5274f7"}}, +{"id":"eventemitter","key":"eventemitter","value":{"rev":"5-7766fd7ebc44d52efbd0e7088e2321ec"}}, +{"id":"eventemitter2","key":"eventemitter2","value":{"rev":"41-927ce7996d4056a21f543e1f928f9699"}}, +{"id":"eventful","key":"eventful","value":{"rev":"7-9505f3c621f50addf02a457cfcc8ae78"}}, +{"id":"eventhub","key":"eventhub","value":{"rev":"15-5390d210a4d3ba079dd6e26bda652caa"}}, +{"id":"eventpipe","key":"eventpipe","value":{"rev":"7-41f0f93a9dcea477f08782af28e5b0f1"}}, +{"id":"events","key":"events","value":{"rev":"12-e3ead8eac62799cb299c139687135289"}}, +{"id":"events.io","key":"events.io","value":{"rev":"3-56c6955024cbb1765a1f9f37d8a739a4"}}, +{"id":"events.node","key":"events.node","value":{"rev":"3-e072f9c457fd8a3882ccd41ce52c5d00"}}, +{"id":"eventstream","key":"eventstream","value":{"rev":"5-a578a3a2a62d50631b3fb4d44a058bd1"}}, +{"id":"eventvat","key":"eventvat","value":{"rev":"3-e26d7fe8a226c7bc7f9e55abf1630e9c"}}, +{"id":"everyauth","key":"everyauth","value":{"rev":"107-a621f3028a230f9f3ade6a4e729a9a38"}}, +{"id":"ewdDOM","key":"ewdDOM","value":{"rev":"7-28188ec27fe011bf7fcb330a5fc90b55"}}, +{"id":"ewdGateway","key":"ewdGateway","value":{"rev":"7-81fe5ec1a3e920894b560fbf96160258"}}, +{"id":"exceptional","key":"exceptional","value":{"rev":"5-5842d306b2cf084c4e7c2ecb1d715280"}}, +{"id":"exceptional-node","key":"exceptional-node","value":{"rev":"5-3385b42af0a6ea8a943cb686d5789b0c"}}, +{"id":"executor","key":"executor","value":{"rev":"3-aee4f949a4d140a439965e137200c4fb"}}, +{"id":"exif","key":"exif","value":{"rev":"3-da6fd2bd837633f673b325231c164a0f"}}, +{"id":"expanda","key":"expanda","value":{"rev":"3-dcbc59c5db0017d25748ec8094aeeb0a"}}, +{"id":"express","key":"express","value":{"rev":"157-24ef0cdd4ba6c6697c66f3e78bc777bb"}}, +{"id":"express-aid","key":"express-aid","value":{"rev":"21-6d3831e93b823f800e6a22eb08aa41d6"}}, +{"id":"express-app-bootstrap","key":"express-app-bootstrap","value":{"rev":"3-4b5a256bef5ca3bd41b0958f594907b9"}}, +{"id":"express-asset","key":"express-asset","value":{"rev":"3-7d5e23bc753851c576e429e7901301d9"}}, +{"id":"express-blocks","key":"express-blocks","value":{"rev":"7-305b6e046355c8e7a4bb0f1f225092ef"}}, +{"id":"express-cache","key":"express-cache","value":{"rev":"5-eebbea6c0e5db5fd4c12847933c853e1"}}, +{"id":"express-chromeframe","key":"express-chromeframe","value":{"rev":"5-1bb72d30b7a1f00d3eaf248285942d5e"}}, +{"id":"express-coffee","key":"express-coffee","value":{"rev":"39-14eff195c9352c6c3898befb3d613807"}}, +{"id":"express-config","key":"express-config","value":{"rev":"3-27ea0d27e20afa9ece375878aab846ed"}}, +{"id":"express-configure","key":"express-configure","value":{"rev":"7-46bd636c0b56dfcfa4f1ee46b43d6ca0"}}, +{"id":"express-contrib","key":"express-contrib","value":{"rev":"20-472c93fefe0a9a6440a76b2c843b2e0e"}}, +{"id":"express-controllers","key":"express-controllers","value":{"rev":"3-296d54f3b5bf26bfa057cd8c5f0a11ea"}}, +{"id":"express-controllers-new","key":"express-controllers-new","value":{"rev":"15-11f73e4a8ab935987a3b8f132d80afa5"}}, +{"id":"express-cross-site","key":"express-cross-site","value":{"rev":"11-b76814fdd58a616b3cafe6e97f3c7c98"}}, +{"id":"express-csrf","key":"express-csrf","value":{"rev":"20-2a79f0fdc65ed91120e7417a5cf8ce6c"}}, +{"id":"express-custom-errors","key":"express-custom-errors","value":{"rev":"6-bd131169ccac73fa3766195147e34404"}}, +{"id":"express-dialect","key":"express-dialect","value":{"rev":"34-1fbc5baf7ea464abbadcfaf3c1971660"}}, +{"id":"express-dust","key":"express-dust","value":{"rev":"5-33a1d8dd9c113d6fb8f1818c8a749c1b"}}, +{"id":"express-expose","key":"express-expose","value":{"rev":"7-f8757d8bf8d3fac8395ee8ce5117a895"}}, +{"id":"express-extras","key":"express-extras","value":{"rev":"6-53c7bfc68a41043eb5e11321673a2c48"}}, +{"id":"express-form","key":"express-form","value":{"rev":"27-533598a1bd5a0e9b8d694f5b38228c6c"}}, +{"id":"express-helpers","key":"express-helpers","value":{"rev":"3-7b9123b0ea6b840bb5a6e4da9c28308c"}}, +{"id":"express-livejade","key":"express-livejade","value":{"rev":"9-1320996d4ed3db352a2c853226880a17"}}, +{"id":"express-logger","key":"express-logger","value":{"rev":"5-c485b1020742310a313cac87abdde67b"}}, +{"id":"express-messages","key":"express-messages","value":{"rev":"5-f6225b906d0ac33ba1bfc5409b227edb"}}, +{"id":"express-messages-bootstrap","key":"express-messages-bootstrap","value":{"rev":"5-fb8fc70c1cbd6df0e07b2e0148bdf8bf"}}, +{"id":"express-mongoose","key":"express-mongoose","value":{"rev":"29-2d6907a23c8c3bbfdf9b6f9b6b3c00e3"}}, +{"id":"express-mvc-bootstrap","key":"express-mvc-bootstrap","value":{"rev":"15-c53ecb696af1d34ff94efe5ab5d89287"}}, +{"id":"express-namespace","key":"express-namespace","value":{"rev":"7-d209feb707821b06426aed233295df75"}}, +{"id":"express-on-railway","key":"express-on-railway","value":{"rev":"7-784b533cbf29930d04039bafb2c03cc0"}}, +{"id":"express-params","key":"express-params","value":{"rev":"3-13f0ed9c17d10fd01d1ff869e625c91f"}}, +{"id":"express-resource","key":"express-resource","value":{"rev":"13-cca556327152588a87112c6bf2613bc9"}}, +{"id":"express-rewrite","key":"express-rewrite","value":{"rev":"7-c76ca2616eb6e70209ace6499f5b961a"}}, +{"id":"express-route-util","key":"express-route-util","value":{"rev":"9-4b7bad7e8ab3bf71daf85362b47ec8be"}}, +{"id":"express-rpx","key":"express-rpx","value":{"rev":"9-54d48f5e24174500c73f07d97a7d3f9f"}}, +{"id":"express-session-mongo","key":"express-session-mongo","value":{"rev":"3-850cf5b42f65a6f27af6edf1ad1aa966"}}, +{"id":"express-session-mongo-russp","key":"express-session-mongo-russp","value":{"rev":"7-441e8afcd466a4cbb5e65a1949190f97"}}, +{"id":"express-session-redis","key":"express-session-redis","value":{"rev":"6-5f4f16092a0706d2daef89470d6971e6"}}, +{"id":"express-share","key":"express-share","value":{"rev":"5-f5327a97738e9c8e6e05a51cb7153f82"}}, +{"id":"express-spdy","key":"express-spdy","value":{"rev":"11-2634f388338c45b2d6f020d2a6739ba1"}}, +{"id":"express-template-override","key":"express-template-override","value":{"rev":"5-758cf2eb0c9cbc32f205c4ba2ece24f9"}}, +{"id":"express-trace","key":"express-trace","value":{"rev":"5-ba59571f8881e02e2b297ed9ffb4e48c"}}, +{"id":"express-unstable","key":"express-unstable","value":{"rev":"3-06467336e1610ba9915401df26c936c1"}}, +{"id":"express-validate","key":"express-validate","value":{"rev":"15-b63bd9b18fadfc2345d0a10a7a2fb2e7"}}, +{"id":"express-view-helpers","key":"express-view-helpers","value":{"rev":"7-4d07ba11f81788783c6f9fd48fdf8834"}}, +{"id":"express-with-ease","key":"express-with-ease","value":{"rev":"3-604d9176a4a03f9f7c74679604c7bbf9"}}, +{"id":"express-wormhole","key":"express-wormhole","value":{"rev":"3-7e06cf63b070e0f54b2aa71b48db9a40"}}, +{"id":"expresso","key":"expresso","value":{"rev":"79-a27b6ef2f9e7bb9f85da34f728d124a8"}}, +{"id":"expressobdd","key":"expressobdd","value":{"rev":"5-e8cae7a17a9e8c1779c08abedc674e03"}}, +{"id":"ext","key":"ext","value":{"rev":"6-8790c06324c5f057b1713ba420e8bf27"}}, +{"id":"extend","key":"extend","value":{"rev":"3-934d0de77bbaefb1b52ec18a17f46d7d"}}, +{"id":"extendables","key":"extendables","value":{"rev":"11-e4db9b62a4047e95fb4d7f88e351a14e"}}, +{"id":"extjs-node","key":"extjs-node","value":{"rev":"3-2b2033dbbf0b99d41e876498886b0995"}}, +{"id":"extractcontent","key":"extractcontent","value":{"rev":"6-ad70764c834ecd3414cbc15dbda317c3"}}, +{"id":"extractor","key":"extractor","value":{"rev":"9-f95bde04bb8db37350c9cc95c5578c03"}}, +{"id":"extx-layout","key":"extx-layout","value":{"rev":"3-f6bbc3a923ebce17f62cbf382b096ac7"}}, +{"id":"extx-reference-slot","key":"extx-reference-slot","value":{"rev":"14-b1b92573492f7239144693ee9e1d1aac"}}, +{"id":"extx-shotenjin","key":"extx-shotenjin","value":{"rev":"5-c641121ba57fb960d8db766511ecf6cd"}}, +{"id":"eyes","key":"eyes","value":{"rev":"16-fab6b201646fb12986e396c33a7cd428"}}, +{"id":"f","key":"f","value":{"rev":"3-23b73ffafbe5b56b6a0736db6a7256a6"}}, +{"id":"f-core","key":"f-core","value":{"rev":"3-9a6898e007acf48d956f0a70ff07a273"}}, +{"id":"f7u12rl","key":"f7u12rl","value":{"rev":"3-7b5e15d106db8b7f8784b27f7d2c9bdc"}}, +{"id":"fab","key":"fab","value":{"rev":"10-149dec0b653ce481af013c63fec125e8"}}, +{"id":"fab.accept","key":"fab.accept","value":{"rev":"6-d6b08e7054d823906c6c64c92b008d3a"}}, +{"id":"fab.static","key":"fab.static","value":{"rev":"6-5bdb6db53223bb5203ba91a5b2b87566"}}, +{"id":"fabric","key":"fabric","value":{"rev":"15-30e99e486c58962c049bea54e00b7cb9"}}, +{"id":"face-detect","key":"face-detect","value":{"rev":"3-d4d3f1a894c807f79ba541d2f2ed630d"}}, +{"id":"facebook","key":"facebook","value":{"rev":"17-e241999000e34aed62ee0f9f358bfd06"}}, +{"id":"facebook-api","key":"facebook-api","value":{"rev":"5-cb9d07b2eba18d8fb960768d69f80326"}}, +{"id":"facebook-client","key":"facebook-client","value":{"rev":"17-84c106420b183ca791b0c80fd8c3fe00"}}, +{"id":"facebook-connect","key":"facebook-connect","value":{"rev":"6-471f28bb12928e32610d02c0b03aa972"}}, +{"id":"facebook-express","key":"facebook-express","value":{"rev":"11-6e6d98b8252907b05c41aac7e0418f4e"}}, +{"id":"facebook-graph","key":"facebook-graph","value":{"rev":"9-c92149825fef42ad76bcffdd232cc9a5"}}, +{"id":"facebook-graph-client","key":"facebook-graph-client","value":{"rev":"10-c3136a2b2e5c5d80b78404a4102af7b5"}}, +{"id":"facebook-js","key":"facebook-js","value":{"rev":"22-dd9d916550ebccb71e451acbd7a4b315"}}, +{"id":"facebook-realtime-graph","key":"facebook-realtime-graph","value":{"rev":"6-c4fe01ac036585394cd59f01c6fc7df1"}}, +{"id":"facebook-sdk","key":"facebook-sdk","value":{"rev":"21-77daf7eba51bb913e54381995718e13d"}}, +{"id":"facebook-session-cookie","key":"facebook-session-cookie","value":{"rev":"9-70e14cac759dacadacb0af17387ab230"}}, +{"id":"facebook-signed-request","key":"facebook-signed-request","value":{"rev":"5-11cb36123a94e37fff6a7efd6f7d88b9"}}, +{"id":"facebook.node","key":"facebook.node","value":{"rev":"3-f6760795e71c1d5734ae34f9288d02be"}}, +{"id":"factory-worker","key":"factory-worker","value":{"rev":"7-1c365b3dd92b12573d00c08b090e01ae"}}, +{"id":"fake","key":"fake","value":{"rev":"25-2d1ae2299168d95edb8d115fb7961c8e"}}, +{"id":"fake-queue","key":"fake-queue","value":{"rev":"7-d6970de6141c1345c6ad3cd1586cfe7b"}}, +{"id":"fakedb","key":"fakedb","value":{"rev":"34-889fb5c9fa328b536f9deb138ff125b1"}}, +{"id":"fakeweb","key":"fakeweb","value":{"rev":"3-7fb1394b4bac70f9ab26e60b1864b41f"}}, +{"id":"fanfeedr","key":"fanfeedr","value":{"rev":"22-de3d485ad60c8642eda260afe5620973"}}, +{"id":"fantomex","key":"fantomex","value":{"rev":"3-79b26bcf9aa365485ed8131c474bf6f8"}}, +{"id":"far","key":"far","value":{"rev":"19-c8d9f1e8bc12a31cb27bef3ed44759ce"}}, +{"id":"farm","key":"farm","value":{"rev":"31-ab77f7f48b24bf6f0388b926d2ac370b"}}, +{"id":"fast-detective","key":"fast-detective","value":{"rev":"5-b0b6c8901458f3f07044d4266db0aa52"}}, +{"id":"fast-msgpack-rpc","key":"fast-msgpack-rpc","value":{"rev":"7-b2dfd3d331459382fe1e8166288ffef6"}}, +{"id":"fast-or-slow","key":"fast-or-slow","value":{"rev":"13-4118190cd6a0185af8ea9b381ee2bc98"}}, +{"id":"fast-stats","key":"fast-stats","value":{"rev":"3-15cdd56d9efa38f08ff20ca731867d4d"}}, +{"id":"fastcgi-stream","key":"fastcgi-stream","value":{"rev":"5-99c0c4dfc7a874e1af71e5ef3ac95ba4"}}, +{"id":"faye","key":"faye","value":{"rev":"30-49b7d05534c35527972a4d5e07ac8895"}}, +{"id":"faye-service","key":"faye-service","value":{"rev":"3-bad8bf6722461627eac7d0141e09b3f7"}}, +{"id":"fe-fu","key":"fe-fu","value":{"rev":"21-f3cb04870621ce40da8ffa009686bdeb"}}, +{"id":"feed-tables","key":"feed-tables","value":{"rev":"9-4410bad138f4df570e7be37bb17209b3"}}, +{"id":"feedBum","key":"feedBum","value":{"rev":"3-b4ff9edffb0c5c33c4ed40f60a12611a"}}, +{"id":"feedparser","key":"feedparser","value":{"rev":"5-eb2c32e00832ed7036eb1b87d2eea33e"}}, +{"id":"feral","key":"feral","value":{"rev":"19-0b512b6301a26ca5502710254bd5a9ba"}}, +{"id":"fermata","key":"fermata","value":{"rev":"25-eeafa3e5b769a38b8a1065c0a66e0653"}}, +{"id":"ferret","key":"ferret","value":{"rev":"9-7ab6b29cb0cad9855d927855c2a27bff"}}, +{"id":"ffmpeg-node","key":"ffmpeg-node","value":{"rev":"3-e55011ecb147f599475a12b10724a583"}}, +{"id":"ffmpeg2theora","key":"ffmpeg2theora","value":{"rev":"13-05d2f83dbbb90e832176ebb7fdc2ae2e"}}, +{"id":"fiberize","key":"fiberize","value":{"rev":"5-dfb978d6b88db702f68a13e363fb21af"}}, +{"id":"fibers","key":"fibers","value":{"rev":"71-4b22dbb449839723ed9b0d533339c764"}}, +{"id":"fibers-promise","key":"fibers-promise","value":{"rev":"9-3a9977528f8df079969d4ae48db7a0a7"}}, +{"id":"fidel","key":"fidel","value":{"rev":"37-370838ed9984cfe6807114b5fef789e6"}}, +{"id":"fig","key":"fig","value":{"rev":"7-24acf90e7d06dc8b83adb02b5776de3c"}}, +{"id":"file","key":"file","value":{"rev":"6-1131008db6855f20969413be7cc2e968"}}, +{"id":"file-api","key":"file-api","value":{"rev":"9-a9cc8f3de14eef5bba86a80f6705651c"}}, +{"id":"fileify","key":"fileify","value":{"rev":"17-50603c037d5e3a0a405ff4af3e71211f"}}, +{"id":"filepad","key":"filepad","value":{"rev":"23-8c4b2c04151723033523369c42144cc9"}}, +{"id":"filerepl","key":"filerepl","value":{"rev":"5-94999cc91621e08f96ded7423ed6d6f0"}}, +{"id":"fileset","key":"fileset","value":{"rev":"3-ea6a9f45aaa5e65279463041ee629dbe"}}, +{"id":"filestore","key":"filestore","value":{"rev":"9-6cce7c9cd2b2b11d12905885933ad25a"}}, +{"id":"filesystem-composer","key":"filesystem-composer","value":{"rev":"34-f1d04d711909f3683c1d00cd4ab7ca47"}}, +{"id":"fileutils","key":"fileutils","value":{"rev":"3-88876b61c9d0a915f95ce0f258e5ce51"}}, +{"id":"filter","key":"filter","value":{"rev":"3-4032087a5cf2de3dd164c95454a2ab05"}}, +{"id":"filter-chain","key":"filter-chain","value":{"rev":"5-c522429dc83ccc7dde4eaf5409070332"}}, +{"id":"fin","key":"fin","value":{"rev":"23-77cf12e84eb62958b40aa08fdcbb259d"}}, +{"id":"fin-id","key":"fin-id","value":{"rev":"3-9f85ee1e426d4bdad5904002a6d9342c"}}, +{"id":"finance","key":"finance","value":{"rev":"3-cf97ddb6af3f6601bfb1e49a600f56af"}}, +{"id":"finder","key":"finder","value":{"rev":"13-65767fe51799a397ddd9b348ead12ed2"}}, +{"id":"findit","key":"findit","value":{"rev":"15-435e4168208548a2853f6efcd4529de3"}}, +{"id":"fingerprint","key":"fingerprint","value":{"rev":"3-c40e2169260010cac472e688c392ea3d"}}, +{"id":"finjector","key":"finjector","value":{"rev":"5-646da199b0b336d20e421ef6ad613e90"}}, +{"id":"firebird","key":"firebird","value":{"rev":"5-7e7ec03bc00e562f5f7afc7cad76da77"}}, +{"id":"firmata","key":"firmata","value":{"rev":"20-f3cbde43ce2677a208bcf3599af5b670"}}, +{"id":"first","key":"first","value":{"rev":"3-c647f6fc1353a1c7b49f5e6cd1905b1e"}}, +{"id":"fishback","key":"fishback","value":{"rev":"19-27a0fdc8c3abe4d61fff9c7a098f3fd9"}}, +{"id":"fitbit-js","key":"fitbit-js","value":{"rev":"3-62fe0869ddefd2949d8c1e568f994c93"}}, +{"id":"fix","key":"fix","value":{"rev":"17-4a79db9924922da010df71e5194bcac6"}}, +{"id":"flagpoll","key":"flagpoll","value":{"rev":"3-0eb7b98e2a0061233aa5228eb7348dff"}}, +{"id":"flags","key":"flags","value":{"rev":"3-594f0ec2e903ac74556d1c1f7c6cca3b"}}, +{"id":"flexcache","key":"flexcache","value":{"rev":"11-e1e4eeaa0793d95056a857bec04282ae"}}, +{"id":"flickr-conduit","key":"flickr-conduit","value":{"rev":"7-d3b2b610171589db68809c3ec3bf2bcb"}}, +{"id":"flickr-js","key":"flickr-js","value":{"rev":"5-66c8e8a00ad0a906f632ff99cf490163"}}, +{"id":"flickr-reflection","key":"flickr-reflection","value":{"rev":"6-3c34c3ac904b6d6f26182807fbb95c5e"}}, +{"id":"flo","key":"flo","value":{"rev":"3-ce440035f0ec9a10575b1c8fab0c77da"}}, +{"id":"flow","key":"flow","value":{"rev":"6-95841a07c96f664d49d1af35373b3dbc"}}, +{"id":"flowcontrol","key":"flowcontrol","value":{"rev":"3-093bbbc7496072d9ecb136a826680366"}}, +{"id":"flowjs","key":"flowjs","value":{"rev":"3-403fc9e107ec70fe06236c27e70451c7"}}, +{"id":"fluent-ffmpeg","key":"fluent-ffmpeg","value":{"rev":"33-5982779d5f55a5915f0f8b0353f1fe2a"}}, +{"id":"flume-rpc","key":"flume-rpc","value":{"rev":"7-4214a2db407a3e64f036facbdd34df91"}}, +{"id":"flux","key":"flux","value":{"rev":"3-1ad83106af7ee83547c797246bd2c8b1"}}, +{"id":"fly","key":"fly","value":{"rev":"9-0a45b1b97f56ba0faf4af4777b473fad"}}, +{"id":"fn","key":"fn","value":{"rev":"5-110bab5d623b3628e413d972e040ed26"}}, +{"id":"fnProxy","key":"fnProxy","value":{"rev":"3-db1c90e5a06992ed290c679ac6dbff6a"}}, +{"id":"follow","key":"follow","value":{"rev":"3-44256c802b4576fcbae1264e9b824e6a"}}, +{"id":"fomatto","key":"fomatto","value":{"rev":"7-31ce5c9eba7f084ccab2dc5994796f2d"}}, +{"id":"foounit","key":"foounit","value":{"rev":"20-caf9cd90d6c94d19be0b3a9c9cb33ee0"}}, +{"id":"forEachAsync","key":"forEachAsync","value":{"rev":"3-d9cd8021ea9d5014583327752a9d01c4"}}, +{"id":"forever","key":"forever","value":{"rev":"99-90060d5d1754b1bf749e5278a2a4516b"}}, +{"id":"forge","key":"forge","value":{"rev":"9-0d9d59fd2d47a804e600aaef538ebbbf"}}, +{"id":"fork","key":"fork","value":{"rev":"13-f355105e07608de5ae2f3e7c0817af52"}}, +{"id":"forker","key":"forker","value":{"rev":"11-9717e2e3fa60b46df08261d936d9e5d7"}}, +{"id":"form-data","key":"form-data","value":{"rev":"3-5750e73f7a0902ec2fafee1db6d2e6f6"}}, +{"id":"form-validator","key":"form-validator","value":{"rev":"25-7d016b35895dc58ffd0bbe54fd9be241"}}, +{"id":"form2json","key":"form2json","value":{"rev":"8-7501dd9b43b9fbb7194b94e647816e5e"}}, +{"id":"formaline","key":"formaline","value":{"rev":"3-2d45fbb3e83b7e77bde0456607e6f1e3"}}, +{"id":"format","key":"format","value":{"rev":"7-5dddc67c10de521ef06a7a07bb3f7e2e"}}, +{"id":"formatdate","key":"formatdate","value":{"rev":"3-6d522e3196fe3b438fcc4aed0f7cf690"}}, +{"id":"formidable","key":"formidable","value":{"rev":"87-d27408b00793fee36f6632a895372590"}}, +{"id":"forms","key":"forms","value":{"rev":"6-253e032f07979b79c2e7dfa01be085dc"}}, +{"id":"forrst","key":"forrst","value":{"rev":"3-ef553ff1b6383bab0f81f062cdebac53"}}, +{"id":"fortumo","key":"fortumo","value":{"rev":"6-def3d146b29b6104019c513ce20bb61f"}}, +{"id":"foss-credits","key":"foss-credits","value":{"rev":"3-c824326e289e093406b2de4efef70cb7"}}, +{"id":"foss-credits-collection","key":"foss-credits-collection","value":{"rev":"17-de4ffca51768a36c8fb1b9c2bc66c80f"}}, +{"id":"foursquareonnode","key":"foursquareonnode","value":{"rev":"5-a4f0a1ed5d3be3056f10f0e9517efa83"}}, +{"id":"fraggle","key":"fraggle","value":{"rev":"7-b9383baf96bcdbd4022b4b887e4a3729"}}, +{"id":"framework","key":"framework","value":{"rev":"3-afb19a9598a0d50320b4f1faab1ae2c6"}}, +{"id":"frameworkjs","key":"frameworkjs","value":{"rev":"7-cd418da3272c1e8349126e442ed15dbd"}}, +{"id":"frank","key":"frank","value":{"rev":"12-98031fb56f1c89dfc7888f5d8ca7f0a9"}}, +{"id":"freakset","key":"freakset","value":{"rev":"21-ba60d0840bfa3da2c8713c3c2e6856a0"}}, +{"id":"freckle","key":"freckle","value":{"rev":"3-8e2e9a07b2650fbbd0a598b948ef993b"}}, +{"id":"freebase","key":"freebase","value":{"rev":"7-a1daf1cc2259b886f574f5c902eebcf4"}}, +{"id":"freecontrol","key":"freecontrol","value":{"rev":"6-7a51776b8764f406573d5192bab36adf"}}, +{"id":"freestyle","key":"freestyle","value":{"rev":"9-100f9e9d3504d6e1c6a2d47651c70f51"}}, +{"id":"frenchpress","key":"frenchpress","value":{"rev":"9-306d6ac21837879b8040d7f9aa69fc20"}}, +{"id":"fs-boot","key":"fs-boot","value":{"rev":"20-72b44b403767aa486bf1dc987c750733"}}, +{"id":"fs-ext","key":"fs-ext","value":{"rev":"10-3360831c3852590a762f8f82525c025e"}}, +{"id":"fsevents","key":"fsevents","value":{"rev":"6-bb994f41842e144cf43249fdf6bf51e1"}}, +{"id":"fsext","key":"fsext","value":{"rev":"9-a1507d84e91ddf26ffaa76016253b4fe"}}, +{"id":"fsh","key":"fsh","value":{"rev":"5-1e3784b2df1c1a28b81f27907945f48b"}}, +{"id":"fsm","key":"fsm","value":{"rev":"5-b113be7b30b2a2c9089edcb6fa4c15d3"}}, +{"id":"fswatch","key":"fswatch","value":{"rev":"11-287eea565c9562161eb8969d765bb191"}}, +{"id":"ftp","key":"ftp","value":{"rev":"5-751e312520c29e76f7d79c648248c56c"}}, +{"id":"ftp-get","key":"ftp-get","value":{"rev":"27-1e908bd075a0743dbb1d30eff06485e2"}}, +{"id":"fugue","key":"fugue","value":{"rev":"81-0c08e67e8deb4b5b677fe19f8362dbd8"}}, +{"id":"fullauto","key":"fullauto","value":{"rev":"9-ef915156026dabded5a4a76c5a751916"}}, +{"id":"fun","key":"fun","value":{"rev":"12-8396e3583e206dbf90bbea4316976f66"}}, +{"id":"functional","key":"functional","value":{"rev":"5-955979028270f5d3749bdf86b4d2c925"}}, +{"id":"functools","key":"functools","value":{"rev":"5-42ba84ce365bf8c0aaf3e5e6c369920b"}}, +{"id":"funk","key":"funk","value":{"rev":"14-67440a9b2118d8f44358bf3b17590243"}}, +{"id":"fusion","key":"fusion","value":{"rev":"19-64983fc6e5496c836be26e5fbc8527d1"}}, +{"id":"fusker","key":"fusker","value":{"rev":"48-58f05561c65ad288a78fa7210f146ba1"}}, +{"id":"future","key":"future","value":{"rev":"3-0ca60d8ae330e40ef6cf8c17a421d668"}}, +{"id":"futures","key":"futures","value":{"rev":"44-8a2aaf0f40cf84c9475824d9cec006ad"}}, +{"id":"fuzzy_file_finder","key":"fuzzy_file_finder","value":{"rev":"8-ee555aae1d433e60166d2af1d72ac6b9"}}, +{"id":"fuzzylogic","key":"fuzzylogic","value":{"rev":"8-596a8f4744d1dabcb8eb6466d9980fca"}}, +{"id":"fxs","key":"fxs","value":{"rev":"3-d3cb81151b0ddd9a4a5934fb63ffff75"}}, +{"id":"g","key":"g","value":{"rev":"3-55742a045425a9b4c9fe0e8925fad048"}}, +{"id":"g.raphael","key":"g.raphael","value":{"rev":"4-190d0235dc08f783dda77b3ecb60b11a"}}, +{"id":"ga","key":"ga","value":{"rev":"3-c47d516ac5e6de8ef7ef9d16fabcf6c7"}}, +{"id":"galletita","key":"galletita","value":{"rev":"3-aa7a01c3362a01794f36e7aa9664b850"}}, +{"id":"game","key":"game","value":{"rev":"3-0f1539e4717a2780205d98ef6ec0886d"}}, +{"id":"gamina","key":"gamina","value":{"rev":"15-871f4970f1e87b7c8ad361456001c76f"}}, +{"id":"gang-bang","key":"gang-bang","value":{"rev":"6-f565cb7027a8ca109481df49a6d41114"}}, +{"id":"gapserver","key":"gapserver","value":{"rev":"9-b25eb0eefc21e407cba596a0946cb3a0"}}, +{"id":"garbage","key":"garbage","value":{"rev":"3-80f4097d5f1f2c75f509430a11c8a15e"}}, +{"id":"gaseous","key":"gaseous","value":{"rev":"3-8021582ab9dde42d235193e6067be72d"}}, +{"id":"gaudium","key":"gaudium","value":{"rev":"11-7d612f1c5d921180ccf1c162fe2c7446"}}, +{"id":"gauss","key":"gauss","value":{"rev":"3-8fd18b2d7a223372f190797e4270a535"}}, +{"id":"gcli","key":"gcli","value":{"rev":"3-210404347cc643e924cec678d0195099"}}, +{"id":"gcw2html","key":"gcw2html","value":{"rev":"3-2aff7bff7981f2f9800c5f65812aa0a6"}}, +{"id":"gd","key":"gd","value":{"rev":"4-ac5a662e709a2993ed1fd1cbf7c4d7b4"}}, +{"id":"gdata","key":"gdata","value":{"rev":"3-c6b3a95064a1e1e0bb74f248ab4e73c4"}}, +{"id":"gdata-js","key":"gdata-js","value":{"rev":"17-0959500a4000d7058d8116af1e01b0d9"}}, +{"id":"gearman","key":"gearman","value":{"rev":"8-ac9fb7af75421ca2988d6098dbfd4c7c"}}, +{"id":"gearnode","key":"gearnode","value":{"rev":"7-8e40ec257984e887e2ff5948a6dde04e"}}, +{"id":"geck","key":"geck","value":{"rev":"161-c8117106ef58a6d7d21920df80159eab"}}, +{"id":"geddy","key":"geddy","value":{"rev":"13-da16f903aca1ec1f47086fa250b58abb"}}, +{"id":"gen","key":"gen","value":{"rev":"3-849005c8b8294c2a811ff4eccdedf436"}}, +{"id":"generic-function","key":"generic-function","value":{"rev":"5-dc046f58f96119225efb17ea5334a60f"}}, +{"id":"generic-pool","key":"generic-pool","value":{"rev":"18-65ff988620293fe7ffbd0891745c3ded"}}, +{"id":"genji","key":"genji","value":{"rev":"49-4c72bcaa57572ad0d43a1b7e9e5a963a"}}, +{"id":"genstatic","key":"genstatic","value":{"rev":"19-4278d0766226af4db924bb0f6b127699"}}, +{"id":"gently","key":"gently","value":{"rev":"24-c9a3ba6b6fd183ee1b5dda569122e978"}}, +{"id":"genx","key":"genx","value":{"rev":"7-f0c0ff65e08e045e8dd1bfcb25ca48d4"}}, +{"id":"geo","key":"geo","value":{"rev":"7-fa2a79f7260b849c277735503a8622e9"}}, +{"id":"geo-distance","key":"geo-distance","value":{"rev":"7-819a30e9b4776e4416fe9510ca79cd93"}}, +{"id":"geocoder","key":"geocoder","value":{"rev":"15-736e627571ad8dba3a9d0da1ae019c35"}}, +{"id":"geohash","key":"geohash","value":{"rev":"6-b9e62c804abe565425a8e6a01354407a"}}, +{"id":"geoip","key":"geoip","value":{"rev":"231-e5aa7acd5fb44833a67f96476b4fac49"}}, +{"id":"geoip-lite","key":"geoip-lite","value":{"rev":"9-efd916135c056406ede1ad0fe15534fa"}}, +{"id":"geojs","key":"geojs","value":{"rev":"35-b0f97b7c72397d6eb714602dc1121183"}}, +{"id":"geolib","key":"geolib","value":{"rev":"3-923a8622d1bd97c22f71ed6537ba5062"}}, +{"id":"geonode","key":"geonode","value":{"rev":"35-c2060653af72123f2f9994fca1c86d70"}}, +{"id":"geoutils","key":"geoutils","value":{"rev":"6-2df101fcbb01849533b2fbc80dc0eb7a"}}, +{"id":"gerbil","key":"gerbil","value":{"rev":"3-b5961044bda490a34085ca826aeb3022"}}, +{"id":"gerenuk","key":"gerenuk","value":{"rev":"13-4e45a640bcbadc3112e105ec5b60b907"}}, +{"id":"get","key":"get","value":{"rev":"18-dd215d673f19bbd8b321a7dd63e004e8"}}, +{"id":"getopt","key":"getopt","value":{"rev":"3-454354e4557d5e7205410acc95c9baae"}}, +{"id":"getrusage","key":"getrusage","value":{"rev":"8-d6ef24793b8e4c46f3cdd14937cbabe1"}}, +{"id":"gettext","key":"gettext","value":{"rev":"3-4c12268a4cab64ec4ef3ac8c9ec7912b"}}, +{"id":"getz","key":"getz","value":{"rev":"9-f3f43934139c9af6ddfb8b91e9a121ba"}}, +{"id":"gevorg.me","key":"gevorg.me","value":{"rev":"33-700502b8ca7041bf8d29368069cac365"}}, +{"id":"gex","key":"gex","value":{"rev":"3-105824d7a3f9c2ac7313f284c3f81d22"}}, +{"id":"gexode","key":"gexode","value":{"rev":"3-4a3552eae4ff3ba4443f9371a1ab4b2e"}}, +{"id":"gfx","key":"gfx","value":{"rev":"8-1f6c90bc3819c3b237e8d1f28ad1b136"}}, +{"id":"gherkin","key":"gherkin","value":{"rev":"77-6e835c8107bb4c7c8ad1fa072ac12c20"}}, +{"id":"ghm","key":"ghm","value":{"rev":"3-c440ae39832a575087ff1920b33c275b"}}, +{"id":"gif","key":"gif","value":{"rev":"14-e65638621d05b99ffe71b18097f29134"}}, +{"id":"gimme","key":"gimme","value":{"rev":"7-caab8354fe257fc307f8597e34ede547"}}, +{"id":"gist","key":"gist","value":{"rev":"11-eea7ea1adf3cde3a0804d2e1b0d6f7d6"}}, +{"id":"gista","key":"gista","value":{"rev":"23-48b8c374cfb8fc4e8310f3469cead6d5"}}, +{"id":"gisty","key":"gisty","value":{"rev":"5-1a898d0816f4129ab9a0d3f03ff9feb4"}}, +{"id":"git","key":"git","value":{"rev":"39-1f77df3ebeec9aae47ae8df56de6757f"}}, +{"id":"git-fs","key":"git-fs","value":{"rev":"14-7d365cddff5029a9d11fa8778a7296d2"}}, +{"id":"gitProvider","key":"gitProvider","value":{"rev":"9-c704ae702ef27bb57c0efd279a464e28"}}, +{"id":"github","key":"github","value":{"rev":"16-9345138ca7507c12be4a817b1abfeef6"}}, +{"id":"github-flavored-markdown","key":"github-flavored-markdown","value":{"rev":"3-f12043eb2969aff51db742b13d329446"}}, +{"id":"gitteh","key":"gitteh","value":{"rev":"39-88b00491fd4ce3294b8cdf61b9708383"}}, +{"id":"gitter","key":"gitter","value":{"rev":"16-88d7ef1ab6a7e751ca2cf6b50894deb4"}}, +{"id":"gittyup","key":"gittyup","value":{"rev":"37-ed6030c1acdd8b989ac34cd10d6dfd1e"}}, +{"id":"gitweb","key":"gitweb","value":{"rev":"9-5331e94c6df9ee7724cde3738a0c6230"}}, +{"id":"gitwiki","key":"gitwiki","value":{"rev":"9-0f167a3a87bce7f3e941136a06e91810"}}, +{"id":"gizmo","key":"gizmo","value":{"rev":"5-1da4da8d66690457c0bf743473b755f6"}}, +{"id":"gleak","key":"gleak","value":{"rev":"17-d44a968b32e4fdc7d27bacb146391422"}}, +{"id":"glob","key":"glob","value":{"rev":"203-4a79e232cf6684a48ccb9134a6ce938c"}}, +{"id":"glob-trie.js","key":"glob-trie.js","value":{"rev":"7-bff534e3aba8f6333fa5ea871b070de2"}}, +{"id":"global","key":"global","value":{"rev":"3-f15b0c9ae0ea9508890bff25c8e0f795"}}, +{"id":"globalize","key":"globalize","value":{"rev":"5-33d10c33fb24af273104f66098e246c4"}}, +{"id":"glossary","key":"glossary","value":{"rev":"3-5e143d09d22a01eb2ee742ceb3e18f6e"}}, +{"id":"glossy","key":"glossy","value":{"rev":"9-f31e00844e8be49e5812fe64a6f1e1cc"}}, +{"id":"gm","key":"gm","value":{"rev":"28-669722d34a3dc29c8c0b27abd73493a1"}}, +{"id":"gnarly","key":"gnarly","value":{"rev":"3-796f5df3483f304cb404cc7ac7702512"}}, +{"id":"gnomenotify","key":"gnomenotify","value":{"rev":"9-bc066c0556ad4a20e7a7ae58cdc4cf91"}}, +{"id":"gofer","key":"gofer","value":{"rev":"15-3fc77ce34e95ffecd12d3854a1bb2da9"}}, +{"id":"goo.gl","key":"goo.gl","value":{"rev":"37-eac7c44d33cc42c618372f0bdd4365c2"}}, +{"id":"goodreads","key":"goodreads","value":{"rev":"5-acd9fe24139aa8b81b26431dce9954aa"}}, +{"id":"goog","key":"goog","value":{"rev":"13-c964ecfcef4d20c8c7d7526323257c04"}}, +{"id":"googl","key":"googl","value":{"rev":"8-2d4d80ef0c5f93400ec2ec8ef80de433"}}, +{"id":"google-openid","key":"google-openid","value":{"rev":"19-380884ba97e3d6fc48c8c7db3dc0e91b"}}, +{"id":"google-spreadsheets","key":"google-spreadsheets","value":{"rev":"3-f640ef136c4b5e90210c2d5d43102b38"}}, +{"id":"google-voice","key":"google-voice","value":{"rev":"37-2e1c3cba3455852f26b0ccaf1fed7125"}}, +{"id":"googleanalytics","key":"googleanalytics","value":{"rev":"8-1d3e470ce4aacadb0418dd125887813d"}}, +{"id":"googleclientlogin","key":"googleclientlogin","value":{"rev":"23-5de8ee62c0ddbc63a001a36a6afe730e"}}, +{"id":"googlediff","key":"googlediff","value":{"rev":"3-438a2f0758e9770a157ae4cce9b6f49e"}}, +{"id":"googlemaps","key":"googlemaps","value":{"rev":"18-bc939560c587711f3d96f3caadd65a7f"}}, +{"id":"googleplus-scraper","key":"googleplus-scraper","value":{"rev":"7-598ea99bd64f4ad69cccb74095abae59"}}, +{"id":"googlereaderauth","key":"googlereaderauth","value":{"rev":"5-cd0eb8ca36ea78620af0fce270339a7b"}}, +{"id":"googlesets","key":"googlesets","value":{"rev":"5-1b2e597e903c080182b3306d63278fd9"}}, +{"id":"googleweather","key":"googleweather","value":{"rev":"3-6bfdaaeedb8a712ee3e89a8ed27508eb"}}, +{"id":"gopostal.node","key":"gopostal.node","value":{"rev":"3-14ff3a655dc3680c9e8e2751ebe294bc"}}, +{"id":"gowallan","key":"gowallan","value":{"rev":"3-23adc9c01a6b309eada47602fdc8ed90"}}, +{"id":"gowiththeflow","key":"gowiththeflow","value":{"rev":"3-52bb6cf6294f67ba5a892db4666d3790"}}, +{"id":"gpg","key":"gpg","value":{"rev":"5-0ca2b5af23e108a4f44f367992a75fed"}}, +{"id":"graceful-fs","key":"graceful-fs","value":{"rev":"3-01e9f7d1c0f6e6a611a60ee84de1f5cc"}}, +{"id":"gracie","key":"gracie","value":{"rev":"3-aa0f7c01a33c7c1e9a49b86886ef5255"}}, +{"id":"graff","key":"graff","value":{"rev":"7-5ab558cb24e30abd67f2a1dbf47cd639"}}, +{"id":"graft","key":"graft","value":{"rev":"3-7419de38b249b891bf7998bcdd2bf557"}}, +{"id":"grain","key":"grain","value":{"rev":"3-e57cbf02121970da230964ddbfd31432"}}, +{"id":"grainstore","key":"grainstore","value":{"rev":"19-5f9c5bb13b2c9ac4e6a05aec33aeb7c5"}}, +{"id":"graph","key":"graph","value":{"rev":"7-909d2fefcc84b5dd1512b60d631ea4e5"}}, +{"id":"graphquire","key":"graphquire","value":{"rev":"27-246e798f80b3310419644302405d68ad"}}, +{"id":"graphviz","key":"graphviz","value":{"rev":"8-3b79341eaf3f67f91bce7c88c08b9f0d"}}, +{"id":"grasshopper","key":"grasshopper","value":{"rev":"45-4002406990476b74dac5108bd19c4274"}}, +{"id":"gravatar","key":"gravatar","value":{"rev":"11-0164b7ac97e8a477b4e8791eae2e7fea"}}, +{"id":"grave","key":"grave","value":{"rev":"3-136f6378b956bc5dd9773250f8813038"}}, +{"id":"gravity","key":"gravity","value":{"rev":"5-dd40fcee1a769ce786337e9536d24244"}}, +{"id":"graylog","key":"graylog","value":{"rev":"5-abcff9cd91ff20e36f8a70a3f2de658b"}}, +{"id":"greg","key":"greg","value":{"rev":"5-ececb0a3bb552b6da4f66b8bf6f75cf0"}}, +{"id":"gridcentric","key":"gridcentric","value":{"rev":"4-4378e1c280e18b5aaabd23038b80d76c"}}, +{"id":"gridly","key":"gridly","value":{"rev":"3-86e878756b493da8f66cbd633a15f821"}}, +{"id":"grinder","key":"grinder","value":{"rev":"9-0aaeecf0c81b1c9c93a924c5eb0bff45"}}, +{"id":"grir.am","key":"grir.am","value":{"rev":"3-3ec153c764af1c26b50fefa437318c5a"}}, +{"id":"groundcrew","key":"groundcrew","value":{"rev":"3-9e9ed9b1c70c00c432f36bb853fa21a0"}}, +{"id":"groupie","key":"groupie","value":{"rev":"6-b5e3f0891a7e8811d6112b24bd5a46b4"}}, +{"id":"groupon","key":"groupon","value":{"rev":"21-8b74723c153695f4ed4917575abcca8f"}}, +{"id":"growing-file","key":"growing-file","value":{"rev":"7-995b233a1add5b9ea80aec7ac3f60dc5"}}, +{"id":"growl","key":"growl","value":{"rev":"10-4be41ae10ec96e1334dccdcdced12fe3"}}, +{"id":"gsl","key":"gsl","value":{"rev":"49-3367acfb521b30d3ddb9b80305009553"}}, +{"id":"gss","key":"gss","value":{"rev":"3-e4cffbbbc4536d952d13d46376d899b7"}}, +{"id":"guards","key":"guards","value":{"rev":"8-d7318d3d9dc842ab41e6ef5b88f9d37f"}}, +{"id":"guardtime","key":"guardtime","value":{"rev":"3-5a2942efabab100ffb3dc0fa3b581b7a"}}, +{"id":"guava","key":"guava","value":{"rev":"11-d9390d298b503f0ffb8e3ba92eeb9759"}}, +{"id":"guid","key":"guid","value":{"rev":"16-d99e725bbbf97a326833858767b7ed08"}}, +{"id":"gumbo","key":"gumbo","value":{"rev":"31-727cf5a3b7d8590fff871f27da114d9d"}}, +{"id":"gunther","key":"gunther","value":{"rev":"9-f95c89128412208d16acd3e615844115"}}, +{"id":"gzbz2","key":"gzbz2","value":{"rev":"3-e1844b1b3a7881a0c8dc0dd4edcc11ca"}}, +{"id":"gzip","key":"gzip","value":{"rev":"17-37afa05944f055d6f43ddc87c1b163c2"}}, +{"id":"gzip-stack","key":"gzip-stack","value":{"rev":"8-cf455d60277832c60ee622d198c0c51a"}}, +{"id":"gzippo","key":"gzippo","value":{"rev":"15-6416c13ecbbe1c5cd3e30adf4112ead7"}}, +{"id":"h5eb","key":"h5eb","value":{"rev":"3-11ed2566fa4b8a01ff63a720c94574cd"}}, +{"id":"hack","key":"hack","value":{"rev":"3-70f536dd46719e8201a6ac5cc96231f6"}}, +{"id":"hack.io","key":"hack.io","value":{"rev":"18-128305614e7fd6b461248bf3bfdd7ab7"}}, +{"id":"hacktor","key":"hacktor","value":{"rev":"3-51b438df35ba8a955d434ab25a4dad67"}}, +{"id":"haibu","key":"haibu","value":{"rev":"99-b29b8c37be42f90985c6d433d53c8679"}}, +{"id":"haibu-carapace","key":"haibu-carapace","value":{"rev":"22-9a89b2f495e533d0f93e4ee34121e48c"}}, +{"id":"haibu-nginx","key":"haibu-nginx","value":{"rev":"7-e176128dc6dbb0d7f5f33369edf1f7ee"}}, +{"id":"halfstreamxml","key":"halfstreamxml","value":{"rev":"7-5c0f3defa6ba921f8edb564584553df4"}}, +{"id":"ham","key":"ham","value":{"rev":"3-1500dc495cade7334f6a051f2758f748"}}, +{"id":"haml","key":"haml","value":{"rev":"15-a93e7762c7d43469a06519472497fd93"}}, +{"id":"haml-edge","key":"haml-edge","value":{"rev":"5-c4e44a73263ac9b7e632375de7e43d7c"}}, +{"id":"hamljs","key":"hamljs","value":{"rev":"10-a01c7214b69992352bde44938418ebf4"}}, +{"id":"hamljs-coffee","key":"hamljs-coffee","value":{"rev":"3-c2733c8ff38f5676075b84cd7f3d8684"}}, +{"id":"handlebars","key":"handlebars","value":{"rev":"4-0e21906b78605f7a1d5ec7cb4c7d35d7"}}, +{"id":"hanging-gardens","key":"hanging-gardens","value":{"rev":"27-3244e37f08bea0e31759e9f38983f59a"}}, +{"id":"hanging_gardens_registry","key":"hanging_gardens_registry","value":{"rev":"17-d87aa3a26f91dc314f02c686672a5ec6"}}, +{"id":"hapi","key":"hapi","value":{"rev":"3-ed721fe9aae4a459fe0945dabd7d680a"}}, +{"id":"harmony","key":"harmony","value":{"rev":"3-d6c9d6acc29d29c97c75c77f7c8e1390"}}, +{"id":"hascan","key":"hascan","value":{"rev":"13-a7ab15c72f464b013cbc55dc426543ca"}}, +{"id":"hash_ring","key":"hash_ring","value":{"rev":"12-0f072b1dd1fd93ae2f2b79f5ea72074d"}}, +{"id":"hashbangify","key":"hashbangify","value":{"rev":"5-738e0cf99649d41c19d3449c0e9a1cbf"}}, +{"id":"hashish","key":"hashish","value":{"rev":"9-62c5e74355458e1ead819d87151b7d38"}}, +{"id":"hashkeys","key":"hashkeys","value":{"rev":"3-490809bdb61f930f0d9f370eaadf36ea"}}, +{"id":"hashlib","key":"hashlib","value":{"rev":"7-1f19c9d6062ff22ed2e963204a1bd405"}}, +{"id":"hashring","key":"hashring","value":{"rev":"11-4c9f2b1ba7931c8bab310f4ecaf91419"}}, +{"id":"hashtable","key":"hashtable","value":{"rev":"7-2aaf2667cbdb74eb8da61e2e138059ca"}}, +{"id":"hat","key":"hat","value":{"rev":"9-6f37874d9703eab62dc875e2373837a8"}}, +{"id":"hbase","key":"hbase","value":{"rev":"20-7ca92712de26ffb18d275a21696aa263"}}, +{"id":"hbase-thrift","key":"hbase-thrift","value":{"rev":"7-39afb33a4e61cc2b3dc94f0c7fd32c65"}}, +{"id":"hbs","key":"hbs","value":{"rev":"29-aa2676e6790c5716f84f128dcd03e797"}}, +{"id":"header-stack","key":"header-stack","value":{"rev":"13-7ad1ccf3c454d77029c000ceb18ce5ab"}}, +{"id":"headers","key":"headers","value":{"rev":"13-04f8f5f25e2dd9890f6b2f120adf297a"}}, +{"id":"healthety","key":"healthety","value":{"rev":"60-07c67c22ee2a13d0ad675739d1814a6d"}}, +{"id":"heatmap","key":"heatmap","value":{"rev":"9-c53f4656d9517f184df7aea9226c1765"}}, +{"id":"heavy-flow","key":"heavy-flow","value":{"rev":"5-0b9188334339e7372b364a7fc730c639"}}, +{"id":"heckle","key":"heckle","value":{"rev":"13-b462abef7b9d1471ed8fb8f23af463e0"}}, +{"id":"helium","key":"helium","value":{"rev":"3-4d6ce9618c1be522268944240873f53e"}}, +{"id":"hello-world","key":"hello-world","value":{"rev":"3-e87f287308a209491c011064a87100b7"}}, +{"id":"hello.io","key":"hello.io","value":{"rev":"3-39b78278fa638495522edc7a84f6a52e"}}, +{"id":"helloworld","key":"helloworld","value":{"rev":"3-8f163aebdcf7d8761709bdbb634c3689"}}, +{"id":"helpers","key":"helpers","value":{"rev":"3-67d75b1c8e5ad2a268dd4ea191d4754b"}}, +{"id":"helpful","key":"helpful","value":{"rev":"41-e11bed25d5a0ca7e7ad116d5a339ec2a"}}, +{"id":"hem","key":"hem","value":{"rev":"27-042fc9d4b96f20112cd943e019e54d20"}}, +{"id":"hempwick","key":"hempwick","value":{"rev":"11-de1f6f0f23937d9f33286e12ee877540"}}, +{"id":"heritable","key":"heritable","value":{"rev":"13-1468ff92063251a037bbe80ee987a9c3"}}, +{"id":"hermes-raw-client","key":"hermes-raw-client","value":{"rev":"11-5d143c371cb8353612badc72be1917ff"}}, +{"id":"heru","key":"heru","value":{"rev":"3-d124a20939e30e2a3c08f7104b2a1a5c"}}, +{"id":"hexdump","key":"hexdump","value":{"rev":"3-c455710ca80662969ccbca3acc081cb8"}}, +{"id":"hexy","key":"hexy","value":{"rev":"16-5142b0461622436daa2e476d252770f2"}}, +{"id":"highlight","key":"highlight","value":{"rev":"9-4b172b7aef6f40d768f022b2ba4e6748"}}, +{"id":"highlight.js","key":"highlight.js","value":{"rev":"5-16c1ebd28d5f2e781e666c6ee013c30c"}}, +{"id":"hiker","key":"hiker","value":{"rev":"9-89d1ce978b349f1f0df262655299d83c"}}, +{"id":"hipchat","key":"hipchat","value":{"rev":"3-73118782367d474af0f6410290df5f7f"}}, +{"id":"hipchat-js","key":"hipchat-js","value":{"rev":"3-253b83875d3e18e9c89333bc377183c3"}}, +{"id":"hiredis","key":"hiredis","value":{"rev":"46-29ceb03860efbd4b3b995247f27f78b9"}}, +{"id":"hive","key":"hive","value":{"rev":"15-40a4c6fcfa3b80007a18ef4ede80075b"}}, +{"id":"hive-cache","key":"hive-cache","value":{"rev":"3-36b10607b68586fccbfeb856412bd6bf"}}, +{"id":"hoard","key":"hoard","value":{"rev":"13-75d4c484095e2e38ac63a65bd9fd7f4b"}}, +{"id":"hook","key":"hook","value":{"rev":"7-2f1e375058e2b1fa61d3651f6d57a6f8"}}, +{"id":"hook.io","key":"hook.io","value":{"rev":"63-9fac4fb8337d1953963d47144f806f72"}}, +{"id":"hook.io-browser","key":"hook.io-browser","value":{"rev":"3-7e04347d80adc03eb5637b7e4b8ca58b"}}, +{"id":"hook.io-couch","key":"hook.io-couch","value":{"rev":"3-ce0eb281d1ba21aa1caca3a52553a07b"}}, +{"id":"hook.io-cron","key":"hook.io-cron","value":{"rev":"15-50deedc2051ce65bca8a42048154139c"}}, +{"id":"hook.io-helloworld","key":"hook.io-helloworld","value":{"rev":"23-ef5cf0cec9045d28d846a7b0872874e4"}}, +{"id":"hook.io-irc","key":"hook.io-irc","value":{"rev":"5-39c7ac5e192aef34b87af791fa77ee04"}}, +{"id":"hook.io-logger","key":"hook.io-logger","value":{"rev":"13-9e3208ea8eacfe5378cd791f2377d06d"}}, +{"id":"hook.io-mailer","key":"hook.io-mailer","value":{"rev":"9-d9415d53dc086102024cf7400fdfb7a2"}}, +{"id":"hook.io-pinger","key":"hook.io-pinger","value":{"rev":"17-860ab3a892284b91999f86c3882e2ff5"}}, +{"id":"hook.io-repl","key":"hook.io-repl","value":{"rev":"13-c0d430ccdfd197e4746c46d2814b6d92"}}, +{"id":"hook.io-request","key":"hook.io-request","value":{"rev":"13-f0e8d167d59917d90266f921e3ef7c64"}}, +{"id":"hook.io-sitemonitor","key":"hook.io-sitemonitor","value":{"rev":"8-725ea7deb9cb1031eabdc4fd798308ff"}}, +{"id":"hook.io-twilio","key":"hook.io-twilio","value":{"rev":"11-6b2e231307f6174861aa5dcddad264b3"}}, +{"id":"hook.io-twitter","key":"hook.io-twitter","value":{"rev":"3-59296395b22e661e7e5c141c4c7be46d"}}, +{"id":"hook.io-webhook","key":"hook.io-webhook","value":{"rev":"15-b27e51b63c8ec70616c66061d949f388"}}, +{"id":"hook.io-webserver","key":"hook.io-webserver","value":{"rev":"29-eb6bff70736648427329eba08b5f55c3"}}, +{"id":"hook.io-ws","key":"hook.io-ws","value":{"rev":"4-a85578068b54560ef663a7ecfea2731f"}}, +{"id":"hooks","key":"hooks","value":{"rev":"33-6640fb0c27903af6b6ae7b7c41d79e01"}}, +{"id":"hoptoad-notifier","key":"hoptoad-notifier","value":{"rev":"16-8249cb753a3626f2bf2664024ae7a5ee"}}, +{"id":"horaa","key":"horaa","value":{"rev":"5-099e5d6486d10944e10b584eb3f6e924"}}, +{"id":"hornet","key":"hornet","value":{"rev":"22-8c40d7ba4ca832b951e6d5db165f3305"}}, +{"id":"horseman","key":"horseman","value":{"rev":"11-7228e0f84c2036669a218710c22f72c0"}}, +{"id":"hostify","key":"hostify","value":{"rev":"11-8c1a2e73f8b9474a6c26121688c28dc7"}}, +{"id":"hostinfo","key":"hostinfo","value":{"rev":"5-c8d638f40ccf94f4083430966d25e787"}}, +{"id":"hostip","key":"hostip","value":{"rev":"3-d4fd628b94e1f913d97ec1746d96f2a0"}}, +{"id":"hostname","key":"hostname","value":{"rev":"7-55fefb3c37990bbcad3d98684d17f38f"}}, +{"id":"hotnode","key":"hotnode","value":{"rev":"16-d7dad5de3ffc2ca6a04f74686aeb0e4b"}}, +{"id":"howmuchtime","key":"howmuchtime","value":{"rev":"3-351ce870ae6e2c21a798169d074e2a3f"}}, +{"id":"hstore","key":"hstore","value":{"rev":"3-55ab4d359c2fc8725829038e3adb7571"}}, +{"id":"hsume2-socket.io","key":"hsume2-socket.io","value":{"rev":"5-4b537247ae9999c285c802cc36457598"}}, +{"id":"htdoc","key":"htdoc","value":{"rev":"3-80ef9e3202b0d96b79435a2bc90bc899"}}, +{"id":"html","key":"html","value":{"rev":"3-92c4af7de329c92ff2e0be5c13020e78"}}, +{"id":"html-minifier","key":"html-minifier","value":{"rev":"7-2441ed004e2a6e7f1c42003ec03277ec"}}, +{"id":"html-sourcery","key":"html-sourcery","value":{"rev":"11-7ce1d4aa2e1d319fa108b02fb294d4ce"}}, +{"id":"html2coffeekup","key":"html2coffeekup","value":{"rev":"13-bae4a70411f6f549c281c69835fe3276"}}, +{"id":"html2coffeekup-bal","key":"html2coffeekup-bal","value":{"rev":"5-0663ac1339d72932004130b668c949f0"}}, +{"id":"html2jade","key":"html2jade","value":{"rev":"11-e50f504c5c847d7ffcde7328c2ade4fb"}}, +{"id":"html5","key":"html5","value":{"rev":"46-ca85ea99accaf1dc9ded4e2e3aa429c6"}}, +{"id":"html5edit","key":"html5edit","value":{"rev":"10-0383296c33ada4d356740f29121eeb9f"}}, +{"id":"htmlKompressor","key":"htmlKompressor","value":{"rev":"13-95a3afe7f7cfe02e089e41588b937fb1"}}, +{"id":"htmlkup","key":"htmlkup","value":{"rev":"27-5b0115636f38886ae0a40e5f52e2bfdd"}}, +{"id":"htmlparser","key":"htmlparser","value":{"rev":"14-52b2196c1456d821d47bb1d2779b2433"}}, +{"id":"htmlparser2","key":"htmlparser2","value":{"rev":"3-9bc0b807acd913999dfc949b3160a3db"}}, +{"id":"htracr","key":"htracr","value":{"rev":"27-384d0522328e625978b97d8eae8d942d"}}, +{"id":"http","key":"http","value":{"rev":"3-f197d1b599cb9da720d3dd58d9813ace"}}, +{"id":"http-agent","key":"http-agent","value":{"rev":"10-1715dd3a7adccf55bd6637d78bd345d1"}}, +{"id":"http-auth","key":"http-auth","value":{"rev":"3-21636d4430be18a5c6c42e5cb622c2e0"}}, +{"id":"http-basic-auth","key":"http-basic-auth","value":{"rev":"6-0a77e99ce8e31558d5917bd684fa2c9a"}}, +{"id":"http-browserify","key":"http-browserify","value":{"rev":"3-4f720b4af628ed8b5fb22839c1f91f4d"}}, +{"id":"http-console","key":"http-console","value":{"rev":"43-a20cbefed77bcae7de461922286a1f04"}}, +{"id":"http-digest","key":"http-digest","value":{"rev":"6-e0164885dcad21ab6150d537af0edd92"}}, +{"id":"http-digest-auth","key":"http-digest-auth","value":{"rev":"7-613ac841b808fd04e272e050fd5a45ac"}}, +{"id":"http-get","key":"http-get","value":{"rev":"39-b7cfeb2b572d4ecf695493e0886869f4"}}, +{"id":"http-load","key":"http-load","value":{"rev":"3-8c64f4972ff59e89fee041adde99b8ba"}}, +{"id":"http-proxy","key":"http-proxy","value":{"rev":"97-5b8af88886c8c047a9862bf62f6b9294"}}, +{"id":"http-proxy-backward","key":"http-proxy-backward","value":{"rev":"2-4433b04a41e8adade3f6b6b2b939df4b"}}, +{"id":"http-proxy-glimpse","key":"http-proxy-glimpse","value":{"rev":"3-a3e9791d4d9bfef5929ca55d874df18b"}}, +{"id":"http-proxy-no-line-184-error","key":"http-proxy-no-line-184-error","value":{"rev":"3-7e20a990820976d8c6d27c312cc5a67c"}}, +{"id":"http-proxy-selective","key":"http-proxy-selective","value":{"rev":"12-6e273fcd008afeceb6737345c46e1024"}}, +{"id":"http-recorder","key":"http-recorder","value":{"rev":"3-26dd0bc4f5c0bf922db1875e995d025f"}}, +{"id":"http-request-provider","key":"http-request-provider","value":{"rev":"6-436b69971dd1735ac3e41571375f2d15"}}, +{"id":"http-server","key":"http-server","value":{"rev":"21-1b80b6558692afd08c36629b0ecdc18c"}}, +{"id":"http-signature","key":"http-signature","value":{"rev":"9-49ca63427b535f2d18182d92427bc5b6"}}, +{"id":"http-stack","key":"http-stack","value":{"rev":"9-51614060741d6c85a7fd4c714ed1a9b2"}}, +{"id":"http-status","key":"http-status","value":{"rev":"5-1ec72fecc62a41d6f180d15c95e81270"}}, +{"id":"http_compat","key":"http_compat","value":{"rev":"3-88244d4b0fd08a3140fa1b2e8b1b152c"}}, +{"id":"http_router","key":"http_router","value":{"rev":"23-ad52b58b6bfc96d6d4e8215e0c31b294"}}, +{"id":"http_trace","key":"http_trace","value":{"rev":"7-d8024b5e41540e4240120ffefae523e4"}}, +{"id":"httpd","key":"httpd","value":{"rev":"3-9e2a19f007a6a487cdb752f4b8249657"}}, +{"id":"httpmock","key":"httpmock","value":{"rev":"3-b6966ba8ee2c31b0e7729fc59bb00ccf"}}, +{"id":"https-proxied","key":"https-proxied","value":{"rev":"5-f63a4c663d372502b0dcd4997e759e66"}}, +{"id":"httpu","key":"httpu","value":{"rev":"5-88a5b2bac8391d91673fc83d4cfd32df"}}, +{"id":"hungarian-magic","key":"hungarian-magic","value":{"rev":"4-9eae750ac6f30b6687d9a031353f5217"}}, +{"id":"huntergatherer","key":"huntergatherer","value":{"rev":"9-5c9d833a134cfaa901d89dce93f5b013"}}, +{"id":"hxp","key":"hxp","value":{"rev":"8-1f52ba766491826bdc6517c6cc508b2c"}}, +{"id":"hyde","key":"hyde","value":{"rev":"3-5763db65cab423404752b1a6354a7a6c"}}, +{"id":"hydra","key":"hydra","value":{"rev":"8-8bb4ed249fe0f9cdb8b11e492b646b88"}}, +{"id":"hyperpublic","key":"hyperpublic","value":{"rev":"11-5738162f3dbf95803dcb3fb28efd8740"}}, +{"id":"i18n","key":"i18n","value":{"rev":"7-f0d6b3c72ecd34dde02d805041eca996"}}, +{"id":"ical","key":"ical","value":{"rev":"13-baf448be48ab83ec9b3fb8bf83fbb9a1"}}, +{"id":"icalendar","key":"icalendar","value":{"rev":"5-78dd8fd8ed2c219ec56ad26a0727cf76"}}, +{"id":"icecap","key":"icecap","value":{"rev":"9-88d6865078a5e6e1ff998e2e73e593f3"}}, +{"id":"icecapdjs","key":"icecapdjs","value":{"rev":"11-d8e3c718a230d49caa3b5f76cfff7ce9"}}, +{"id":"icecast-stack","key":"icecast-stack","value":{"rev":"9-13b8da6ae373152ab0c8560e2f442af0"}}, +{"id":"ichabod","key":"ichabod","value":{"rev":"19-d0f02ffba80661398ceb80a7e0cbbfe6"}}, +{"id":"icing","key":"icing","value":{"rev":"11-84815e78828190fbaa52d6b93c75cb4f"}}, +{"id":"ico","key":"ico","value":{"rev":"3-5727a35c1df453bfdfa6a03e49725adf"}}, +{"id":"iconv","key":"iconv","value":{"rev":"18-5f5b3193268f1fa099e0112b3e033ffc"}}, +{"id":"iconv-jp","key":"iconv-jp","value":{"rev":"3-660b8f2def930263d2931cae2dcc401d"}}, +{"id":"id3","key":"id3","value":{"rev":"8-afe68aede872cae7b404aaa01c0108a5"}}, +{"id":"idea","key":"idea","value":{"rev":"9-a126c0e52206c51dcf972cf53af0bc32"}}, +{"id":"idiomatic-console","key":"idiomatic-console","value":{"rev":"25-67696c16bf79d1cc8caf4df62677c3ec"}}, +{"id":"idiomatic-stdio","key":"idiomatic-stdio","value":{"rev":"15-9d74c9a8872b1f7c41d6c671d7a14b7d"}}, +{"id":"iglob","key":"iglob","value":{"rev":"6-b8a3518cb67cad20c89f37892a2346a5"}}, +{"id":"ignite","key":"ignite","value":{"rev":"19-06daa730a70f69dc3a0d6d4984905c61"}}, +{"id":"iles-forked-irc-js","key":"iles-forked-irc-js","value":{"rev":"7-eb446f4e0db856e00351a5da2fa20616"}}, +{"id":"image","key":"image","value":{"rev":"8-5f7811db33c210eb38e1880f7cc433f2"}}, +{"id":"imageable","key":"imageable","value":{"rev":"61-9f7e03d3d990d34802f1e9c8019dbbfa"}}, +{"id":"imageinfo","key":"imageinfo","value":{"rev":"11-9bde1a1f0801d94539a4b70b61614849"}}, +{"id":"imagemagick","key":"imagemagick","value":{"rev":"10-b1a1ea405940fecf487da94b733e8c29"}}, +{"id":"imagick","key":"imagick","value":{"rev":"3-21d51d8a265a705881dadbc0c9f7c016"}}, +{"id":"imap","key":"imap","value":{"rev":"13-6a59045496c80b474652d2584edd4acb"}}, +{"id":"imbot","key":"imbot","value":{"rev":"11-0d8075eff5e5ec354683f396378fd101"}}, +{"id":"imdb","key":"imdb","value":{"rev":"7-2bba884d0e8804f4a7e0883abd47b0a7"}}, +{"id":"imgur","key":"imgur","value":{"rev":"3-30c0e5fddc1be3398ba5f7eee1a251d7"}}, +{"id":"impact","key":"impact","value":{"rev":"7-d3390690f11c6f9dcca9f240a7bedfef"}}, +{"id":"imsi","key":"imsi","value":{"rev":"3-0aa9a01c9c79b17afae3684b7b920ced"}}, +{"id":"index","key":"index","value":{"rev":"13-ad5d8d7dfad64512a12db4d820229c07"}}, +{"id":"indexer","key":"indexer","value":{"rev":"9-b0173ce9ad9fa1b80037fa8e33a8ce12"}}, +{"id":"inflect","key":"inflect","value":{"rev":"17-9e5ea2826fe08bd950cf7e22d73371bd"}}, +{"id":"inflectjs","key":"inflectjs","value":{"rev":"3-c59db027b72be720899b4a280ac2518f"}}, +{"id":"inflector","key":"inflector","value":{"rev":"3-191ff29d3b5ed8ef6877032a1d01d864"}}, +{"id":"inheritance","key":"inheritance","value":{"rev":"3-450a1e68bd2d8f16abe7001491abb6a8"}}, +{"id":"inherits","key":"inherits","value":{"rev":"3-284f97a7ae4f777bfabe721b66de07fa"}}, +{"id":"ini","key":"ini","value":{"rev":"5-142c8f9125fbace57689e2837deb1883"}}, +{"id":"iniparser","key":"iniparser","value":{"rev":"14-1053c59ef3d50a46356be45576885c49"}}, +{"id":"inireader","key":"inireader","value":{"rev":"15-9cdc485b18bff6397f5fec45befda402"}}, +{"id":"init","key":"init","value":{"rev":"5-b81610ad72864417dab49f7a3f29cc9f"}}, +{"id":"inject","key":"inject","value":{"rev":"5-82bddb6b4f21ddaa0137fedc8913d60e"}}, +{"id":"inliner","key":"inliner","value":{"rev":"45-8a1c3e8f78438f06865b3237d6c5339a"}}, +{"id":"inode","key":"inode","value":{"rev":"7-118ffafc62dcef5bbeb14e4328c68ab3"}}, +{"id":"inotify","key":"inotify","value":{"rev":"18-03d7b1a318bd283e0185b414b48dd602"}}, +{"id":"inotify-plusplus","key":"inotify-plusplus","value":{"rev":"10-0e0ce9065a62e5e21ee5bb53fac61a6d"}}, +{"id":"inspect","key":"inspect","value":{"rev":"5-b5f18717e29caec3399abe5e4ce7a269"}}, +{"id":"instagram","key":"instagram","value":{"rev":"5-decddf3737a1764518b6a7ce600d720d"}}, +{"id":"instagram-node-lib","key":"instagram-node-lib","value":{"rev":"13-8be77f1180b6afd9066834b3f5ee8de5"}}, +{"id":"instant-styleguide","key":"instant-styleguide","value":{"rev":"9-66c02118993621376ad0b7396db435b3"}}, +{"id":"intercept","key":"intercept","value":{"rev":"9-f5622744c576405516a427b4636ee864"}}, +{"id":"interface","key":"interface","value":{"rev":"10-13806252722402bd18d88533056a863b"}}, +{"id":"interleave","key":"interleave","value":{"rev":"25-69bc136937604863748a029fb88e3605"}}, +{"id":"interstate","key":"interstate","value":{"rev":"3-3bb4a6c35ca765f88a10b9fab6307c59"}}, +{"id":"intervals","key":"intervals","value":{"rev":"21-89b71bd55b8d5f6b670d69fc5b9f847f"}}, +{"id":"intestine","key":"intestine","value":{"rev":"3-66a5531e06865ed9c966d95437ba1371"}}, +{"id":"ios7crypt","key":"ios7crypt","value":{"rev":"7-a2d309a2c074e5c1c456e2b56cbcfd17"}}, +{"id":"iostat","key":"iostat","value":{"rev":"11-f0849c0072e76701b435aa769a614e82"}}, +{"id":"ip2cc","key":"ip2cc","value":{"rev":"9-2c282606fd08d469184a272a2108639c"}}, +{"id":"ipaddr.js","key":"ipaddr.js","value":{"rev":"5-1017fd5342840745614701476ed7e6c4"}}, +{"id":"iptables","key":"iptables","value":{"rev":"7-23e56ef5d7bf0ee8f5bd0e38bde8aae3"}}, +{"id":"iptrie","key":"iptrie","value":{"rev":"4-10317b0e073befe9601e9dc308dc361a"}}, +{"id":"ipv6","key":"ipv6","value":{"rev":"6-85e937f3d79e44dbb76264c7aaaa140f"}}, +{"id":"iqengines","key":"iqengines","value":{"rev":"3-8bdbd32e9dc35b77d80a31edae235178"}}, +{"id":"irc","key":"irc","value":{"rev":"8-ed30964f57b99b1b2f2104cc5e269618"}}, +{"id":"irc-colors","key":"irc-colors","value":{"rev":"9-7ddb19db9a553567aae86bd97f1dcdfc"}}, +{"id":"irc-js","key":"irc-js","value":{"rev":"58-1c898cea420aee60283edb4fadceb90e"}}, +{"id":"ircat.js","key":"ircat.js","value":{"rev":"6-f25f20953ce96697c033315d250615d0"}}, +{"id":"ircbot","key":"ircbot","value":{"rev":"9-85a4a6f88836fc031855736676b10dec"}}, +{"id":"irccd","key":"irccd","value":{"rev":"3-bf598ae8b6af63be41852ae8199416f4"}}, +{"id":"ircd","key":"ircd","value":{"rev":"7-3ba7fc2183d32ee1e58e63092d7e82bb"}}, +{"id":"ircdjs","key":"ircdjs","value":{"rev":"15-8fcdff2bf29cf24c3bbc4b461e6cbe9f"}}, +{"id":"irclog","key":"irclog","value":{"rev":"3-79a99bd8048dd98a93c747a1426aabde"}}, +{"id":"ircrpc","key":"ircrpc","value":{"rev":"5-278bec6fc5519fdbd152ea4fa35dc58c"}}, +{"id":"irrklang","key":"irrklang","value":{"rev":"3-65936dfabf7777027069343c2e72b32e"}}, +{"id":"isaacs","key":"isaacs","value":{"rev":"7-c55a41054056f502bc580bc6819d9d1f"}}, +{"id":"isbn","key":"isbn","value":{"rev":"3-51e784ded2e3ec9ef9b382fecd1c26a1"}}, +{"id":"iscroll","key":"iscroll","value":{"rev":"4-4f6635793806507665503605e7c180f0"}}, +{"id":"isodate","key":"isodate","value":{"rev":"7-ea4b1f77e9557b153264f68fd18a9f23"}}, +{"id":"it-is","key":"it-is","value":{"rev":"14-7617f5831c308d1c4ef914bc5dc30fa7"}}, +{"id":"iterator","key":"iterator","value":{"rev":"3-e6f70367a55cabbb89589f2a88be9ab0"}}, +{"id":"itunes","key":"itunes","value":{"rev":"7-47d151c372d70d0bc311141749c84d5a"}}, +{"id":"iws","key":"iws","value":{"rev":"3-dc7b4d18565b79d3e14aa691e5e632f4"}}, +{"id":"jQuery","key":"jQuery","value":{"rev":"29-f913933259b4ec5f4c5ea63466a4bb08"}}, +{"id":"jWorkflow","key":"jWorkflow","value":{"rev":"7-582cd7aa62085ec807117138b6439550"}}, +{"id":"jaCodeMap","key":"jaCodeMap","value":{"rev":"7-28efcbf4146977bdf1e594e0982ec097"}}, +{"id":"jaaulde-cookies","key":"jaaulde-cookies","value":{"rev":"3-d5b5a75f9cabbebb2804f0b4ae93d0c5"}}, +{"id":"jacker","key":"jacker","value":{"rev":"3-888174c7e3e2a5d241f2844257cf1b10"}}, +{"id":"jade","key":"jade","value":{"rev":"144-318a9d9f63906dc3da1ef7c1ee6420b5"}}, +{"id":"jade-browser","key":"jade-browser","value":{"rev":"9-0ae6b9e321cf04e3ca8fbfe0e38f4d9e"}}, +{"id":"jade-client-connect","key":"jade-client-connect","value":{"rev":"5-96dbafafa31187dd7f829af54432de8e"}}, +{"id":"jade-ext","key":"jade-ext","value":{"rev":"9-aac9a58a4e07d82bc496bcc4241d1be0"}}, +{"id":"jade-i18n","key":"jade-i18n","value":{"rev":"23-76a21a41b5376e10c083672dccf7fc62"}}, +{"id":"jade-serial","key":"jade-serial","value":{"rev":"3-5ec712e1d8cd8d5af20ae3e62ee92854"}}, +{"id":"jadedown","key":"jadedown","value":{"rev":"11-0d16ce847d6afac2939eebcb24a7216c"}}, +{"id":"jadeify","key":"jadeify","value":{"rev":"17-4322b68bb5a7e81e839edabbc8c405a4"}}, +{"id":"jadevu","key":"jadevu","value":{"rev":"15-1fd8557a6db3c23f267de76835f9ee65"}}, +{"id":"jah","key":"jah","value":{"rev":"3-f29704037a1cffe2b08abb4283bee4a4"}}, +{"id":"jake","key":"jake","value":{"rev":"36-5cb64b1c5a89ac53eb4d09d66a5b10e1"}}, +{"id":"jammit-express","key":"jammit-express","value":{"rev":"6-e3dfa928114a2721fe9b8882d284f759"}}, +{"id":"janrain","key":"janrain","value":{"rev":"5-9554501be76fb3a472076858d1abbcd5"}}, +{"id":"janrain-api","key":"janrain-api","value":{"rev":"3-f45a65c695f4c72fdd1bf3593d8aa796"}}, +{"id":"jaque","key":"jaque","value":{"rev":"32-7f269a70c67beefc53ba1684bff5a57b"}}, +{"id":"jar","key":"jar","value":{"rev":"3-7fe0ab4aa3a2ccc5d50853f118e7aeb5"}}, +{"id":"jarvis","key":"jarvis","value":{"rev":"3-fb203b29b397a0b12c1ae56240624e3d"}}, +{"id":"jarvis-test","key":"jarvis-test","value":{"rev":"5-9537ddae8291e6dad03bc0e6acc9ac80"}}, +{"id":"jasbin","key":"jasbin","value":{"rev":"25-ae22f276406ac8bb4293d78595ce02ad"}}, +{"id":"jasmine-dom","key":"jasmine-dom","value":{"rev":"17-686de4c573f507c30ff72c6671dc3d93"}}, +{"id":"jasmine-jquery","key":"jasmine-jquery","value":{"rev":"7-86c077497a367bcd9ea96d5ab8137394"}}, +{"id":"jasmine-node","key":"jasmine-node","value":{"rev":"27-4c544c41c69d2b3cb60b9953d1c46d54"}}, +{"id":"jasmine-reporters","key":"jasmine-reporters","value":{"rev":"3-21ba522ae38402848d5a66d3d4d9a2b3"}}, +{"id":"jasmine-runner","key":"jasmine-runner","value":{"rev":"23-7458777b7a6785efc878cfd40ccb99d8"}}, +{"id":"jasminy","key":"jasminy","value":{"rev":"3-ce76023bac40c5f690cba59d430fd083"}}, +{"id":"jason","key":"jason","value":{"rev":"15-394a59963c579ed5db37fada4d082b5c"}}, +{"id":"javiary","key":"javiary","value":{"rev":"5-661be61fd0f47c9609b7d148e298e2fc"}}, +{"id":"jazz","key":"jazz","value":{"rev":"12-d11d602c1240b134b0593425911242fc"}}, +{"id":"jdoc","key":"jdoc","value":{"rev":"3-0c61fdd6b367a9acac710e553927b290"}}, +{"id":"jeesh","key":"jeesh","value":{"rev":"13-23b4e1ecf9ca76685bf7f1bfc6c076f1"}}, +{"id":"jellyfish","key":"jellyfish","value":{"rev":"25-7fef81f9b5ef5d4abbcecb030a433a72"}}, +{"id":"jen","key":"jen","value":{"rev":"3-ab1b07453318b7e0254e1dadbee7868f"}}, +{"id":"jerk","key":"jerk","value":{"rev":"34-e31f26d5e3b700d0a3e5f5a5acf0d381"}}, +{"id":"jessie","key":"jessie","value":{"rev":"19-829b932e57204f3b7833b34f75d6bf2a"}}, +{"id":"jezebel","key":"jezebel","value":{"rev":"15-b67c259e160390064da69a512382e06f"}}, +{"id":"jimi","key":"jimi","value":{"rev":"10-cc4a8325d6b847362a422304a0057231"}}, +{"id":"jinjs","key":"jinjs","value":{"rev":"37-38fcf1989f1b251a35e4ff725118f55e"}}, +{"id":"jinkies","key":"jinkies","value":{"rev":"30-73fec0e854aa31bcbf3ae1ca04462b22"}}, +{"id":"jison","key":"jison","value":{"rev":"52-d03c6f5e2bdd7624d39d93ec5e88c383"}}, +{"id":"jitsu","key":"jitsu","value":{"rev":"164-95083f8275f0bf2834f62027569b4da2"}}, +{"id":"jitter","key":"jitter","value":{"rev":"16-3f7b183aa7922615f4b5b2fb46653477"}}, +{"id":"jj","key":"jj","value":{"rev":"21-1b3f97e9725e1241c96a884c85dc4e30"}}, +{"id":"jjw","key":"jjw","value":{"rev":"13-835c632dfc5df7dd37860bd0b2c1cb38"}}, +{"id":"jkwery","key":"jkwery","value":{"rev":"11-212429c9c9e1872d4e278da055b5ae0a"}}, +{"id":"jmen","key":"jmen","value":{"rev":"3-a0b67d5b84a077061d3fed2ddbf2c6a8"}}, +{"id":"jobmanager","key":"jobmanager","value":{"rev":"15-1a589ede5f10d1ea2f33f1bb91f9b3aa"}}, +{"id":"jobs","key":"jobs","value":{"rev":"12-3072b6164c5dca8fa9d24021719048ff"}}, +{"id":"jobvite","key":"jobvite","value":{"rev":"56-3d69b0e6d91722ef4908b4fe26bb5432"}}, +{"id":"jodoc","key":"jodoc","value":{"rev":"3-7b05c6d7b4c9a9fa85d3348948d2d52d"}}, +{"id":"johnny-mnemonic","key":"johnny-mnemonic","value":{"rev":"3-e8749d4be597f002aae720011b7c9273"}}, +{"id":"join","key":"join","value":{"rev":"5-ab92491dc83b5e8ed5f0cc49e306d5d5"}}, +{"id":"jolokia-client","key":"jolokia-client","value":{"rev":"26-1f93cb53f4a870b94540cdbf7627b1c4"}}, +{"id":"joo","key":"joo","value":{"rev":"11-e0d4a97eceacdd13769bc5f56e059aa7"}}, +{"id":"jools","key":"jools","value":{"rev":"3-9da332d524a117c4d72a58bb45fa34fd"}}, +{"id":"joose","key":"joose","value":{"rev":"22-ef8a1895680ad2f9c1cd73cd1afbb58e"}}, +{"id":"joosex-attribute","key":"joosex-attribute","value":{"rev":"18-119df97dba1ba2631c94d49e3142bbd7"}}, +{"id":"joosex-bridge-ext","key":"joosex-bridge-ext","value":{"rev":"20-5ad2168291aad2cf021df0a3eb103538"}}, +{"id":"joosex-class-simpleconstructor","key":"joosex-class-simpleconstructor","value":{"rev":"6-f71e02e44f611550374ad9f5d0c37fdf"}}, +{"id":"joosex-class-singleton","key":"joosex-class-singleton","value":{"rev":"6-3ba6b8644722b29febe384a368c18aab"}}, +{"id":"joosex-cps","key":"joosex-cps","value":{"rev":"20-493c65faf1ec59416bae475529c51cd4"}}, +{"id":"joosex-meta-lazy","key":"joosex-meta-lazy","value":{"rev":"13-ef8bc4e57006cfcecd72a344d8dc9da6"}}, +{"id":"joosex-namespace-depended","key":"joosex-namespace-depended","value":{"rev":"22-8a38a21f8564470b96082177e81f3db6"}}, +{"id":"joosex-observable","key":"joosex-observable","value":{"rev":"7-52e7018931e5465920bb6feab88aa468"}}, +{"id":"joosex-role-parameterized","key":"joosex-role-parameterized","value":{"rev":"6-65aa4fa4967c4fbe06357ccda5e6f810"}}, +{"id":"joosex-simplerequest","key":"joosex-simplerequest","value":{"rev":"10-12d105b60b8b3ca3a3626ca0ec53892d"}}, +{"id":"josp","key":"josp","value":{"rev":"3-c4fa8445a0d96037e00fe96d007bcf0c"}}, +{"id":"jot","key":"jot","value":{"rev":"3-8fab571ce3ad993f3594f3c2e0fc6915"}}, +{"id":"journey","key":"journey","value":{"rev":"40-efe1fa6c8d735592077c9a24b3b56a03"}}, +{"id":"jpeg","key":"jpeg","value":{"rev":"8-ab437fbaf88f32a7fb625a0b27521292"}}, +{"id":"jq","key":"jq","value":{"rev":"3-9d83287aa9e6aab25590fac9adbab968"}}, +{"id":"jqNode","key":"jqNode","value":{"rev":"3-fcaf2c47aba5637a4a23c64b6fc778cf"}}, +{"id":"jqbuild","key":"jqbuild","value":{"rev":"3-960edcea36784aa9ca135cd922e0cb9b"}}, +{"id":"jqserve","key":"jqserve","value":{"rev":"3-39272c5479aabaafe66ffa26a6eb3bb5"}}, +{"id":"jqtpl","key":"jqtpl","value":{"rev":"54-ce2b62ced4644d5fe24c3a8ebcb4d528"}}, +{"id":"jquajax","key":"jquajax","value":{"rev":"3-a079cb8f3a686faaafe420760e77a330"}}, +{"id":"jquery","key":"jquery","value":{"rev":"27-60fd58bba99d044ffe6e140bafd72595"}}, +{"id":"jquery-browserify","key":"jquery-browserify","value":{"rev":"9-a4e9afd657f3c632229afa356382f6a4"}}, +{"id":"jquery-deferred","key":"jquery-deferred","value":{"rev":"5-0fd0cec51f7424a50f0dba3cbe74fd58"}}, +{"id":"jquery-drive","key":"jquery-drive","value":{"rev":"3-8474f192fed5c5094e56bc91f5e8a0f8"}}, +{"id":"jquery-mousewheel","key":"jquery-mousewheel","value":{"rev":"3-cff81086cf651e52377a8d5052b09d64"}}, +{"id":"jquery-placeholdize","key":"jquery-placeholdize","value":{"rev":"3-7acc3fbda1b8daabce18876d2b4675e3"}}, +{"id":"jquery-tmpl-jst","key":"jquery-tmpl-jst","value":{"rev":"13-575031eb2f2b1e4c5562e195fce0bc93"}}, +{"id":"jquery.effects.blind","key":"jquery.effects.blind","value":{"rev":"3-5f3bec5913edf1bfcee267891f6204e2"}}, +{"id":"jquery.effects.bounce","key":"jquery.effects.bounce","value":{"rev":"3-245b2e7d9a1295dd0f7d568b8087190d"}}, +{"id":"jquery.effects.clip","key":"jquery.effects.clip","value":{"rev":"3-7aa63a590b6d90d5ea20e21c8dda675d"}}, +{"id":"jquery.effects.core","key":"jquery.effects.core","value":{"rev":"3-dd2fa270d8aea21104c2c92d6b06500d"}}, +{"id":"jquery.effects.drop","key":"jquery.effects.drop","value":{"rev":"3-8d0e30016e99460063a9a9000ce7b032"}}, +{"id":"jquery.effects.explode","key":"jquery.effects.explode","value":{"rev":"3-3d5e3bb2fb451f7eeaeb72b6743b6e6c"}}, +{"id":"jquery.effects.fade","key":"jquery.effects.fade","value":{"rev":"3-f362c762053eb278b5db5f92e248c3a5"}}, +{"id":"jquery.effects.fold","key":"jquery.effects.fold","value":{"rev":"3-c7d823c2b25c4f1e6a1801f4b1bc7a2c"}}, +{"id":"jquery.effects.highlight","key":"jquery.effects.highlight","value":{"rev":"3-44ef3c62a6b829382bffa6393cd31ed9"}}, +{"id":"jquery.effects.pulsate","key":"jquery.effects.pulsate","value":{"rev":"3-3cad87635cecc2602d40682cf669d2fe"}}, +{"id":"jquery.effects.scale","key":"jquery.effects.scale","value":{"rev":"3-2c8df02eeed343088e2253d84064a219"}}, +{"id":"jquery.effects.shake","key":"jquery.effects.shake","value":{"rev":"3-d63ab567d484311744d848b520a720c7"}}, +{"id":"jquery.effects.slide","key":"jquery.effects.slide","value":{"rev":"3-9eb5d1075d67045a8fa305e596981934"}}, +{"id":"jquery.effects.transfer","key":"jquery.effects.transfer","value":{"rev":"3-371bc87350ede6da53a40468b63200a9"}}, +{"id":"jquery.tmpl","key":"jquery.tmpl","value":{"rev":"5-75efd6c8c0ce030f2da12b984f9dfe6c"}}, +{"id":"jquery.ui.accordion","key":"jquery.ui.accordion","value":{"rev":"3-964ee7d6c50f31e7db6631da28e2261a"}}, +{"id":"jquery.ui.autocomplete","key":"jquery.ui.autocomplete","value":{"rev":"3-950d240629d142eab5e07c2776e39bcc"}}, +{"id":"jquery.ui.button","key":"jquery.ui.button","value":{"rev":"3-a1c7f3eeb9298ac0c116d75a176a6d17"}}, +{"id":"jquery.ui.core","key":"jquery.ui.core","value":{"rev":"3-b7ba340b7304a304f85c4d13438d1195"}}, +{"id":"jquery.ui.datepicker","key":"jquery.ui.datepicker","value":{"rev":"3-5b76579057f1b870959a06ab833f1972"}}, +{"id":"jquery.ui.dialog","key":"jquery.ui.dialog","value":{"rev":"3-0c314cee86bf67298759efcfd47246f6"}}, +{"id":"jquery.ui.draggable","key":"jquery.ui.draggable","value":{"rev":"3-b7a15d2bdbcdc6f0f3cd6e4522f9f1f3"}}, +{"id":"jquery.ui.droppable","key":"jquery.ui.droppable","value":{"rev":"3-86d8a1558f5e9383b271b4d968ba081d"}}, +{"id":"jquery.ui.mouse","key":"jquery.ui.mouse","value":{"rev":"3-ccb88d773c452c778c694f9f551cb816"}}, +{"id":"jquery.ui.position","key":"jquery.ui.position","value":{"rev":"3-c49c13b38592a363585600b7af54d977"}}, +{"id":"jquery.ui.progressbar","key":"jquery.ui.progressbar","value":{"rev":"3-b28dfadab64f9548b828c42bf870fcc9"}}, +{"id":"jquery.ui.resizable","key":"jquery.ui.resizable","value":{"rev":"3-aa356230544cbe8ab8dc5fab08cc0fa7"}}, +{"id":"jquery.ui.selectable","key":"jquery.ui.selectable","value":{"rev":"3-6b11846c104d580556e40eb5194c45f2"}}, +{"id":"jquery.ui.slider","key":"jquery.ui.slider","value":{"rev":"3-e8550b76bf58a9cbeca9ea91eb763257"}}, +{"id":"jquery.ui.sortable","key":"jquery.ui.sortable","value":{"rev":"3-1ddd981bd720f055fbd5bb1d06df55ad"}}, +{"id":"jquery.ui.tabs","key":"jquery.ui.tabs","value":{"rev":"3-e0514383f4d920b9dc23ef7a7ea4d8af"}}, +{"id":"jquery.ui.widget","key":"jquery.ui.widget","value":{"rev":"3-3a0800fa067c12d013168f74acf21e6d"}}, +{"id":"jqueryify","key":"jqueryify","value":{"rev":"3-2655cf6a45795a8bd138a464e6c18f04"}}, +{"id":"jrep","key":"jrep","value":{"rev":"3-edbcf6931b8a2b3f550727d8b839acc3"}}, +{"id":"js-beautify-node","key":"js-beautify-node","value":{"rev":"3-401cd1c130aaec2c090b578fe8db6290"}}, +{"id":"js-class","key":"js-class","value":{"rev":"5-a63fbb0136dcd602feee72e70674d5db"}}, +{"id":"js-jango","key":"js-jango","value":{"rev":"3-af4e4a7844791617e66a40a1c403bb98"}}, +{"id":"js-loader","key":"js-loader","value":{"rev":"13-8d9729495c1692e47d2cd923e839b4c8"}}, +{"id":"js-manager","key":"js-manager","value":{"rev":"5-6d384a2ce4737f13d417f85689c3c372"}}, +{"id":"js-nts","key":"js-nts","value":{"rev":"3-7d921611b567d2d890bc983c343558ef"}}, +{"id":"js-openstack","key":"js-openstack","value":{"rev":"11-d56996be276fbe6162573575932b1cba"}}, +{"id":"js-select","key":"js-select","value":{"rev":"9-9d20f6d86d9e6f8a84191346288b76ed"}}, +{"id":"js.io","key":"js.io","value":{"rev":"3-c5e16e13372ba592ccf2ac86ee007a1f"}}, +{"id":"js2","key":"js2","value":{"rev":"35-2dc694e48b67252d8787f5e889a07430"}}, +{"id":"js2coffee","key":"js2coffee","value":{"rev":"19-8eeafa894dcc0dc306b02e728543511e"}}, +{"id":"jsDAV","key":"jsDAV","value":{"rev":"11-4ab1935d98372503439b054daef2e78e"}}, +{"id":"jsDump","key":"jsDump","value":{"rev":"5-32d6e4032bd114245356970f0b76a58a"}}, +{"id":"jsSourceCodeParser","key":"jsSourceCodeParser","value":{"rev":"3-78c5e8624ab25fca99a7bb6cd9be402b"}}, +{"id":"jsapp","key":"jsapp","value":{"rev":"3-6758eb2743cc22f723a6612b34c8d943"}}, +{"id":"jscc-node","key":"jscc-node","value":{"rev":"3-5f52dc20dc2a188bc32e7219c9d2f225"}}, +{"id":"jscheckstyle","key":"jscheckstyle","value":{"rev":"5-82021f06a1bd824ac195e0ab8a3b598c"}}, +{"id":"jsclass","key":"jsclass","value":{"rev":"9-2a0656b9497c5a8208a0fefa5aae3350"}}, +{"id":"jsconfig","key":"jsconfig","value":{"rev":"3-b1afef99468f81eff319453623135a56"}}, +{"id":"jscssp","key":"jscssp","value":{"rev":"6-413ad0701e6dbb412e8a01aadb6672c4"}}, +{"id":"jsdata","key":"jsdata","value":{"rev":"5-53f8b26f28291dccfdff8f14e7f4c44c"}}, +{"id":"jsdeferred","key":"jsdeferred","value":{"rev":"8-bc238b921a1fa465503722756a98e9b7"}}, +{"id":"jsdoc","key":"jsdoc","value":{"rev":"3-386eb47a2761a1ad025996232751fba9"}}, +{"id":"jsdog","key":"jsdog","value":{"rev":"11-d4a523898a7c474b5c7b8cb8b24bafe8"}}, +{"id":"jsdom","key":"jsdom","value":{"rev":"63-86bc6b9d8bfdb99b793ac959e126f7ff"}}, +{"id":"jsftp","key":"jsftp","value":{"rev":"35-89cd772521d7ac3cead71c602ddeb819"}}, +{"id":"jsgi","key":"jsgi","value":{"rev":"20-dbef9d8dfb5c9bf1a3b6014159bb305a"}}, +{"id":"jsgi-node","key":"jsgi-node","value":{"rev":"1-8ec0892e521754aaf88684714d306af9"}}, +{"id":"jsgrep","key":"jsgrep","value":{"rev":"7-be19445481acdbbb684fdc2425d88d08"}}, +{"id":"jshelpers","key":"jshelpers","value":{"rev":"11-9509dcdd48bc494de76cae66217ebedb"}}, +{"id":"jshint","key":"jshint","value":{"rev":"34-ed2e7ea0e849126bd9821b86f23b7314"}}, +{"id":"jshint-autofix","key":"jshint-autofix","value":{"rev":"9-abbb3622aa8a47a8890dbbaab0009b6d"}}, +{"id":"jshint-mode","key":"jshint-mode","value":{"rev":"5-06ec066819b93c7ae6782c755a0e2125"}}, +{"id":"jshint-runner","key":"jshint-runner","value":{"rev":"7-6fc8a15e387a4e81e300a54a86a3a240"}}, +{"id":"jshtml","key":"jshtml","value":{"rev":"5-d3e96c31cf1cd2fcf7743defc1631c3a"}}, +{"id":"jsinc","key":"jsinc","value":{"rev":"9-0e4dc3ba04b440085a79d6001232abfc"}}, +{"id":"jslint","key":"jslint","value":{"rev":"10-ab451352333b5f3d29c6cdbab49187dd"}}, +{"id":"jslint-core","key":"jslint-core","value":{"rev":"3-1f874d8cca07b6f007bc80c23ba15e2e"}}, +{"id":"jslint-strict","key":"jslint-strict","value":{"rev":"8-3d694a0f3079691da1866de16f290ea2"}}, +{"id":"jslinux","key":"jslinux","value":{"rev":"13-033cb60c7867aae599863323a97f45c0"}}, +{"id":"jslitmus","key":"jslitmus","value":{"rev":"6-d3f3f82ea1a376acc2b24c69da003409"}}, +{"id":"jsmeter","key":"jsmeter","value":{"rev":"5-7838bb9b970cbaa29a48802c508fd091"}}, +{"id":"jsmin","key":"jsmin","value":{"rev":"6-002ad1b385915e60f895b5e52492fb94"}}, +{"id":"json","key":"json","value":{"rev":"39-1d24fb8c3bdf0ac533bfc52e74420adc"}}, +{"id":"json-browser","key":"json-browser","value":{"rev":"6-883f051c1297cf631adba1c855ff2e13"}}, +{"id":"json-builder","key":"json-builder","value":{"rev":"5-e7a996ff1ef89114ce2ab6de9b653af8"}}, +{"id":"json-command","key":"json-command","value":{"rev":"16-8239cb65563720c42da5562d3a031b09"}}, +{"id":"json-fu","key":"json-fu","value":{"rev":"5-7933c35711cb9d7673d7514fe495c56d"}}, +{"id":"json-line-protocol","key":"json-line-protocol","value":{"rev":"7-98de63467d154b40a029391af8a26042"}}, +{"id":"json-object","key":"json-object","value":{"rev":"7-534cd9680c386c5b9800848755698f2b"}}, +{"id":"json-ref","key":"json-ref","value":{"rev":"3-cd09776d166c3f77013e429737c7e1e9"}}, +{"id":"json-san","key":"json-san","value":{"rev":"7-8683abde23232c1d84266e7a2d5c4527"}}, +{"id":"json-schema","key":"json-schema","value":{"rev":"1-2f323062e7ec80d2ff765da43c7aaa7d"}}, +{"id":"json-sockets","key":"json-sockets","value":{"rev":"26-bfef71c0d9fb4d56010b05f47f142748"}}, +{"id":"json-storage","key":"json-storage","value":{"rev":"3-46139e3a54c0a27e67820df2c7e87dbf"}}, +{"id":"json-storage-model","key":"json-storage-model","value":{"rev":"3-8b77044e192791613cf92b2f3317357f"}}, +{"id":"json-streamify","key":"json-streamify","value":{"rev":"5-d98cd72265fba652481eef6baa980f46"}}, +{"id":"json-streams","key":"json-streams","value":{"rev":"3-e07fc5ca24b33145c8aacf9995d46723"}}, +{"id":"json-tables","key":"json-tables","value":{"rev":"3-37a652b54880487e66ffeee6822b945b"}}, +{"id":"json-template","key":"json-template","value":{"rev":"3-9ee3a101c60ea682fb88759b2df837e4"}}, +{"id":"json2","key":"json2","value":{"rev":"12-bc3d411db772e0947ca58a54c2084073"}}, +{"id":"json2ify","key":"json2ify","value":{"rev":"3-c2d6677cc35e4668c97cf6800a4728d8"}}, +{"id":"json2xml","key":"json2xml","value":{"rev":"3-e955b994479362685e2197b39909dea2"}}, +{"id":"json_req","key":"json_req","value":{"rev":"15-14520bc890cbb0ab4c142b59bf21c9f1"}}, +{"id":"jsonapi","key":"jsonapi","value":{"rev":"11-2b27aaca5643d6a5b3ab38721cf6342f"}}, +{"id":"jsonconfig","key":"jsonconfig","value":{"rev":"5-0072bb54cb0ae5b13eee4f1657ba6a29"}}, +{"id":"jsond","key":"jsond","value":{"rev":"13-7c3622aeb147dae4698608ee32d81b45"}}, +{"id":"jsondate","key":"jsondate","value":{"rev":"3-1da5d30ee1cf7c6d9605a446efd91478"}}, +{"id":"jsonds","key":"jsonds","value":{"rev":"9-af2867869a46787e58c337e700dbf0dd"}}, +{"id":"jsonds2","key":"jsonds2","value":{"rev":"3-e7ed9647cc1ba72e59b625840358c7ca"}}, +{"id":"jsonfiles","key":"jsonfiles","value":{"rev":"3-5e643ba75c401f653f505e7938540d83"}}, +{"id":"jsonify","key":"jsonify","value":{"rev":"3-91207fd1bc11668be7906f74992de6bb"}}, +{"id":"jsonize","key":"jsonize","value":{"rev":"3-4881031480a5326d9f5966189170db25"}}, +{"id":"jsonlint","key":"jsonlint","value":{"rev":"11-88d3c1c395846e7687f410e0dc405469"}}, +{"id":"jsonml","key":"jsonml","value":{"rev":"3-9990d9515fa554b5c7ff8bf8c7bb3308"}}, +{"id":"jsonparse","key":"jsonparse","value":{"rev":"3-569962847a5fd9d65fdf91af9e3e87a5"}}, +{"id":"jsonpointer","key":"jsonpointer","value":{"rev":"5-0310a11e82e9e22a4e5239dee2bc2213"}}, +{"id":"jsonprettify","key":"jsonprettify","value":{"rev":"3-173ae677f2110dfff8cb17dd2b4c68de"}}, +{"id":"jsonreq","key":"jsonreq","value":{"rev":"5-84b47d8c528ea7efa9aae113e5ff53cf"}}, +{"id":"jsonrpc","key":"jsonrpc","value":{"rev":"10-e40ff49715537320cbbbde67378f099e"}}, +{"id":"jsonrpc-ws","key":"jsonrpc-ws","value":{"rev":"7-73c385f3d35dadbdc87927f6a751e3ca"}}, +{"id":"jsonrpc2","key":"jsonrpc2","value":{"rev":"13-71efdea4f551d3a2550fcf5355ea8c8c"}}, +{"id":"jsontool","key":"jsontool","value":{"rev":"14-44bc979d3a8dc9295c825def01e533b4"}}, +{"id":"jsontoxml","key":"jsontoxml","value":{"rev":"8-2640fd26237ab4a45450748d392dd2d2"}}, +{"id":"jsontry","key":"jsontry","value":{"rev":"3-adb3f32f86419ac4b589ce41ab253952"}}, +{"id":"jsorm-i18n","key":"jsorm-i18n","value":{"rev":"3-54347174039512616ed76cc9a37605ea"}}, +{"id":"jsorm-utilities","key":"jsorm-utilities","value":{"rev":"3-187fc9f86ed8d32ebcb6c451fa7cc3c4"}}, +{"id":"jspack","key":"jspack","value":{"rev":"3-84955792d8b57fc301968daf674bace7"}}, +{"id":"jspkg","key":"jspkg","value":{"rev":"5-f5471c37554dad3492021490a70a1190"}}, +{"id":"jspp","key":"jspp","value":{"rev":"8-7607018fa48586f685dda17d77d0999b"}}, +{"id":"jss","key":"jss","value":{"rev":"20-4517b1daeda4f878debddc9f23347f00"}}, +{"id":"jst","key":"jst","value":{"rev":"27-8372bf5c052b6bd6e28f5d2c89b47e49"}}, +{"id":"jstestdriver","key":"jstestdriver","value":{"rev":"3-d26b172af33d6c45fc3dc96b96865714"}}, +{"id":"jstoxml","key":"jstoxml","value":{"rev":"15-c26b77ed5228500238c7b21a3dbdbbb7"}}, +{"id":"jsup","key":"jsup","value":{"rev":"3-54eb8598ae1a49bd1540e482a44a6abc"}}, +{"id":"jthon","key":"jthon","value":{"rev":"5-d578940ac32497839ff48d3f6205e9e2"}}, +{"id":"juggernaut","key":"juggernaut","value":{"rev":"20-15d33218943b9ec64b642e2a4a05e4b8"}}, +{"id":"juggernaut-yoomee","key":"juggernaut-yoomee","value":{"rev":"7-a58d429e46aac76260e236c64d20ff02"}}, +{"id":"jump","key":"jump","value":{"rev":"19-d47e23c31dc623b54e60004b08f6f624"}}, +{"id":"jumprope","key":"jumprope","value":{"rev":"5-98d4e2452f14d3b0996f04882b07d674"}}, +{"id":"junction","key":"junction","value":{"rev":"3-2b73ea17d862b1e95039141e98e53268"}}, +{"id":"jus-config","key":"jus-config","value":{"rev":"5-d2da00317dceb712d82dbfc776122dbe"}}, +{"id":"jus-i18n","key":"jus-i18n","value":{"rev":"3-d146cfc5f3c9aee769390ed921836b6e"}}, +{"id":"jus-task","key":"jus-task","value":{"rev":"13-d127de2a102eef2eb0d1b67810ecd558"}}, +{"id":"justtest","key":"justtest","value":{"rev":"17-467ee4ca606f0447a0c458550552fd0a"}}, +{"id":"jute","key":"jute","value":{"rev":"99-158d262e9126de5026bbfeb3168d9277"}}, +{"id":"jwt","key":"jwt","value":{"rev":"3-4cb8a706d1bc3c300bdadeba781c7bc4"}}, +{"id":"kaffeine","key":"kaffeine","value":{"rev":"47-261825b8d8cdf168387c6a275682dd0b"}}, +{"id":"kafka","key":"kafka","value":{"rev":"9-7465d4092e6322d0b744f017be8ffcea"}}, +{"id":"kahan","key":"kahan","value":{"rev":"5-107bb2dcdb51faaa00aef1e37eff91eb"}}, +{"id":"kahve-ansi","key":"kahve-ansi","value":{"rev":"5-a86d9a3ea56362fa81c8ee9f1ef8f2ef"}}, +{"id":"kahve-cake","key":"kahve-cake","value":{"rev":"3-873b4e553c4ba417c888aadce3b800f6"}}, +{"id":"kahve-classmethod","key":"kahve-classmethod","value":{"rev":"3-08e0a5786edc15539cc6746fe6c65bec"}}, +{"id":"kahve-exception","key":"kahve-exception","value":{"rev":"3-fb9d839cfdc069271cbc10fa27a87f3c"}}, +{"id":"kahve-progress","key":"kahve-progress","value":{"rev":"3-d2fcdd99793a0c3c3a314afb067a3701"}}, +{"id":"kanso","key":"kanso","value":{"rev":"41-2b18ab56cc86313daa840b7b3f63b318"}}, +{"id":"kaph","key":"kaph","value":{"rev":"7-c24622e38cf23bac67459bfe5a0edd63"}}, +{"id":"karait","key":"karait","value":{"rev":"9-a4abc4bc11c747448c4884cb714737c9"}}, +{"id":"kasabi","key":"kasabi","value":{"rev":"3-36cb65aef11d181c532f4549d58944e6"}}, +{"id":"kassit","key":"kassit","value":{"rev":"27-6fafe5122a4dda542a34ba18dddfc9ea"}}, +{"id":"kdtree","key":"kdtree","value":{"rev":"9-177bf5018be1f177d302af1d746b0462"}}, +{"id":"keeper","key":"keeper","value":{"rev":"13-43ce24b6e1fb8ac23c58a78e3e92d137"}}, +{"id":"kestrel","key":"kestrel","value":{"rev":"3-1303ae0617ed1076eed022176c78b0c4"}}, +{"id":"kettle","key":"kettle","value":{"rev":"3-385c10c43df484666148e796840e72c7"}}, +{"id":"keyed_list","key":"keyed_list","value":{"rev":"5-c98d8bc8619300da1a09098bb298bf16"}}, +{"id":"keyframely","key":"keyframely","value":{"rev":"5-586380d2258a099d8fa4748f2688b571"}}, +{"id":"keygrip","key":"keygrip","value":{"rev":"18-4178954fb4f0e26407851104876f1a03"}}, +{"id":"keyjson","key":"keyjson","value":{"rev":"5-96ab1d8b6fa77864883b657360070af4"}}, +{"id":"keymaster","key":"keymaster","value":{"rev":"8-e7eb722489b02991943e9934b8155162"}}, +{"id":"keys","key":"keys","value":{"rev":"12-8b34b8f593667f0c23f1841edb5b6fa3"}}, +{"id":"keysym","key":"keysym","value":{"rev":"13-ec57906511f8f2f896a9e81dc206ea77"}}, +{"id":"keyx","key":"keyx","value":{"rev":"3-80dc49b56e3ba1d280298c36afa2a82c"}}, +{"id":"khronos","key":"khronos","value":{"rev":"3-1a3772db2725c4c3098d5cf4ca2189a4"}}, +{"id":"kindred","key":"kindred","value":{"rev":"5-99c7f4f06e4a47e476f9d75737f719d7"}}, +{"id":"kiokujs","key":"kiokujs","value":{"rev":"8-4b96a9bc1866f58bb263b310e64df403"}}, +{"id":"kiokujs-backend-batch","key":"kiokujs-backend-batch","value":{"rev":"3-4739de0f2e0c01581ce0b02638d3df02"}}, +{"id":"kiokujs-backend-couchdb","key":"kiokujs-backend-couchdb","value":{"rev":"8-53e830e0a7e8ea810883c00ce79bfeef"}}, +{"id":"kiss.js","key":"kiss.js","value":{"rev":"11-7c9b1d7e2faee25ade6f1cad1bb261d9"}}, +{"id":"kissy","key":"kissy","value":{"rev":"8-3f8f7c169a3e84df6a7f68315f13b3ba"}}, +{"id":"kitkat","key":"kitkat","value":{"rev":"41-5f2600e4e1c503f63702c74195ff3361"}}, +{"id":"kitkat-express","key":"kitkat-express","value":{"rev":"3-91ef779ed9acdad1ca6f776e10a70246"}}, +{"id":"kizzy","key":"kizzy","value":{"rev":"5-f281b9e4037eda414f918ec9021e28c9"}}, +{"id":"kjs","key":"kjs","value":{"rev":"3-2ee03262f843e497161f1aef500dd229"}}, +{"id":"kju","key":"kju","value":{"rev":"5-0a7de1cd26864c85a22c7727c660d441"}}, +{"id":"klass","key":"klass","value":{"rev":"39-61491ef3824772d5ef33f7ea04219461"}}, +{"id":"klout-js","key":"klout-js","value":{"rev":"8-8d99f6dad9c21cb5da0d64fefef8c6d6"}}, +{"id":"knid","key":"knid","value":{"rev":"7-2cbfae088155da1044b568584cd296df"}}, +{"id":"knox","key":"knox","value":{"rev":"19-3c42553bd201b23a6bc15fdd073dad17"}}, +{"id":"knox-stream","key":"knox-stream","value":{"rev":"17-e40275f926b6ed645e4ef04caf8e5df4"}}, +{"id":"kns","key":"kns","value":{"rev":"9-5da1a89ad8c08f4b10cd715036200da3"}}, +{"id":"ko","key":"ko","value":{"rev":"9-9df2853d0e9ed9f7740f53291d0035dd"}}, +{"id":"koala","key":"koala","value":{"rev":"8-9e3fea91917f6d8cfb5aae22115e132f"}}, +{"id":"kohai","key":"kohai","value":{"rev":"3-1721a193589459fa077fea809fd7c9a9"}}, +{"id":"koku","key":"koku","value":{"rev":"5-414736980e0e70d90cd7f29b175fb18c"}}, +{"id":"komainu","key":"komainu","value":{"rev":"5-0f1a8f132fe58385e989dd4f93aefa26"}}, +{"id":"komodo-scheme","key":"komodo-scheme","value":{"rev":"3-97d1bd27f069684c491012e079fd82c4"}}, +{"id":"konphyg","key":"konphyg","value":{"rev":"7-e5fc03d6ddf39f2e0723291800bf0d43"}}, +{"id":"kranium","key":"kranium","value":{"rev":"3-4a78d2eb28e949a55b0dbd2ab00cecaf"}}, +{"id":"kue","key":"kue","value":{"rev":"21-053b32204d89a3067c5a90ca62ede08c"}}, +{"id":"kyatchi","key":"kyatchi","value":{"rev":"21-8dfbbe498f3740a2869c82e4ab4522d1"}}, +{"id":"kyoto","key":"kyoto","value":{"rev":"15-b9acdad89d56c71b6f427a443c16f85f"}}, +{"id":"kyoto-client","key":"kyoto-client","value":{"rev":"11-7fb392ee23ce64a48ae5638d713f4fbd"}}, +{"id":"kyoto-tycoon","key":"kyoto-tycoon","value":{"rev":"18-81ece8df26dbd9986efe1d97d935bec2"}}, +{"id":"kyuri","key":"kyuri","value":{"rev":"9-bedd4c087bd7bf612bde5e862d8b91bb"}}, +{"id":"labBuilder","key":"labBuilder","value":{"rev":"11-37f85b5325f1ccf25193c8b737823185"}}, +{"id":"laconic","key":"laconic","value":{"rev":"3-f5b7b9ac113fe7d32cbf4cb0d01c3052"}}, +{"id":"languagedetect","key":"languagedetect","value":{"rev":"3-ac487c034a3470ebd47b54614ea848f9"}}, +{"id":"lastfm","key":"lastfm","value":{"rev":"52-5af213489ca6ecdf2afc851c4642b082"}}, +{"id":"layers","key":"layers","value":{"rev":"7-62cd47d9645faa588c635dab2fbd2ef0"}}, +{"id":"lazy","key":"lazy","value":{"rev":"18-9b5ccdc9c3a970ec4c2b63b6f882da6a"}}, +{"id":"lazy-image","key":"lazy-image","value":{"rev":"5-34a6bc95017c50b3cb69981c7343e5da"}}, +{"id":"lazyBum","key":"lazyBum","value":{"rev":"15-03da6d744ba8cce7efca88ccb7e18c4d"}}, +{"id":"lazyprop","key":"lazyprop","value":{"rev":"14-82b4bcf318094a7950390f03e2fec252"}}, +{"id":"ldapjs","key":"ldapjs","value":{"rev":"11-e2b28e11a0aebe37b758d8f1ed61dd57"}}, +{"id":"ldapjs-riak","key":"ldapjs-riak","value":{"rev":"7-005413a1d4e371663626a3cca200c7e0"}}, +{"id":"ldifgrep","key":"ldifgrep","value":{"rev":"3-e4f06821a3444abbcd3c0c26300dcdda"}}, +{"id":"leaf","key":"leaf","value":{"rev":"8-0ccf5cdd1b59717b53375fe4bf044ec3"}}, +{"id":"lean","key":"lean","value":{"rev":"3-32dbbc771a3f1f6697c21c5d6c516967"}}, +{"id":"leche","key":"leche","value":{"rev":"7-0f5e19052ae1e3cb25ff2aa73271ae4f"}}, +{"id":"leche.spice.io","key":"leche.spice.io","value":{"rev":"3-07db415fdb746873f211e8155ecdf232"}}, +{"id":"less","key":"less","value":{"rev":"37-160fe5ea5dba44f02defdb8ec8c647d5"}}, +{"id":"less-bal","key":"less-bal","value":{"rev":"3-d50532c7c46013a62d06a0e54f8846ce"}}, +{"id":"less4clients","key":"less4clients","value":{"rev":"5-343d2973a166801681c856558d975ddf"}}, +{"id":"lessup","key":"lessup","value":{"rev":"9-a2e7627ef1b493fe82308d019ae481ac"}}, +{"id":"lessweb","key":"lessweb","value":{"rev":"9-e21794e578884c228dbed7c5d6128a41"}}, +{"id":"leveldb","key":"leveldb","value":{"rev":"11-3809e846a7a5ff883d17263288664195"}}, +{"id":"levenshtein","key":"levenshtein","value":{"rev":"6-44d27b6a6bc407772cafc29af485854f"}}, +{"id":"lib","key":"lib","value":{"rev":"5-a95272f11e927888c8b711503fce670b"}}, +{"id":"libdtrace","key":"libdtrace","value":{"rev":"8-4d4f72b2349154da514700f576e34564"}}, +{"id":"liberator","key":"liberator","value":{"rev":"15-b702710ccb3b45e41e9e2f3ebb6375ae"}}, +{"id":"libirc","key":"libirc","value":{"rev":"3-05b125de0c179dd311129aac2e1c8047"}}, +{"id":"liblzg","key":"liblzg","value":{"rev":"5-445ed45dc3cd166a299f85f6149aa098"}}, +{"id":"libnotify","key":"libnotify","value":{"rev":"10-c6723206898865e4828e963f5acc005e"}}, +{"id":"libxml-to-js","key":"libxml-to-js","value":{"rev":"33-64d3152875d33d6feffd618152bc41df"}}, +{"id":"libxmlext","key":"libxmlext","value":{"rev":"3-6a896dacba6f25fbca9b79d4143aaa9a"}}, +{"id":"libxmljs","key":"libxmljs","value":{"rev":"17-4b2949b53d9ecde79a99361774c1144b"}}, +{"id":"libxpm","key":"libxpm","value":{"rev":"3-c03efe75832c4416ceee5d72be12a8ef"}}, +{"id":"libyaml","key":"libyaml","value":{"rev":"5-f279bde715345a4e81d43c1d798ee608"}}, +{"id":"lift","key":"lift","value":{"rev":"21-61dcb771e5e0dc03fa327120d440ccda"}}, +{"id":"light-traits","key":"light-traits","value":{"rev":"26-b35c49550f9380fd462d57c64d51540f"}}, +{"id":"lightnode","key":"lightnode","value":{"rev":"3-ce37ccbf6a6546d4fa500e0eff84e882"}}, +{"id":"limestone","key":"limestone","value":{"rev":"3-d6f76ae98e4189db4ddfa8e15b4cdea9"}}, +{"id":"limited-file","key":"limited-file","value":{"rev":"3-c1d78250965b541836a70d3e867c694f"}}, +{"id":"lin","key":"lin","value":{"rev":"17-0a26ea2a603df0d14a9c40aad96bfb5e"}}, +{"id":"line-parser","key":"line-parser","value":{"rev":"7-84047425699f5a8a8836f4f2e63777bc"}}, +{"id":"line-reader","key":"line-reader","value":{"rev":"9-d2a7cb3a9793149e643490dc16a1eb50"}}, +{"id":"linebuffer","key":"linebuffer","value":{"rev":"12-8e79075aa213ceb49b28e0af7b3f3861"}}, +{"id":"lines","key":"lines","value":{"rev":"9-01a0565f47c3816919ca75bf77539df5"}}, +{"id":"lines-adapter","key":"lines-adapter","value":{"rev":"23-f287561e42a841c00bbf94bc8741bebc"}}, +{"id":"linestream","key":"linestream","value":{"rev":"5-18c2be87653ecf20407ed70eeb601ae7"}}, +{"id":"lingo","key":"lingo","value":{"rev":"10-b3d62b203c4af108feeaf0e32b2a4186"}}, +{"id":"link","key":"link","value":{"rev":"15-7570cea23333dbe3df11fd71171e6226"}}, +{"id":"linkedin-js","key":"linkedin-js","value":{"rev":"22-1bb1f392a9838684076b422840cf98eb"}}, +{"id":"linkscape","key":"linkscape","value":{"rev":"5-7272f50a54b1db015ce6d1e79eeedad7"}}, +{"id":"linkshare","key":"linkshare","value":{"rev":"3-634c4a18a217f77ccd6b89a9a2473d2a"}}, +{"id":"linode-api","key":"linode-api","value":{"rev":"13-2b43281ec86206312a2c387c9fc2c49f"}}, +{"id":"lint","key":"lint","value":{"rev":"49-fb76fddeb3ca609e5cac75fb0b0ec216"}}, +{"id":"linter","key":"linter","value":{"rev":"18-0fc884c96350f860cf2695f615572dba"}}, +{"id":"lintnode","key":"lintnode","value":{"rev":"8-b70bca986d7bde759521d0693dbc28b8"}}, +{"id":"linux-util","key":"linux-util","value":{"rev":"9-d049e8375e9c50b7f2b6268172d79734"}}, +{"id":"liquid","key":"liquid","value":{"rev":"3-353fa3c93ddf1951e3a75d60e6e8757b"}}, +{"id":"liquor","key":"liquor","value":{"rev":"3-4ee78e69a4a400a4de3491b0954947e7"}}, +{"id":"listener","key":"listener","value":{"rev":"5-02b5858d36aa99dcc5fc03c9274c94ee"}}, +{"id":"litmus","key":"litmus","value":{"rev":"9-7e403d052483301d025e9d09b4e7a9dd"}}, +{"id":"littering","key":"littering","value":{"rev":"5-9026438311ffc18d369bfa886c120bcd"}}, +{"id":"live-twitter-map","key":"live-twitter-map","value":{"rev":"3-45a40054bbab23374a4f1743c8bd711d"}}, +{"id":"livereload","key":"livereload","value":{"rev":"5-11ff486b4014ec1998705dbd396e96f2"}}, +{"id":"load","key":"load","value":{"rev":"7-2fff87aeb91d74bc57c134ee2cf0d65b"}}, +{"id":"loadbuilder","key":"loadbuilder","value":{"rev":"9-fa9c5cb13b3af03f9d9fbf5064fa0e0f"}}, +{"id":"loadit","key":"loadit","value":{"rev":"3-51bee062ed0d985757c6ae24929fa74e"}}, +{"id":"local-cdn","key":"local-cdn","value":{"rev":"9-9c2931766a559cf036318583455456e6"}}, +{"id":"localStorage","key":"localStorage","value":{"rev":"3-455fbe195db27131789b5d59db4504b0"}}, +{"id":"locales","key":"locales","value":{"rev":"5-bee452772e2070ec07af0dd86d6dbc41"}}, +{"id":"localhose","key":"localhose","value":{"rev":"9-3a2f63ecbed2e31400ca7515fd020a77"}}, +{"id":"localhost","key":"localhost","value":{"rev":"3-c6c4f6b5688cbe62865010099c9f461f"}}, +{"id":"localhostapp","key":"localhostapp","value":{"rev":"3-17884c4847c549e07e0c881fdf60d01f"}}, +{"id":"localize","key":"localize","value":{"rev":"7-1f83adb6d1eefcf7222a05f489b5db10"}}, +{"id":"location","key":"location","value":{"rev":"3-cc6fbf77b4ade80312bd95fde4e00015"}}, +{"id":"lockfile","key":"lockfile","value":{"rev":"3-4b4b79c2b0f09cc516db1a9d581c5038"}}, +{"id":"lode","key":"lode","value":{"rev":"15-5062a9a0863770d172097c5074a2bdae"}}, +{"id":"log","key":"log","value":{"rev":"12-0aa7922459ff8397764956c56a106930"}}, +{"id":"log-buddy","key":"log-buddy","value":{"rev":"3-64c6d4927d1d235d927f09c16c874e06"}}, +{"id":"log-watcher","key":"log-watcher","value":{"rev":"3-70f8727054c8e4104f835930578f4ee1"}}, +{"id":"log4js","key":"log4js","value":{"rev":"38-137b28e6e96515da7a6399cae86795dc"}}, +{"id":"log4js-amqp","key":"log4js-amqp","value":{"rev":"3-90530c28ef63d4598c12dfcf450929c0"}}, +{"id":"log5","key":"log5","value":{"rev":"17-920e3765dcfdc31bddf13de6895122b3"}}, +{"id":"logbot","key":"logbot","value":{"rev":"3-234eedc70b5474c713832e642f4dc3b4"}}, +{"id":"logger","key":"logger","value":{"rev":"3-5eef338fb5e845a81452fbb22e582aa7"}}, +{"id":"logging","key":"logging","value":{"rev":"22-99d320792c5445bd04699c4cf19edd89"}}, +{"id":"logging-system","key":"logging-system","value":{"rev":"5-5eda9d0b1d04256f5f44abe51cd14626"}}, +{"id":"loggly","key":"loggly","value":{"rev":"49-944a404e188327431a404e5713691a8c"}}, +{"id":"login","key":"login","value":{"rev":"44-7c450fe861230a5121ff294bcd6f97c9"}}, +{"id":"logly","key":"logly","value":{"rev":"7-832fe9af1cd8bfed84a065822cec398a"}}, +{"id":"logmagic","key":"logmagic","value":{"rev":"11-5d2c7dd32ba55e5ab85127be09723ef8"}}, +{"id":"logmonger","key":"logmonger","value":{"rev":"3-07a101d795f43f7af668210660274a7b"}}, +{"id":"lokki","key":"lokki","value":{"rev":"3-f6efcce38029ea0b4889707764088540"}}, +{"id":"long-stack-traces","key":"long-stack-traces","value":{"rev":"7-4b2fe23359b29e188cb2b8936b63891a"}}, +{"id":"loom","key":"loom","value":{"rev":"3-6348ab890611154da4881a0b351b0cb5"}}, +{"id":"loop","key":"loop","value":{"rev":"3-a56e9a6144f573092bb441106b370e0c"}}, +{"id":"looseleaf","key":"looseleaf","value":{"rev":"57-46ef6f055a40c34c714e3e9b9fe5d4cd"}}, +{"id":"lovely","key":"lovely","value":{"rev":"21-f577923512458f02f48ef59eebe55176"}}, +{"id":"lpd","key":"lpd","value":{"rev":"3-433711ae25002f67aa339380668fd491"}}, +{"id":"lpd-printers","key":"lpd-printers","value":{"rev":"3-47060e6c05fb4aad227d36f6e7941227"}}, +{"id":"lru-cache","key":"lru-cache","value":{"rev":"10-23c5e7423fe315745ef924f58c36e119"}}, +{"id":"ls-r","key":"ls-r","value":{"rev":"7-a769b11a06fae8ff439fe7eeb0806b5e"}}, +{"id":"lsof","key":"lsof","value":{"rev":"5-82aa3bcf23b8026a95e469b6188938f9"}}, +{"id":"ltx","key":"ltx","value":{"rev":"21-89ca85a9ce0c9fc13b20c0f1131168b0"}}, +{"id":"lucky-server","key":"lucky-server","value":{"rev":"3-a50d87239166f0ffc374368463f96b07"}}, +{"id":"lunapark","key":"lunapark","value":{"rev":"3-841d197f404da2e63d69b0c2132d87db"}}, +{"id":"lunchbot","key":"lunchbot","value":{"rev":"3-5d8984bef249e3d9e271560b5753f4cf"}}, +{"id":"lw-nun","key":"lw-nun","value":{"rev":"3-b686f89361b7b405e4581db6c60145ed"}}, +{"id":"lw-sass","key":"lw-sass","value":{"rev":"3-e46f90e0c8eab0c8c5d5eb8cf2a9a6da"}}, +{"id":"lwes","key":"lwes","value":{"rev":"3-939bb87efcbede1c1a70de881686fbce"}}, +{"id":"lwink","key":"lwink","value":{"rev":"3-1c432fafe4809e8d4a7e6214123ae452"}}, +{"id":"lzma","key":"lzma","value":{"rev":"3-31dc39414531e329b42b3a4ea0292c43"}}, +{"id":"m1node","key":"m1node","value":{"rev":"11-b34d55bdbc6f65b1814e77fab4a7e823"}}, +{"id":"m1test","key":"m1test","value":{"rev":"3-815ce56949e41e120082632629439eac"}}, +{"id":"m2node","key":"m2node","value":{"rev":"7-f50ec5578d995dd6a0a38e1049604bfc"}}, +{"id":"m2pdb","key":"m2pdb","value":{"rev":"3-ee798ac17c8c554484aceae2f77a826b"}}, +{"id":"m3u","key":"m3u","value":{"rev":"5-7ca6d768e0aed5b88dd45c943ca9ffa0"}}, +{"id":"mac","key":"mac","value":{"rev":"21-db5883c390108ff9ba46660c78b18b6c"}}, +{"id":"macchiato","key":"macchiato","value":{"rev":"5-0df1c87029e6005577fd8fd5cdb25947"}}, +{"id":"macgyver","key":"macgyver","value":{"rev":"3-f517699102b7bd696d8197d7ce57afb9"}}, +{"id":"macros","key":"macros","value":{"rev":"3-8356bcc0d1b1bd3879eeb880b2f3330b"}}, +{"id":"macrotest","key":"macrotest","value":{"rev":"10-2c6ceffb38f8ce5b0f382dbb02720d70"}}, +{"id":"maddy","key":"maddy","value":{"rev":"9-93d59c65c3f44aa6ed43dc986dd73ca5"}}, +{"id":"madmimi-node","key":"madmimi-node","value":{"rev":"11-257e1b1bd5ee5194a7052542952b8b7a"}}, +{"id":"maga","key":"maga","value":{"rev":"24-c69734f9fc138788db741b862f889583"}}, +{"id":"magic","key":"magic","value":{"rev":"34-aed787cc30ab86c95f547b9555d6a381"}}, +{"id":"magic-templates","key":"magic-templates","value":{"rev":"3-89546e9a038150cf419b4b15a84fd2aa"}}, +{"id":"magickal","key":"magickal","value":{"rev":"3-e9ed74bb90df0a52564d47aed0451ce7"}}, +{"id":"mai","key":"mai","value":{"rev":"5-f3561fe6de2bd25201250ddb6dcf9f01"}}, +{"id":"mail","key":"mail","value":{"rev":"14-9ae558552e6a7c11017f118a71c072e9"}}, +{"id":"mail-stack","key":"mail-stack","value":{"rev":"5-c82567203540076cf4878ea1ab197b52"}}, +{"id":"mailbox","key":"mailbox","value":{"rev":"12-0b582e127dd7cf669de16ec36f8056a4"}}, +{"id":"mailchimp","key":"mailchimp","value":{"rev":"23-3d9328ee938b7940322351254ea54877"}}, +{"id":"mailer","key":"mailer","value":{"rev":"40-7b251b758f9dba4667a3127195ea0380"}}, +{"id":"mailer-bal","key":"mailer-bal","value":{"rev":"3-fc8265b1905ea37638309d7c10852050"}}, +{"id":"mailer-fixed","key":"mailer-fixed","value":{"rev":"13-3004df43c62eb64ed5fb0306b019fe66"}}, +{"id":"mailgun","key":"mailgun","value":{"rev":"25-29de1adb355636822dc21fef51f37aed"}}, +{"id":"mailparser","key":"mailparser","value":{"rev":"14-7142e4168046418afc4a76d1b330f302"}}, +{"id":"mailto-parser","key":"mailto-parser","value":{"rev":"3-f8dea7b60c0e993211f81a86dcf5b18d"}}, +{"id":"makeerror","key":"makeerror","value":{"rev":"17-ceb9789357d80467c9ae75caa64ca8ac"}}, +{"id":"malt","key":"malt","value":{"rev":"7-e5e76a842eb0764a5ebe57290b629097"}}, +{"id":"mango","key":"mango","value":{"rev":"7-6224e74a3132e54f294f62998ed9127f"}}, +{"id":"map-reduce","key":"map-reduce","value":{"rev":"11-a81d8bdc6dae7e7b76d5df74fff40ae1"}}, +{"id":"mapnik","key":"mapnik","value":{"rev":"64-693f5b957b7faf361c2cc2a22747ebf7"}}, +{"id":"maptail","key":"maptail","value":{"rev":"14-8334618ddc20006a5f77ff35b172c152"}}, +{"id":"marak","key":"marak","value":{"rev":"3-27be187af00fc97501035dfb97a11ecf"}}, +{"id":"markdoc","key":"markdoc","value":{"rev":"13-23becdeda44b26ee54c9aaa31457e4ba"}}, +{"id":"markdom","key":"markdom","value":{"rev":"10-3c0df12e4f4a2e675d0f0fde48aa425f"}}, +{"id":"markdown","key":"markdown","value":{"rev":"19-88e02c28ce0179be900bf9e6aadc070f"}}, +{"id":"markdown-js","key":"markdown-js","value":{"rev":"6-964647c2509850358f70f4e23670fbeb"}}, +{"id":"markdown-wiki","key":"markdown-wiki","value":{"rev":"6-ce35fb0612a463db5852c5d3dcc7fdd3"}}, +{"id":"markdown2html","key":"markdown2html","value":{"rev":"3-549babe5d9497785fa8b9305c81d7214"}}, +{"id":"marked","key":"marked","value":{"rev":"21-9371df65f63131c9f24e8805db99a7d9"}}, +{"id":"markov","key":"markov","value":{"rev":"13-9ab795448c54ef87851f1392d6f3671a"}}, +{"id":"maryjane","key":"maryjane","value":{"rev":"3-e2e6cce443850b5df1554bf851d16760"}}, +{"id":"massagist","key":"massagist","value":{"rev":"11-cac3a103aecb4ff3f0f607aca2b1d3fb"}}, +{"id":"masson","key":"masson","value":{"rev":"10-87a5e6fd05bd4b8697fa3fa636238c20"}}, +{"id":"masstransit","key":"masstransit","value":{"rev":"11-74898c746e541ff1a00438017ee66d4a"}}, +{"id":"matchmaker","key":"matchmaker","value":{"rev":"3-192db6fb162bdf84fa3e858092fd3e20"}}, +{"id":"math","key":"math","value":{"rev":"5-16a74d8639e44a5ccb265ab1a3b7703b"}}, +{"id":"math-lexer","key":"math-lexer","value":{"rev":"19-54b42374b0090eeee50f39cb35f2eb40"}}, +{"id":"matrices","key":"matrices","value":{"rev":"43-06d64271a5148f89d649645712f8971f"}}, +{"id":"matrix","key":"matrix","value":{"rev":"3-77cff57242445cf3d76313b72bbc38f4"}}, +{"id":"matrixlib","key":"matrixlib","value":{"rev":"11-b3c105a5e5be1835183e7965d04825d9"}}, +{"id":"matterhorn","key":"matterhorn","value":{"rev":"9-a310dba2ea054bdce65e6df2f6ae85e5"}}, +{"id":"matterhorn-dust","key":"matterhorn-dust","value":{"rev":"3-2fb311986d62cf9f180aa76038ebf7b3"}}, +{"id":"matterhorn-gui","key":"matterhorn-gui","value":{"rev":"3-7921b46c9bff3ee82e4b32bc0a0a977d"}}, +{"id":"matterhorn-prng","key":"matterhorn-prng","value":{"rev":"3-c33fd59c1f1d24fb423553ec242e444b"}}, +{"id":"matterhorn-standard","key":"matterhorn-standard","value":{"rev":"13-0aaab6ecf55cdad6f773736da968afba"}}, +{"id":"matterhorn-state","key":"matterhorn-state","value":{"rev":"3-0ba8fd8a4c644b18aff34f1aef95db33"}}, +{"id":"matterhorn-user","key":"matterhorn-user","value":{"rev":"17-e42dc37a5cb24710803b3bd8dee7484d"}}, +{"id":"matterhorn-view","key":"matterhorn-view","value":{"rev":"3-b39042d665f5912d02e724d33d129a97"}}, +{"id":"mbtiles","key":"mbtiles","value":{"rev":"41-b92035d0ec8f47850734c4bb995baf7d"}}, +{"id":"mcast","key":"mcast","value":{"rev":"8-559b2b09cfa34cb88c16ae72ec90d28a"}}, +{"id":"md5","key":"md5","value":{"rev":"3-43d600c70f6442d3878c447585bf43bf"}}, +{"id":"mdgram","key":"mdgram","value":{"rev":"15-4d65cf0d5edef976de9a612c0cde0907"}}, +{"id":"mdns","key":"mdns","value":{"rev":"11-8b6789c3779fce7f019f9f10c625147a"}}, +{"id":"mecab-binding","key":"mecab-binding","value":{"rev":"3-3395763d23a3f8e3e00ba75cb988f9b4"}}, +{"id":"mechanize","key":"mechanize","value":{"rev":"5-94b72f43e270aa24c00e283fa52ba398"}}, +{"id":"mediatags","key":"mediatags","value":{"rev":"3-d5ea41e140fbbc821590cfefdbd016a5"}}, +{"id":"mediator","key":"mediator","value":{"rev":"3-42aac2225b47f72f97001107a3d242f5"}}, +{"id":"memcache","key":"memcache","value":{"rev":"5-aebcc4babe11b654afd3cede51e945ec"}}, +{"id":"memcached","key":"memcached","value":{"rev":"9-7c46464425c78681a8e6767ef9993c4c"}}, +{"id":"memcouchd","key":"memcouchd","value":{"rev":"3-b57b9fb4f6c60604f616c2f70456b4d6"}}, +{"id":"meme","key":"meme","value":{"rev":"11-53fcb51e1d8f8908b95f0fa12788e9aa"}}, +{"id":"memo","key":"memo","value":{"rev":"9-3a9ca97227ed19cacdacf10ed193ee8b"}}, +{"id":"memoize","key":"memoize","value":{"rev":"15-44bdd127c49035c8bd781a9299c103c2"}}, +{"id":"memoizer","key":"memoizer","value":{"rev":"9-d9a147e8c8a58fd7e8f139dc902592a6"}}, +{"id":"memorystream","key":"memorystream","value":{"rev":"9-6d0656067790e158f3c4628968ed70d3"}}, +{"id":"memstore","key":"memstore","value":{"rev":"5-03dcac59882c8a434e4c2fe2ac354941"}}, +{"id":"mercury","key":"mercury","value":{"rev":"3-147af865af6f7924f44f14f4b5c14dac"}}, +{"id":"mersenne","key":"mersenne","value":{"rev":"7-d8ae550eb8d0deaa1fd60f86351cb548"}}, +{"id":"meryl","key":"meryl","value":{"rev":"23-2c0e3fad99005109c584530e303bc5bf"}}, +{"id":"mesh","key":"mesh","value":{"rev":"5-f3ea4aef5b3f169eab8b518e5044c950"}}, +{"id":"meta-promise","key":"meta-promise","value":{"rev":"5-0badf85ab432341e6256252463468b89"}}, +{"id":"meta-test","key":"meta-test","value":{"rev":"49-92df2922499960ac750ce96d861ddd7e"}}, +{"id":"meta_code","key":"meta_code","value":{"rev":"7-9b4313c0c52a09c788464f1fea05baf7"}}, +{"id":"metamanager","key":"metamanager","value":{"rev":"5-dbb0312dad15416d540eb3d860fbf205"}}, +{"id":"metaweblog","key":"metaweblog","value":{"rev":"3-d3ab090ec27242e220412d6413e388ee"}}, +{"id":"metric","key":"metric","value":{"rev":"3-8a706db5b518421ad640a75e65cb4be9"}}, +{"id":"metrics","key":"metrics","value":{"rev":"13-62e5627c1ca5e6d3b3bde8d17e675298"}}, +{"id":"metrics-broker","key":"metrics-broker","value":{"rev":"15-0fdf57ea4ec84aa1f905f53b4975e72d"}}, +{"id":"mhash","key":"mhash","value":{"rev":"3-f00d65dc939474a5c508d37a327e5074"}}, +{"id":"micro","key":"micro","value":{"rev":"17-882c0ecf34ddaef5c673c547ae80b80b"}}, +{"id":"microcache","key":"microcache","value":{"rev":"3-ef75e04bc6e86d14f93ad9c429503bd9"}}, +{"id":"microevent","key":"microevent","value":{"rev":"3-9c0369289b62873ef6e8624eef724d15"}}, +{"id":"microtest","key":"microtest","value":{"rev":"11-11afdadfb15c1db030768ce52f34de1a"}}, +{"id":"microtime","key":"microtime","value":{"rev":"20-5f75e87316cbb5f7a4be09142cd755e5"}}, +{"id":"middlefiddle","key":"middlefiddle","value":{"rev":"13-bb94c05d75c24bdeb23a4637c7ecf55e"}}, +{"id":"middleware","key":"middleware","value":{"rev":"5-80937a4c620fcc2a5532bf064ec0837b"}}, +{"id":"midi","key":"midi","value":{"rev":"9-96da6599a84a761430adfd41deb3969a"}}, +{"id":"midi-js","key":"midi-js","value":{"rev":"11-1d174af1352e3d37f6ec0df32d56ce1a"}}, +{"id":"migrate","key":"migrate","value":{"rev":"13-7493879fb60a31b9e2a9ad19e94bfef6"}}, +{"id":"mikronode","key":"mikronode","value":{"rev":"31-1edae4ffbdb74c43ea584a7757dacc9b"}}, +{"id":"milk","key":"milk","value":{"rev":"21-81fb117817ed2e4c19e16dc310c09735"}}, +{"id":"millstone","key":"millstone","value":{"rev":"29-73d54de4b4de313b0fec4edfaec741a4"}}, +{"id":"mime","key":"mime","value":{"rev":"33-de72b641474458cb21006dea6a524ceb"}}, +{"id":"mime-magic","key":"mime-magic","value":{"rev":"13-2df6b966d7f29d5ee2dd2e1028d825b1"}}, +{"id":"mimelib","key":"mimelib","value":{"rev":"9-7994cf0fe3007329b9397f4e08481487"}}, +{"id":"mimelib-noiconv","key":"mimelib-noiconv","value":{"rev":"5-c84995d4b2bbe786080c9b54227b5bb4"}}, +{"id":"mimeograph","key":"mimeograph","value":{"rev":"37-bead083230f48f354f3ccac35e11afc0"}}, +{"id":"mimeparse","key":"mimeparse","value":{"rev":"8-5ca7e6702fe7f1f37ed31b05e82f4a87"}}, +{"id":"mingy","key":"mingy","value":{"rev":"19-09b19690c55abc1e940374e25e9a0d26"}}, +{"id":"mini-lzo-wrapper","key":"mini-lzo-wrapper","value":{"rev":"4-d751d61f481363a2786ac0312893dfca"}}, +{"id":"miniee","key":"miniee","value":{"rev":"5-be0833a9f15382695f861a990f3d6108"}}, +{"id":"minifyjs","key":"minifyjs","value":{"rev":"13-f255df8c7567440bc4c0f8eaf04a18c6"}}, +{"id":"minimal","key":"minimal","value":{"rev":"5-6be6b3454d30c59a30f9ee8af0ee606c"}}, +{"id":"minimal-test","key":"minimal-test","value":{"rev":"15-65dca2c1ee27090264577cc8b93983cb"}}, +{"id":"minimatch","key":"minimatch","value":{"rev":"11-449e570c76f4e6015c3dc90f080f8c47"}}, +{"id":"minirpc","key":"minirpc","value":{"rev":"10-e85b92273a97fa86e20faef7a3b50518"}}, +{"id":"ministore","key":"ministore","value":{"rev":"11-f131868141ccd0851bb91800c86dfff1"}}, +{"id":"minitest","key":"minitest","value":{"rev":"13-c92e32499a25ff2d7e484fbbcabe1081"}}, +{"id":"miniweb","key":"miniweb","value":{"rev":"3-e8c413a77e24891138eaa9e73cb08715"}}, +{"id":"minj","key":"minj","value":{"rev":"9-ccf50caf8e38b0fc2508f01a63f80510"}}, +{"id":"minotaur","key":"minotaur","value":{"rev":"29-6d048956b26e8a213f6ccc96027bacde"}}, +{"id":"mirror","key":"mirror","value":{"rev":"21-01bdd78ff03ca3f8f99fce104baab9f9"}}, +{"id":"misao-chan","key":"misao-chan","value":{"rev":"13-f032690f0897fc4a1dc12f1e03926627"}}, +{"id":"mite.node","key":"mite.node","value":{"rev":"13-0bfb15c4a6f172991756660b29869dd4"}}, +{"id":"mixable","key":"mixable","value":{"rev":"3-bc518ab862a6ceacc48952b9bec7d61a"}}, +{"id":"mixin","key":"mixin","value":{"rev":"3-3a7ae89345d21ceaf545d93b20caf2f2"}}, +{"id":"mixinjs","key":"mixinjs","value":{"rev":"3-064173d86b243316ef1b6c5743a60bf9"}}, +{"id":"mixpanel","key":"mixpanel","value":{"rev":"7-f742248bfbfc480658c4c46f7ab7a74a"}}, +{"id":"mixpanel-api","key":"mixpanel-api","value":{"rev":"5-61a3fa28921887344d1af339917e147a"}}, +{"id":"mixpanel_api","key":"mixpanel_api","value":{"rev":"3-11939b6fd20b80bf9537380875bf3996"}}, +{"id":"mjoe","key":"mjoe","value":{"rev":"3-8b3549cd6edcc03112217370b071b076"}}, +{"id":"mjsunit.runner","key":"mjsunit.runner","value":{"rev":"12-94c779b555069ca5fb0bc9688515673e"}}, +{"id":"mkdir","key":"mkdir","value":{"rev":"3-e8fd61b35638f1f3a65d36f09344ff28"}}, +{"id":"mkdirp","key":"mkdirp","value":{"rev":"15-c8eacf17b336ea98d1d9960f02362cbf"}}, +{"id":"mmap","key":"mmap","value":{"rev":"16-df335eb3257dfbd2fb0de341970d2656"}}, +{"id":"mmikulicic-thrift","key":"mmikulicic-thrift","value":{"rev":"3-f4a9f7a97bf50e966d1184fba423a07f"}}, +{"id":"mmmodel","key":"mmmodel","value":{"rev":"7-00d61723742a325aaaa6955ba52cef60"}}, +{"id":"mmodel","key":"mmodel","value":{"rev":"3-717309af27d6c5d98ed188c9c9438a37"}}, +{"id":"mmseg","key":"mmseg","value":{"rev":"17-794d553e67d6023ca3d58dd99fe1da15"}}, +{"id":"mobilize","key":"mobilize","value":{"rev":"25-8a657ec0accf8db2e8d7b935931ab77b"}}, +{"id":"mock","key":"mock","value":{"rev":"3-d8805bff4796462750071cddd3f75ea7"}}, +{"id":"mock-request","key":"mock-request","value":{"rev":"7-4ac4814c23f0899b1100d5f0617e40f4"}}, +{"id":"mock-request-response","key":"mock-request-response","value":{"rev":"5-fe1566c9881039a92a80e0e82a95f096"}}, +{"id":"mocket","key":"mocket","value":{"rev":"13-9001879cd3cb6f52f3b2d85fb14b8f9b"}}, +{"id":"modbus-stack","key":"modbus-stack","value":{"rev":"7-50c56e74d9cb02c5d936b0b44c54f621"}}, +{"id":"model","key":"model","value":{"rev":"3-174181c2f314f35fc289b7a921ba4d39"}}, +{"id":"models","key":"models","value":{"rev":"8-6cc2748edfd96679f9bb3596864874a9"}}, +{"id":"modestmaps","key":"modestmaps","value":{"rev":"8-79265968137a2327f98bfc6943a84da9"}}, +{"id":"modjewel","key":"modjewel","value":{"rev":"3-73efc7b9dc24d82cab1de249896193fd"}}, +{"id":"modlr","key":"modlr","value":{"rev":"17-ccf16db98ab6ccb95e005b3bb76dba64"}}, +{"id":"module-grapher","key":"module-grapher","value":{"rev":"19-b6ba30b41e29fc01d4b679a643f030e5"}}, +{"id":"modulr","key":"modulr","value":{"rev":"15-8e8ffd75c6c6149206de4ce0c2aefad7"}}, +{"id":"mogile","key":"mogile","value":{"rev":"5-79a8af20dbe6bff166ac2197a3998b0c"}}, +{"id":"mojo","key":"mojo","value":{"rev":"25-1d9c26d6afd6ea77253f220d86d60307"}}, +{"id":"monad","key":"monad","value":{"rev":"10-cf20354900b7e67d94c342feb06a1eb9"}}, +{"id":"mongeese","key":"mongeese","value":{"rev":"3-f4b319d98f9f73fb17cd3ebc7fc86412"}}, +{"id":"mongo-pool","key":"mongo-pool","value":{"rev":"3-215481828e69fd874b5938a79a7e0934"}}, +{"id":"mongodb","key":"mongodb","value":{"rev":"147-3dc09965e762787f34131a8739297383"}}, +{"id":"mongodb-async","key":"mongodb-async","value":{"rev":"7-ba9097bdc86b72885fa5a9ebb49a64d0"}}, +{"id":"mongodb-provider","key":"mongodb-provider","value":{"rev":"5-5523643b403e969e0b80c57db08cb9d3"}}, +{"id":"mongodb-rest","key":"mongodb-rest","value":{"rev":"36-60b4abc4a22f31de09407cc7cdd0834f"}}, +{"id":"mongodb-wrapper","key":"mongodb-wrapper","value":{"rev":"13-7a6c5eaff36ede45211aa80f3a506cfe"}}, +{"id":"mongodb_heroku","key":"mongodb_heroku","value":{"rev":"3-05947c1e06e1f8860c7809b063a8d1a0"}}, +{"id":"mongode","key":"mongode","value":{"rev":"11-faa14f050da4a165e2568d413a6b8bc0"}}, +{"id":"mongojs","key":"mongojs","value":{"rev":"26-a628eb51534ffcdd97c1a940d460a52c"}}, +{"id":"mongolia","key":"mongolia","value":{"rev":"76-711c39de0e152e224d4118c9b0de834f"}}, +{"id":"mongolian","key":"mongolian","value":{"rev":"44-3773671b31c406a18cb9f5a1764ebee4"}}, +{"id":"mongoose","key":"mongoose","value":{"rev":"181-03a8aa7f691cbd987995bf6e3354e0f5"}}, +{"id":"mongoose-admin","key":"mongoose-admin","value":{"rev":"7-59078ad5a345e9e66574346d3e70f9ad"}}, +{"id":"mongoose-auth","key":"mongoose-auth","value":{"rev":"49-87c79f3a6164c438a53b7629be87ae5d"}}, +{"id":"mongoose-autoincr","key":"mongoose-autoincr","value":{"rev":"3-9c4dd7c3fdcd8621166665a68fccb602"}}, +{"id":"mongoose-closures","key":"mongoose-closures","value":{"rev":"3-2ff9cff790f387f2236a2c7382ebb55b"}}, +{"id":"mongoose-crypt","key":"mongoose-crypt","value":{"rev":"3-d77ffbf250e39fcc290ad37824fe2236"}}, +{"id":"mongoose-dbref","key":"mongoose-dbref","value":{"rev":"29-02090b9904fd6f5ce72afcfa729f7c96"}}, +{"id":"mongoose-flatmatcher","key":"mongoose-flatmatcher","value":{"rev":"5-4f0565901e8b588cc562ae457ad975a6"}}, +{"id":"mongoose-helpers","key":"mongoose-helpers","value":{"rev":"3-3a57e9819e24c9b0f5b5eabe41037092"}}, +{"id":"mongoose-joins","key":"mongoose-joins","value":{"rev":"3-9bae444730a329473421f50cba1c86a7"}}, +{"id":"mongoose-misc","key":"mongoose-misc","value":{"rev":"3-bcd7f3f450cf6ed233d042ac574409ce"}}, +{"id":"mongoose-relationships","key":"mongoose-relationships","value":{"rev":"9-6155a276b162ec6593b8542f0f769024"}}, +{"id":"mongoose-rest","key":"mongoose-rest","value":{"rev":"29-054330c035adf842ab34423215995113"}}, +{"id":"mongoose-spatial","key":"mongoose-spatial","value":{"rev":"3-88660dabd485edcaa29a2ea01afb90bd"}}, +{"id":"mongoose-temporal","key":"mongoose-temporal","value":{"rev":"3-1dd736395fe9be95498e588df502b7bb"}}, +{"id":"mongoose-types","key":"mongoose-types","value":{"rev":"13-8126458b91ef1bf46e582042f5dbd015"}}, +{"id":"mongoose-units","key":"mongoose-units","value":{"rev":"3-5fcdb7aedb1d5cff6e18ee1352c3d0f7"}}, +{"id":"mongoq","key":"mongoq","value":{"rev":"11-2060d674d5f8a964e800ed4470b92587"}}, +{"id":"mongoskin","key":"mongoskin","value":{"rev":"13-5a7bfacd9e9b95ec469f389751e7e435"}}, +{"id":"mongous","key":"mongous","value":{"rev":"3-4d98b4a4bfdd6d9f46342002a69d8d3a"}}, +{"id":"mongrel2","key":"mongrel2","value":{"rev":"3-93156356e478f30fc32455054e384b80"}}, +{"id":"monguava","key":"monguava","value":{"rev":"9-69ec50128220aba3e16128a4be2799c0"}}, +{"id":"mongueue","key":"mongueue","value":{"rev":"9-fc8d9df5bf15f5a25f68cf58866f11fe"}}, +{"id":"moniker","key":"moniker","value":{"rev":"5-a139616b725ddfdd1db6a376fb6584f7"}}, +{"id":"monitor","key":"monitor","value":{"rev":"56-44d2b8b7dec04b3f320f7dc4a1704c53"}}, +{"id":"monome","key":"monome","value":{"rev":"3-2776736715cbfc045bf7b42e70ccda9c"}}, +{"id":"monomi","key":"monomi","value":{"rev":"6-b6b745441f157cc40c846d23cd14297a"}}, +{"id":"moof","key":"moof","value":{"rev":"13-822b4ebf873b720bd4c7e16fcbbbbb3d"}}, +{"id":"moonshado","key":"moonshado","value":{"rev":"3-b54de1aef733c8fa118fa7cf6af2fb9b"}}, +{"id":"moose","key":"moose","value":{"rev":"5-e11c8b7c09826e3431ed3408ee874779"}}, +{"id":"mootools","key":"mootools","value":{"rev":"9-39f5535072748ccd3cf0212ef4c3d4fa"}}, +{"id":"mootools-array","key":"mootools-array","value":{"rev":"3-d1354704a9fe922d969c2bf718e0dc53"}}, +{"id":"mootools-browser","key":"mootools-browser","value":{"rev":"3-ce0946b357b6ddecc128febef2c5d720"}}, +{"id":"mootools-class","key":"mootools-class","value":{"rev":"3-0ea815d28b61f3880087e3f4b8668354"}}, +{"id":"mootools-class-extras","key":"mootools-class-extras","value":{"rev":"3-575796745bd169c35f4fc0019bb36b76"}}, +{"id":"mootools-client","key":"mootools-client","value":{"rev":"3-b658c331f629f80bfe17c3e6ed44c525"}}, +{"id":"mootools-cookie","key":"mootools-cookie","value":{"rev":"3-af93588531e5a52c76a8e7a4eac3612a"}}, +{"id":"mootools-core","key":"mootools-core","value":{"rev":"3-01b1678fc56d94d29566b7853ad56059"}}, +{"id":"mootools-domready","key":"mootools-domready","value":{"rev":"3-0fc6620e2c8f7d107816cace9c099633"}}, +{"id":"mootools-element","key":"mootools-element","value":{"rev":"3-bac857c1701c91207d1ec6d1eb002d07"}}, +{"id":"mootools-element-dimensions","key":"mootools-element-dimensions","value":{"rev":"3-d82df62b3e97122ad0a7668efb7ba776"}}, +{"id":"mootools-element-event","key":"mootools-element-event","value":{"rev":"3-a30380151989ca31851cf751fcd55e9a"}}, +{"id":"mootools-element-style","key":"mootools-element-style","value":{"rev":"3-6103fa8551a21dc592e410dc7df647f8"}}, +{"id":"mootools-event","key":"mootools-event","value":{"rev":"3-7327279ec157de8c47f3ee24615ead95"}}, +{"id":"mootools-function","key":"mootools-function","value":{"rev":"3-eb3ee17acf40d6cc05463cb88edc6f5e"}}, +{"id":"mootools-fx","key":"mootools-fx","value":{"rev":"3-757ab6c8423e8c434d1ee783ea28cdb5"}}, +{"id":"mootools-fx-css","key":"mootools-fx-css","value":{"rev":"3-8eb0cf468c826b9c485835fab94837e7"}}, +{"id":"mootools-fx-morph","key":"mootools-fx-morph","value":{"rev":"3-b91310f8a81221592970fe7632bd9f7a"}}, +{"id":"mootools-fx-transitions","key":"mootools-fx-transitions","value":{"rev":"3-a1ecde35dfbb80f3a6062005758bb934"}}, +{"id":"mootools-fx-tween","key":"mootools-fx-tween","value":{"rev":"3-39497defbffdf463932cc9f00cde8d5d"}}, +{"id":"mootools-json","key":"mootools-json","value":{"rev":"3-69deb6679a5d1d49f22e19834ae07c32"}}, +{"id":"mootools-more","key":"mootools-more","value":{"rev":"3-d8f46ce319ca0e3deb5fc04ad5f73cb9"}}, +{"id":"mootools-number","key":"mootools-number","value":{"rev":"3-9f4494883ac39f93734fea9af6ef2fc5"}}, +{"id":"mootools-object","key":"mootools-object","value":{"rev":"3-c9632dfa793ab4d9ad4b68a2e27f09fc"}}, +{"id":"mootools-request","key":"mootools-request","value":{"rev":"3-663e5472f351eea3b7488ee441bc6a61"}}, +{"id":"mootools-request-html","key":"mootools-request-html","value":{"rev":"3-0ab9576c11a564d44b3c3ca3ef3dc240"}}, +{"id":"mootools-request-json","key":"mootools-request-json","value":{"rev":"3-c0359201c94ba1684ea6336e35cd70c2"}}, +{"id":"mootools-server","key":"mootools-server","value":{"rev":"3-98e89499f6eab137bbab053a3932a526"}}, +{"id":"mootools-slick-finder","key":"mootools-slick-finder","value":{"rev":"3-9a5820e90d6ea2d797268f3c60a9f177"}}, +{"id":"mootools-slick-parser","key":"mootools-slick-parser","value":{"rev":"3-d4e6b1673e6e2a6bcc66bf4988b2994d"}}, +{"id":"mootools-string","key":"mootools-string","value":{"rev":"3-2fda1c7915295df62e547018a7f05916"}}, +{"id":"mootools-swiff","key":"mootools-swiff","value":{"rev":"3-f0edeead85f3d48cf2af2ca35a4e67a5"}}, +{"id":"mootools.js","key":"mootools.js","value":{"rev":"3-085e50e3529d19e1d6ad630027ba51dc"}}, +{"id":"morestreams","key":"morestreams","value":{"rev":"7-3d0145c2cfb9429dfdcfa872998c9fe8"}}, +{"id":"morpheus","key":"morpheus","value":{"rev":"45-04335640f709335d1828523425a87909"}}, +{"id":"morton","key":"morton","value":{"rev":"11-abd787350e21bef65c1c6776e40a0753"}}, +{"id":"mothermayi","key":"mothermayi","value":{"rev":"5-2c46f9873efd19f543def5eeda0a05f1"}}, +{"id":"mountable-proxy","key":"mountable-proxy","value":{"rev":"7-3b91bd0707447885676727ad183bb051"}}, +{"id":"move","key":"move","value":{"rev":"69-ce11c235c78de6d6184a86aaa93769eb"}}, +{"id":"moviesearch","key":"moviesearch","value":{"rev":"3-72e77965a44264dfdd5af23e4a36d2ce"}}, +{"id":"mp","key":"mp","value":{"rev":"3-47899fb2bdaf21dda16abd037b325c3b"}}, +{"id":"mpdsocket","key":"mpdsocket","value":{"rev":"3-2dd4c9bb019f3f491c55364be7a56229"}}, +{"id":"mrcolor","key":"mrcolor","value":{"rev":"3-4695b11798a65c61714b8f236a40936c"}}, +{"id":"msgbus","key":"msgbus","value":{"rev":"27-a5d861b55c933842226d4e536820ec99"}}, +{"id":"msgme","key":"msgme","value":{"rev":"3-d1968af1234a2059eb3d84eb76cdaa4e"}}, +{"id":"msgpack","key":"msgpack","value":{"rev":"9-ecf7469392d87460ddebef2dd369b0e5"}}, +{"id":"msgpack-0.4","key":"msgpack-0.4","value":{"rev":"3-5d509ddba6c53ed6b8dfe4afb1d1661d"}}, +{"id":"msgpack2","key":"msgpack2","value":{"rev":"4-63b8f3ccf35498eb5c8bd9b8d683179b"}}, +{"id":"mu","key":"mu","value":{"rev":"7-7a8ce1cba5d6d98e696c4e633aa081fa"}}, +{"id":"mu2","key":"mu2","value":{"rev":"3-4ade1c5b1496c720312beae1822da9de"}}, +{"id":"mud","key":"mud","value":{"rev":"66-56e1b1a1e5af14c3df0520c58358e7cd"}}, +{"id":"muffin","key":"muffin","value":{"rev":"22-210c45a888fe1f095becdcf11876a2bc"}}, +{"id":"multi-node","key":"multi-node","value":{"rev":"1-224161d875f0e1cbf4b1e249603c670a"}}, +{"id":"multicast-eventemitter","key":"multicast-eventemitter","value":{"rev":"13-ede3e677d6e21bbfe42aad1b549a137c"}}, +{"id":"multimeter","key":"multimeter","value":{"rev":"7-847f45a6f592a8410a77d3e5efb5cbf3"}}, +{"id":"multipart-stack","key":"multipart-stack","value":{"rev":"9-85aaa2ed2180d3124d1dcd346955b672"}}, +{"id":"muse","key":"muse","value":{"rev":"3-d6bbc06df2e359d6ef285f9da2bd0efd"}}, +{"id":"musicmetadata","key":"musicmetadata","value":{"rev":"21-957bf986aa9d0db02175ea1d79293909"}}, +{"id":"mustache","key":"mustache","value":{"rev":"6-7f8458f2b52de5b37004b105c0f39e62"}}, +{"id":"mustachio","key":"mustachio","value":{"rev":"9-6ed3f41613f886128acd18b73b55439f"}}, +{"id":"mutex","key":"mutex","value":{"rev":"3-de95bdff3dd00271361067b5d70ea03b"}}, +{"id":"muzak","key":"muzak","value":{"rev":"9-5ff968ffadebe957b72a8b77b538b71c"}}, +{"id":"mvc","key":"mvc","value":{"rev":"52-7c954b6c3b90b1b734d8e8c3d2d34f5e"}}, +{"id":"mvc.coffee","key":"mvc.coffee","value":{"rev":"3-f203564ed70c0284455e7f96ea61fdb7"}}, +{"id":"mypackage","key":"mypackage","value":{"rev":"3-49cc95fb2e5ac8ee3dbbab1de451c0d1"}}, +{"id":"mypakege","key":"mypakege","value":{"rev":"3-e74d7dc2c2518304ff1700cf295eb823"}}, +{"id":"myrtle-parser","key":"myrtle-parser","value":{"rev":"3-9089c1a2f3c3a24f0bce3941bc1d534d"}}, +{"id":"mysql","key":"mysql","value":{"rev":"30-a8dc68eb056cb6f69fae2423c1337474"}}, +{"id":"mysql-activerecord","key":"mysql-activerecord","value":{"rev":"17-9d21d0b10a5c84f6cacfd8d2236f9887"}}, +{"id":"mysql-client","key":"mysql-client","value":{"rev":"5-cc877218864c319d17f179e49bf58c99"}}, +{"id":"mysql-helper","key":"mysql-helper","value":{"rev":"3-c6f3b9f00cd9fee675aa2a9942cc336a"}}, +{"id":"mysql-libmysqlclient","key":"mysql-libmysqlclient","value":{"rev":"38-51c08e24257b99bf5591232016ada8ab"}}, +{"id":"mysql-native","key":"mysql-native","value":{"rev":"12-0592fbf66c55e6e9db6a75c97be088c3"}}, +{"id":"mysql-native-prerelease","key":"mysql-native-prerelease","value":{"rev":"7-b1a6f3fc41f6c152f3b178e13f91b5c4"}}, +{"id":"mysql-oil","key":"mysql-oil","value":{"rev":"9-70c07b9c552ff592be8ca89ea6efa408"}}, +{"id":"mysql-pool","key":"mysql-pool","value":{"rev":"15-41f510c45174b6c887856120ce3d5a3b"}}, +{"id":"mysql-simple","key":"mysql-simple","value":{"rev":"13-7ee13f035e8ebcbc27f6fe910058aee9"}}, +{"id":"n","key":"n","value":{"rev":"31-bfaed5022beae2177a090c4c8fce82a4"}}, +{"id":"n-ext","key":"n-ext","value":{"rev":"3-5ad67a300f8e88ef1dd58983c9061bc1"}}, +{"id":"n-pubsub","key":"n-pubsub","value":{"rev":"3-af990bcbf9f94554365788b81715d3b4"}}, +{"id":"n-rest","key":"n-rest","value":{"rev":"7-42f1d92f9229f126a1b063ca27bfc85b"}}, +{"id":"n-util","key":"n-util","value":{"rev":"6-d0c59c7412408bc94e20de4d22396d79"}}, +{"id":"nMemcached","key":"nMemcached","value":{"rev":"3-be350fd46624a1cac0052231101e0594"}}, +{"id":"nStoreSession","key":"nStoreSession","value":{"rev":"3-a3452cddd2b9ff8edb6d46999fa5b0eb"}}, +{"id":"nTPL","key":"nTPL","value":{"rev":"41-16a54848286364d894906333b0c1bb2c"}}, +{"id":"nTunes","key":"nTunes","value":{"rev":"18-76bc566a504100507056316fe8d3cc35"}}, +{"id":"nabe","key":"nabe","value":{"rev":"13-dc93f35018e84a23ace4d5114fa1bb28"}}, +{"id":"nack","key":"nack","value":{"rev":"118-f629c8c208c76fa0c2ce66d21f927ee4"}}, +{"id":"nagari","key":"nagari","value":{"rev":"11-cb200690c6d606d8597178e492b54cde"}}, +{"id":"nailplate","key":"nailplate","value":{"rev":"11-e1532c42d9d83fc32942dec0b87df587"}}, +{"id":"nails","key":"nails","value":{"rev":"12-f472bf005c4a4c2b49fb0118b109bef1"}}, +{"id":"nake","key":"nake","value":{"rev":"11-250933df55fbe7bb19e34a84ed23ca3e"}}, +{"id":"named-routes","key":"named-routes","value":{"rev":"6-ffbdd4caa74a30e87aa6dbb36f2b967c"}}, +{"id":"namespace","key":"namespace","value":{"rev":"7-89e2850e14206af13f26441e75289878"}}, +{"id":"namespaces","key":"namespaces","value":{"rev":"11-7a9b3d2537438211021a472035109f3c"}}, +{"id":"nami","key":"nami","value":{"rev":"29-3d44b1338222a4d994d4030868a94ea8"}}, +{"id":"nano","key":"nano","value":{"rev":"105-50efc49a8f6424706af554872002c014"}}, +{"id":"nanostate","key":"nanostate","value":{"rev":"9-1664d985e8cdbf16e150ba6ba4d79ae5"}}, +{"id":"narcissus","key":"narcissus","value":{"rev":"3-46581eeceff566bd191a14dec7b337f6"}}, +{"id":"nariya","key":"nariya","value":{"rev":"13-d83b8b6162397b154a4b59553be225e9"}}, +{"id":"narrativ","key":"narrativ","value":{"rev":"9-ef215eff6bf222425f73d23e507f7ff3"}}, +{"id":"narrow","key":"narrow","value":{"rev":"5-c6963048ba02adaf819dc51815fa0015"}}, +{"id":"narwhal","key":"narwhal","value":{"rev":"6-13bf3f87e6cfb1e57662cc3e3be450fc"}}, +{"id":"narwhal-lib","key":"narwhal-lib","value":{"rev":"6-4722d9b35fed59a2e8f7345a1eb6769d"}}, +{"id":"nat","key":"nat","value":{"rev":"3-da0906c08792043546f98ace8ce59a78"}}, +{"id":"native2ascii","key":"native2ascii","value":{"rev":"3-9afd51209d67303a8ee807ff862e31fc"}}, +{"id":"nativeUtil","key":"nativeUtil","value":{"rev":"7-6e3e9757b436ebcee35a20e633c08d60"}}, +{"id":"natives","key":"natives","value":{"rev":"24-6c4269c9c7cfb52571bd2c94fa26efc6"}}, +{"id":"natural","key":"natural","value":{"rev":"110-fc92701ad8525f45fbdb5863959ca03c"}}, +{"id":"naturalsort","key":"naturalsort","value":{"rev":"3-4321f5e432aee224af0fee9e4fb901ff"}}, +{"id":"nave","key":"nave","value":{"rev":"29-79baa66065fa9075764cc3e5da2edaef"}}, +{"id":"navigator","key":"navigator","value":{"rev":"3-f2f4f5376afb10753006f40bd49689c3"}}, +{"id":"nbs-api","key":"nbs-api","value":{"rev":"3-94949b1f0797369abc0752482268ef08"}}, +{"id":"nbt","key":"nbt","value":{"rev":"3-b711b9db76f64449df7f43c659ad8e7f"}}, +{"id":"nclosure","key":"nclosure","value":{"rev":"9-042b39740a39f0556d0dc2c0990b7fa8"}}, +{"id":"nclosureultimate","key":"nclosureultimate","value":{"rev":"3-61ff4bc480239304c459374c9a5f5754"}}, +{"id":"nconf","key":"nconf","value":{"rev":"65-8d8c0d2c6d5d9d526b8a3f325f68eca1"}}, +{"id":"nconf-redis","key":"nconf-redis","value":{"rev":"5-21ae138633b20cb29ed49b9fcd425e10"}}, +{"id":"ncp","key":"ncp","value":{"rev":"23-6441091c6c27ecb5b99f5781299a2192"}}, +{"id":"ncss","key":"ncss","value":{"rev":"9-1d2330e0fdbc40f0810747c2b156ecf2"}}, +{"id":"ncurses","key":"ncurses","value":{"rev":"12-bb059ea6fee12ca77f1fbb7bb6dd9447"}}, +{"id":"ndb","key":"ndb","value":{"rev":"15-b3e826f68a57095413666e9fe74589da"}}, +{"id":"ndistro","key":"ndistro","value":{"rev":"3-fcda3c018d11000b2903ad7104b60b35"}}, +{"id":"ndns","key":"ndns","value":{"rev":"5-1aeaaca119be44af7a83207d76f263fc"}}, +{"id":"nebulog","key":"nebulog","value":{"rev":"3-1863b0ce17cc0f07a50532a830194254"}}, +{"id":"neco","key":"neco","value":{"rev":"43-e830913302b52012ab63177ecf292822"}}, +{"id":"ned","key":"ned","value":{"rev":"15-4230c69fb52dfddfd65526dcfe5c4ec6"}}, +{"id":"nedis","key":"nedis","value":{"rev":"7-d49e329dca586d1a3569266f0595c9ad"}}, +{"id":"neko","key":"neko","value":{"rev":"60-13aa87d2278c3a734733cff2a34a7970"}}, +{"id":"neo4j","key":"neo4j","value":{"rev":"7-dde7066eac32a405df95ccf9c50c8ae7"}}, +{"id":"nerve","key":"nerve","value":{"rev":"3-2c47b79586d7930aabf9325ca88ad7e8"}}, +{"id":"nest","key":"nest","value":{"rev":"23-560d67971e9acddacf087608306def24"}}, +{"id":"nestableflow","key":"nestableflow","value":{"rev":"5-ee8af667a84d333fcc8092c89f4189c3"}}, +{"id":"nestor","key":"nestor","value":{"rev":"3-f1affbc37be3bf4e337365bd172578dc"}}, +{"id":"net","key":"net","value":{"rev":"3-895103ee532ef31396d9c06764df1ed8"}}, +{"id":"netiface","key":"netiface","value":{"rev":"3-885c94284fd3a9601afe291ab68aca84"}}, +{"id":"netpool","key":"netpool","value":{"rev":"3-dadfd09b9eb7ef73e2bff34a381de207"}}, +{"id":"netstring","key":"netstring","value":{"rev":"9-d26e7bf4a3ce5eb91bb1889d362f71e6"}}, +{"id":"neuron","key":"neuron","value":{"rev":"11-edaed50492368ff39eaf7d2004d7f4d8"}}, +{"id":"new","key":"new","value":{"rev":"3-7789b37104d8161b7ccf898a9cda1fc6"}}, +{"id":"newforms","key":"newforms","value":{"rev":"9-2a87cb74477d210fcb1d0c3e3e236f03"}}, +{"id":"nexpect","key":"nexpect","value":{"rev":"15-e7127f41b9f3ec45185ede7bab7b4acd"}}, +{"id":"next","key":"next","value":{"rev":"13-de5e62125b72e48ea142a55a3817589c"}}, +{"id":"nextrip","key":"nextrip","value":{"rev":"5-1ac8103552967af98d3de452ef81a94f"}}, +{"id":"nexttick","key":"nexttick","value":{"rev":"9-c7ec279e713ea8483d33c31871aea0db"}}, +{"id":"ngen","key":"ngen","value":{"rev":"9-972980a439c34851d67e4f61a96c2632"}}, +{"id":"ngen-basicexample","key":"ngen-basicexample","value":{"rev":"3-897763c230081d320586bcadfa84499f"}}, +{"id":"ngeohash","key":"ngeohash","value":{"rev":"5-9ca0c06066bc798e934db35cad99453e"}}, +{"id":"ngist","key":"ngist","value":{"rev":"7-592c24e72708219ed1eb078ddff95ab6"}}, +{"id":"ngram","key":"ngram","value":{"rev":"5-00e6b24dc178bdeb49b1ac8cb09f6e77"}}, +{"id":"ngrep","key":"ngrep","value":{"rev":"3-49c1a3839b12083280475177c1a16e38"}}, +{"id":"nhp-body-restreamer","key":"nhp-body-restreamer","value":{"rev":"1-8a4e5e23ae681a3f8be9afb613648230"}}, +{"id":"nhttpd","key":"nhttpd","value":{"rev":"3-cdc73384e1a1a4666e813ff52f2f5e4f"}}, +{"id":"nib","key":"nib","value":{"rev":"25-d67d5a294ba5b8953472cf936b97e13d"}}, +{"id":"nicetime","key":"nicetime","value":{"rev":"3-39fdba269d712064dc1e02a7ab846821"}}, +{"id":"nicknack","key":"nicknack","value":{"rev":"5-7b5477b63f782d0a510b0c15d2824f20"}}, +{"id":"nide","key":"nide","value":{"rev":"9-74f642fced47c934f9bae29f04d17a46"}}, +{"id":"nih-op","key":"nih-op","value":{"rev":"3-6e649b45964f84cb04340ab7f0a36a1c"}}, +{"id":"nimble","key":"nimble","value":{"rev":"5-867b808dd80eab33e5f22f55bb5a7376"}}, +{"id":"ninjs","key":"ninjs","value":{"rev":"3-f59997cc4bacb2d9d9852f955d15199e"}}, +{"id":"ninotify","key":"ninotify","value":{"rev":"3-a0f3c7cbbe7ccf5d547551aa062cc8b5"}}, +{"id":"nirc","key":"nirc","value":{"rev":"3-28197984656939a5a93a77c0a1605406"}}, +{"id":"nithub","key":"nithub","value":{"rev":"3-eaa85e6ac6668a304e4e4a565c54f57d"}}, +{"id":"nix","key":"nix","value":{"rev":"12-7b338b03c0e110aeb348551b14796ff1"}}, +{"id":"nko","key":"nko","value":{"rev":"39-2bf94b2bc279b8cf847bfc7668029d37"}}, +{"id":"nlog","key":"nlog","value":{"rev":"3-ae469820484ca33f346001dcb7b63a2d"}}, +{"id":"nlog4js","key":"nlog4js","value":{"rev":"3-bc17a61a9023d64e192d249144e69f02"}}, +{"id":"nlogger","key":"nlogger","value":{"rev":"11-1e48fc9a5a4214d9e56db6c6b63f1eeb"}}, +{"id":"nmd","key":"nmd","value":{"rev":"27-2dcb60d0258a9cea838f7cc4e0922f90"}}, +{"id":"nntp","key":"nntp","value":{"rev":"5-c86b189e366b9a6a428f9a2ee88dccf1"}}, +{"id":"no.de","key":"no.de","value":{"rev":"10-0dc855fd6b0b36a710b473b2720b22c0"}}, +{"id":"nobj","key":"nobj","value":{"rev":"3-0b4a46b91b70117306a9888202117223"}}, +{"id":"noblemachine","key":"noblemachine","value":{"rev":"3-06fec410fe0c7328e06eec50b4fa5d9a"}}, +{"id":"noblerecord","key":"noblerecord","value":{"rev":"5-22f24c4285bd405785588480bb2bc324"}}, +{"id":"nock","key":"nock","value":{"rev":"5-f94423d37dbdf41001ec097f20635271"}}, +{"id":"nocr-mongo","key":"nocr-mongo","value":{"rev":"5-ce6335ed276187cc38c30cb5872d3d83"}}, +{"id":"nodast","key":"nodast","value":{"rev":"3-1c563107f2d77b79a8f0d0b8ba7041f5"}}, +{"id":"node-api","key":"node-api","value":{"rev":"3-b69cefec93d9f73256acf9fb9edeebd6"}}, +{"id":"node-apidoc","key":"node-apidoc","value":{"rev":"6-cd26945e959403fcbee8ba542e14e667"}}, +{"id":"node-app-reloader","key":"node-app-reloader","value":{"rev":"5-e08cac7656afd6c124f8e2a9b9d6fdd3"}}, +{"id":"node-arse","key":"node-arse","value":{"rev":"9-b643c828541739a5fa972c801f81b212"}}, +{"id":"node-assert-extras","key":"node-assert-extras","value":{"rev":"3-3498e17b996ffc42a29d46c9699a3b52"}}, +{"id":"node-assert-lint-free","key":"node-assert-lint-free","value":{"rev":"5-852130ba6bafc703657b833343bc5646"}}, +{"id":"node-asset","key":"node-asset","value":{"rev":"18-f7cf59be8e0d015a43d05807a1ed9c0c"}}, +{"id":"node-awesm","key":"node-awesm","value":{"rev":"3-539c10145541ac5efc4dd295767b2abc"}}, +{"id":"node-backbone-couch","key":"node-backbone-couch","value":{"rev":"19-c4d8e93436b60e098c81cc0fe50f960c"}}, +{"id":"node-base64","key":"node-base64","value":{"rev":"11-da10a7157fd9e139b48bc8d9e44a98fa"}}, +{"id":"node-bj","key":"node-bj","value":{"rev":"3-5cd21fa259199870d1917574cd167396"}}, +{"id":"node-bosh-stress-tool","key":"node-bosh-stress-tool","value":{"rev":"3-36afc4b47e570964b7f8d705e1d47732"}}, +{"id":"node-brainfuck","key":"node-brainfuck","value":{"rev":"5-c7a6f703a97a409670005cab52664629"}}, +{"id":"node-build","key":"node-build","value":{"rev":"10-4f2f137fb4ef032f9dca3e3c64c15270"}}, +{"id":"node-casa","key":"node-casa","value":{"rev":"3-3f80a478aa47620bfc0c64cc6f140d98"}}, +{"id":"node-ccl","key":"node-ccl","value":{"rev":"13-00498b820cc4cadce8cc5b7b76e30b0f"}}, +{"id":"node-chain","key":"node-chain","value":{"rev":"6-b543f421ac63eeedc667b3395e7b8971"}}, +{"id":"node-child-process-manager","key":"node-child-process-manager","value":{"rev":"36-befb1a0eeac02ad400e2aaa8a076a053"}}, +{"id":"node-chirpstream","key":"node-chirpstream","value":{"rev":"10-f20e404f9ae5d43dfb6bcee15bd9affe"}}, +{"id":"node-clone","key":"node-clone","value":{"rev":"5-5ace5d51179d0e642bf9085b3bbf999b"}}, +{"id":"node-cloudwatch","key":"node-cloudwatch","value":{"rev":"3-7f9d1e075fcc3bd3e7849acd893371d5"}}, +{"id":"node-combine","key":"node-combine","value":{"rev":"3-51891c3c7769ff11a243c89c7e537907"}}, +{"id":"node-compat","key":"node-compat","value":{"rev":"9-24fce8e15eed3e193832b1c93a482d15"}}, +{"id":"node-config","key":"node-config","value":{"rev":"6-8821f6b46347e57258e62e1be841c186"}}, +{"id":"node-crocodoc","key":"node-crocodoc","value":{"rev":"5-ad4436f633f37fe3248dce93777fc26e"}}, +{"id":"node-csv","key":"node-csv","value":{"rev":"10-cd15d347b595f1d9d1fd30b483c52724"}}, +{"id":"node-date","key":"node-date","value":{"rev":"3-a5b41cab3247e12f2beaf1e0b1ffadfa"}}, +{"id":"node-dbi","key":"node-dbi","value":{"rev":"27-96e1df6fdefbae77bfa02eda64c3e3b9"}}, +{"id":"node-debug-proxy","key":"node-debug-proxy","value":{"rev":"9-c00a14832cdd5ee4d489eb41a3d0d621"}}, +{"id":"node-dep","key":"node-dep","value":{"rev":"15-378dedd3f0b3e54329c00c675b19401c"}}, +{"id":"node-dev","key":"node-dev","value":{"rev":"48-6a98f38078fe5678d6c2fb48aec3c1c3"}}, +{"id":"node-downloader","key":"node-downloader","value":{"rev":"3-a541126c56c48681571e5e998c481343"}}, +{"id":"node-evented","key":"node-evented","value":{"rev":"6-a6ce8ab39e01cc0262c80d4bf08fc333"}}, +{"id":"node-exception-notifier","key":"node-exception-notifier","value":{"rev":"3-cebc02c45dace4852f8032adaa4e3c9c"}}, +{"id":"node-expat","key":"node-expat","value":{"rev":"33-261d85273a0a551e7815f835a933d5eb"}}, +{"id":"node-expect","key":"node-expect","value":{"rev":"7-5ba4539adfd3ba95dab21bb5bc0a5193"}}, +{"id":"node-express-boilerplate","key":"node-express-boilerplate","value":{"rev":"3-972f51d1ff9493e48d7cf508461f1114"}}, +{"id":"node-extjs","key":"node-extjs","value":{"rev":"7-33143616b4590523b4e1549dd8ffa991"}}, +{"id":"node-extjs4","key":"node-extjs4","value":{"rev":"3-8e5033aed477629a6fb9812466a90cfd"}}, +{"id":"node-fakeweb","key":"node-fakeweb","value":{"rev":"5-f01377fa6d03461cbe77f41b73577cf4"}}, +{"id":"node-fb","key":"node-fb","value":{"rev":"3-bc5f301a60e475de7c614837d3f9f35a"}}, +{"id":"node-fb-signed-request","key":"node-fb-signed-request","value":{"rev":"3-33c8f043bb947b63a84089d633d68f8e"}}, +{"id":"node-fects","key":"node-fects","value":{"rev":"3-151b7b895b74b24a87792fac34735814"}}, +{"id":"node-ffi","key":"node-ffi","value":{"rev":"22-25cf229f0ad4102333b2b13e03054ac5"}}, +{"id":"node-filter","key":"node-filter","value":{"rev":"3-0e6a86b4abb65df3594e5c93ab04bd31"}}, +{"id":"node-foursquare","key":"node-foursquare","value":{"rev":"25-549bbb0c2b4f96b2c5e6a5f642e8481d"}}, +{"id":"node-fs","key":"node-fs","value":{"rev":"5-14050cbc3887141f6b0e1e7d62736a63"}}, +{"id":"node-fs-synchronize","key":"node-fs-synchronize","value":{"rev":"11-6341e79f3391a9e1daa651a5932c8795"}}, +{"id":"node-gd","key":"node-gd","value":{"rev":"11-2ede7f4af38f062b86cc32bb0125e1bf"}}, +{"id":"node-geocode","key":"node-geocode","value":{"rev":"6-505af45c7ce679ac6738b495cc6b03c2"}}, +{"id":"node-get","key":"node-get","value":{"rev":"9-906945005a594ea1f05d4ad23170a83f"}}, +{"id":"node-gettext","key":"node-gettext","value":{"rev":"5-532ea4b528108b4c8387ddfc8fa690b2"}}, +{"id":"node-gist","key":"node-gist","value":{"rev":"11-3495a499c9496d01235676f429660424"}}, +{"id":"node-glbse","key":"node-glbse","value":{"rev":"5-69a537189610c69cc549f415431b181a"}}, +{"id":"node-google-sql","key":"node-google-sql","value":{"rev":"7-bfe20d25a4423651ecdff3f5054a6946"}}, +{"id":"node-gravatar","key":"node-gravatar","value":{"rev":"6-8265fc1ad003fd8a7383244c92abb346"}}, +{"id":"node-handlersocket","key":"node-handlersocket","value":{"rev":"16-f1dc0246559748a842dd0e1919c569ae"}}, +{"id":"node-hdfs","key":"node-hdfs","value":{"rev":"3-d460fba8ff515660de34cb216223c569"}}, +{"id":"node-hipchat","key":"node-hipchat","value":{"rev":"3-9d16738bf70f9e37565727e671ffe551"}}, +{"id":"node-hive","key":"node-hive","value":{"rev":"31-5eef1fa77a39e4bdacd8fa85ec2ce698"}}, +{"id":"node-html-encoder","key":"node-html-encoder","value":{"rev":"3-75f92e741a3b15eb56e3c4513feaca6d"}}, +{"id":"node-i3","key":"node-i3","value":{"rev":"3-5c489f43aeb06054b02ad3706183599c"}}, +{"id":"node-indextank","key":"node-indextank","value":{"rev":"5-235a17fce46c73c8b5abc4cf5f964385"}}, +{"id":"node-inherit","key":"node-inherit","value":{"rev":"3-099c0acf9c889eea94faaf64067bfc52"}}, +{"id":"node-inspector","key":"node-inspector","value":{"rev":"34-ca9fa856cf32a737d1ecccb759aaf5e1"}}, +{"id":"node-int64","key":"node-int64","value":{"rev":"11-50b92b5b65adf17e673b4d15df643ed4"}}, +{"id":"node-ip-lib","key":"node-ip-lib","value":{"rev":"3-2fe72f7b78cbc1739c71c7cfaec9fbcd"}}, +{"id":"node-iplookup","key":"node-iplookup","value":{"rev":"10-ba8474624dd852a46303d32ff0556883"}}, +{"id":"node-jdownloader","key":"node-jdownloader","value":{"rev":"3-b015035cfb8540568da5deb55b35248c"}}, +{"id":"node-jslint-all","key":"node-jslint-all","value":{"rev":"5-582f4a31160d3700731fa39771702896"}}, +{"id":"node-jsonengine","key":"node-jsonengine","value":{"rev":"3-6e429c32e42b205f3ed1ea1f48d67cbc"}}, +{"id":"node-khtml","key":"node-khtml","value":{"rev":"39-db8e8eea569657fc7de6300172a6a8a7"}}, +{"id":"node-linkshare","key":"node-linkshare","value":{"rev":"35-acc18a5d584b828bb2bd4f32bbcde98c"}}, +{"id":"node-log","key":"node-log","value":{"rev":"17-79cecc66227b4fb3a2ae04b7dac17cc2"}}, +{"id":"node-logentries","key":"node-logentries","value":{"rev":"3-0f640d5ff489a6904f4a8c18fb5f7e9c"}}, +{"id":"node-logger","key":"node-logger","value":{"rev":"3-75084f98359586bdd254e57ea5915d37"}}, +{"id":"node-logging","key":"node-logging","value":{"rev":"15-af01bc2b6128150787c85c8df1dae642"}}, +{"id":"node-mailer","key":"node-mailer","value":{"rev":"5-5b88675f05efe2836126336c880bd841"}}, +{"id":"node-mailgun","key":"node-mailgun","value":{"rev":"5-4bcfb7bf5163748b87c1b9ed429ed178"}}, +{"id":"node-markdown","key":"node-markdown","value":{"rev":"6-67137da4014f22f656aaefd9dfa2801b"}}, +{"id":"node-mdbm","key":"node-mdbm","value":{"rev":"22-3006800b042cf7d4b0b391c278405143"}}, +{"id":"node-minify","key":"node-minify","value":{"rev":"13-e853813d4b6519b168965979b8ccccdd"}}, +{"id":"node-mug","key":"node-mug","value":{"rev":"3-f7567ffac536bfa7eb5a7e3da7a0efa0"}}, +{"id":"node-mvc","key":"node-mvc","value":{"rev":"3-74f7c07b2991fcddb27afd2889b6db4e"}}, +{"id":"node-mwire","key":"node-mwire","value":{"rev":"26-79d7982748f42b9e07ab293447b167ec"}}, +{"id":"node-mynix-feed","key":"node-mynix-feed","value":{"rev":"3-59d4a624b3831bbab6ee99be2f84e568"}}, +{"id":"node-nether","key":"node-nether","value":{"rev":"3-0fbefe710fe0d74262bfa25f6b4e1baf"}}, +{"id":"node-nude","key":"node-nude","value":{"rev":"3-600abb219646299ac602fa51fa260f37"}}, +{"id":"node-nxt","key":"node-nxt","value":{"rev":"3-8ce48601c2b0164e2b125259a0c97d45"}}, +{"id":"node-oauth","key":"node-oauth","value":{"rev":"3-aa6cd61f44d74118bafa5408900c4984"}}, +{"id":"node-opencalais","key":"node-opencalais","value":{"rev":"13-a3c0b882aca7207ce36f107e40a0ce50"}}, +{"id":"node-props","key":"node-props","value":{"rev":"7-e400cee08cc9abdc1f1ce4f262a04b05"}}, +{"id":"node-proxy","key":"node-proxy","value":{"rev":"20-ce722bf45c84a7d925b8b7433e786ed6"}}, +{"id":"node-pusher","key":"node-pusher","value":{"rev":"3-7cc7cd5bffaf3b11c44438611beeba98"}}, +{"id":"node-putio","key":"node-putio","value":{"rev":"3-8a1fc6362fdcf16217cdb6846e419b4c"}}, +{"id":"node-raphael","key":"node-raphael","value":{"rev":"25-e419d98a12ace18a40d94a9e8e32cdd4"}}, +{"id":"node-rapleaf","key":"node-rapleaf","value":{"rev":"11-c849c8c8635e4eb2f81bd7810b7693fd"}}, +{"id":"node-rats","key":"node-rats","value":{"rev":"3-dca544587f3121148fe02410032cf726"}}, +{"id":"node-rdf2json","key":"node-rdf2json","value":{"rev":"3-bde382dc2fcb40986c5ac41643d44543"}}, +{"id":"node-recurly","key":"node-recurly","value":{"rev":"11-79cab9ccee7c1ddb83791e8de41c72f5"}}, +{"id":"node-redis","key":"node-redis","value":{"rev":"13-12adf3a3e986675637fa47b176f527e3"}}, +{"id":"node-redis-mapper","key":"node-redis-mapper","value":{"rev":"5-53ba8f67cc82dbf1d127fc7359353f32"}}, +{"id":"node-redis-monitor","key":"node-redis-monitor","value":{"rev":"3-79bcba76241d7c7dbc4b18d90a9d59e3"}}, +{"id":"node-restclient","key":"node-restclient","value":{"rev":"6-5844eba19bc465a8f75b6e94c061350f"}}, +{"id":"node-restclient2","key":"node-restclient2","value":{"rev":"5-950de911f7bde7900dfe5b324f49818c"}}, +{"id":"node-runner","key":"node-runner","value":{"rev":"3-e9a9e6bd10d2ab1aed8b401b04fadc7b"}}, +{"id":"node-sc-setup","key":"node-sc-setup","value":{"rev":"3-e89c496e03c48d8574ccaf61c9ed4fca"}}, +{"id":"node-schedule","key":"node-schedule","value":{"rev":"9-ae12fa59226f1c9b7257b8a2d71373b4"}}, +{"id":"node-sdlmixer","key":"node-sdlmixer","value":{"rev":"8-489d85278d6564b6a4e94990edcb0527"}}, +{"id":"node-secure","key":"node-secure","value":{"rev":"3-73673522a4bb5f853d55e535f0934803"}}, +{"id":"node-sendgrid","key":"node-sendgrid","value":{"rev":"9-4662c31304ca4ee4e702bd3a54ea7824"}}, +{"id":"node-sizzle","key":"node-sizzle","value":{"rev":"6-c08c24d9d769d3716e5c4e3441740eb2"}}, +{"id":"node-soap-client","key":"node-soap-client","value":{"rev":"9-35ff34a4a5af569de6a2e89d1b35b69a"}}, +{"id":"node-spec","key":"node-spec","value":{"rev":"9-92e99ca74b9a09a8ae2eb7382ef511ef"}}, +{"id":"node-static","key":"node-static","value":{"rev":"10-11b0480fcd416db3d3d4041f43a55290"}}, +{"id":"node-static-maccman","key":"node-static-maccman","value":{"rev":"3-49e256728b14c85776b74f2bd912eb42"}}, +{"id":"node-statsd","key":"node-statsd","value":{"rev":"5-08d3e6b4b2ed1d0b7916e9952f55573c"}}, +{"id":"node-statsd-instrument","key":"node-statsd-instrument","value":{"rev":"3-c3cd3315e1edcc91096830392f439305"}}, +{"id":"node-std","key":"node-std","value":{"rev":"3-f99be0f03be4175d546823799bb590d3"}}, +{"id":"node-store","key":"node-store","value":{"rev":"3-7cb6bf13de9550b869c768f464fd0f65"}}, +{"id":"node-stringprep","key":"node-stringprep","value":{"rev":"13-9b08baa97042f71c5c8e9e2fdcc2c300"}}, +{"id":"node-synapse","key":"node-synapse","value":{"rev":"3-c46c47099eb2792f4a57fdfd789520ca"}}, +{"id":"node-syslog","key":"node-syslog","value":{"rev":"23-34f7df06ba88d9f897b7e00404db7187"}}, +{"id":"node-t","key":"node-t","value":{"rev":"3-042225eff3208ba9add61a9f79d90871"}}, +{"id":"node-taobao","key":"node-taobao","value":{"rev":"7-c988ace74806b2e2f55e162f54ba1a2c"}}, +{"id":"node-term-ui","key":"node-term-ui","value":{"rev":"5-210310014b19ce26c5e3e840a8a0549e"}}, +{"id":"node-tiny","key":"node-tiny","value":{"rev":"7-df05ab471f25ca4532d80c83106944d7"}}, +{"id":"node-tmpl","key":"node-tmpl","value":{"rev":"3-6fcfa960da8eb72a5e3087559d3fe206"}}, +{"id":"node-twilio","key":"node-twilio","value":{"rev":"11-af69e600109d38c77eadbcec4bee4782"}}, +{"id":"node-twitter-mailer","key":"node-twitter-mailer","value":{"rev":"7-f915b76d834cb162c91816abc30cee5f"}}, +{"id":"node-usb","key":"node-usb","value":{"rev":"3-0c3837307f86a80427800f1b45aa5862"}}, +{"id":"node-uuid","key":"node-uuid","value":{"rev":"6-642efa619ad8a6476a44a5c6158e7a36"}}, +{"id":"node-vapor.js","key":"node-vapor.js","value":{"rev":"3-d293284cc415b2906533e91db13ee748"}}, +{"id":"node-version","key":"node-version","value":{"rev":"3-433b1529a6aa3d619314e461e978d2b6"}}, +{"id":"node-webapp","key":"node-webapp","value":{"rev":"11-65411bfd8eaf19d3539238360d904d43"}}, +{"id":"node-wiki","key":"node-wiki","value":{"rev":"5-22b0177c9a5e4dc1f72d36bb83c746d0"}}, +{"id":"node-wkhtml","key":"node-wkhtml","value":{"rev":"5-a8fa203720442b443d558670c9750548"}}, +{"id":"node-xerces","key":"node-xerces","value":{"rev":"3-de6d82ec712af997b7aae451277667f0"}}, +{"id":"node-xml","key":"node-xml","value":{"rev":"3-e14a52dcd04302aea7dd6943cf6dd886"}}, +{"id":"node-xmpp","key":"node-xmpp","value":{"rev":"36-031eb5e830ed2e2027ee4ee7f861cf81"}}, +{"id":"node-xmpp-bosh","key":"node-xmpp-bosh","value":{"rev":"85-f7f8b699b6fda74fc27c621466915bd1"}}, +{"id":"node-xmpp-via-bosh","key":"node-xmpp-via-bosh","value":{"rev":"3-5f5fee9e42ae8ce8f42d55c31808c969"}}, +{"id":"node.io","key":"node.io","value":{"rev":"224-e99561d454a7676d10875e1b06ba44c7"}}, +{"id":"node.io-min","key":"node.io-min","value":{"rev":"3-e8389bdcfa55c68ae9698794d9089ce4"}}, +{"id":"node.isbn","key":"node.isbn","value":{"rev":"3-76aa84f3c49a54b6c901f440af35192d"}}, +{"id":"node.uptime","key":"node.uptime","value":{"rev":"5-cfc2c1c1460d000eab4e1a28506e6d29"}}, +{"id":"node3p","key":"node3p","value":{"rev":"14-b1931b8aa96227854d78965cc4301168"}}, +{"id":"node3p-web","key":"node3p-web","value":{"rev":"12-bc783ee1e493e80b7e7a3c2fce39f55e"}}, +{"id":"nodeBase","key":"nodeBase","value":{"rev":"39-4d9ae0f18e0bca7192901422d85e85c7"}}, +{"id":"nodeCgi","key":"nodeCgi","value":{"rev":"9-bb65e71ee63551e519f49434f2ae1cd7"}}, +{"id":"nodeDocs","key":"nodeDocs","value":{"rev":"3-0c6e714d3e6d5c2cc9482444680fb3ca"}}, +{"id":"nodePhpSessions","key":"nodePhpSessions","value":{"rev":"3-5063b38582deaca9cacdc029db97c2b1"}}, +{"id":"node_bsdiff","key":"node_bsdiff","value":{"rev":"5-e244ef36755a2b6534ce50fa1ee5ee6e"}}, +{"id":"node_hash","key":"node_hash","value":{"rev":"3-cdce2fcc2c18fcd25e16be8e52add891"}}, +{"id":"node_util","key":"node_util","value":{"rev":"3-cde723ee2311cf48f7cf0a3bc3484f9a"}}, +{"id":"node_xslt","key":"node_xslt","value":{"rev":"3-f12035155aee31d1749204fdca2aee10"}}, +{"id":"nodec","key":"nodec","value":{"rev":"3-dba2af2d5b98a71964abb4328512b9e1"}}, +{"id":"nodefm","key":"nodefm","value":{"rev":"3-c652a95d30318a371736515feab649f9"}}, +{"id":"nodegit","key":"nodegit","value":{"rev":"31-92a2cea0d1c92086c920bc007f5a3f16"}}, +{"id":"nodeib","key":"nodeib","value":{"rev":"3-e67d779007817597ca36e8b821f38e6a"}}, +{"id":"nodeinfo","key":"nodeinfo","value":{"rev":"53-61bf0f48662dc2e04cde38a2b897c211"}}, +{"id":"nodejitsu-client","key":"nodejitsu-client","value":{"rev":"3-4fa613f888ebe249aff7b03aa9b8d7ef"}}, +{"id":"nodejs-intro","key":"nodejs-intro","value":{"rev":"4-c75f03e80b597f734f4466e62ecebfeb"}}, +{"id":"nodejs-tvrage","key":"nodejs-tvrage","value":{"rev":"9-88bb3b5d23652ebdb7186a30bc3be43f"}}, +{"id":"nodejs.be-cli","key":"nodejs.be-cli","value":{"rev":"3-d8f23777f9b18101f2d2dc5aa618a703"}}, +{"id":"nodeler","key":"nodeler","value":{"rev":"9-00760d261ea75164a5709109011afb25"}}, +{"id":"nodelint","key":"nodelint","value":{"rev":"8-31502553d4bb099ba519fb331cccdd63"}}, +{"id":"nodeload","key":"nodeload","value":{"rev":"12-f02626475b59ebe67a864a114c99ff9b"}}, +{"id":"nodemachine","key":"nodemachine","value":{"rev":"8-5342324502e677e35aefef17dc08c8db"}}, +{"id":"nodemailer","key":"nodemailer","value":{"rev":"63-d39a5143b06fa79edcb81252d6329861"}}, +{"id":"nodemock","key":"nodemock","value":{"rev":"33-7095334209b39c8e1482374bee1b712a"}}, +{"id":"nodemon","key":"nodemon","value":{"rev":"42-4f40ba2299ef4ae613a384a48e4045fa"}}, +{"id":"nodepad","key":"nodepad","value":{"rev":"5-93718cc67e97c89f45b753c1caef07e4"}}, +{"id":"nodepal","key":"nodepal","value":{"rev":"5-e53372a5081b3753993ee98299ecd550"}}, +{"id":"nodepie","key":"nodepie","value":{"rev":"21-a44a6d3575758ed591e13831a5420758"}}, +{"id":"nodepress","key":"nodepress","value":{"rev":"3-f17616b9ae61e15d1d219cb87ac5a63a"}}, +{"id":"noderelict","key":"noderelict","value":{"rev":"23-0ca0997e3ef112e9393ae8ccef63f1ee"}}, +{"id":"noderpc","key":"noderpc","value":{"rev":"27-7efb6365916b403c3aa4e1c766de75a2"}}, +{"id":"nodespec","key":"nodespec","value":{"rev":"3-69f357577e52e9fd096ac88a1e7e3445"}}, +{"id":"nodespy","key":"nodespy","value":{"rev":"3-ad33e14db2bcaf61bf99d3e8915da5ee"}}, +{"id":"nodestalker","key":"nodestalker","value":{"rev":"5-080eba88a3625ecf7935ec5e9d2db6e9"}}, +{"id":"nodester-api","key":"nodester-api","value":{"rev":"39-52046dbcdf4447bbb85aecc92086ae1d"}}, +{"id":"nodester-cli","key":"nodester-cli","value":{"rev":"89-6de3d724a974c1dd3b632417f8b01267"}}, +{"id":"nodetk","key":"nodetk","value":{"rev":"11-265d267335e7603249e1af9441700f2f"}}, +{"id":"nodeunit","key":"nodeunit","value":{"rev":"40-d1cc6c06f878fb0b86779186314bc193"}}, +{"id":"nodeunit-coverage","key":"nodeunit-coverage","value":{"rev":"3-29853918351e75e3f6f93acd97e2942f"}}, +{"id":"nodeunit-dsl","key":"nodeunit-dsl","value":{"rev":"6-91be44077bc80c942f86f0ac28a69c5e"}}, +{"id":"nodevlc","key":"nodevlc","value":{"rev":"3-e151577d3e1ba2f58db465d94ebcb1c1"}}, +{"id":"nodevore","key":"nodevore","value":{"rev":"3-ac73b3bc33e2f934776dda359869ddcf"}}, +{"id":"nodewatch","key":"nodewatch","value":{"rev":"9-267bfe1324c51993865dc41b09aee6dc"}}, +{"id":"nodewii","key":"nodewii","value":{"rev":"9-716b3faa8957c1aea337540402ae7f43"}}, +{"id":"nodie","key":"nodie","value":{"rev":"3-cc29702a2e7e295cfe583a05fb77b530"}}, +{"id":"nodify","key":"nodify","value":{"rev":"10-87fadf6bf262882bd71ab7e759b29949"}}, +{"id":"nodrrr","key":"nodrrr","value":{"rev":"3-75937f4ffb722a67d6c5a67663366854"}}, +{"id":"nodules","key":"nodules","value":{"rev":"8-2c6ec430f26ff7ef171e80b7b5e990c2"}}, +{"id":"nodysentary","key":"nodysentary","value":{"rev":"3-7574fc8e12b1271c2eb1c66026f702cb"}}, +{"id":"nohm","key":"nohm","value":{"rev":"45-09dcf4df92734b3c51c8df3c3b374b0b"}}, +{"id":"noid","key":"noid","value":{"rev":"5-ac31e001806789e80a7ffc64f2914eb4"}}, +{"id":"nolife","key":"nolife","value":{"rev":"7-cfd4fe84b1062303cefb83167ea48bba"}}, +{"id":"nolog","key":"nolog","value":{"rev":"9-6e82819b801f5d7ec6773596d5d2efb2"}}, +{"id":"nomnom","key":"nomnom","value":{"rev":"34-bf66753d1d155820cfacfc7fa7a830c9"}}, +{"id":"nomplate","key":"nomplate","value":{"rev":"9-6ea21ee9568421a60cb80637c4c6cb48"}}, +{"id":"nonogo","key":"nonogo","value":{"rev":"5-8307413f9a3da913f9818c4f2d951519"}}, +{"id":"noode","key":"noode","value":{"rev":"7-454df50a7cbd03c46a9951cb1ddbe1c6"}}, +{"id":"noodle","key":"noodle","value":{"rev":"7-163745527770de0de8e7e9d59fc3888c"}}, +{"id":"noop","key":"noop","value":{"rev":"5-ed9fd66573ed1186e66b4c2bc16192cb"}}, +{"id":"nope","key":"nope","value":{"rev":"3-7088ffb62b8e06261527cbfa69cb94c5"}}, +{"id":"nopro","key":"nopro","value":{"rev":"11-6c4aeafe6329821b2259ef11414481dd"}}, +{"id":"nopt","key":"nopt","value":{"rev":"23-cce441940b6f129cab94a359ddb8b3e4"}}, +{"id":"norm","key":"norm","value":{"rev":"9-2bf26c3803fdc3bb6319e490cae3b625"}}, +{"id":"norq","key":"norq","value":{"rev":"3-b1a80ad1aa4ccc493ac25da22b0f0697"}}, +{"id":"norris","key":"norris","value":{"rev":"3-a341286d9e83fa392c1ce6b764d0aace"}}, +{"id":"norris-ioc","key":"norris-ioc","value":{"rev":"15-d022f159229d89ce60fc2a15d71eac59"}}, +{"id":"norris-tester","key":"norris-tester","value":{"rev":"3-fc2f34c9373bbdf5a1cd9cfbaff21f83"}}, +{"id":"northwatcher","key":"northwatcher","value":{"rev":"13-edab28a123f0100e12f96c9828428a8a"}}, +{"id":"nosey","key":"nosey","value":{"rev":"4-10a22f27dd9f2a40acf035a7d250c661"}}, +{"id":"nosql-thin","key":"nosql-thin","value":{"rev":"6-604169cacf303b5278064f68b884090b"}}, +{"id":"notch","key":"notch","value":{"rev":"3-5b720089f0f9cfdbbbea8677216eeee5"}}, +{"id":"notes","key":"notes","value":{"rev":"3-5dfbd6ec33c69c0f1b619dd65d9e7a56"}}, +{"id":"nothing","key":"nothing","value":{"rev":"3-8b44e10efd7d6504755c0c4bd1043814"}}, +{"id":"notifications","key":"notifications","value":{"rev":"3-a68448bca7ea2d3d3ce43e4d03cd76c6"}}, +{"id":"notifo","key":"notifo","value":{"rev":"8-0bc13ea6135adfa80c5fac497a2ddeda"}}, +{"id":"notify","key":"notify","value":{"rev":"3-da00942576bcb5fab594186f80d4575a"}}, +{"id":"notify-send","key":"notify-send","value":{"rev":"7-89f5c6bc656d51577e3997b9f90d0454"}}, +{"id":"nova","key":"nova","value":{"rev":"3-4e136f35b7d5b85816c17496c6c0e382"}}, +{"id":"now","key":"now","value":{"rev":"84-dbfde18b3f6fe79dd3637b6da34b78cf"}}, +{"id":"now-bal","key":"now-bal","value":{"rev":"3-c769bcdd45a93095f68c2de54f35543f"}}, +{"id":"nowpad","key":"nowpad","value":{"rev":"51-8d90c49031f79a9d31eb4ed6f39609b6"}}, +{"id":"nowww","key":"nowww","value":{"rev":"3-541994af2e579b376d2037f4e34f31d8"}}, +{"id":"noxmox","key":"noxmox","value":{"rev":"9-4ac8b1529dced329cac0976b9ca9eed0"}}, +{"id":"nozzle","key":"nozzle","value":{"rev":"23-e60444326d11a5b57c208de548c325e8"}}, +{"id":"npm","key":"npm","value":{"rev":"665-71d13d024c846b2ee85ed054fcfcb242"}}, +{"id":"npm-deploy","key":"npm-deploy","value":{"rev":"23-751e9d3c2edac0fd9916b0e886414ef2"}}, +{"id":"npm-dev-install","key":"npm-dev-install","value":{"rev":"3-7a08e11a59758329ba8dc4e781ea9993"}}, +{"id":"npm-docsite","key":"npm-docsite","value":{"rev":"3-5ed4f1ffea02487ab9ea24cfa0196f76"}}, +{"id":"npm-github-service","key":"npm-github-service","value":{"rev":"8-6891bc055b499e088fc79a7f94b6a4ec"}}, +{"id":"npm-intro-slides","key":"npm-intro-slides","value":{"rev":"8-e95f28475662cb8f70f4cb48baaa9d27"}}, +{"id":"npm-monitor","key":"npm-monitor","value":{"rev":"7-4e3209ea893fe37c0e516fe21de2d8ad"}}, +{"id":"npm-remapper","key":"npm-remapper","value":{"rev":"3-69163475ee93f32faac3f934e772b6c7"}}, +{"id":"npm-tweets","key":"npm-tweets","value":{"rev":"9-86064412a8aa02d813b20d2e49d78d84"}}, +{"id":"npm-wrapper","key":"npm-wrapper","value":{"rev":"3-59c4d372b84f6e91dbe48a220511dfd5"}}, +{"id":"npm2debian","key":"npm2debian","value":{"rev":"3-3cf2f471f3bfbc613176c7c780a6aad6"}}, +{"id":"npmcount","key":"npmcount","value":{"rev":"5-59c55b09d9c2cc7da217cab3b0ea642c"}}, +{"id":"npmdep","key":"npmdep","value":{"rev":"9-78184ad3b841e5c91bbfa29ff722778a"}}, +{"id":"npmtop","key":"npmtop","value":{"rev":"19-2754af894829f22d6edb3a17a64cdf1e"}}, +{"id":"nquery","key":"nquery","value":{"rev":"9-461fb0c9bcc3c15e0696dc2e99807c98"}}, +{"id":"nrecipe","key":"nrecipe","value":{"rev":"15-a96b6b0134a7625eb4eb236b4bf3fbf3"}}, +{"id":"nserver","key":"nserver","value":{"rev":"5-ea895373c340dd8d9119f3f549990048"}}, +{"id":"nserver-util","key":"nserver-util","value":{"rev":"5-5e14eb0bc9f7ab0eac04c5699c6bb328"}}, +{"id":"nssocket","key":"nssocket","value":{"rev":"51-6aac1d5dd0aa7629b3619b3085d63c04"}}, +{"id":"nstore","key":"nstore","value":{"rev":"28-6e2639829539b7315040487dfa5c79af"}}, +{"id":"nstore-cache","key":"nstore-cache","value":{"rev":"3-453ed78dcbe68b31ff675f4d94b47c4a"}}, +{"id":"nstore-query","key":"nstore-query","value":{"rev":"3-39f46992dd278824db641a37ec5546f5"}}, +{"id":"ntodo","key":"ntodo","value":{"rev":"7-e214da8bbed2d3e40bdaec77d7a49831"}}, +{"id":"ntp","key":"ntp","value":{"rev":"5-5ee2b25e8f3bca06d1cc4ce3b25cac42"}}, +{"id":"nts","key":"nts","value":{"rev":"7-ecaf47f8af1f77de791d1d1fa9bab88e"}}, +{"id":"nttpd","key":"nttpd","value":{"rev":"21-cda7aa0f1db126428f6ca01d44b4d209"}}, +{"id":"ntwitter","key":"ntwitter","value":{"rev":"11-732c6f34137c942bc98967170b2f83fc"}}, +{"id":"nub","key":"nub","value":{"rev":"3-932ecf56889fa43584687dbb2cf4aa91"}}, +{"id":"nubnub","key":"nubnub","value":{"rev":"6-93a5267209e1aa869521a5952cbb1828"}}, +{"id":"null","key":"null","value":{"rev":"3-ae8247cfa9553d23a229993cfc8436c5"}}, +{"id":"numb","key":"numb","value":{"rev":"5-594cd9e8e8e4262ddb3ddd80e8084b62"}}, +{"id":"nun","key":"nun","value":{"rev":"8-3bd8b37ed85c1a5da211bd0d5766848e"}}, +{"id":"nunz","key":"nunz","value":{"rev":"3-040f033943158be495f6b0da1a0c0344"}}, +{"id":"nurl","key":"nurl","value":{"rev":"11-6c4ee6fc5c5119c56f2fd8ad8a0cb928"}}, +{"id":"nutil","key":"nutil","value":{"rev":"3-7785a1d4651dcfe78c874848f41d1348"}}, +{"id":"nutils","key":"nutils","value":{"rev":"13-889624db0c155fc2f0b501bba47e55ec"}}, +{"id":"nuvem","key":"nuvem","value":{"rev":"23-054b9b1240f4741f561ef0bb3197bdf8"}}, +{"id":"nvm","key":"nvm","value":{"rev":"28-251b7eb3429a00099b37810d05accd47"}}, +{"id":"nwm","key":"nwm","value":{"rev":"3-fe9274106aac9e67eea734159477acaf"}}, +{"id":"nx","key":"nx","value":{"rev":"55-7ad32fcb34ec25f841ddd0e5857375c7"}}, +{"id":"nx-core","key":"nx-core","value":{"rev":"33-a7bc62348591bae89fff82057bede1ab"}}, +{"id":"nx-daemon","key":"nx-daemon","value":{"rev":"3-7b86a87654c9e32746a4d36d7c527182"}}, +{"id":"nyaatorrents","key":"nyaatorrents","value":{"rev":"5-8600707a1e84f617bd5468b5c9179202"}}, +{"id":"nyala","key":"nyala","value":{"rev":"17-23c908297a37c47f9f09977f4cf101ff"}}, +{"id":"nyam","key":"nyam","value":{"rev":"17-697b5f17fe67630bc9494184146c12f1"}}, +{"id":"nyancat","key":"nyancat","value":{"rev":"13-84c18d007db41b40e9145bdc049b0a00"}}, +{"id":"nymph","key":"nymph","value":{"rev":"5-3a5d7a75d32f7a71bf4ec131f71484d8"}}, +{"id":"o3-xml","key":"o3-xml","value":{"rev":"3-cc4df881333805600467563f80b5216c"}}, +{"id":"oahu","key":"oahu","value":{"rev":"3-e789fc2098292518cb33606c73bfeca4"}}, +{"id":"oauth","key":"oauth","value":{"rev":"38-36b99063db7dc302b70d932e9bbafc24"}}, +{"id":"oauth-client","key":"oauth-client","value":{"rev":"12-ae097c9580ddcd5ca938b169486a63c6"}}, +{"id":"oauth-server","key":"oauth-server","value":{"rev":"7-ea931e31eaffaa843be61ffc89f29da7"}}, +{"id":"oauth2","key":"oauth2","value":{"rev":"3-4fce73fdc95580f397afeaf1bbd596bb"}}, +{"id":"oauth2-client","key":"oauth2-client","value":{"rev":"7-b5bd019159112384abc2087b2f8cb4f7"}}, +{"id":"oauth2-provider","key":"oauth2-provider","value":{"rev":"3-acd8f23b8c1c47b19838424b64618c70"}}, +{"id":"oauth2-server","key":"oauth2-server","value":{"rev":"11-316baa7e754053d0153086d0748b07c5"}}, +{"id":"obj_diff","key":"obj_diff","value":{"rev":"3-9289e14caaec4bb6aa64aa1be547db3b"}}, +{"id":"object-additions","key":"object-additions","value":{"rev":"3-11f03ae5afe00ad2be034fb313ce71a9"}}, +{"id":"object-proxy","key":"object-proxy","value":{"rev":"3-4d531308fc97bac6f6f9acd1e8f5b53a"}}, +{"id":"object-sync","key":"object-sync","value":{"rev":"5-6628fff49d65c96edc9d7a2e13db8d6d"}}, +{"id":"observer","key":"observer","value":{"rev":"3-a48052671a59b1c7874b4462e375664d"}}, +{"id":"octo.io","key":"octo.io","value":{"rev":"7-5692104396299695416ecb8548e53541"}}, +{"id":"octopus","key":"octopus","value":{"rev":"3-0a286abf59ba7232210e24a371902e7b"}}, +{"id":"odbc","key":"odbc","value":{"rev":"3-8550f0b183b229e41f3cb947bad9b059"}}, +{"id":"odot","key":"odot","value":{"rev":"13-3954b69c1a560a71fe58ab0c5c1072ba"}}, +{"id":"offliner","key":"offliner","value":{"rev":"3-9b58041cbd7b0365e04fec61c192c9b2"}}, +{"id":"ofxer","key":"ofxer","value":{"rev":"11-f8a79e1f27c92368ca1198ad37fbe83e"}}, +{"id":"ogre","key":"ogre","value":{"rev":"35-ea9c78c1d5b1761f059bb97ea568b23d"}}, +{"id":"oi.tekcos","key":"oi.tekcos","value":{"rev":"5-fdca9adb54acea3f91567082b107dde9"}}, +{"id":"oktest","key":"oktest","value":{"rev":"3-3b40312743a3eb1d8541ceee3ecfeace"}}, +{"id":"omcc","key":"omcc","value":{"rev":"3-19718e77bf82945c3ca7a3cdfb91188c"}}, +{"id":"omegle","key":"omegle","value":{"rev":"3-507ba8a51afbe2ff078e3e96712b7286"}}, +{"id":"ometa","key":"ometa","value":{"rev":"10-457fa17de89e1012ce812af3a53f4035"}}, +{"id":"ometa-highlighter","key":"ometa-highlighter","value":{"rev":"21-d18470d6d9a93bc7383c7d8ace22ad1d"}}, +{"id":"ometajs","key":"ometajs","value":{"rev":"20-c7e8c32926f2523e40e4a7ba2297192c"}}, +{"id":"onion","key":"onion","value":{"rev":"3-b46c000c8ff0b06f5f0028d268bc5c94"}}, +{"id":"onvalid","key":"onvalid","value":{"rev":"3-090bc1cf1418545b84db0fceb0846293"}}, +{"id":"oo","key":"oo","value":{"rev":"7-2297a18cdbcf29ad4867a2159912c04e"}}, +{"id":"oop","key":"oop","value":{"rev":"7-45fab8bae343e805d0c1863149dc20df"}}, +{"id":"op","key":"op","value":{"rev":"13-4efb059757caaecc18d5110b44266b35"}}, +{"id":"open-uri","key":"open-uri","value":{"rev":"21-023a00f26ecd89e278136fbb417ae9c3"}}, +{"id":"open.core","key":"open.core","value":{"rev":"35-f578db4e41dd4ae9128e3be574cf7b14"}}, +{"id":"open311","key":"open311","value":{"rev":"13-bb023a45d3c3988022d2fef809de8d98"}}, +{"id":"openid","key":"openid","value":{"rev":"29-b3c8a0e76d99ddb80c98d2aad5586771"}}, +{"id":"openlayers","key":"openlayers","value":{"rev":"3-602c34468c9be326e95be327b58d599b"}}, +{"id":"opentok","key":"opentok","value":{"rev":"5-5f4749f1763d45141d0272c1dbe6249a"}}, +{"id":"opentsdb-dashboard","key":"opentsdb-dashboard","value":{"rev":"3-2e0c5ccf3c9cfce17c20370c93283707"}}, +{"id":"opower-jobs","key":"opower-jobs","value":{"rev":"16-1602139f92e58d88178f21f1b3e0939f"}}, +{"id":"optimist","key":"optimist","value":{"rev":"64-ca3e5085acf135169d79949c25d84690"}}, +{"id":"optparse","key":"optparse","value":{"rev":"6-0200c34395f982ae3b80f4d18cb14483"}}, +{"id":"opts","key":"opts","value":{"rev":"8-ce2a0e31de55a1e02d5bbff66c4e8794"}}, +{"id":"orchestra","key":"orchestra","value":{"rev":"9-52ca98cddb51a2a43ec02338192c44fc"}}, +{"id":"orchid","key":"orchid","value":{"rev":"49-af9635443671ed769e4efa691b8ca84a"}}, +{"id":"orderly","key":"orderly","value":{"rev":"3-9ccc42d45b64278c9ffb1e64fc4f0d62"}}, +{"id":"orgsync.live","key":"orgsync.live","value":{"rev":"3-4dffc8ac43931364f59b9cb534acbaef"}}, +{"id":"orm","key":"orm","value":{"rev":"21-f3e7d89239364559d306110580bbb08f"}}, +{"id":"ormnomnom","key":"ormnomnom","value":{"rev":"15-0aacfbb5b7b580d76e9ecf5214a1d5ed"}}, +{"id":"orona","key":"orona","value":{"rev":"8-62d4ba1bf49098a140a2b85f80ebb103"}}, +{"id":"osc4node","key":"osc4node","value":{"rev":"3-0910613e78065f78b61142b35986e8b3"}}, +{"id":"oscar","key":"oscar","value":{"rev":"3-f5d2d39a67c67441bc2135cdaf2b47f8"}}, +{"id":"osrandom","key":"osrandom","value":{"rev":"3-026016691a5ad068543503e5e7ce6a84"}}, +{"id":"ossp-uuid","key":"ossp-uuid","value":{"rev":"10-8b7e1fba847d7cc9aa4f4c8813ebe6aa"}}, +{"id":"ostatus","key":"ostatus","value":{"rev":"3-76e0ec8c61c6df15c964197b722e24e7"}}, +{"id":"ostrich","key":"ostrich","value":{"rev":"3-637e0821e5ccfd0f6b1261b22c168c8d"}}, +{"id":"otk","key":"otk","value":{"rev":"5-2dc24e159cc618f43e573561286c4dcd"}}, +{"id":"ourl","key":"ourl","value":{"rev":"5-a3945e59e33faac96c75b508ef7fa1fb"}}, +{"id":"oursql","key":"oursql","value":{"rev":"21-bc53ab462155fa0aedbe605255fb9988"}}, +{"id":"out","key":"out","value":{"rev":"5-eb261f940b6382e2689210a58bc1b440"}}, +{"id":"overload","key":"overload","value":{"rev":"10-b88919e5654bef4922029afad4f1d519"}}, +{"id":"ox","key":"ox","value":{"rev":"3-0ca445370b4f76a93f2181ad113956d9"}}, +{"id":"pachube","key":"pachube","value":{"rev":"10-386ac6be925bab307b5d545516fb18ef"}}, +{"id":"pachube-stream","key":"pachube-stream","value":{"rev":"13-176dadcc5c516420fb3feb1f964739e0"}}, +{"id":"pack","key":"pack","value":{"rev":"29-8f8c511d95d1fb322c1a6d7965ef8f29"}}, +{"id":"packagebohrer","key":"packagebohrer","value":{"rev":"3-507358253a945a74c49cc169ad0bf5a2"}}, +{"id":"packer","key":"packer","value":{"rev":"9-23410d893d47418731e236cfcfcfbf03"}}, +{"id":"packet","key":"packet","value":{"rev":"8-1b366f97d599c455dcbbe4339da7cf9e"}}, +{"id":"pacote-sam-egenial","key":"pacote-sam-egenial","value":{"rev":"3-b967db1b9fceb9a937f3520efd89f479"}}, +{"id":"pacoteegenial","key":"pacoteegenial","value":{"rev":"3-9cfe8518b885bfd9a44ed38814f7d623"}}, +{"id":"pact","key":"pact","value":{"rev":"7-82996c1a0c8e9a5e9df959d4ad37085e"}}, +{"id":"pad","key":"pad","value":{"rev":"3-eef6147f09b662cff95c946f2b065da5"}}, +{"id":"paddle","key":"paddle","value":{"rev":"3-fedd0156b9a0dadb5e9b0f1cfab508fd"}}, +{"id":"padlock","key":"padlock","value":{"rev":"9-3a9e378fbe8e3817da7999f675af227e"}}, +{"id":"pagen","key":"pagen","value":{"rev":"9-9aac56724039c38dcdf7f6d5cbb4911c"}}, +{"id":"paginate-js","key":"paginate-js","value":{"rev":"5-995269155152db396662c59b67e9e93d"}}, +{"id":"pairtree","key":"pairtree","value":{"rev":"3-0361529e6c91271e2a61f3d7fd44366e"}}, +{"id":"palsu-app","key":"palsu-app","value":{"rev":"3-73f1fd9ae35e3769efc9c1aa25ec6da7"}}, +{"id":"pam","key":"pam","value":{"rev":"3-77b5bd15962e1c8be1980b33fd3b9737"}}, +{"id":"panache","key":"panache","value":{"rev":"25-749d2034f7f9179c2266cf896bb4abb0"}}, +{"id":"panic","key":"panic","value":{"rev":"7-068b22be54ca8ae7b03eb153c2ea849a"}}, +{"id":"pantry","key":"pantry","value":{"rev":"33-3896f0fc165092f6cabb2949be3952c4"}}, +{"id":"paper-keys","key":"paper-keys","value":{"rev":"3-729378943040ae01d59f07bb536309b7"}}, +{"id":"paperboy","key":"paperboy","value":{"rev":"8-db2d51c2793b4ffc82a1ae928c813aae"}}, +{"id":"paperserve","key":"paperserve","value":{"rev":"6-8509fb68217199a3eb74f223b1e2bee5"}}, +{"id":"parall","key":"parall","value":{"rev":"5-279d7105a425e136f6101250e8f81a14"}}, +{"id":"parallel","key":"parallel","value":{"rev":"14-f1294b3b840cfb26095107110b6720ec"}}, +{"id":"paramon","key":"paramon","value":{"rev":"3-37e599e924beb509c894c992cf72791b"}}, +{"id":"parannus","key":"parannus","value":{"rev":"7-7541f1ed13553261330b9e1c4706f112"}}, +{"id":"parasite","key":"parasite","value":{"rev":"13-83c26181bb92cddb8ff76bc154a50210"}}, +{"id":"parrot","key":"parrot","value":{"rev":"3-527d1cb4b5be0e252dc92a087d380f17"}}, +{"id":"parseUri","key":"parseUri","value":{"rev":"3-3b60b1fd6d8109279b5d0cfbdb89b343"}}, +{"id":"parseopt","key":"parseopt","value":{"rev":"10-065f1acaf02c94f0684f75fefc2fd1ec"}}, +{"id":"parser","key":"parser","value":{"rev":"5-f661f0b7ede9b6d3e0de259ed20759b1"}}, +{"id":"parser_email","key":"parser_email","value":{"rev":"12-63333860c62f2a9c9d6b0b7549bf1cdc"}}, +{"id":"parstream","key":"parstream","value":{"rev":"3-ef7e8ffc8ce1e7d951e37f85bfd445ab"}}, +{"id":"parted","key":"parted","value":{"rev":"9-250e4524994036bc92915b6760d62d8a"}}, +{"id":"partial","key":"partial","value":{"rev":"7-208411e6191275a4193755ee86834716"}}, +{"id":"party","key":"party","value":{"rev":"5-9337d8dc5e163f0300394f533ab1ecdf"}}, +{"id":"pashua","key":"pashua","value":{"rev":"3-b752778010f4e20f662a3d8f0f57b18b"}}, +{"id":"pass","key":"pass","value":{"rev":"3-66a2d55d93eae8535451f12965578db8"}}, +{"id":"passthru","key":"passthru","value":{"rev":"9-3c8f0b20f1a16976f3645a6f7411b56a"}}, +{"id":"passwd","key":"passwd","value":{"rev":"19-44ac384382a042faaa1f3b111786c831"}}, +{"id":"password","key":"password","value":{"rev":"9-0793f6a8d09076f25cde7c9e528eddec"}}, +{"id":"password-hash","key":"password-hash","value":{"rev":"9-590c62e275ad577c6f8ddbf5ba4579cc"}}, +{"id":"path","key":"path","value":{"rev":"3-3ec064cf3f3a85cb59528654c5bd938f"}}, +{"id":"pathjs","key":"pathjs","value":{"rev":"5-d5e1b1a63e711cae3ac79a3b1033b609"}}, +{"id":"pathname","key":"pathname","value":{"rev":"9-16f2c1473454900ce18a217b2ea52c57"}}, +{"id":"paths","key":"paths","value":{"rev":"3-fa47b7c1d533a7d9f4bbaffc5fb89905"}}, +{"id":"patr","key":"patr","value":{"rev":"7-7bcd37586389178b9f23d33c1d7a0292"}}, +{"id":"pattern","key":"pattern","value":{"rev":"36-3ded826185c384af535dcd428af3f626"}}, +{"id":"payment-paypal-payflowpro","key":"payment-paypal-payflowpro","value":{"rev":"14-d8814a1d8bba57a6ecf8027064adc7ad"}}, +{"id":"paynode","key":"paynode","value":{"rev":"16-16084e61db66ac18fdbf95a51d31c09a"}}, +{"id":"payos","key":"payos","value":{"rev":"3-373695bd80c454b32b83a5eba6044261"}}, +{"id":"paypal-ipn","key":"paypal-ipn","value":{"rev":"5-ef32291f9f8371b20509db3acee722f6"}}, +{"id":"pcap","key":"pcap","value":{"rev":"46-8ae9e919221102581d6bb848dc67b84b"}}, +{"id":"pd","key":"pd","value":{"rev":"7-82146739c4c0eb4e49e40aa80a29cc0a"}}, +{"id":"pdf","key":"pdf","value":{"rev":"6-5c6b6a133e1b3ce894ebb1a49090216c"}}, +{"id":"pdfcrowd","key":"pdfcrowd","value":{"rev":"5-026b4611b50374487bfd64fd3e0d562c"}}, +{"id":"pdfkit","key":"pdfkit","value":{"rev":"13-2fd34c03225a87dfd8057c85a83f3c50"}}, +{"id":"pdflatex","key":"pdflatex","value":{"rev":"3-bbbf61f09ebe4c49ca0aff8019611660"}}, +{"id":"pdl","key":"pdl","value":{"rev":"3-4c41bf12e901ee15bdca468db8c89102"}}, +{"id":"peanut","key":"peanut","value":{"rev":"55-b797121dbbcba1219934284ef56abb8a"}}, +{"id":"pebble","key":"pebble","value":{"rev":"21-3cd08362123260a2e96d96d80e723805"}}, +{"id":"pecode","key":"pecode","value":{"rev":"3-611f5e8c61bbf4467b84da954ebdd521"}}, +{"id":"pegjs","key":"pegjs","value":{"rev":"11-091040d16433014d1da895e32ac0f6a9"}}, +{"id":"per-second","key":"per-second","value":{"rev":"5-e1593b3f7008ab5e1c3cae86f39ba3f3"}}, +{"id":"permafrost","key":"permafrost","value":{"rev":"9-494cbc9a2f43a60b57f23c5f5b12270d"}}, +{"id":"perry","key":"perry","value":{"rev":"41-15aed7a778fc729ad62fdfb231c50774"}}, +{"id":"persistencejs","key":"persistencejs","value":{"rev":"20-2585af3f15f0a4a7395e937237124596"}}, +{"id":"pg","key":"pg","value":{"rev":"142-48de452fb8a84022ed7cae8ec2ebdaf6"}}, +{"id":"phonetap","key":"phonetap","value":{"rev":"7-2cc7d3c2a09518ad9b0fe816c6a99125"}}, +{"id":"php-autotest","key":"php-autotest","value":{"rev":"3-04470b38b259187729af574dd3dc1f97"}}, +{"id":"phpass","key":"phpass","value":{"rev":"3-66f4bec659bf45b312022bb047b18696"}}, +{"id":"piano","key":"piano","value":{"rev":"3-0bab6b5409e4305c87a775e96a2b7ad3"}}, +{"id":"picard","key":"picard","value":{"rev":"5-7676e6ad6d5154fdc016b001465891f3"}}, +{"id":"picardForTynt","key":"picardForTynt","value":{"rev":"3-09d205b790bd5022b69ec4ad54bad770"}}, +{"id":"pid","key":"pid","value":{"rev":"3-0ba7439d599b9d613461794c3892d479"}}, +{"id":"pieshop","key":"pieshop","value":{"rev":"12-7851afe1bbc20de5d054fe93b071f849"}}, +{"id":"pig","key":"pig","value":{"rev":"3-8e6968a7b64635fed1bad12c39d7a46a"}}, +{"id":"pigeons","key":"pigeons","value":{"rev":"53-8df70420d3c845cf0159b3f25d0aab90"}}, +{"id":"piles","key":"piles","value":{"rev":"3-140cb1e83b5a939ecd429b09886132ef"}}, +{"id":"pillar","key":"pillar","value":{"rev":"6-83c81550187f6d00e11dd9955c1c94b7"}}, +{"id":"pilot","key":"pilot","value":{"rev":"3-073ed1a083cbd4c2aa2561f19e5935ea"}}, +{"id":"pinboard","key":"pinboard","value":{"rev":"3-1020cab02a1183acdf82e1f7620dc1e0"}}, +{"id":"pinf-loader-js","key":"pinf-loader-js","value":{"rev":"5-709ba9c86fb4de906bd7bbca53771f0f"}}, +{"id":"pinf-loader-js-demos-npmpackage","key":"pinf-loader-js-demos-npmpackage","value":{"rev":"3-860569d98c83e59185cff356e56b10a6"}}, +{"id":"pingback","key":"pingback","value":{"rev":"5-5d0a05d65a14f6837b0deae16c550bec"}}, +{"id":"pingdom","key":"pingdom","value":{"rev":"11-f299d6e99122a9fa1497bfd166dadd02"}}, +{"id":"pintpay","key":"pintpay","value":{"rev":"3-eba9c4059283adec6b1ab017284c1f17"}}, +{"id":"pipe","key":"pipe","value":{"rev":"5-d202bf317c10a52ac817b5c1a4ce4c88"}}, +{"id":"pipe_utils","key":"pipe_utils","value":{"rev":"13-521857c99eb76bba849a22240308e584"}}, +{"id":"pipegram","key":"pipegram","value":{"rev":"3-1449333c81dd658d5de9eebf36c07709"}}, +{"id":"pipeline-surveyor","key":"pipeline-surveyor","value":{"rev":"11-464db89b17e7b44800088ec4a263d92e"}}, +{"id":"pipes","key":"pipes","value":{"rev":"99-8320636ff840a61d82d9c257a2e0ed48"}}, +{"id":"pipes-cellar","key":"pipes-cellar","value":{"rev":"27-e035e58a3d82e50842d766bb97ea3ed9"}}, +{"id":"pipes-cohort","key":"pipes-cohort","value":{"rev":"9-88fc0971e01516873396e44974874903"}}, +{"id":"piton-entity","key":"piton-entity","value":{"rev":"31-86254212066019f09d67dfd58524bd75"}}, +{"id":"piton-http-utils","key":"piton-http-utils","value":{"rev":"3-6cf6aa0c655ff6118d53e62e3b970745"}}, +{"id":"piton-mixin","key":"piton-mixin","value":{"rev":"3-7b7737004e53e04f7f95ba5850eb5e70"}}, +{"id":"piton-pipe","key":"piton-pipe","value":{"rev":"3-8d7df4e53f620ef2f24e9fc8b24f0238"}}, +{"id":"piton-simplate","key":"piton-simplate","value":{"rev":"3-9ac00835d3de59d535cdd2347011cdc9"}}, +{"id":"piton-string-utils","key":"piton-string-utils","value":{"rev":"3-ecab73993d764dfb378161ea730dbbd5"}}, +{"id":"piton-validity","key":"piton-validity","value":{"rev":"13-1766651d69e3e075bf2c66b174b66026"}}, +{"id":"pixel-ping","key":"pixel-ping","value":{"rev":"11-38d717c927e13306e8ff9032785b50f2"}}, +{"id":"pixelcloud","key":"pixelcloud","value":{"rev":"7-0897d734157b52dece8f86cde7be19d4"}}, +{"id":"pixiedust","key":"pixiedust","value":{"rev":"3-6b932dee4b6feeed2f797de5d0066f8a"}}, +{"id":"pkginfo","key":"pkginfo","value":{"rev":"13-3ee42503d6672812960a965d4f3a1bc2"}}, +{"id":"pksqlite","key":"pksqlite","value":{"rev":"13-095e7d7d0258b71491c39d0e8c4f19be"}}, +{"id":"plants.js","key":"plants.js","value":{"rev":"3-e3ef3a16f637787e84c100a9b9ec3b08"}}, +{"id":"plate","key":"plate","value":{"rev":"20-92ba0729b2edc931f28870fe7f2ca95a"}}, +{"id":"platform","key":"platform","value":{"rev":"4-be465a1d21be066c96e30a42b8602177"}}, +{"id":"platformjs","key":"platformjs","value":{"rev":"35-5c510fa0c90492fd1d0f0fc078460018"}}, +{"id":"platoon","key":"platoon","value":{"rev":"28-e0e0c5f852eadacac5a652860167aa11"}}, +{"id":"play","key":"play","value":{"rev":"5-17f7cf7cf5d1c21c7392f3c43473098d"}}, +{"id":"plist","key":"plist","value":{"rev":"10-2a23864923aeed93fb8e25c4b5b2e97e"}}, +{"id":"png","key":"png","value":{"rev":"14-9cc7aeaf0c036c9a880bcee5cd46229a"}}, +{"id":"png-guts","key":"png-guts","value":{"rev":"5-a29c7c686f9d08990ce29632bf59ef90"}}, +{"id":"policyfile","key":"policyfile","value":{"rev":"21-4a9229cca4bcac10f730f296f7118548"}}, +{"id":"polla","key":"polla","value":{"rev":"27-9af5a575961a4dddb6bef482c168c756"}}, +{"id":"poly","key":"poly","value":{"rev":"3-7f7fe29d9f0ec4fcbf8481c797b20455"}}, +{"id":"polyglot","key":"polyglot","value":{"rev":"3-9306e246d1f8b954b41bef76e3e81291"}}, +{"id":"pool","key":"pool","value":{"rev":"10-f364b59aa8a9076a17cd94251dd013ab"}}, +{"id":"poolr","key":"poolr","value":{"rev":"5-cacfbeaa7aaca40c1a41218e8ac8b732"}}, +{"id":"pop","key":"pop","value":{"rev":"41-8edd9ef2f34a90bf0ec5e8eb0e51e644"}}, +{"id":"pop-disqus","key":"pop-disqus","value":{"rev":"3-4a8272e6a8453ed2d754397dc8b349bb"}}, +{"id":"pop-ga","key":"pop-ga","value":{"rev":"3-5beaf7b355d46b3872043b97696ee693"}}, +{"id":"pop-gallery","key":"pop-gallery","value":{"rev":"3-1a88920ff930b8ce51cd50fcfe62675e"}}, +{"id":"pop3-client","key":"pop3-client","value":{"rev":"3-be8c314b0479d9d98384e2ff36d7f207"}}, +{"id":"poplib","key":"poplib","value":{"rev":"7-ab64c5c35269aee897b0904b4548096b"}}, +{"id":"porter-stemmer","key":"porter-stemmer","value":{"rev":"5-724a7b1d635b95a14c9ecd9d2f32487d"}}, +{"id":"portfinder","key":"portfinder","value":{"rev":"5-cdf36d1c666bbdae500817fa39b9c2bd"}}, +{"id":"portscanner","key":"portscanner","value":{"rev":"3-773c1923b6f3b914bd801476efcfdf64"}}, +{"id":"pos","key":"pos","value":{"rev":"3-1c1a27020560341ecd1b54d0e3cfaf2a"}}, +{"id":"posix-getopt","key":"posix-getopt","value":{"rev":"3-819b69724575b65fe25cf1c768e1b1c6"}}, +{"id":"postageapp","key":"postageapp","value":{"rev":"9-f5735237f7e6f0b467770e28e84c56db"}}, +{"id":"postal","key":"postal","value":{"rev":"19-dd70aeab4ae98ccf3d9f203dff9ccf37"}}, +{"id":"posterous","key":"posterous","value":{"rev":"3-6f8a9e7cae8a26f021653f2c27b0c67f"}}, +{"id":"postgres","key":"postgres","value":{"rev":"6-e8844a47c83ff3ef0a1ee7038b2046b2"}}, +{"id":"postgres-js","key":"postgres-js","value":{"rev":"3-bbe27a49ee9f8ae8789660e178d6459d"}}, +{"id":"postman","key":"postman","value":{"rev":"5-548538583f2e7ad448adae27f9a801e5"}}, +{"id":"postmark","key":"postmark","value":{"rev":"24-a6c61b346329e499d4a4a37dbfa446a2"}}, +{"id":"postmark-api","key":"postmark-api","value":{"rev":"3-79973af301aa820fc18c2c9d418adcd7"}}, +{"id":"postmessage","key":"postmessage","value":{"rev":"5-854bdb27c2a1af5b629b01f7d69691fe"}}, +{"id":"postpie","key":"postpie","value":{"rev":"10-88527e2731cd07a3b8ddec2608682700"}}, +{"id":"postprocess","key":"postprocess","value":{"rev":"5-513ecd54bf8df0ae73d2a50c717fd939"}}, +{"id":"potato","key":"potato","value":{"rev":"3-0f4cab343859692bf619e79cd9cc5be1"}}, +{"id":"pour","key":"pour","value":{"rev":"7-272bee63c5f19d12102198a23a4af902"}}, +{"id":"pow","key":"pow","value":{"rev":"22-58b557cd71ec0e95eef51dfd900e4736"}}, +{"id":"precious","key":"precious","value":{"rev":"19-b370292b258bcbca02c5d8861ebee0bb"}}, +{"id":"predicate","key":"predicate","value":{"rev":"3-1c6d1871fe71bc61457483793eecf7f9"}}, +{"id":"prefer","key":"prefer","value":{"rev":"11-236b9d16cd019e1d9af41e745bfed754"}}, +{"id":"prenup","key":"prenup","value":{"rev":"3-4c56ddf1ee22cd90c85963209736bc75"}}, +{"id":"pretty-json","key":"pretty-json","value":{"rev":"5-2dbb22fc9573c19e64725ac331a8d59c"}}, +{"id":"prettyfy","key":"prettyfy","value":{"rev":"3-fc7e39aad63a42533d4ac6d6bfa32325"}}, +{"id":"prick","key":"prick","value":{"rev":"10-71a02e1be02df2af0e6a958099be565a"}}, +{"id":"printf","key":"printf","value":{"rev":"5-2896b8bf90df19d4a432153211ca3a7e"}}, +{"id":"pro","key":"pro","value":{"rev":"5-e98adaf2f741e00953bbb942bbeb14d2"}}, +{"id":"probe_couchdb","key":"probe_couchdb","value":{"rev":"28-86f8918a3e64608f8009280fb28a983d"}}, +{"id":"process","key":"process","value":{"rev":"3-6865fc075d8083afd8e2aa266512447c"}}, +{"id":"procfile","key":"procfile","value":{"rev":"3-22dbb2289f5fb3060a8f7833b50116a4"}}, +{"id":"profile","key":"profile","value":{"rev":"29-5afee07fe4c334d9836fda1df51e1f2d"}}, +{"id":"profilejs","key":"profilejs","value":{"rev":"9-128c2b0e09624ee69a915cff20cdf359"}}, +{"id":"profiler","key":"profiler","value":{"rev":"13-4f1582fad93cac11daad5d5a67565e4f"}}, +{"id":"progress","key":"progress","value":{"rev":"7-bba60bc39153fa0fbf5e909b6df213b0"}}, +{"id":"progress-bar","key":"progress-bar","value":{"rev":"5-616721d3856b8e5a374f247404d6ab29"}}, +{"id":"progressify","key":"progressify","value":{"rev":"5-0379cbed5adc2c3f3ac6adf0307ec11d"}}, +{"id":"proj4js","key":"proj4js","value":{"rev":"5-7d209ce230f6a2d5931800acef436a06"}}, +{"id":"projectwatch","key":"projectwatch","value":{"rev":"15-d0eca46ffc3d9e18a51db2d772fa2778"}}, +{"id":"promise","key":"promise","value":{"rev":"3-1409350eb10aa9055ed13a5b59f0abc3"}}, +{"id":"promised-fs","key":"promised-fs","value":{"rev":"28-1d3e0dd1884e1c39a5d5e2d35bb1f911"}}, +{"id":"promised-http","key":"promised-http","value":{"rev":"8-3f8d560c800ddd44a617bf7d7c688392"}}, +{"id":"promised-io","key":"promised-io","value":{"rev":"11-e9a280e85c021cd8b77e524aac50fafb"}}, +{"id":"promised-traits","key":"promised-traits","value":{"rev":"14-62d0ac59d4ac1c6db99c0273020565ea"}}, +{"id":"promised-utils","key":"promised-utils","value":{"rev":"20-0c2488685eb8999c40ee5e7cfa4fd75d"}}, +{"id":"prompt","key":"prompt","value":{"rev":"32-d52a524c147e34c1258facab69660cc2"}}, +{"id":"props","key":"props","value":{"rev":"17-8c4c0bf1b69087510612c8d5ccbfbfeb"}}, +{"id":"proserver","key":"proserver","value":{"rev":"3-4b0a001404171eb0f6f3e5d73a35fcb1"}}, +{"id":"protege","key":"protege","value":{"rev":"150-9790c23d7b7eb5fb94cd5b8048bdbf10"}}, +{"id":"proto","key":"proto","value":{"rev":"6-29fe2869f34e2737b0cc2a0dbba8e397"}}, +{"id":"proto-list","key":"proto-list","value":{"rev":"3-0f64ff29a4a410d5e03a57125374b87b"}}, +{"id":"protobuf-stream","key":"protobuf-stream","value":{"rev":"3-950e621ce7eef306eff5f932a9c4cbae"}}, +{"id":"protodiv","key":"protodiv","value":{"rev":"9-ed8d84033943934eadf5d95dfd4d8eca"}}, +{"id":"proton","key":"proton","value":{"rev":"19-8ad32d57a3e71df786ff41ef8c7281f2"}}, +{"id":"protoparse","key":"protoparse","value":{"rev":"3-9fbcc3b26220f974d4b9c9c883a0260b"}}, +{"id":"prototype","key":"prototype","value":{"rev":"5-2a672703595e65f5d731a967b43655a7"}}, +{"id":"prowl","key":"prowl","value":{"rev":"5-ec480caa5a7db4f1ec2ce22d5eb1dad8"}}, +{"id":"prowler","key":"prowler","value":{"rev":"3-09747704f78c7c123fb1c719c4996924"}}, +{"id":"prox","key":"prox","value":{"rev":"5-0ac5f893b270a819d91f0c6581aca2a8"}}, +{"id":"proxify","key":"proxify","value":{"rev":"3-d24a979b708645328476bd42bd5aaba8"}}, +{"id":"proxino","key":"proxino","value":{"rev":"7-894cc6d453af00e5e39ebc8f0b0abe3a"}}, +{"id":"proxio","key":"proxio","value":{"rev":"55-a1b2744054b3dc3adc2f7f67d2c026a4"}}, +{"id":"proxy","key":"proxy","value":{"rev":"3-c6dd1a8b58e0ed7ac983c89c05ee987d"}}, +{"id":"proxy-by-url","key":"proxy-by-url","value":{"rev":"5-acfcf47f3575cea6594513ff459c5f2c"}}, +{"id":"pseudo","key":"pseudo","value":{"rev":"11-4d894a335036d96cdb9bb19f7b857293"}}, +{"id":"psk","key":"psk","value":{"rev":"17-375055bf6315476a37b5fadcdcb6b149"}}, +{"id":"pty","key":"pty","value":{"rev":"8-0b3ea0287fd23f882da27dabce4e3230"}}, +{"id":"pub-mix","key":"pub-mix","value":{"rev":"3-2c455b249167cbf6b1a6ea761bf119f4"}}, +{"id":"pubjs","key":"pubjs","value":{"rev":"3-a0ceab8bc6ec019dfcf9a8e16756bea0"}}, +{"id":"publicsuffix","key":"publicsuffix","value":{"rev":"8-1592f0714595c0ca0433272c60afc733"}}, +{"id":"publisher","key":"publisher","value":{"rev":"13-f2c8722f14732245d3ca8842fe5b7661"}}, +{"id":"pubnub-client","key":"pubnub-client","value":{"rev":"8-6e511a6dd2b7feb6cefe410facd61f53"}}, +{"id":"pubsub","key":"pubsub","value":{"rev":"11-6c6270bf95af417fb766c05f66b2cc9e"}}, +{"id":"pubsub.io","key":"pubsub.io","value":{"rev":"24-9686fe9ae3356966dffee99f53eaad2c"}}, +{"id":"pubsubd","key":"pubsubd","value":{"rev":"3-b1ff2fa958bd450933735162e9615449"}}, +{"id":"pulley","key":"pulley","value":{"rev":"13-f81ed698175ffd0b5b19357a623b8f15"}}, +{"id":"pulse","key":"pulse","value":{"rev":"9-da4bdabb6d7c189d05c8d6c64713e4ac"}}, +{"id":"pulverizr","key":"pulverizr","value":{"rev":"16-ffd4db4d2b1bfbd0b6ac794dca9e728e"}}, +{"id":"pulverizr-bal","key":"pulverizr-bal","value":{"rev":"5-dba279d07f3ed72990d10f11c5d10792"}}, +{"id":"punycode","key":"punycode","value":{"rev":"3-c0df35bb32d1490a4816161974610682"}}, +{"id":"puppy","key":"puppy","value":{"rev":"3-355fb490dba55efdf8840e2769cb7f41"}}, +{"id":"pure","key":"pure","value":{"rev":"7-b2da0d64ea12cea63bed940222bb36df"}}, +{"id":"purpose","key":"purpose","value":{"rev":"3-ef30ac479535bd603954c27ecb5d564a"}}, +{"id":"push-it","key":"push-it","value":{"rev":"35-2640be8ca8938768836520ce5fc7fff2"}}, +{"id":"pusher","key":"pusher","value":{"rev":"5-eb363d1e0ea2c59fd92a07ea642c5d03"}}, +{"id":"pusher-pipe","key":"pusher-pipe","value":{"rev":"11-11ab87d1288a8c7d11545fdab56616f6"}}, +{"id":"pushinator","key":"pushinator","value":{"rev":"15-6b2c37931bc9438e029a6af0cf97091c"}}, +{"id":"put","key":"put","value":{"rev":"12-4b05a7cdfdb24a980597b38781457cf5"}}, +{"id":"put-selector","key":"put-selector","value":{"rev":"1-1a9b3b8b5a44485b93966503370978aa"}}, +{"id":"putio","key":"putio","value":{"rev":"3-973b65e855e1cd0d3cc685542263cc55"}}, +{"id":"pwilang","key":"pwilang","value":{"rev":"43-49ad04f5abbdd9c5b16ec0271ab17520"}}, +{"id":"py","key":"py","value":{"rev":"3-aade832559d0fab88116aa794e3a9f35"}}, +{"id":"pygments","key":"pygments","value":{"rev":"3-2b2c96f39bdcb9ff38eb7d4bac7c90ba"}}, +{"id":"python","key":"python","value":{"rev":"15-706af811b5544a4aacc6ad1e9863e369"}}, +{"id":"q","key":"q","value":{"rev":"80-fd2397ad465750240d0f22a0abc53de5"}}, +{"id":"q-comm","key":"q-comm","value":{"rev":"17-972994947f097fdcffcfcb2277c966ce"}}, +{"id":"q-fs","key":"q-fs","value":{"rev":"68-958b01dd5bdc4da5ba3c1cd02c85fc0e"}}, +{"id":"q-http","key":"q-http","value":{"rev":"26-42a7db91b650386d920f52afe3e9161f"}}, +{"id":"q-io","key":"q-io","value":{"rev":"20-79f7b3d43bcbd53cc57b6531426738e2"}}, +{"id":"q-io-buffer","key":"q-io-buffer","value":{"rev":"5-05528d9a527da73357991bec449a1b76"}}, +{"id":"q-require","key":"q-require","value":{"rev":"12-e3fc0388e4d3e6d8a15274c3cc239712"}}, +{"id":"q-util","key":"q-util","value":{"rev":"10-94e0c392e70fec942aee0f024e5c090f"}}, +{"id":"qbox","key":"qbox","value":{"rev":"17-88f9148881ede94ae9dcbf4e1980aa69"}}, +{"id":"qfi","key":"qfi","value":{"rev":"3-a6052f02aec10f17085b09e4f9da1ce0"}}, +{"id":"qjscl","key":"qjscl","value":{"rev":"11-def1631b117a53cab5fd38ffec28d727"}}, +{"id":"qooxdoo","key":"qooxdoo","value":{"rev":"5-720d33ec2de3623d6535b3bdc8041d81"}}, +{"id":"qoper8","key":"qoper8","value":{"rev":"11-48fa2ec116bec46d64161e35b0f0cd86"}}, +{"id":"qq","key":"qq","value":{"rev":"23-6f7a5f158364bbf2e90a0c6eb1fbf8a9"}}, +{"id":"qqwry","key":"qqwry","value":{"rev":"10-bf0d6cc2420bdad92a1104c184e7e045"}}, +{"id":"qr","key":"qr","value":{"rev":"11-0a0120b7ec22bbcf76ff1d78fd4a7689"}}, +{"id":"qrcode","key":"qrcode","value":{"rev":"11-b578b6a76bffe996a0390e3d886b79bb"}}, +{"id":"qs","key":"qs","value":{"rev":"23-3da45c8c8a5eb33d45360d92b6072d37"}}, +{"id":"quack-array","key":"quack-array","value":{"rev":"5-6b676aa6273e4515ab5e7bfee1c331e0"}}, +{"id":"quadprog","key":"quadprog","value":{"rev":"7-c0ceeeb12735f334e8c7940ac1f0a896"}}, +{"id":"quadraticon","key":"quadraticon","value":{"rev":"66-1da88ea871e6f90967b9f65c0204309d"}}, +{"id":"quasi","key":"quasi","value":{"rev":"3-6fe0faa91d849938d8c92f91b0828395"}}, +{"id":"query","key":"query","value":{"rev":"13-635ff8d88c6a3f9d92f9ef465b14fb82"}}, +{"id":"query-engine","key":"query-engine","value":{"rev":"21-66feaee07df9fa1f625ac797e8f6b90b"}}, +{"id":"querystring","key":"querystring","value":{"rev":"5-2b509239fafba56319137bfbe1e9eeb7"}}, +{"id":"queue","key":"queue","value":{"rev":"3-5c4af574e5056f7e6ceb9bfefc1c632d"}}, +{"id":"queuelib","key":"queuelib","value":{"rev":"61-87c2abc94a5ad40af8193fac9a1d9f7e"}}, +{"id":"quickcheck","key":"quickcheck","value":{"rev":"7-64e6c1e9efc08a89abe3d01c414d1411"}}, +{"id":"quickserve","key":"quickserve","value":{"rev":"3-9c19f8ad7daf06182f42b8c7063b531f"}}, +{"id":"quip","key":"quip","value":{"rev":"8-0624055f5056f72bc719340c95e5111a"}}, +{"id":"qunit","key":"qunit","value":{"rev":"37-6e7fefdaffab8fc5fb92a391da227c38"}}, +{"id":"qunit-tap","key":"qunit-tap","value":{"rev":"22-0266cd1b5bb7cbab89fa52642f0e8277"}}, +{"id":"qwery","key":"qwery","value":{"rev":"66-29f9b44da544a3a9b4537a85ceace7c8"}}, +{"id":"qwery-mobile","key":"qwery-mobile","value":{"rev":"5-182264ca68c30519bf0d29cf1e15854b"}}, +{"id":"raZerdummy","key":"raZerdummy","value":{"rev":"7-1fa549e0cff60795b49cbd3732f32175"}}, +{"id":"rabbit.js","key":"rabbit.js","value":{"rev":"3-dbcd5cd590576673c65b34c44ff06bec"}}, +{"id":"rabblescay","key":"rabblescay","value":{"rev":"5-3fea196ffd581a842a24ab7bb2118fe2"}}, +{"id":"racer","key":"racer","value":{"rev":"51-41c65689a335d70fa6b55b9706b9c0fe"}}, +{"id":"radcouchdb","key":"radcouchdb","value":{"rev":"3-64ccb4d0acb2b11cbb1d3fcef5f9a68e"}}, +{"id":"radio-stream","key":"radio-stream","value":{"rev":"6-c5f80a0bef7bbaacdd22d92da3d09244"}}, +{"id":"railway","key":"railway","value":{"rev":"74-5ce92a45c7d11540b0e2b5a8455361ce"}}, +{"id":"railway-mailer","key":"railway-mailer","value":{"rev":"3-8df2fbe4af4d3b1f12557d8397bf0548"}}, +{"id":"railway-twitter","key":"railway-twitter","value":{"rev":"3-df984f182bb323052e36876e8e3a066c"}}, +{"id":"rand","key":"rand","value":{"rev":"11-abb69107c390e2a6dcec64cb72f36096"}}, +{"id":"random","key":"random","value":{"rev":"7-32550b221f3549b67f379c1c2dbc5c57"}}, +{"id":"random-data","key":"random-data","value":{"rev":"5-ae651ea36724105b8677ae489082ab4d"}}, +{"id":"range","key":"range","value":{"rev":"3-1d3925f30ffa6b5f3494d507fcef3aa1"}}, +{"id":"ranger","key":"ranger","value":{"rev":"17-6135a9a9d83cbd3945f1ce991f276cb8"}}, +{"id":"rap-battle","key":"rap-battle","value":{"rev":"3-6960516c0d27906bb9343805a5eb0e45"}}, +{"id":"raphael","key":"raphael","value":{"rev":"7-012f159593a82e4587ea024a5d4fbe41"}}, +{"id":"raphael-zoom","key":"raphael-zoom","value":{"rev":"3-aaab74bebbeb4241cade4f4d3c9b130e"}}, +{"id":"rapid","key":"rapid","value":{"rev":"8-ae0b05388c7904fc88c743e3dcde1d9d"}}, +{"id":"rasputin","key":"rasputin","value":{"rev":"3-87cdd9bd591606f4b8439e7a76681c7b"}}, +{"id":"rate-limiter","key":"rate-limiter","value":{"rev":"3-24cd20fef83ce02f17dd383b72f5f125"}}, +{"id":"rats","key":"rats","value":{"rev":"3-1ff1efb311451a17789da910eaf59fb6"}}, +{"id":"raydash","key":"raydash","value":{"rev":"7-96c345beb3564d2789d209d1fe695857"}}, +{"id":"rbytes","key":"rbytes","value":{"rev":"13-cf09d91347a646f590070e516f0c9bc9"}}, +{"id":"rdf","key":"rdf","value":{"rev":"3-9a5012d1fc10da762dbe285d0b317499"}}, +{"id":"rdf-raptor-parser","key":"rdf-raptor-parser","value":{"rev":"11-25c61e4d57cf67ee8a5afb6dfcf193e3"}}, +{"id":"rdfstore","key":"rdfstore","value":{"rev":"41-4499a73efc48ad07234e56fd4e27e4e0"}}, +{"id":"rdio","key":"rdio","value":{"rev":"5-fa20a8ab818a6150e38e9bb7744968f9"}}, +{"id":"rdx","key":"rdx","value":{"rev":"3-e1db5ee3aad06edd9eadcdaa8aaba149"}}, +{"id":"rea","key":"rea","value":{"rev":"3-f17ceeb35337bc9ccf9cb440d5c4dfaf"}}, +{"id":"read-files","key":"read-files","value":{"rev":"3-e08fac4abcdbc7312beb0362ff4427b4"}}, +{"id":"readability","key":"readability","value":{"rev":"3-475601a3d99d696763872c52bce6a155"}}, +{"id":"readabilitySAX","key":"readabilitySAX","value":{"rev":"19-83277777f3f721be26aca28c66227b01"}}, +{"id":"ready.js","key":"ready.js","value":{"rev":"39-8e309b8b274722c051c67f90885571e8"}}, +{"id":"readyjslint","key":"readyjslint","value":{"rev":"3-0a3742129bfbe07d47fcfb9ff67d39b2"}}, +{"id":"recaptcha","key":"recaptcha","value":{"rev":"8-8895926476be014fbe08b301294bf37b"}}, +{"id":"recaptcha-async","key":"recaptcha-async","value":{"rev":"9-3033260389f8afdb5351974119b78ca2"}}, +{"id":"recline","key":"recline","value":{"rev":"189-b56ab8c7791201dccf4aea2532189f1d"}}, +{"id":"recon","key":"recon","value":{"rev":"13-79cbddefb00fec6895342d18609cadb1"}}, +{"id":"reconf","key":"reconf","value":{"rev":"5-0596988db2cf9bf5921502a2aab24ade"}}, +{"id":"redback","key":"redback","value":{"rev":"37-03b390f69cacf42a46e393b7cf297d09"}}, +{"id":"rede","key":"rede","value":{"rev":"3-ee74c2fd990c7780dc823e22a9c3bef2"}}, +{"id":"redecard","key":"redecard","value":{"rev":"13-7dec5a50c34132a2f20f0f143d6b5215"}}, +{"id":"redim","key":"redim","value":{"rev":"15-91c9fd560d1ce87d210b461c52a6d258"}}, +{"id":"redis","key":"redis","value":{"rev":"98-ec237259e8ef5c42a76ff260be50f8fd"}}, +{"id":"redis-channels","key":"redis-channels","value":{"rev":"3-8efc40a25fd18c1c9c41bbaeedb0b22f"}}, +{"id":"redis-client","key":"redis-client","value":{"rev":"3-3376054236e651e7dfcf91be8632fd0e"}}, +{"id":"redis-completer","key":"redis-completer","value":{"rev":"11-9e5bf1f8d37df681e7896252809188d3"}}, +{"id":"redis-keyspace","key":"redis-keyspace","value":{"rev":"25-245f2375741eb3e574dfce9f2da2b687"}}, +{"id":"redis-lua","key":"redis-lua","value":{"rev":"7-81f3dd3a4601271818f15278f495717a"}}, +{"id":"redis-namespace","key":"redis-namespace","value":{"rev":"3-ddf52a172db190fe788aad4116b1cb29"}}, +{"id":"redis-node","key":"redis-node","value":{"rev":"24-7a1e9098d8b5a42a99ca71a01b0d7672"}}, +{"id":"redis-queue","key":"redis-queue","value":{"rev":"3-9896587800c4b98ff291b74210c16b6e"}}, +{"id":"redis-session-store","key":"redis-session-store","value":{"rev":"3-2229501ecf817f9ca60ff2c7721ddd73"}}, +{"id":"redis-tag","key":"redis-tag","value":{"rev":"9-6713e8e91a38613cfef09d7b40f4df71"}}, +{"id":"redis-url","key":"redis-url","value":{"rev":"5-f53545a0039b512a2f7afd4ba2e08773"}}, +{"id":"redis-user","key":"redis-user","value":{"rev":"11-a8c0f6d40cbfbb6183a46e121f31ec06"}}, +{"id":"redis2json","key":"redis2json","value":{"rev":"5-dd96f78f8db0bf695346c95c2ead1307"}}, +{"id":"redis_objects","key":"redis_objects","value":{"rev":"3-499fe6dd07e7a3839111b1892b97f54c"}}, +{"id":"redisev","key":"redisev","value":{"rev":"3-8e857dbe2341292c6e170a7bfe3fa81b"}}, +{"id":"redisfs","key":"redisfs","value":{"rev":"69-d9c90256d32348fdca7a4e646ab4d551"}}, +{"id":"redisify","key":"redisify","value":{"rev":"3-03fce3095b4129e71280d278f11121ba"}}, +{"id":"rediskit","key":"rediskit","value":{"rev":"5-6a0324708f45d884a492cbc408137059"}}, +{"id":"redisql","key":"redisql","value":{"rev":"6-b31802eb37910cb74bd3c9f7b477c025"}}, +{"id":"redmark","key":"redmark","value":{"rev":"5-8724ab00513b6bd7ddfdcd3cc2e0a4e8"}}, +{"id":"redmess","key":"redmess","value":{"rev":"13-14f58666444993ce899cd2260cdc9140"}}, +{"id":"redobj","key":"redobj","value":{"rev":"7-7ebbeffc306f4f7ff9b53ee57e1a250e"}}, +{"id":"redpack","key":"redpack","value":{"rev":"73-58b3fb3bcadf7d80fbe97d9e82d4928b"}}, +{"id":"reds","key":"reds","value":{"rev":"9-baebb36b92887d93fd79785a8c1e6355"}}, +{"id":"reed","key":"reed","value":{"rev":"45-5580f319dc3b5bfb66612ed5c7e17337"}}, +{"id":"reflect","key":"reflect","value":{"rev":"18-b590003cd55332160a5e5327e806e851"}}, +{"id":"reflect-builder","key":"reflect-builder","value":{"rev":"3-453d618b263f9452c0b6bbab0a701f49"}}, +{"id":"reflect-next","key":"reflect-next","value":{"rev":"9-4f2b27a38985d81e906e824321af7713"}}, +{"id":"reflect-tree-builder","key":"reflect-tree-builder","value":{"rev":"5-5f801f53e126dc8a72e13b1417904ce6"}}, +{"id":"reflect-unbuilder","key":"reflect-unbuilder","value":{"rev":"5-f36fd4182fd465a743198b5188697db9"}}, +{"id":"reflectjs","key":"reflectjs","value":{"rev":"3-e03bdb411ffcdd901b896a1cf43eea69"}}, +{"id":"reflex","key":"reflex","value":{"rev":"3-e8bb6b6de906265114b22036832ef650"}}, +{"id":"refmate","key":"refmate","value":{"rev":"3-7d44c45a2eb39236ad2071c84dc0fbba"}}, +{"id":"regext","key":"regext","value":{"rev":"4-97ca5c25fd2f3dc4bd1f3aa821d06f0f"}}, +{"id":"reid-yui3","key":"reid-yui3","value":{"rev":"5-cab8f6e22dfa9b9c508a5dd312bf56b0"}}, +{"id":"rel","key":"rel","value":{"rev":"7-f447870ac7a078f742e4295896646241"}}, +{"id":"relative-date","key":"relative-date","value":{"rev":"5-d0fa11f8100da888cbcce6e96d76b2e4"}}, +{"id":"reloadOnUpdate","key":"reloadOnUpdate","value":{"rev":"9-e7d4c215578b779b2f888381d398bd79"}}, +{"id":"reloaded","key":"reloaded","value":{"rev":"3-dba828b9ab73fc7ce8e47f98068bce8c"}}, +{"id":"remap","key":"remap","value":{"rev":"5-825ac1783df84aba3255c1d39f32ac00"}}, +{"id":"remedial","key":"remedial","value":{"rev":"17-9bb17db015e96db3c833f84d9dbd972a"}}, +{"id":"remote-console","key":"remote-console","value":{"rev":"6-104bae3ba9e4b0a8f772d0b8dc37007e"}}, +{"id":"remote_js","key":"remote_js","value":{"rev":"3-6c0e3058c33113346c037c59206ac0ec"}}, +{"id":"render","key":"render","value":{"rev":"27-fc8be4e9c50e49fb42df83e9446a1f58"}}, +{"id":"renode","key":"renode","value":{"rev":"11-107a3e15a987393157b47125487af296"}}, +{"id":"reparse","key":"reparse","value":{"rev":"10-210ec92e82f5a8515f45d20c7fa2f164"}}, +{"id":"repl","key":"repl","value":{"rev":"3-295279fe20b9ac54b2a235a6bc7013aa"}}, +{"id":"repl-edit","key":"repl-edit","value":{"rev":"18-eb2e604ab8bb65685376459beb417a31"}}, +{"id":"repl-utils","key":"repl-utils","value":{"rev":"7-fc31547ecb53e7e36610cdb68bcec582"}}, +{"id":"replace","key":"replace","value":{"rev":"17-a8976fcdbeb08e27ee2f0fc69ccd7c9d"}}, +{"id":"replica","key":"replica","value":{"rev":"3-f9dae960f91e8dc594f43b004f516d5f"}}, +{"id":"replicate","key":"replicate","value":{"rev":"3-3d6e52af6ff36c02139f619c7e5599c6"}}, +{"id":"replique","key":"replique","value":{"rev":"5-72d990b7d9ce9ff107d96be17490226a"}}, +{"id":"req2","key":"req2","value":{"rev":"3-712151f335b25b5bdef428982d77d0e0"}}, +{"id":"reqhooks","key":"reqhooks","value":{"rev":"17-2f0f0b73545bb1936f449a1ec4a28011"}}, +{"id":"request","key":"request","value":{"rev":"55-0d0b00eecde877ca5cd4ad9e0badc4d1"}}, +{"id":"require","key":"require","value":{"rev":"15-59e9fa05a9de52ee2a818c045736452b"}}, +{"id":"require-analyzer","key":"require-analyzer","value":{"rev":"72-f759f0cdc352df317df29791bfe451f1"}}, +{"id":"require-kiss","key":"require-kiss","value":{"rev":"5-f7ef9d7beda584e9c95635a281a01587"}}, +{"id":"require-like","key":"require-like","value":{"rev":"7-29d5de79e7ff14bb02da954bd9a2ee33"}}, +{"id":"requireincontext","key":"requireincontext","value":{"rev":"5-988ff7c27a21e527ceeb50cbedc8d1b0"}}, +{"id":"requirejs","key":"requirejs","value":{"rev":"3-e609bc91d12d698a17aa51bb50a50509"}}, +{"id":"requirejson","key":"requirejson","value":{"rev":"3-2b8173e58d08034a53a3226c464b1dc8"}}, +{"id":"reqwest","key":"reqwest","value":{"rev":"57-5aa2c1ed17b1e3630859bcad85559e6a"}}, +{"id":"resig-class","key":"resig-class","value":{"rev":"3-16b1a2cdb3224f2043708436dbac4395"}}, +{"id":"resistance","key":"resistance","value":{"rev":"9-9cacbf5fa8318419b4751034a511b8c1"}}, +{"id":"resmin","key":"resmin","value":{"rev":"17-a9c8ded5073118748d765784ca4ea069"}}, +{"id":"resolve","key":"resolve","value":{"rev":"11-bba3470bc93a617ccf9fb6c12097c793"}}, +{"id":"resource-router","key":"resource-router","value":{"rev":"13-7b2991958da4d7701c51537192ca756c"}}, +{"id":"resourcer","key":"resourcer","value":{"rev":"3-4e8b5493d6fcdf147f53d3aaa731a509"}}, +{"id":"response","key":"response","value":{"rev":"3-c5cadf4e5dd90dc1022b92a67853b0f8"}}, +{"id":"resque","key":"resque","value":{"rev":"12-e2f5e1bc3e53ac0a992d1a7da7da0d14"}}, +{"id":"rest-in-node","key":"rest-in-node","value":{"rev":"3-41d1ba925857302211bd0bf9d19975f9"}}, +{"id":"rest-mongo","key":"rest-mongo","value":{"rev":"3-583d2a4b672d6d7e7ad26d0b6df20b45"}}, +{"id":"rest.node","key":"rest.node","value":{"rev":"3-2ed59ba9dcc97123632dfdfaea2559ed"}}, +{"id":"restalytics","key":"restalytics","value":{"rev":"11-5fb3cd8e95b37f1725922fa6fbb146e0"}}, +{"id":"restarter","key":"restarter","value":{"rev":"52-ab0a4fe59128b8848ffd88f9756d0049"}}, +{"id":"restartr","key":"restartr","value":{"rev":"12-d3b86e43e7df7697293db65bb1a1ae65"}}, +{"id":"restify","key":"restify","value":{"rev":"132-054bdc85bebc6221a07dda186238b4c3"}}, +{"id":"restler","key":"restler","value":{"rev":"13-f5392d9dd22e34ce3bcc307c51c889b3"}}, +{"id":"restler-aaronblohowiak","key":"restler-aaronblohowiak","value":{"rev":"8-28b231eceb667153e10effcb1ebeb989"}}, +{"id":"restmvc.js","key":"restmvc.js","value":{"rev":"25-d57b550754437580c447adf612c87d9a"}}, +{"id":"resware","key":"resware","value":{"rev":"9-a5ecbc53fefb280c5d1e3efd822704ff"}}, +{"id":"retrie","key":"retrie","value":{"rev":"7-28ea803ad6b119928ac792cbc8f475c9"}}, +{"id":"retro","key":"retro","value":{"rev":"3-94c3aec940e28869554cbb8449d9369e"}}, +{"id":"retry","key":"retry","value":{"rev":"19-89f3ef664c6fa48ff33a0b9f7e798f15"}}, +{"id":"reut","key":"reut","value":{"rev":"23-d745dd7f8606275848a299ad7c38ceb7"}}, +{"id":"rewrite","key":"rewrite","value":{"rev":"3-5cb91fd831d0913e89354f53b875137d"}}, +{"id":"rex","key":"rex","value":{"rev":"39-59025e6947e5f197f124d24a5393865f"}}, +{"id":"rfb","key":"rfb","value":{"rev":"34-db6e684ac9366a0e3658a508a2187ae1"}}, +{"id":"rhyme","key":"rhyme","value":{"rev":"7-27347762f3f5bfa07307da4e476c2d52"}}, +{"id":"riak-js","key":"riak-js","value":{"rev":"55-11d4ee4beb566946f3968abdf1c4b0ef"}}, +{"id":"riakqp","key":"riakqp","value":{"rev":"7-83f562e6907431fcee56a9408ac6d2c1"}}, +{"id":"rightjs","key":"rightjs","value":{"rev":"9-d53ae4c4f5af3bbbe18d7c879e5bdd1b"}}, +{"id":"rimraf","key":"rimraf","value":{"rev":"17-3ddc3f3f36618712e5f4f27511836e7a"}}, +{"id":"rio","key":"rio","value":{"rev":"11-7c6249c241392b51b9142ca1b228dd4e"}}, +{"id":"ristretto","key":"ristretto","value":{"rev":"3-beb22d7a575e066781f1fd702c4572d7"}}, +{"id":"roast","key":"roast","value":{"rev":"32-17cb066823afab1656196a2fe81246cb"}}, +{"id":"robb","key":"robb","value":{"rev":"5-472ed7ba7928131d86a05fcae89b9f93"}}, +{"id":"robots","key":"robots","value":{"rev":"9-afac82b944045c82acb710cc98c7311d"}}, +{"id":"robotskirt","key":"robotskirt","value":{"rev":"63-29a66420951812d421bf6728f67e710c"}}, +{"id":"robotstxt","key":"robotstxt","value":{"rev":"25-1e01cac90f4570d35ab20232feaeebfa"}}, +{"id":"rocket","key":"rocket","value":{"rev":"27-b0f1ff02e70b237bcf6a5b46aa9b74df"}}, +{"id":"roil","key":"roil","value":{"rev":"48-6b00c09b576fe195546bd031763c0d79"}}, +{"id":"roll","key":"roll","value":{"rev":"5-d3fed9271132eb6c954b3ac6c7ffccf0"}}, +{"id":"rollin","key":"rollin","value":{"rev":"3-bd461bc810c12cfcea94109ba9a2ab39"}}, +{"id":"ron","key":"ron","value":{"rev":"5-913645180d29f377506bcd5292d3cb49"}}, +{"id":"rondo","key":"rondo","value":{"rev":"3-9bed539bbaa0cb978f5c1b711d70cd50"}}, +{"id":"ronn","key":"ronn","value":{"rev":"12-b1b1a1d47376fd11053e2b81fe772c4c"}}, +{"id":"rot13","key":"rot13","value":{"rev":"10-a41e8b581812f02ca1a593f6da0c52dc"}}, +{"id":"router","key":"router","value":{"rev":"26-a7883048759715134710d68f179da18b"}}, +{"id":"routes","key":"routes","value":{"rev":"3-d841826cfd365d8f383a9c4f4288933c"}}, +{"id":"rpc","key":"rpc","value":{"rev":"5-5896f380115a7a606cd7cbbc6d113f05"}}, +{"id":"rpc-socket","key":"rpc-socket","value":{"rev":"17-8743dc1a1f5ba391fc5c7d432cc6eeba"}}, +{"id":"rq","key":"rq","value":{"rev":"7-ba263671c3a3b52851dc7d5e6bd4ef8c"}}, +{"id":"rql","key":"rql","value":{"rev":"1-ac5ec10ed5e41a10a289f26aff4def5a"}}, +{"id":"rqueue","key":"rqueue","value":{"rev":"12-042898704386874c70d0ffaeea6ebc78"}}, +{"id":"rrd","key":"rrd","value":{"rev":"9-488adf135cf29cd4725865a8f25a57ba"}}, +{"id":"rsa","key":"rsa","value":{"rev":"8-7d6f981d72322028c3bebb7141252e98"}}, +{"id":"rss","key":"rss","value":{"rev":"3-0a97b20a0a9051876d779af7663880bd"}}, +{"id":"rssee","key":"rssee","value":{"rev":"9-da2599eae68e50c1695fd7f8fcba2b30"}}, +{"id":"rumba","key":"rumba","value":{"rev":"3-7a3827fa6eca2d02d3189cbad38dd6ca"}}, +{"id":"run","key":"run","value":{"rev":"9-0145abb61e6107a3507624928db461da"}}, +{"id":"runforcover","key":"runforcover","value":{"rev":"3-a36b00ea747c98c7cd7afebf1e1b203c"}}, +{"id":"runlol","key":"runlol","value":{"rev":"3-3c97684baaa3d5b31ca404e8a616fe41"}}, +{"id":"runner","key":"runner","value":{"rev":"11-b7ceeedf7b0dde19c809642f1537723a"}}, +{"id":"runways","key":"runways","value":{"rev":"5-f216f5fa6af7ccc7566cdd06cf424980"}}, +{"id":"rw-translate","key":"rw-translate","value":{"rev":"3-16d2beb17a27713e10459ce368c5d087"}}, +{"id":"rx","key":"rx","value":{"rev":"5-ea2a04ecf38963f8a99b7a408b45af31"}}, +{"id":"rzr","key":"rzr","value":{"rev":"4-6a137fa752709531f2715de5a213b326"}}, +{"id":"s-tpl","key":"s-tpl","value":{"rev":"3-1533cf9657cfe669a25da96b6a655f5c"}}, +{"id":"s3-post","key":"s3-post","value":{"rev":"9-ad3b268bc6754852086b50c2f465c02c"}}, +{"id":"safis","key":"safis","value":{"rev":"3-f1494d0dae2b7dfd60beba5a72412ad2"}}, +{"id":"saiga","key":"saiga","value":{"rev":"22-0c67e8cf8f4b6e8ea30552ffc57d222a"}}, +{"id":"sailthru-client","key":"sailthru-client","value":{"rev":"7-1c9c236050868fb8dec4a34ded2436d3"}}, +{"id":"saimonmoore-cradle","key":"saimonmoore-cradle","value":{"rev":"3-5059616ab0f0f10e1c2d164f686e127e"}}, +{"id":"salesforce","key":"salesforce","value":{"rev":"7-f88cbf517b1fb900358c97b2c049960f"}}, +{"id":"sam","key":"sam","value":{"rev":"7-d7e24d2e94411a17cbedfbd8083fd878"}}, +{"id":"sandbox","key":"sandbox","value":{"rev":"10-0b51bed24e0842f99744dcf5d79346a6"}}, +{"id":"sandboxed-module","key":"sandboxed-module","value":{"rev":"15-bf8fa69d15ae8416d534e3025a16d87d"}}, +{"id":"sanitizer","key":"sanitizer","value":{"rev":"32-6ea8f4c77cd17253c27d0d87e0790678"}}, +{"id":"sapnwrfc","key":"sapnwrfc","value":{"rev":"3-0bc717109ffcd5265ae24f00416a0281"}}, +{"id":"sardines","key":"sardines","value":{"rev":"7-82712731b5af112ca43b9e3fe9975bb0"}}, +{"id":"sargam","key":"sargam","value":{"rev":"3-6b4c70f4b2bcd2add43704bf40c44507"}}, +{"id":"sasl","key":"sasl","value":{"rev":"4-44a6e12b561b112a574ec9e0c4a8843f"}}, +{"id":"sass","key":"sass","value":{"rev":"14-46bcee5423a1efe22f039e116bb7a77c"}}, +{"id":"satisfic","key":"satisfic","value":{"rev":"3-c6e9a2e65a0e55868cea708bcf7b11cf"}}, +{"id":"sax","key":"sax","value":{"rev":"30-58c5dd2c3367522974406bbf29204a40"}}, +{"id":"say","key":"say","value":{"rev":"10-95f31672af6166ea9099d92706c49ed1"}}, +{"id":"sayndo","key":"sayndo","value":{"rev":"51-fd93715c5ff0fcaa68e4e13c2b51ba61"}}, +{"id":"sc-handlebars","key":"sc-handlebars","value":{"rev":"3-b424c3a66fd0e538b068c6046f404084"}}, +{"id":"scgi-server","key":"scgi-server","value":{"rev":"9-3364b5c39985ea8f3468b6abb53d5ea6"}}, +{"id":"scheduler","key":"scheduler","value":{"rev":"25-72bc526bb49b0dd42ad5917d38ea3b18"}}, +{"id":"schema","key":"schema","value":{"rev":"21-166410ae972449965dfa1ce615971168"}}, +{"id":"schema-builder","key":"schema-builder","value":{"rev":"3-bce4612e1e5e6a8a85f16326d3810145"}}, +{"id":"schema-org","key":"schema-org","value":{"rev":"15-59b3b654de0380669d0dcd7573c3b7a1"}}, +{"id":"scone","key":"scone","value":{"rev":"15-85ed2dd4894e896ca1c942322753b76b"}}, +{"id":"scooj","key":"scooj","value":{"rev":"3-1be2074aeba4df60594c03f3e59c7734"}}, +{"id":"scope","key":"scope","value":{"rev":"65-9d7eb8c5fc6c54d8e2c49f4b4b4f5166"}}, +{"id":"scope-provider","key":"scope-provider","value":{"rev":"22-2c25a0b260fd18236d5245c8250d990e"}}, +{"id":"scoped-http-client","key":"scoped-http-client","value":{"rev":"3-afa954fe6d1c8b64a1240b77292d99b5"}}, +{"id":"scottbot","key":"scottbot","value":{"rev":"3-d812ddb4af49976c391f14aeecf93180"}}, +{"id":"scraper","key":"scraper","value":{"rev":"19-e2166b3de2b33d7e6baa04c704887fa6"}}, +{"id":"scrapinode","key":"scrapinode","value":{"rev":"15-ae5bf5085d8c4d5390f7c313b0ad13d2"}}, +{"id":"scrappy-do","key":"scrappy-do","value":{"rev":"3-868f5d299da401112e3ed9976194f1ee"}}, +{"id":"scrapr","key":"scrapr","value":{"rev":"3-d700714a56e8f8b8e9b3bc94274f4a24"}}, +{"id":"scrawl","key":"scrawl","value":{"rev":"3-a70a2905b9a1d2f28eb379c14363955f"}}, +{"id":"scribe","key":"scribe","value":{"rev":"5-4cefaaf869ba8e6ae0257e5705532fbe"}}, +{"id":"scriptTools","key":"scriptTools","value":{"rev":"7-1b66b7f02f2f659ae224057afac60bcf"}}, +{"id":"scriptbroadcast","key":"scriptbroadcast","value":{"rev":"10-3cdc4dae471445b7e08e6fc37c2481e6"}}, +{"id":"scriptjs","key":"scriptjs","value":{"rev":"38-9a522df4f0707d47c904f6781fd97ff6"}}, +{"id":"scrowser","key":"scrowser","value":{"rev":"3-a76938b1f84db0793941dba1f84f4c2f"}}, +{"id":"scss","key":"scss","value":{"rev":"10-49a4ad40eca3c797add57986c74e100b"}}, +{"id":"scylla","key":"scylla","value":{"rev":"10-2c5a1efed63c0ac3a3e75861ee323af4"}}, +{"id":"sdl","key":"sdl","value":{"rev":"40-3df0824da620098c0253b5330c6b0c5c"}}, +{"id":"sdlmixer","key":"sdlmixer","value":{"rev":"4-91455739802a98a5549f6c2b8118758d"}}, +{"id":"search","key":"search","value":{"rev":"9-8f696da412a6ccd07c3b8f22cec315cb"}}, +{"id":"searchjs","key":"searchjs","value":{"rev":"3-59418ce307d41de5649dfc158be51adf"}}, +{"id":"searchparser","key":"searchparser","value":{"rev":"3-a84719692ee33c88f3419f033b839f7a"}}, +{"id":"sechash","key":"sechash","value":{"rev":"11-20db8651628dcf6e8cbbc9bf9b2c4f12"}}, +{"id":"secret","key":"secret","value":{"rev":"7-ac44b38fa32b3f5ebc8fd03b02ec69ec"}}, +{"id":"seedrandom","key":"seedrandom","value":{"rev":"3-becb92de803208672887fc22a1a33694"}}, +{"id":"seek","key":"seek","value":{"rev":"3-d778b8d56582e15d409e2346b86caa53"}}, +{"id":"sel","key":"sel","value":{"rev":"19-94c8bc0872d2da7eab2b35daff7a3b5d"}}, +{"id":"select","key":"select","value":{"rev":"5-43593bfec39caaf1a0bc1fedc96d0dce"}}, +{"id":"selenium","key":"selenium","value":{"rev":"3-8ae8ac7a491b813fd011671e0d494f20"}}, +{"id":"selfish","key":"selfish","value":{"rev":"17-827856c3f3b9a3fdd1758477a24bf706"}}, +{"id":"selleck","key":"selleck","value":{"rev":"13-b8325fcdb383397041e4a408b40d708c"}}, +{"id":"semver","key":"semver","value":{"rev":"25-b2aea0cc920a9981cd429442a3fd62f6"}}, +{"id":"sendgrid","key":"sendgrid","value":{"rev":"3-047e2ad730390bac7cf72b7fc3856c1c"}}, +{"id":"sendgrid-api","key":"sendgrid-api","value":{"rev":"5-6e951b0d60a1b7c778fbf548d4e3aed8"}}, +{"id":"sendgrid-web","key":"sendgrid-web","value":{"rev":"3-dc77d2dbcedfcbe4e497958a2a070cfd"}}, +{"id":"sentry","key":"sentry","value":{"rev":"7-57af332354cbd37ce1c743b424b27dd0"}}, +{"id":"seq","key":"seq","value":{"rev":"77-33a8f54017402835c8542945a5c0a443"}}, +{"id":"sequelize","key":"sequelize","value":{"rev":"63-4c28ad13b73549aad7edc57378b21854"}}, +{"id":"sequence","key":"sequence","value":{"rev":"3-914f8010dc12aec0749ddb719f5ac82d"}}, +{"id":"sequencer","key":"sequencer","value":{"rev":"7-d83e687509678c0f5bcf15e5297677c0"}}, +{"id":"sequent","key":"sequent","value":{"rev":"3-cc6f26ab708c7681fa7d9e3bc15d19c0"}}, +{"id":"serializer","key":"serializer","value":{"rev":"7-a0d13120e2d5cfaa6e453b085280fa08"}}, +{"id":"serialport","key":"serialport","value":{"rev":"32-dc365d057a4f46e9f140dc36d6cc825a"}}, +{"id":"serialportify","key":"serialportify","value":{"rev":"3-1bf4ad9c5ebb5d96ca91fc03a10b5443"}}, +{"id":"serialq","key":"serialq","value":{"rev":"3-5897fcd0fca7d8312e61dbcb93790a71"}}, +{"id":"series","key":"series","value":{"rev":"11-0374191f646c277c51602ebe73033b6a"}}, +{"id":"serve","key":"serve","value":{"rev":"11-560c0c1bdeb3348c7a7d18265d27988e"}}, +{"id":"servedir","key":"servedir","value":{"rev":"18-17cffd8d8326b26e7d9319c79d601dda"}}, +{"id":"server-backbone-redis","key":"server-backbone-redis","value":{"rev":"13-c56419457002aa4fa23b142634882594"}}, +{"id":"server-tracker","key":"server-tracker","value":{"rev":"21-f620e295079a8b0acd29fa1a1469100c"}}, +{"id":"service","key":"service","value":{"rev":"11-07533f9e5e854248c0a1d99e911fa419"}}, +{"id":"sesame","key":"sesame","value":{"rev":"19-1e7ad5d030566f4c67027cc5925a2bdb"}}, +{"id":"sesh","key":"sesh","value":{"rev":"4-1682b3ced38e95f2a11a2f545a820bd5"}}, +{"id":"session","key":"session","value":{"rev":"6-a798bf4cd7d127d0111da7cdc3e058a4"}}, +{"id":"session-mongoose","key":"session-mongoose","value":{"rev":"3-b089c8d365d7de3e659cfa7080697dba"}}, +{"id":"sessionvoc-client","key":"sessionvoc-client","value":{"rev":"23-0f9ed8cd4af55f2aae17cb841247b818"}}, +{"id":"set","key":"set","value":{"rev":"3-a285b30a9c1545b427ebd882bc53d8b2"}}, +{"id":"setInterval","key":"setInterval","value":{"rev":"3-0557f666d05223391466547f52cfff42"}}, +{"id":"setTimeout","key":"setTimeout","value":{"rev":"3-e3c059c93763967ddff5974471f227f8"}}, +{"id":"setochka","key":"setochka","value":{"rev":"3-d559e24618b4fc2d5fc4ef44bccb68be"}}, +{"id":"settings","key":"settings","value":{"rev":"5-4af85bb564a330886c79682d2f1d927c"}}, +{"id":"sexy","key":"sexy","value":{"rev":"7-e57fa6bca5d89be86467786fb9f9b997"}}, +{"id":"sexy-args","key":"sexy-args","value":{"rev":"3-715d7d57234220bd79c78772d2566355"}}, +{"id":"sfaClient","key":"sfaClient","value":{"rev":"3-5d9ddd6ea05d7ef366dbf4f66dd4f642"}}, +{"id":"sfml","key":"sfml","value":{"rev":"10-766c876cd1cc220f776e2fa3c1d9efbb"}}, +{"id":"sh","key":"sh","value":{"rev":"5-3ce779be28550e831cf3c0140477376c"}}, +{"id":"sha1","key":"sha1","value":{"rev":"3-66d4b67ace9c65ae8f03d6dd0647ff6b"}}, +{"id":"sha1_file","key":"sha1_file","value":{"rev":"7-eb25e9c5f470a1b80c1697a952a1c5ed"}}, +{"id":"shadows","key":"shadows","value":{"rev":"5-d6a1a21871c733f34495592307ab7961"}}, +{"id":"share","key":"share","value":{"rev":"15-ef81a004f0e115040dcc1510f6302fa9"}}, +{"id":"shared-views","key":"shared-views","value":{"rev":"11-2c83145e6deb3493e44805c92b58929e"}}, +{"id":"sharedjs","key":"sharedjs","value":{"rev":"9-d43a861b02aa88ae22810f9771d774ec"}}, +{"id":"shell","key":"shell","value":{"rev":"39-7e2042bd6f485b827d53f5f727164d6f"}}, +{"id":"shelld","key":"shelld","value":{"rev":"3-118a62ff31d85e61b78bbd97333a7330"}}, +{"id":"shimify","key":"shimify","value":{"rev":"3-dde4d45bcbd2f6f7faaeb7f8c31d5e8b"}}, +{"id":"ship","key":"ship","value":{"rev":"3-5f294fc3841c901d6cea7f3862625d95"}}, +{"id":"shmakowiki","key":"shmakowiki","value":{"rev":"15-079ae4595d1ddf019d22d3d0ac49a188"}}, +{"id":"shorten","key":"shorten","value":{"rev":"3-ed1395b35faf4639e25dacbb038cf237"}}, +{"id":"shorttag","key":"shorttag","value":{"rev":"5-21d15e4cb8b62aeefe23edc99ff768ec"}}, +{"id":"shorturl","key":"shorturl","value":{"rev":"5-58f78b2a5318ec7da8a5f88739f2796b"}}, +{"id":"shorty","key":"shorty","value":{"rev":"9-17f804ff6e94295549cca6fd534b89de"}}, +{"id":"shotenjin","key":"shotenjin","value":{"rev":"3-91a7864d216a931095e9999133d3c41f"}}, +{"id":"should","key":"should","value":{"rev":"19-ed561071d434f319080fa5d0f647dd93"}}, +{"id":"shovel","key":"shovel","value":{"rev":"5-0168a02a8fa8d7856a5f4a5c18706724"}}, +{"id":"showdown","key":"showdown","value":{"rev":"3-7be5479804451db3faed968fa428af56"}}, +{"id":"shredder","key":"shredder","value":{"rev":"3-93e12ab8822ba5fe86d662f124a8ad1a"}}, +{"id":"shrtn","key":"shrtn","value":{"rev":"19-5883692283903e3166b478b98bcad999"}}, +{"id":"shuffle","key":"shuffle","value":{"rev":"3-71c96da1843abb468649ab0806e6b9d3"}}, +{"id":"sibilant","key":"sibilant","value":{"rev":"18-4dcb400eb9ed9cb1c7826d155807f6d0"}}, +{"id":"sideline","key":"sideline","value":{"rev":"15-84f284a9277718bf90f68dc9351500ae"}}, +{"id":"siesta","key":"siesta","value":{"rev":"5-ff99a009e6e5897c6322237c51d0a142"}}, +{"id":"sign","key":"sign","value":{"rev":"3-2cf70313707c6a046a6ceca61431ea5e"}}, +{"id":"signals","key":"signals","value":{"rev":"7-c756190260cd3ea43e6d44e4722164cb"}}, +{"id":"signature","key":"signature","value":{"rev":"3-fb7552c27ace0f9321ec7438057a37bf"}}, +{"id":"signed-request","key":"signed-request","value":{"rev":"13-9f1563535dcc1a83338a7375d8240f35"}}, +{"id":"signer","key":"signer","value":{"rev":"5-32c9909da2c4dfb284b858164c03cfe0"}}, +{"id":"simple-class","key":"simple-class","value":{"rev":"3-92c6eea4b3a6169db9d62b12f66268cb"}}, +{"id":"simple-ffmpeg","key":"simple-ffmpeg","value":{"rev":"9-b6dd4fe162803e6db434d71035637993"}}, +{"id":"simple-logger","key":"simple-logger","value":{"rev":"5-52b4c957b3671375547d623c6a9444be"}}, +{"id":"simple-mime","key":"simple-mime","value":{"rev":"9-34e4b1dcc26047b64459d924abab65cc"}}, +{"id":"simple-proxy","key":"simple-proxy","value":{"rev":"9-ad6cd76215717527dc6b226e1219e98e"}}, +{"id":"simple-rest-client","key":"simple-rest-client","value":{"rev":"3-8331b3ae49b52720adf2b72d5da0353d"}}, +{"id":"simple-schedule","key":"simple-schedule","value":{"rev":"7-432d3803e1cf9ab5830923a30fd312e0"}}, +{"id":"simple-server","key":"simple-server","value":{"rev":"25-d4d8ba53d3829f4ca51545a3c23a1244"}}, +{"id":"simple-settings","key":"simple-settings","value":{"rev":"3-497d7c5422f764f3738b3ef303ff9737"}}, +{"id":"simple-static","key":"simple-static","value":{"rev":"3-64c9cf84e5140d4285e451357ac83df5"}}, +{"id":"simple-xml-writer","key":"simple-xml-writer","value":{"rev":"3-d1ca18252c341b4430ab6e1240b5f571"}}, +{"id":"simple-xmpp","key":"simple-xmpp","value":{"rev":"11-b4c10de5e4e12a81c4486206d7fb6b40"}}, +{"id":"simple_pubsub","key":"simple_pubsub","value":{"rev":"9-22ae79856ca25b152f104e5d8bc93f12"}}, +{"id":"simpledb","key":"simpledb","value":{"rev":"13-6bf111aa18bffd86e65fd996525a6113"}}, +{"id":"simplegeo","key":"simplegeo","value":{"rev":"8-eb684eea019ae7e5fa0c087a9747367e"}}, +{"id":"simplegeo-client","key":"simplegeo-client","value":{"rev":"7-b2c976bbf8c145c6b0e1744630548084"}}, +{"id":"simplegeo-thrift","key":"simplegeo-thrift","value":{"rev":"3-bf6ddf40c020889fe28630217f38a442"}}, +{"id":"simplelogger","key":"simplelogger","value":{"rev":"3-36634d2543faecdeccc962422d149ffc"}}, +{"id":"simplesets","key":"simplesets","value":{"rev":"26-48fc18f94744c9b288945844b7cc9196"}}, +{"id":"simplesmtp","key":"simplesmtp","value":{"rev":"6-0952f0c5f43a8e94b11355774bbbe9e8"}}, +{"id":"simplydb","key":"simplydb","value":{"rev":"5-34659bf97bbb40f0ec4a3af14107dc31"}}, +{"id":"sin","key":"sin","value":{"rev":"6-0e8bd66b3e2c8c91efef14a3ddc79c53"}}, +{"id":"sink","key":"sink","value":{"rev":"8-4c49709009dfb5719935dba568a3398e"}}, +{"id":"sink-test","key":"sink-test","value":{"rev":"18-411afcb398102f245e92f2ce91897d3e"}}, +{"id":"sinon","key":"sinon","value":{"rev":"19-fa38010bb1bbed437273e1296660d598"}}, +{"id":"sinon-buster","key":"sinon-buster","value":{"rev":"5-a456f0e21b3edb647ad11179cd02354b"}}, +{"id":"sinon-nodeunit","key":"sinon-nodeunit","value":{"rev":"7-d60aa76cc41a6c9d9db4e8ae268b7b3c"}}, +{"id":"sip","key":"sip","value":{"rev":"17-02be6fb014d41fe66ab22ff2ae60a5b8"}}, +{"id":"sitemap","key":"sitemap","value":{"rev":"13-a6d1c830fdc8942c317c1ebe00efbb6d"}}, +{"id":"sizlate","key":"sizlate","value":{"rev":"3-a86c680c681299045f9aabecb99dc161"}}, +{"id":"sizzle","key":"sizzle","value":{"rev":"5-f00e18a80fb8a4f6bdbf11735e265720"}}, +{"id":"sk","key":"sk","value":{"rev":"33-b0b894d02b0211dae08baadfd84b46c2"}}, +{"id":"skeleton","key":"skeleton","value":{"rev":"5-3559721c222b99cd3f56acaaf706992f"}}, +{"id":"skillet","key":"skillet","value":{"rev":"3-0d6bbe21952f85967a5e12425691ee50"}}, +{"id":"skull.io","key":"skull.io","value":{"rev":"3-082e9d58f24ac59144fc130f6b54927e"}}, +{"id":"slang","key":"slang","value":{"rev":"7-3cd6390e3421f677e4e1b00fdf2d3ee1"}}, +{"id":"sleepless","key":"sleepless","value":{"rev":"5-1482568719534caf17f12daf0130ae0d"}}, +{"id":"sleepylib","key":"sleepylib","value":{"rev":"3-60e851f120e34b0726eb50a38b1e27e2"}}, +{"id":"sleight","key":"sleight","value":{"rev":"3-a0f16b17befee698b172074f84daf44c"}}, +{"id":"slick","key":"slick","value":{"rev":"3-596b7b7cf7b8881c55327e8bcf373700"}}, +{"id":"slickback","key":"slickback","value":{"rev":"9-c036e7393d0f9a463a263f287f3bcefd"}}, +{"id":"slide","key":"slide","value":{"rev":"14-83ade7490da699cf0ed99cec818ce3cd"}}, +{"id":"slippers","key":"slippers","value":{"rev":"5-0d657ed5fca4c0ed8b51c6d7f6eac08a"}}, +{"id":"slug","key":"slug","value":{"rev":"3-046a5bd74cc1edce30faa3b6ab239652"}}, +{"id":"slugr","key":"slugr","value":{"rev":"39-ac346964f547433fe34e637de682f81a"}}, +{"id":"smartdc","key":"smartdc","value":{"rev":"31-8c9db85e4548007a0ef87b7286229952"}}, +{"id":"smoosh","key":"smoosh","value":{"rev":"34-ba1c140a173ff8d1f9cdbe5e5addcc43"}}, +{"id":"smores","key":"smores","value":{"rev":"17-1aef1fa2e1675093c5aaf33436d83f5a"}}, +{"id":"smpp","key":"smpp","value":{"rev":"5-9be31b75aee4db09cfe5a2ceef4bea13"}}, +{"id":"smsified","key":"smsified","value":{"rev":"13-bb97eae0bbb6f4d5c4f2f391cd20e891"}}, +{"id":"smtp","key":"smtp","value":{"rev":"20-c3de67c5d0b3c4493293d9f55adb21ad"}}, +{"id":"smtpc","key":"smtpc","value":{"rev":"11-7c4e1207be6eb06350221af0134e8bd7"}}, +{"id":"smtpclient","key":"smtpclient","value":{"rev":"3-ba61ad5f0fd3fdd382e505abcde8c24e"}}, +{"id":"snake","key":"snake","value":{"rev":"15-384892bf8a5ebf222f6fe0ae321aaaa4"}}, +{"id":"snappy","key":"snappy","value":{"rev":"11-94f2d59347c10cc41b6f4a2dd2b0f15e"}}, +{"id":"sng","key":"sng","value":{"rev":"41-a1d3c6253dec5da8b3134ba3505924f5"}}, +{"id":"snip","key":"snip","value":{"rev":"3-cc51d232fff6a7d7b24588bd98e5613b"}}, +{"id":"snipes","key":"snipes","value":{"rev":"3-12af12ca83e15d056969ec76a3cc2ef0"}}, +{"id":"snippets","key":"snippets","value":{"rev":"13-d19c8a99287ec721d56ef9efdf3ce729"}}, +{"id":"snorkel","key":"snorkel","value":{"rev":"11-bc7ba5d1465c7d1ba71479087292615e"}}, +{"id":"snowball","key":"snowball","value":{"rev":"3-76cfbdb9f379ac635874b76d7ee2fd3b"}}, +{"id":"snpp","key":"snpp","value":{"rev":"8-4f10a9f2bff48e348303d8a143afaa6c"}}, +{"id":"snsclient","key":"snsclient","value":{"rev":"3-302ce1c7132a36ef909ce534a509e27f"}}, +{"id":"soap","key":"soap","value":{"rev":"7-10f361a406dfee3074adac0cea127d87"}}, +{"id":"socket-push","key":"socket-push","value":{"rev":"22-196553953d58d92c288678b1dcd49ba7"}}, +{"id":"socket-twitchat","key":"socket-twitchat","value":{"rev":"11-9b159a4610ea444eaae39baa3bf05280"}}, +{"id":"socket.io","key":"socket.io","value":{"rev":"95-c29c929613dd95aa5aea8a5e14f2573f"}}, +{"id":"socket.io-client","key":"socket.io-client","value":{"rev":"33-a3c79d917bb038f0ca72f9cb27180a66"}}, +{"id":"socket.io-cluster","key":"socket.io-cluster","value":{"rev":"5-83bdaf79d2243eaf3a59b45fc604dc1a"}}, +{"id":"socket.io-connect","key":"socket.io-connect","value":{"rev":"17-62f00efc3bff3a1b549cc5e346da996f"}}, +{"id":"socket.io-context","key":"socket.io-context","value":{"rev":"42-a029996765557776d72690db1f14c1fa"}}, +{"id":"socket.io-ender","key":"socket.io-ender","value":{"rev":"9-c4523af5f5cc815ee69c325c1e29ede4"}}, +{"id":"socket.io-juggernaut","key":"socket.io-juggernaut","value":{"rev":"6-b8b97b2df2c186f24487e027278ec975"}}, +{"id":"socket.io-sessions","key":"socket.io-sessions","value":{"rev":"11-2151ee14eb29543811a9e567bcf6811a"}}, +{"id":"socketstream","key":"socketstream","value":{"rev":"29-b198d27ad6a3c4f9b63bc467e85a54a3"}}, +{"id":"sockjs","key":"sockjs","value":{"rev":"21-a8d6534c55e8b3e33cf06516b59aa408"}}, +{"id":"socksified","key":"socksified","value":{"rev":"3-92350ec9889b8db9c3d34bdbc41b1f7b"}}, +{"id":"soda","key":"soda","value":{"rev":"24-04987191e2c4241fbfaf78263c83d121"}}, +{"id":"soda-runner","key":"soda-runner","value":{"rev":"5-da4e8078a7666404d2a5ab3267a5ef75"}}, +{"id":"sodn","key":"sodn","value":{"rev":"3-3ee6350723c54aad792c769947c6b05e"}}, +{"id":"sofa","key":"sofa","value":{"rev":"7-2f8ffd47ce19e6fb7e1ea2e02076955d"}}, +{"id":"solder","key":"solder","value":{"rev":"10-8f7ad0a60c2716ce65658047c4ae5361"}}, +{"id":"solr","key":"solr","value":{"rev":"11-56a295dff56d9f2a4a7293257ca793a4"}}, +{"id":"solr-client","key":"solr-client","value":{"rev":"7-a296273d32224eb241343cb98ded7b82"}}, +{"id":"sones","key":"sones","value":{"rev":"3-9ddbbdc44f3501917e701d3304eb91a5"}}, +{"id":"song","key":"song","value":{"rev":"7-967aa3a58702b3470996cd8e63b1b18d"}}, +{"id":"sorted","key":"sorted","value":{"rev":"3-47b6ec0f744aa04929d48a7d3d10f581"}}, +{"id":"sosumi","key":"sosumi","value":{"rev":"10-8c3980beb3d7c48d4cccf44a8d1d5ff7"}}, +{"id":"soundcloud","key":"soundcloud","value":{"rev":"7-9ee76aecd3d1946731a1173185796864"}}, +{"id":"soupselect","key":"soupselect","value":{"rev":"12-5fea60f4e52117a8212aa7add6c34278"}}, +{"id":"source","key":"source","value":{"rev":"7-57d6cae0530c7cba4a3932f0df129f20"}}, +{"id":"source-map","key":"source-map","value":{"rev":"6-7da8d2ccc104fa30a93ee165975f28e8"}}, +{"id":"spacesocket","key":"spacesocket","value":{"rev":"6-d1679084b0917f86d6c4e3ac89a89809"}}, +{"id":"spark","key":"spark","value":{"rev":"12-64d44ebde2a4b48aed3bc7814c63e773"}}, +{"id":"spark2","key":"spark2","value":{"rev":"28-918548a309f0d18eebd5c64966376959"}}, +{"id":"sparql","key":"sparql","value":{"rev":"3-8eec87fe9fcb4d07aef214858eada777"}}, +{"id":"sparql-orm","key":"sparql-orm","value":{"rev":"3-b2a7efa5622b0b478fdca3f9050800cc"}}, +{"id":"spatial","key":"spatial","value":{"rev":"3-d09d40af02a9c9e5150500cc66d75f8d"}}, +{"id":"spawn","key":"spawn","value":{"rev":"3-f882c01cf1bb538f5f4be78769e1b097"}}, +{"id":"spdy","key":"spdy","value":{"rev":"13-1fbf077bbb8bc87d5058648c0c66288b"}}, +{"id":"spec","key":"spec","value":{"rev":"15-1074d3a8b8332fcc1059fbb5c4f69a7a"}}, +{"id":"speck","key":"speck","value":{"rev":"21-652b0670953ba79e548f4e5d9ce3d923"}}, +{"id":"spectrum","key":"spectrum","value":{"rev":"28-21fb9eeffe2e63a5383371a44a58a1ad"}}, +{"id":"speller","key":"speller","value":{"rev":"6-91e03f89b09338cf8f38d2e64c1778ce"}}, +{"id":"sphericalmercator","key":"sphericalmercator","value":{"rev":"9-3affc61ae0d64854d77829da5414bbc5"}}, +{"id":"spider","key":"spider","value":{"rev":"3-cd04679891875dfb2bf67613514238eb"}}, +{"id":"spider-tdd","key":"spider-tdd","value":{"rev":"3-d95b6d680d053a063e6fab3fdae16261"}}, +{"id":"spine","key":"spine","value":{"rev":"9-2a5cd4733be1d78376814e78966d885a"}}, +{"id":"spine.app","key":"spine.app","value":{"rev":"43-1044b31d4c53ff5c741a16d49291b321"}}, +{"id":"spine.mobile","key":"spine.mobile","value":{"rev":"19-220f64c212a5f22b27d597e299263490"}}, +{"id":"split_er","key":"split_er","value":{"rev":"3-3419662807bf16f7b5b53998a4759246"}}, +{"id":"spludo","key":"spludo","value":{"rev":"14-d41915fcd1b50553f5b9e706b41d2894"}}, +{"id":"spm","key":"spm","value":{"rev":"9-28d6699288d580807091aafdf78dd479"}}, +{"id":"spore","key":"spore","value":{"rev":"44-1c50fb0e6f7c3447f34b1927c976201f"}}, +{"id":"spork","key":"spork","value":{"rev":"3-e90976749b649b88ab83b59785dba101"}}, +{"id":"spotify","key":"spotify","value":{"rev":"3-90c74506a69e08a41feeb23541ac0b4f"}}, +{"id":"spotify-metadata","key":"spotify-metadata","value":{"rev":"3-a546d3e59e40ec0be5d8524f3a1e7a60"}}, +{"id":"spotlight","key":"spotlight","value":{"rev":"3-bead50ac8f53311d539a420c74ea23e2"}}, +{"id":"spread","key":"spread","value":{"rev":"3-ad7bf6d948043fc6dd47a6fcec7da294"}}, +{"id":"spreadsheet","key":"spreadsheet","value":{"rev":"11-94030e23cc9c8e515c1f340656aea031"}}, +{"id":"spreadsheets","key":"spreadsheets","value":{"rev":"3-6563c479735b1b6599bf9602fa65ff38"}}, +{"id":"sprintf","key":"sprintf","value":{"rev":"10-56c5bc7a19ecf8dd92e24d4dca081059"}}, +{"id":"spruce","key":"spruce","value":{"rev":"7-1ea45ef3c5412dd2a6c1fe7b2a083d68"}}, +{"id":"spy","key":"spy","value":{"rev":"3-f5546fdbbec80ba97756d0d1fefa7923"}}, +{"id":"sql","key":"sql","value":{"rev":"5-6c41452f684418ba521666e977f46e54"}}, +{"id":"sqlite","key":"sqlite","value":{"rev":"9-18761259920b497360f581ff8051dcbb"}}, +{"id":"sqlite3","key":"sqlite3","value":{"rev":"51-f9c99537afd9826819c5f40105e50987"}}, +{"id":"sqlmw","key":"sqlmw","value":{"rev":"17-b05b0b089c0f3b1185f96dc19bf61cf5"}}, +{"id":"squeeze","key":"squeeze","value":{"rev":"6-5e517be339d9aa409cedfcc11d1883b1"}}, +{"id":"squish","key":"squish","value":{"rev":"15-2334d8412df59ddd2fce60c1f77954c7"}}, +{"id":"sqwish","key":"sqwish","value":{"rev":"28-cc159dd5fd420432a7724c46456f4958"}}, +{"id":"srand","key":"srand","value":{"rev":"16-22f98b1b1a208c22dfbe95aa889cd08e"}}, +{"id":"srcds","key":"srcds","value":{"rev":"3-bd79da47d36662609c0c75c713874fd1"}}, +{"id":"srs","key":"srs","value":{"rev":"32-c8c961ea10fc60fc428bddff133a8aba"}}, +{"id":"sserve","key":"sserve","value":{"rev":"3-957457395e2c61c20bcb727fc19fc4d4"}}, +{"id":"ssh","key":"ssh","value":{"rev":"3-c7dda694daa7ca1e264b494400edfa18"}}, +{"id":"ssh-agent","key":"ssh-agent","value":{"rev":"3-dbc87102ed1f17b7253a1901976dfa9d"}}, +{"id":"sshmq","key":"sshmq","value":{"rev":"3-052f36ca47cddf069a1700fc79a08930"}}, +{"id":"stache","key":"stache","value":{"rev":"11-9bb0239153147939a25fd20184f20fc6"}}, +{"id":"stack","key":"stack","value":{"rev":"7-e18abdce80008ac9e2feb66f3407fe67"}}, +{"id":"stack-trace","key":"stack-trace","value":{"rev":"13-9fe20c5a3e34a5e4472c6f4fdea86efc"}}, +{"id":"stack.static","key":"stack.static","value":{"rev":"7-ad064faf6255a632cefa71a6ff3c47f3"}}, +{"id":"stack2","key":"stack2","value":{"rev":"3-e5f8ea94c0dd2b4c7f5d3941d689622b"}}, +{"id":"stackedy","key":"stackedy","value":{"rev":"25-f988787b9b5720dece8ae3cb83a2bc12"}}, +{"id":"stage","key":"stage","value":{"rev":"7-d2931fcb473f63320067c3e75638924e"}}, +{"id":"stalker","key":"stalker","value":{"rev":"19-ece35be8695846fc766a71c0022d4ff7"}}, +{"id":"startupify","key":"startupify","value":{"rev":"11-3c87ef5e9ee33122cf3515a63b22c52a"}}, +{"id":"stash","key":"stash","value":{"rev":"10-41239a1df74b69fe7bb3e360f9a35ad1"}}, +{"id":"statechart","key":"statechart","value":{"rev":"6-97e6947b5bbaf14bdb55efa6dfa5e19c"}}, +{"id":"stately","key":"stately","value":{"rev":"6-f8a257cd9fdd84947ff2cf7357afc88b"}}, +{"id":"stathat","key":"stathat","value":{"rev":"3-b79b7bd50bb1e4dcc1301424104a5b36"}}, +{"id":"station","key":"station","value":{"rev":"5-92e6387138b1ee10976bd92dd48ea818"}}, +{"id":"statistics","key":"statistics","value":{"rev":"3-a1c3a03d833c6f02fde403950790e9b4"}}, +{"id":"stats","key":"stats","value":{"rev":"13-fe513ea6b3b5b6b31935fd3464ec5d3b"}}, +{"id":"std","key":"std","value":{"rev":"55-58a4f182c3f51996a0d60a6f575cfefd"}}, +{"id":"steam","key":"steam","value":{"rev":"5-bffdf677d2d1ae3e8236892e68a3dd66"}}, +{"id":"stem","key":"stem","value":{"rev":"36-4f1c38eff671ede0241038017a810132"}}, +{"id":"step","key":"step","value":{"rev":"8-048d7707a45af3a7824a478d296cc467"}}, +{"id":"stepc","key":"stepc","value":{"rev":"3-be85de2c02f4889fdf77fda791feefea"}}, +{"id":"stepper","key":"stepper","value":{"rev":"9-cc54000dc973835c38e139b30cbb10cc"}}, +{"id":"steps","key":"steps","value":{"rev":"5-3561591b425e1fff52dc397f9688feae"}}, +{"id":"stextile","key":"stextile","value":{"rev":"29-9a8b6de917df01d322847f112dcadadf"}}, +{"id":"stitch","key":"stitch","value":{"rev":"13-8a50e4a4f015d1afe346aa6b6c8646bd"}}, +{"id":"stitchup","key":"stitchup","value":{"rev":"7-fe14604e3a8b82f62c38d0cb3ccce61e"}}, +{"id":"stomp","key":"stomp","value":{"rev":"15-e0430c0be74cd20c5204b571999922f7"}}, +{"id":"stopwords","key":"stopwords","value":{"rev":"3-2dd9fade030cfcce85848c5b3b4116fc"}}, +{"id":"store","key":"store","value":{"rev":"9-5537cc0f4827044504e8dae9617c9347"}}, +{"id":"store.js","key":"store.js","value":{"rev":"22-116c9a6194703ea98512d89ec5865e3d"}}, +{"id":"stories","key":"stories","value":{"rev":"11-244ca52d0a41f70bc4dfa0aca0f82a40"}}, +{"id":"storify","key":"storify","value":{"rev":"5-605b197219e916df561dd7722af97e2e"}}, +{"id":"storify-templates","key":"storify-templates","value":{"rev":"3-0960756aa963cee21b679a59cef114a1"}}, +{"id":"storm","key":"storm","value":{"rev":"3-9052e6af8528d1bc0d96021dfa21dd3e"}}, +{"id":"stove","key":"stove","value":{"rev":"17-01c9f0e87398e6bfa03a764e89295e00"}}, +{"id":"str.js","key":"str.js","value":{"rev":"9-301f54edeebde3c5084c3a8071e2aa09"}}, +{"id":"strack","key":"strack","value":{"rev":"10-5acf78ae6a417a82b49c221d606b8fed"}}, +{"id":"strappy","key":"strappy","value":{"rev":"3-fb63a899ff82c0f1142518cc263dd632"}}, +{"id":"strata","key":"strata","value":{"rev":"31-de615eccbda796e2bea405c2806ec792"}}, +{"id":"stream-buffers","key":"stream-buffers","value":{"rev":"7-d8fae628da43d377dd4e982f5bf7b09b"}}, +{"id":"stream-handler","key":"stream-handler","value":{"rev":"7-333eb7dcf2aeb550f948ee2162b21be2"}}, +{"id":"stream-stack","key":"stream-stack","value":{"rev":"22-a70979df042e2ff760b2d900259c84a1"}}, +{"id":"streamer","key":"streamer","value":{"rev":"17-dd16e62ada55311a793fbf7963a920f3"}}, +{"id":"streamlib","key":"streamlib","value":{"rev":"3-5125b1e6a92290f8d7f5fdad71e13fc2"}}, +{"id":"streamline","key":"streamline","value":{"rev":"152-0931f5697340c62e05dcd1a741afd38f"}}, +{"id":"streamline-streams","key":"streamline-streams","value":{"rev":"3-3224030ecfbf5a8ac5d218ab56dee545"}}, +{"id":"streamline-util","key":"streamline-util","value":{"rev":"3-a8047ecf37b985ec836c552fd2bcbf78"}}, +{"id":"streamlogger","key":"streamlogger","value":{"rev":"3-43f93a109774591f1409b0b86c363623"}}, +{"id":"streamlogger-fixed","key":"streamlogger-fixed","value":{"rev":"3-6e48de9e269b4f5bf979c560190b0680"}}, +{"id":"strftime","key":"strftime","value":{"rev":"25-74130d5c9cbf91025ce91f0463a9b1b5"}}, +{"id":"string-color","key":"string-color","value":{"rev":"3-9f336bf06bd80b2d2338c216099421c7"}}, +{"id":"strscan","key":"strscan","value":{"rev":"8-3e0d182a8d0c786754c555c0ac12e9d9"}}, +{"id":"strtok","key":"strtok","value":{"rev":"8-a1a1da7946d62fabb6cca56fc218654b"}}, +{"id":"struct","key":"struct","value":{"rev":"3-ff0f9cb336df73a5a19a38e17633583c"}}, +{"id":"structr","key":"structr","value":{"rev":"21-69b3672dab234d0effec5a72a2b1791c"}}, +{"id":"sty","key":"sty","value":{"rev":"9-ce5691388abc3ccaff23030bff190914"}}, +{"id":"style","key":"style","value":{"rev":"7-342569887fb53caddc60d745706cd66e"}}, +{"id":"style-compile","key":"style-compile","value":{"rev":"5-6f8b86c94c5344ec280a28f025691996"}}, +{"id":"styleless","key":"styleless","value":{"rev":"5-c236b81c38193ad71d7ed7c5b571995d"}}, +{"id":"stylewriter","key":"stylewriter","value":{"rev":"3-25a3f83252b220d8db0aa70c8fc1da4f"}}, +{"id":"stylus","key":"stylus","value":{"rev":"135-8b69084f50a95c297d1044e48b39a6c9"}}, +{"id":"stylus-blueprint","key":"stylus-blueprint","value":{"rev":"5-50ec59a9fa161ca68dac765f2281c13e"}}, +{"id":"stylus-sprite","key":"stylus-sprite","value":{"rev":"27-db597a75467baaad94de287494e9c21e"}}, +{"id":"styout","key":"styout","value":{"rev":"9-9d9460bb9bfa253ed0b5fbeb27f7710a"}}, +{"id":"sugar","key":"sugar","value":{"rev":"5-2722426edc51a7703f5c37306b03a8c4"}}, +{"id":"sugardoll","key":"sugardoll","value":{"rev":"16-cfadf4e7108357297be180a3868130db"}}, +{"id":"suger-pod","key":"suger-pod","value":{"rev":"5-c812b763cf6cdd218c6a18e1a4e2a4ac"}}, +{"id":"sunny","key":"sunny","value":{"rev":"3-c26b62eef1eeeeef58a7ea9373df3b39"}}, +{"id":"superagent","key":"superagent","value":{"rev":"3-1b32cc8372b7713f973bb1e044e6a86f"}}, +{"id":"supermarket","key":"supermarket","value":{"rev":"20-afa8a26ecec3069717c8ca7e5811cc31"}}, +{"id":"supershabam-websocket","key":"supershabam-websocket","value":{"rev":"7-513117fb37b3ab7cdaeeae31589e212e"}}, +{"id":"supervisor","key":"supervisor","value":{"rev":"16-2c6c141d018ef8927acee79f31d466ff"}}, +{"id":"supervisord","key":"supervisord","value":{"rev":"7-359ba115e5e10b5c95ef1a7562ad7a45"}}, +{"id":"svg2jadepartial","key":"svg2jadepartial","value":{"rev":"9-4a6260dd5d7c14801e8012e3ba7510f5"}}, +{"id":"swake","key":"swake","value":{"rev":"5-6f780362f0317427752d87cc5c640021"}}, +{"id":"swarm","key":"swarm","value":{"rev":"43-f1a963a0aeb043bf69529a82798b3afc"}}, +{"id":"sweet","key":"sweet","value":{"rev":"5-333f4d3529f65ce53b037cc282e3671d"}}, +{"id":"swig","key":"swig","value":{"rev":"29-53294b9d4f350192cf65817692092bfa"}}, +{"id":"switchback","key":"switchback","value":{"rev":"3-e117371d415f4a3d4ad30e78f5ec28bf"}}, +{"id":"switchboard","key":"switchboard","value":{"rev":"3-504d6c1e45165c54fbb1d3025d5120d7"}}, +{"id":"swiz","key":"swiz","value":{"rev":"82-cfb7840376b57896fba469e5c6ff3786"}}, +{"id":"swizec-bitly","key":"swizec-bitly","value":{"rev":"3-a705807238b8ef3ff2d008910bc350c3"}}, +{"id":"sws","key":"sws","value":{"rev":"5-bc5e8558bde6c2ae971abdd448a006d2"}}, +{"id":"symbie","key":"symbie","value":{"rev":"5-3184f869ed386341a4cdc35d85efb62a"}}, +{"id":"symbox","key":"symbox","value":{"rev":"5-eed33350cbb763726335ef1df74a6591"}}, +{"id":"synapse","key":"synapse","value":{"rev":"3-a9672d5159c0268babbfb94d7554d4bb"}}, +{"id":"sync","key":"sync","value":{"rev":"65-89fa6b8ab2df135d57e0bba4e921ad3b"}}, +{"id":"synchro","key":"synchro","value":{"rev":"21-6a881704308298f1894509a5b59287ae"}}, +{"id":"synchronous","key":"synchronous","value":{"rev":"7-bf89d61f001d994429e0fd12c26c2676"}}, +{"id":"syncler","key":"syncler","value":{"rev":"2-12870522e069945fc12f7d0f612700ee"}}, +{"id":"syncrepl","key":"syncrepl","value":{"rev":"5-e9234a1d8a529bc0d1b01c3b77c69c30"}}, +{"id":"synct","key":"synct","value":{"rev":"3-3664581b69e6f40dabc90525217f46cd"}}, +{"id":"syndicate","key":"syndicate","value":{"rev":"7-1db2b05d6b3e55fa622c3c26df7f9cad"}}, +{"id":"syslog","key":"syslog","value":{"rev":"5-d52fbc739505a2a194faf9a32da39d23"}}, +{"id":"syslog-node","key":"syslog-node","value":{"rev":"15-039177b9c516fd8d0b31faf92aa73f6f"}}, +{"id":"system","key":"system","value":{"rev":"18-33152371e0696a853ddb8b2234a6dfea"}}, +{"id":"taazr-uglify","key":"taazr-uglify","value":{"rev":"7-5c63dc75aa7c973df102c298291be8a5"}}, +{"id":"table","key":"table","value":{"rev":"9-a8a46ddf3a7cab63a0228303305cc32e"}}, +{"id":"tache.io","key":"tache.io","value":{"rev":"7-5639c70dc56b0a6333b568af377bb216"}}, +{"id":"taco","key":"taco","value":{"rev":"3-97cfbd54b4053c9e01e18af7c3902d1a"}}, +{"id":"tad","key":"tad","value":{"rev":"3-529ebda7291e24ae020d5c2931ba22cd"}}, +{"id":"tafa-misc-util","key":"tafa-misc-util","value":{"rev":"19-52984b66029c7d5cc78d3e2ae88c98d6"}}, +{"id":"tag","key":"tag","value":{"rev":"3-80b0d526b10a26f41fe73978843a07b9"}}, +{"id":"taglib","key":"taglib","value":{"rev":"3-efd2e6bc818bf3b385df40dfae506fa5"}}, +{"id":"tail","key":"tail","value":{"rev":"21-09bce80ad6aa4b01c6a70825fd141fd4"}}, +{"id":"tails","key":"tails","value":{"rev":"14-3ba6976831b1388e14235622ab001681"}}, +{"id":"tamejs","key":"tamejs","value":{"rev":"39-9a3657941df3bd24c43b5473e9f3b4c8"}}, +{"id":"taobao-js-api","key":"taobao-js-api","value":{"rev":"7-d46c8b48364b823dabf808f2b30e1eb8"}}, +{"id":"tap","key":"tap","value":{"rev":"35-1b8e553cf848f5ab27711efa0e74a033"}}, +{"id":"tap-assert","key":"tap-assert","value":{"rev":"19-f2960c64bcfa6ce4ed73e870d8d9e3fa"}}, +{"id":"tap-consumer","key":"tap-consumer","value":{"rev":"3-3e38aafb6d2d840bdb20818efbc75df4"}}, +{"id":"tap-global-harness","key":"tap-global-harness","value":{"rev":"3-f32589814daf8c1816c1f5a24de4ad12"}}, +{"id":"tap-harness","key":"tap-harness","value":{"rev":"7-a5af01384152c452abc11d4e641e6157"}}, +{"id":"tap-producer","key":"tap-producer","value":{"rev":"3-2db67a9541c37c912d4de2576bb3caa0"}}, +{"id":"tap-results","key":"tap-results","value":{"rev":"5-b8800525438965e38dc586e6b5cb142d"}}, +{"id":"tap-runner","key":"tap-runner","value":{"rev":"11-3975c0f5044530b61158a029899f4c03"}}, +{"id":"tap-test","key":"tap-test","value":{"rev":"5-0a3bba26b6b94dae8b7f59712335ee98"}}, +{"id":"tar","key":"tar","value":{"rev":"6-94226dd7add6ae6a1e68088360a466e4"}}, +{"id":"tar-async","key":"tar-async","value":{"rev":"37-d6579d43c1ee2f41205f28b0cde5da23"}}, +{"id":"tar-js","key":"tar-js","value":{"rev":"5-6826f2aad965fb532c7403964ce80d85"}}, +{"id":"task","key":"task","value":{"rev":"3-81f72759a5b64dff88a01a4838cc4a23"}}, +{"id":"task-extjs","key":"task-extjs","value":{"rev":"14-c9ba76374805425c332e0c66725e885c"}}, +{"id":"task-joose-nodejs","key":"task-joose-nodejs","value":{"rev":"20-6b8e4d24323d3240d5ee790d00c0d96a"}}, +{"id":"task-joose-stable","key":"task-joose-stable","value":{"rev":"32-026eada52cd5dd17a680359daec4917a"}}, +{"id":"tasks","key":"tasks","value":{"rev":"5-84e8f83d0c6ec27b4f05057c48063d62"}}, +{"id":"tav","key":"tav","value":{"rev":"3-da9899817edd20f0c73ad09bdf540cc6"}}, +{"id":"taxman","key":"taxman","value":{"rev":"5-9b9c68db8a1c8efedad800026cb23ae4"}}, +{"id":"tbone","key":"tbone","value":{"rev":"3-5789b010d0b1f1c663750c894fb5c570"}}, +{"id":"tcp-proxy","key":"tcp-proxy","value":{"rev":"3-118c6dc26d11537cf157fe2f28b05af5"}}, +{"id":"teamgrowl","key":"teamgrowl","value":{"rev":"8-3d13200b3bfeeace0787f9f9f027216d"}}, +{"id":"teamgrowl-server","key":"teamgrowl-server","value":{"rev":"8-a14dc4a26c2c06a4d9509eaff6e24735"}}, +{"id":"telehash","key":"telehash","value":{"rev":"6-4fae3629c1e7e111ba3e486b39a29913"}}, +{"id":"telemail","key":"telemail","value":{"rev":"3-60928460428265fc8002ca61c7f23abe"}}, +{"id":"telemetry","key":"telemetry","value":{"rev":"5-1be1d37ef62dc786b0a0f0d2d7984eb1"}}, +{"id":"teleport","key":"teleport","value":{"rev":"36-5b55a43ba83f4fe1a547c04e29139c3d"}}, +{"id":"teleport-dashboard","key":"teleport-dashboard","value":{"rev":"7-4cbc728d7a3052848a721fcdd92dda30"}}, +{"id":"teleport-site","key":"teleport-site","value":{"rev":"3-aeb8c0a93b7b0bcd7a30fe33bf23808c"}}, +{"id":"telnet","key":"telnet","value":{"rev":"11-7a587104b94ce135315c7540eb3493f6"}}, +{"id":"telnet-protocol","key":"telnet-protocol","value":{"rev":"3-8fcee2ed02c2e603c48e51e90ae78a00"}}, +{"id":"temp","key":"temp","value":{"rev":"6-91ef505da0a0860a13c0eb1a5d2531e6"}}, +{"id":"tempPath","key":"tempPath","value":{"rev":"3-34f2c1937d97207245986c344136547c"}}, +{"id":"tempis","key":"tempis","value":{"rev":"3-b2c0989068cc8125a519d19b9c79ffb6"}}, +{"id":"template","key":"template","value":{"rev":"6-d0088c6a5a7610570920db0f5c950bf9"}}, +{"id":"template-engine","key":"template-engine","value":{"rev":"3-3746216e1e2e456dbb0fd2f9070c1619"}}, +{"id":"tengwar","key":"tengwar","value":{"rev":"3-645a00f03e1e9546631ac22c37e1f3b4"}}, +{"id":"tenjin","key":"tenjin","value":{"rev":"5-0925c7535455266125b7730296c66356"}}, +{"id":"teriaki","key":"teriaki","value":{"rev":"3-d3c17f70d8697c03f43a7eae75f8c089"}}, +{"id":"terminal","key":"terminal","value":{"rev":"11-0e024d173ee3c28432877c0c5f633f19"}}, +{"id":"termspeak","key":"termspeak","value":{"rev":"7-fdfc93dd7d0d65fe502cabca191d8496"}}, +{"id":"termutil","key":"termutil","value":{"rev":"5-bccf8377ff28bc1f07f8b4b44d1e2335"}}, +{"id":"test","key":"test","value":{"rev":"38-129620013bbd3ec13617c403b02b52f1"}}, +{"id":"test-cmd","key":"test-cmd","value":{"rev":"35-7dd417a80390c2c124c66273ae33bd07"}}, +{"id":"test-helper","key":"test-helper","value":{"rev":"3-7b29af65825fc46d0603a39cdc6c95b4"}}, +{"id":"test-report","key":"test-report","value":{"rev":"5-e51cd1069b6cc442707f0861b35851be"}}, +{"id":"test-report-view","key":"test-report-view","value":{"rev":"3-9ba670940a8235eaef9b957dde6379af"}}, +{"id":"test-run","key":"test-run","value":{"rev":"20-6de89383602e6843d9376a78778bec19"}}, +{"id":"test_it","key":"test_it","value":{"rev":"5-be5cd436b9145398fa88c15c1269b102"}}, +{"id":"testbed","key":"testbed","value":{"rev":"2-db233788f7e516f227fac439d9450ef4"}}, +{"id":"testharness","key":"testharness","value":{"rev":"46-787468cb68ec31b442327639dcc0a4e5"}}, +{"id":"testingey","key":"testingey","value":{"rev":"17-a7ad6a9ff5721ae449876f6448d6f22f"}}, +{"id":"testnode","key":"testnode","value":{"rev":"9-cb63c450b241806e2271cd56fe502395"}}, +{"id":"testosterone","key":"testosterone","value":{"rev":"35-278e8af2b59bb6caf56728c67f720c37"}}, +{"id":"testqueue","key":"testqueue","value":{"rev":"3-59c574aeb345ef2d6e207a342be3f497"}}, +{"id":"testrunner","key":"testrunner","value":{"rev":"7-152e7d4a97f6cf6f00e22140e1969664"}}, +{"id":"testy","key":"testy","value":{"rev":"5-e8f4c9f4a799b6f8ab4effc21c3073a0"}}, +{"id":"text","key":"text","value":{"rev":"6-58a79b0db4968d6ad233898744a75351"}}, +{"id":"textareaserver","key":"textareaserver","value":{"rev":"3-f032b1397eb5e6369e1ac0ad1e78f466"}}, +{"id":"textile","key":"textile","value":{"rev":"6-2a8db66876f0119883449012c9c54c47"}}, +{"id":"textual","key":"textual","value":{"rev":"3-0ad9d5d3403b239185bad403625fed19"}}, +{"id":"tf2logparser","key":"tf2logparser","value":{"rev":"5-ffbc427b95ffeeb013dc13fa2b9621e3"}}, +{"id":"tfe-express","key":"tfe-express","value":{"rev":"3-b68ac01185885bcd22fa430ddb97e757"}}, +{"id":"tfidf","key":"tfidf","value":{"rev":"13-988808af905397dc103a0edf8c7c8a9f"}}, +{"id":"theBasics","key":"theBasics","value":{"rev":"7-9ebef2e59e1bd2fb3544ed16e1dc627b"}}, +{"id":"thefunlanguage.com","key":"thefunlanguage.com","value":{"rev":"3-25d56a3a4f639af23bb058db541bffe0"}}, +{"id":"thelinuxlich-docco","key":"thelinuxlich-docco","value":{"rev":"7-2ac0969da67ead2fa8bc0b21880b1d6b"}}, +{"id":"thelinuxlich-vogue","key":"thelinuxlich-vogue","value":{"rev":"5-ebc0a28cf0ae447b7ebdafc51c460bc0"}}, +{"id":"thepusher","key":"thepusher","value":{"rev":"5-b80cce6f81b1cae7373cd802df34c05c"}}, +{"id":"thetvdb","key":"thetvdb","value":{"rev":"3-a3a017a90b752d8158bf6dfcbcfdf250"}}, +{"id":"thirty-two","key":"thirty-two","value":{"rev":"3-1d4761ba7c4fa475e0c69e9c96d6ac04"}}, +{"id":"thoonk","key":"thoonk","value":{"rev":"15-c62c90d7e9072d96302d3a534ce943bb"}}, +{"id":"thrift","key":"thrift","value":{"rev":"14-447a41c9b655ec06e8e4854d5a55523a"}}, +{"id":"throttle","key":"throttle","value":{"rev":"3-8a3b3c657c49ede67c883806fbfb4df6"}}, +{"id":"thyme","key":"thyme","value":{"rev":"5-f06104f10d43a2b4cbcc7621ed45eacf"}}, +{"id":"tiamat","key":"tiamat","value":{"rev":"44-810633d6cd5edaa0510fe0f38c02ad58"}}, +{"id":"tictoc","key":"tictoc","value":{"rev":"3-0be6cf95d4466595376dadd0fc08bd95"}}, +{"id":"tidy","key":"tidy","value":{"rev":"3-25116d4dcf6765ef2a09711ecc1e03c9"}}, +{"id":"tiers","key":"tiers","value":{"rev":"3-ffaa8ffe472fe703de8f0bbeb8af5621"}}, +{"id":"tilejson","key":"tilejson","value":{"rev":"5-76b990dd945fb412ed00a96edc86b59d"}}, +{"id":"tilelive","key":"tilelive","value":{"rev":"57-9283e846e77263ed6e7299680d6b4b06"}}, +{"id":"tilelive-mapnik","key":"tilelive-mapnik","value":{"rev":"31-30f871ede46789fc6a36f427a1a99fff"}}, +{"id":"tilemill","key":"tilemill","value":{"rev":"19-7b884c9d707dd34f21cb71e88b45fc73"}}, +{"id":"tilestream","key":"tilestream","value":{"rev":"76-3a29ba96ecdb6c860c211ae8f2d909a9"}}, +{"id":"timbits","key":"timbits","value":{"rev":"59-b48dde4a210ec9fb4c33c07a52bce61e"}}, +{"id":"time","key":"time","value":{"rev":"51-907f587206e6a27803a3570e42650adc"}}, +{"id":"timeTraveller","key":"timeTraveller","value":{"rev":"7-389de8c8e86daea495d14aeb2b77df38"}}, +{"id":"timeout","key":"timeout","value":{"rev":"11-8e53dedecfaf6c4f1086eb0f43c71325"}}, +{"id":"timer","key":"timer","value":{"rev":"5-a8bcbb898a807e6662b54ac988fb967b"}}, +{"id":"timerjs","key":"timerjs","value":{"rev":"3-7d24eb268746fdb6b5e9be93bec93f1b"}}, +{"id":"timespan","key":"timespan","value":{"rev":"12-315b2793cbf28a18cea36e97a3c8a55f"}}, +{"id":"timezone","key":"timezone","value":{"rev":"35-2741d5d3b68a953d4cb3a596bc2bc15e"}}, +{"id":"tiny","key":"tiny","value":{"rev":"9-a61d26d02ce39381f7e865ad82494692"}}, +{"id":"tld","key":"tld","value":{"rev":"3-5ce4b4e48a11413ad8a1f3bfd0d0b778"}}, +{"id":"tldextract","key":"tldextract","value":{"rev":"7-620962e27145bd9fc17dc406c38b0c32"}}, +{"id":"tmp","key":"tmp","value":{"rev":"23-20f5c14244d58f35bd3e970f5f65cc32"}}, +{"id":"tmpl","key":"tmpl","value":{"rev":"5-5894c206e15fa58ab9415706b9d53f1f"}}, +{"id":"tmpl-precompile","key":"tmpl-precompile","value":{"rev":"15-3db34b681596b258cae1dae8cc24119d"}}, +{"id":"tmppckg","key":"tmppckg","value":{"rev":"11-b3a13e1280eb9cbef182c1f3f24bd570"}}, +{"id":"tnetstrings","key":"tnetstrings","value":{"rev":"3-d6b8ed2390a3e38138cb01b82d820079"}}, +{"id":"toDataURL","key":"toDataURL","value":{"rev":"3-1ea3cb62666b37343089bb9ef48fbace"}}, +{"id":"toYaml","key":"toYaml","value":{"rev":"11-3c629e3859c70d57b1ae51b2ac459011"}}, +{"id":"tob","key":"tob","value":{"rev":"7-376c174d06a675855406cfcdcacf61f5"}}, +{"id":"tobi","key":"tobi","value":{"rev":"50-d8749ac3739b042afe82657802bc3ba8"}}, +{"id":"toddick","key":"toddick","value":{"rev":"13-db528ef519f57b8c1d752ad7270b4d05"}}, +{"id":"tokenizer","key":"tokenizer","value":{"rev":"5-f6524fafb16059b66074cd04bf248a03"}}, +{"id":"tokyotosho","key":"tokyotosho","value":{"rev":"5-7432e0207165d9c165fd73d2a23410d6"}}, +{"id":"tolang","key":"tolang","value":{"rev":"7-65dbdf56b039f680e61a1e1d7feb9fb1"}}, +{"id":"toolkit","key":"toolkit","value":{"rev":"13-58075a57a6069dc39f98e72d473a0c30"}}, +{"id":"tools","key":"tools","value":{"rev":"3-ba301d25cfc6ad71dd68c811ea97fa01"}}, +{"id":"topcube","key":"topcube","value":{"rev":"29-736b3816d410f626dbc4da663acb05aa"}}, +{"id":"torrent-search","key":"torrent-search","value":{"rev":"7-7dd48fac0c1f99f34fad7da365085b6c"}}, +{"id":"tosource","key":"tosource","value":{"rev":"5-13483e2c11b07611c26b37f2e76a0bf3"}}, +{"id":"tplcpl","key":"tplcpl","value":{"rev":"15-8ba1e6d14ad6b8eb71b703e22054ac0a"}}, +{"id":"tracejs","key":"tracejs","value":{"rev":"23-1ffec83afc19855bcbed8049a009a910"}}, +{"id":"traceur","key":"traceur","value":{"rev":"9-a48f7e4cb1fb452125d81c62c8ab628b"}}, +{"id":"traceurl","key":"traceurl","value":{"rev":"21-e016db44a86b124ea00411f155d884d4"}}, +{"id":"tracey","key":"tracey","value":{"rev":"5-76699aab64e89271cbb7df80a00d3583"}}, +{"id":"tracy","key":"tracy","value":{"rev":"5-412f78082ba6f4c3c7d5328cf66d2e10"}}, +{"id":"traits","key":"traits","value":{"rev":"10-3a37dbec4b78518c00c577f5e286a9b9"}}, +{"id":"tramp","key":"tramp","value":{"rev":"5-3b6d27b8b432b925b7c9fc088e84d8e4"}}, +{"id":"transcode","key":"transcode","value":{"rev":"6-a6494707bd94b5e6d1aa9df3dbcf8d7c"}}, +{"id":"transformer","key":"transformer","value":{"rev":"15-7738ac7c02f03d64f73610fbf7ed92a6"}}, +{"id":"transformjs","key":"transformjs","value":{"rev":"5-f1ab667c430838e1d3238e1f878998e2"}}, +{"id":"transitive","key":"transitive","value":{"rev":"43-841de40a5e3434bd51a1c8f19891f982"}}, +{"id":"translate","key":"translate","value":{"rev":"12-f3ddbbada2f109843c5422d83dd7a203"}}, +{"id":"transliteration.ua","key":"transliteration.ua","value":{"rev":"3-f847c62d8749904fc7de6abe075e619a"}}, +{"id":"transmission","key":"transmission","value":{"rev":"9-587eaa395430036f17b175bc439eabb6"}}, +{"id":"transmogrify","key":"transmogrify","value":{"rev":"5-3e415cd9420c66551cccc0aa91b11d98"}}, +{"id":"transporter","key":"transporter","value":{"rev":"6-698b696890bf01d751e9962bd86cfe7e"}}, +{"id":"traverse","key":"traverse","value":{"rev":"60-9432066ab44fbb0e913227dc62c953d9"}}, +{"id":"traverser","key":"traverser","value":{"rev":"11-1d50662f13134868a1df5019d99bf038"}}, +{"id":"treeeater","key":"treeeater","value":{"rev":"56-2c8a9fd3e842b221ab8da59c6d847327"}}, +{"id":"treelib","key":"treelib","value":{"rev":"13-212ccc836a943c8b2a5342b65ab9edf3"}}, +{"id":"trees","key":"trees","value":{"rev":"3-3ee9e9cf3fd8aa985e32b3d9586a7c0e"}}, +{"id":"trentm-datetime","key":"trentm-datetime","value":{"rev":"3-740a291379ddf97bda2aaf2ff0e1654d"}}, +{"id":"trentm-git","key":"trentm-git","value":{"rev":"3-b81ce3764a45e5d0862488fab9fac486"}}, +{"id":"trentm-hashlib","key":"trentm-hashlib","value":{"rev":"3-4b4175b6a8702bdb9c1fe5ac4786761b"}}, +{"id":"trial","key":"trial","value":{"rev":"3-cf77f189409517495dd8259f86e0620e"}}, +{"id":"trie","key":"trie","value":{"rev":"3-6cc3c209cf4aae5a4f92e1ca38c4c54c"}}, +{"id":"trollop","key":"trollop","value":{"rev":"6-75076593614c9cd51d61a76f73d2c5b5"}}, +{"id":"trollscript","key":"trollscript","value":{"rev":"5-fcf646075c5be575b9174f84d08fbb37"}}, +{"id":"trollscriptjs","key":"trollscriptjs","value":{"rev":"3-1dfd1acd3d15c0bd18ea407e3933b621"}}, +{"id":"tropo-webapi","key":"tropo-webapi","value":{"rev":"11-5106730dbd79167df38812ffaa912ded"}}, +{"id":"tropo-webapi-node","key":"tropo-webapi-node","value":{"rev":"15-483c64bcbf1dcadaea30e78d7bc3ebbc"}}, +{"id":"trundle","key":"trundle","value":{"rev":"3-2af32ed348fdedebd1077891bb22a756"}}, +{"id":"trust-reverse-proxy","key":"trust-reverse-proxy","value":{"rev":"6-ba5bed0849617e0390f0e24750bf5747"}}, +{"id":"trying","key":"trying","value":{"rev":"3-43b417160b178c710e0d85af6b3d56e7"}}, +{"id":"ttapi","key":"ttapi","value":{"rev":"51-727e47d8b383b387a498711c07ce4de6"}}, +{"id":"tubbs","key":"tubbs","value":{"rev":"7-b386e59f2205b22615a376f5ddee3eb0"}}, +{"id":"tuild","key":"tuild","value":{"rev":"13-4a2b92f95a0ee342c060974ce7a0021d"}}, +{"id":"tumbler","key":"tumbler","value":{"rev":"5-ff16653ab92d0af5e70d9caa88f3b7ed"}}, +{"id":"tumbler-sprite","key":"tumbler-sprite","value":{"rev":"3-604d25b7bb9e32b92cadd75aeb23997c"}}, +{"id":"tumblr","key":"tumblr","value":{"rev":"9-14d160f1f2854330fba300b3ea233893"}}, +{"id":"tumblr2","key":"tumblr2","value":{"rev":"7-29bb5d86501cdbcef889289fe7f4b51e"}}, +{"id":"tumblrrr","key":"tumblrrr","value":{"rev":"10-0c50379fbab7b39766e1a61379c39964"}}, +{"id":"tunguska","key":"tunguska","value":{"rev":"1-a6b24d2c2a5a9f091a9b6f13bac66927"}}, +{"id":"tupalocomapi","key":"tupalocomapi","value":{"rev":"3-a1cdf85a08784f62c2ec440a1ed90ad4"}}, +{"id":"turing","key":"turing","value":{"rev":"5-4ba083c8343718acb9450d96551b65c0"}}, +{"id":"tutti","key":"tutti","value":{"rev":"21-929cc205b3d8bc68f86aa63578e0af95"}}, +{"id":"tuttiserver","key":"tuttiserver","value":{"rev":"39-b3fe7cbaf2d43458dae061f37aa5ae18"}}, +{"id":"tuttiterm","key":"tuttiterm","value":{"rev":"7-6c0e9e7f6f137de0ee7c886351fdf373"}}, +{"id":"tvister","key":"tvister","value":{"rev":"7-963eab682ab09922a44fbca50c0ec019"}}, +{"id":"twbot","key":"twbot","value":{"rev":"15-923625f516566c977975b3da3d4bc46b"}}, +{"id":"tweasy","key":"tweasy","value":{"rev":"10-7215063e5729b1c114ef73f07a1368d3"}}, +{"id":"tweeter.js","key":"tweeter.js","value":{"rev":"3-bc8437157c11cf32eec168d7c71037bb"}}, +{"id":"tweetstream","key":"tweetstream","value":{"rev":"6-81a6bf2a3e29208e1c4c65a3958ee5d8"}}, +{"id":"twerk","key":"twerk","value":{"rev":"5-01cbfddf9ad25a67ff1e45ec39acb780"}}, +{"id":"twerp","key":"twerp","value":{"rev":"23-1b4726d1fef030a3dde6fae2cdfbb687"}}, +{"id":"twigjs","key":"twigjs","value":{"rev":"7-07b90e2c35c5c81d394b29086507de04"}}, +{"id":"twilio","key":"twilio","value":{"rev":"20-68d5439ecb1774226025e6f9125bbb86"}}, +{"id":"twilio-node","key":"twilio-node","value":{"rev":"13-84d31c2dc202df3924ed399289cbc1fc"}}, +{"id":"twiliode","key":"twiliode","value":{"rev":"3-6cbe432dd6c6d94d8a4faa6e0ea47dd3"}}, +{"id":"twill","key":"twill","value":{"rev":"5-3a0caf9c0e83ab732ae8ae61f4f17830"}}, +{"id":"twisted-deferred","key":"twisted-deferred","value":{"rev":"9-f35acecb8736d96582e1f9b62dd4ae47"}}, +{"id":"twitpic","key":"twitpic","value":{"rev":"11-55b11432a09edeec1189024f26a48153"}}, +{"id":"twitter","key":"twitter","value":{"rev":"60-9ad6368932c8a74ea5bd10dda993d74d"}}, +{"id":"twitter-client","key":"twitter-client","value":{"rev":"11-dc3da9e1724cf00aa86c1e7823cfd919"}}, +{"id":"twitter-connect","key":"twitter-connect","value":{"rev":"12-969292347a4251d121566169236a3091"}}, +{"id":"twitter-js","key":"twitter-js","value":{"rev":"24-251d0c54749e86bd544a15290e311370"}}, +{"id":"twitter-node","key":"twitter-node","value":{"rev":"12-a7ed6c69f05204de2e258f46230a05b6"}}, +{"id":"twitter-text","key":"twitter-text","value":{"rev":"16-978bda8ec4eaf68213d0ee54242feefa"}}, +{"id":"type","key":"type","value":{"rev":"3-c5b8b87cde9e27277302cb5cb6d00f85"}}, +{"id":"typecheck","key":"typecheck","value":{"rev":"5-79723661620bb0fb254bc7f888d6e937"}}, +{"id":"typed-array","key":"typed-array","value":{"rev":"3-89ac91e2a51a9e5872515d5a83691e83"}}, +{"id":"typhoon","key":"typhoon","value":{"rev":"23-2027c96b8fd971332848594f3b0526cb"}}, +{"id":"typogr","key":"typogr","value":{"rev":"13-2dfe00f08ee13e6b00a99df0a8f96718"}}, +{"id":"ua-parser","key":"ua-parser","value":{"rev":"14-d1a018354a583dba4506bdc0c04a416b"}}, +{"id":"uberblic","key":"uberblic","value":{"rev":"5-500704ed73f255eb5b86ad0a5e158bc9"}}, +{"id":"ucengine","key":"ucengine","value":{"rev":"5-1e8a91c813e39b6f1b9f988431bb65c8"}}, +{"id":"udon","key":"udon","value":{"rev":"3-9a819e835f88fc91272b6366c70d83c0"}}, +{"id":"ueberDB","key":"ueberDB","value":{"rev":"85-fa700e5a64efaf2e71de843d7175606c"}}, +{"id":"uglify-js","key":"uglify-js","value":{"rev":"30-9ac97132a90f94b0a3aadcd96ed51890"}}, +{"id":"uglify-js-middleware","key":"uglify-js-middleware","value":{"rev":"5-47bd98d7f1118f5cab617310d4022eb4"}}, +{"id":"uglifycss","key":"uglifycss","value":{"rev":"3-4eefc4632e6e61ec999e93a1e26e0c83"}}, +{"id":"ui","key":"ui","value":{"rev":"27-b6439c8fcb5feb1d8f722ac5a91727c0"}}, +{"id":"ukijs","key":"ukijs","value":{"rev":"13-a0d7b143104e6cc0760cbe7e61c4f293"}}, +{"id":"umecob","key":"umecob","value":{"rev":"19-960fef8b8b8468ee69096173baa63232"}}, +{"id":"underscore","key":"underscore","value":{"rev":"29-419857a1b0dc08311717d1f6066218b8"}}, +{"id":"underscore-data","key":"underscore-data","value":{"rev":"17-e763dd42ea6e4ab71bc442e9966e50e4"}}, +{"id":"underscore.date","key":"underscore.date","value":{"rev":"11-a1b5870b855d49a3bd37823a736e9f93"}}, +{"id":"underscore.inspector","key":"underscore.inspector","value":{"rev":"7-04d67b5bfe387391d461b11c6ddda231"}}, +{"id":"underscore.string","key":"underscore.string","value":{"rev":"31-4100a9e1f1d7e8dde007cc6736073e88"}}, +{"id":"underscorem","key":"underscorem","value":{"rev":"5-181dd113e62482020122e6a68f80cdc1"}}, +{"id":"underscorex","key":"underscorex","value":{"rev":"8-76b82cffecd4304822fbc346e6cebc1b"}}, +{"id":"underscorify","key":"underscorify","value":{"rev":"3-7bb03dccba21d30c50328e7d4878704e"}}, +{"id":"unicode","key":"unicode","value":{"rev":"45-2fc73b36aad2661e5bb2e703e62a6f71"}}, +{"id":"unicoder","key":"unicoder","value":{"rev":"3-6f6571d361217af7fea7c224ca8a1149"}}, +{"id":"unit","key":"unit","value":{"rev":"5-68847eeb11474765cf73f1e21ca4b839"}}, +{"id":"unite","key":"unite","value":{"rev":"3-a8812f4e77d1d1a9dc67c327d8e75b47"}}, +{"id":"unittest-jslint","key":"unittest-jslint","value":{"rev":"3-c371c63c7b68a32357becb7b6a02d048"}}, +{"id":"unixlib","key":"unixlib","value":{"rev":"3-41f4c2859ca92951cf40556faa4eacdb"}}, +{"id":"unlimit","key":"unlimit","value":{"rev":"3-f42d98066e6ebbc23ef67499845ac020"}}, +{"id":"unrequire","key":"unrequire","value":{"rev":"17-bc75241891ae005eb52844222daf8f97"}}, +{"id":"unshortener","key":"unshortener","value":{"rev":"15-0851cb8bc3c378c37a3df9760067a109"}}, +{"id":"unused","key":"unused","value":{"rev":"3-362e713349c4a5541564fa2de33d01ba"}}, +{"id":"upload","key":"upload","value":{"rev":"3-63aedcfb335754c3bca1675c4add51c4"}}, +{"id":"ups_node","key":"ups_node","value":{"rev":"15-fa6d0be3831ee09420fb703c4d508534"}}, +{"id":"upy","key":"upy","value":{"rev":"5-dab63054d02be71f9c2709659974a5e1"}}, +{"id":"uri","key":"uri","value":{"rev":"3-5baaa12433cff7539b1d39c0c7f62853"}}, +{"id":"uri-parser","key":"uri-parser","value":{"rev":"3-d7e81b08e8b3f6f5ac8c6b4220228529"}}, +{"id":"url","key":"url","value":{"rev":"3-0dfd5ec2904cb1f645fa7449dbb0ce52"}}, +{"id":"url-expander","key":"url-expander","value":{"rev":"21-73bf9fa3c98b15d5ef0ed9815d862953"}}, +{"id":"urllib","key":"urllib","value":{"rev":"5-b015944526c15589a1504d398dcb598a"}}, +{"id":"urn-parser","key":"urn-parser","value":{"rev":"3-08a35a166790ecf88729befd4ebc7bf1"}}, +{"id":"useless","key":"useless","value":{"rev":"3-9d7b7ab9d4811847ed6e99ce2226d687"}}, +{"id":"user-agent","key":"user-agent","value":{"rev":"16-ac00f085795346421242e3d4d75523ad"}}, +{"id":"useragent","key":"useragent","value":{"rev":"7-3184d8aba5540e6596da9e3635ee3c24"}}, +{"id":"useragent_parser","key":"useragent_parser","value":{"rev":"3-730427aba3f0825fd28850e96b1613d4"}}, +{"id":"utf7","key":"utf7","value":{"rev":"3-ad56e4c9ac5a509ff568a3cdf0ed074f"}}, +{"id":"utf8","key":"utf8","value":{"rev":"3-c530cad759dd6e4e471338a71a307434"}}, +{"id":"util","key":"util","value":{"rev":"3-0e55e3466bc3ea6aeda6384639e842c3"}}, +{"id":"utility-belt","key":"utility-belt","value":{"rev":"3-8de401b41ef742b3c0a144b99099771f"}}, +{"id":"utml","key":"utml","value":{"rev":"5-5f0f3de6f787056bd124ca98716fbc19"}}, +{"id":"uubench","key":"uubench","value":{"rev":"6-b6cb0756e35ce998b61bb9a6ea0f5732"}}, +{"id":"uuid","key":"uuid","value":{"rev":"13-3f014b236668ec5eb49d0a17ad54d397"}}, +{"id":"uuid-lib","key":"uuid-lib","value":{"rev":"3-3de40495439e240b5a41875c19c65b1a"}}, +{"id":"uuid-pure","key":"uuid-pure","value":{"rev":"19-b94e9f434901fe0a0bbfdfa06f785874"}}, +{"id":"uuid.js","key":"uuid.js","value":{"rev":"8-3232a97c9f4a2b601d207488350df01b"}}, +{"id":"v8-profiler","key":"v8-profiler","value":{"rev":"12-790c90391bcbec136e316e57b30a845c"}}, +{"id":"valentine","key":"valentine","value":{"rev":"35-dd4b0642aacaf833e1119fc42bb6e9df"}}, +{"id":"validate-json","key":"validate-json","value":{"rev":"5-6a71fb36b102b3a4c5f6cc35012518b3"}}, +{"id":"validations","key":"validations","value":{"rev":"5-7272c97d35e3269813d91f1ea06e7217"}}, +{"id":"validator","key":"validator","value":{"rev":"45-9983ff692c291143ba670b613e07ddab"}}, +{"id":"vanilla","key":"vanilla","value":{"rev":"3-2e1d05af0873386b7cd6d432f1e76217"}}, +{"id":"vapor","key":"vapor","value":{"rev":"1-e1f86f03c94a4b90bca347408dbc56ff"}}, +{"id":"vargs","key":"vargs","value":{"rev":"6-9e389cfd648034dd469348112eedb23b"}}, +{"id":"vash","key":"vash","value":{"rev":"9-85ade8b7249a0e8230e8f0aaf1c34e2a"}}, +{"id":"vbench","key":"vbench","value":{"rev":"3-059528251a566c6ac363e236212448ce"}}, +{"id":"vendor.js","key":"vendor.js","value":{"rev":"5-264b0f8a771cad113be6919b6004ff95"}}, +{"id":"ventstatus","key":"ventstatus","value":{"rev":"3-16aa39e22b149b23b64317991415f92c"}}, +{"id":"version-compare","key":"version-compare","value":{"rev":"3-a8d6eea31572fe973ddd98c0a8097bc6"}}, +{"id":"vertica","key":"vertica","value":{"rev":"37-035d50183c3ad3056db0d7a13c20005d"}}, +{"id":"vhost","key":"vhost","value":{"rev":"9-53bbdba14dae631a49e782d169e4fc5a"}}, +{"id":"vice","key":"vice","value":{"rev":"5-0f74600349f4540b1b104d4ebfec1309"}}, +{"id":"video","key":"video","value":{"rev":"10-65c0b603047188fe2b07cbd2e1c93fe7"}}, +{"id":"vie","key":"vie","value":{"rev":"5-94e23770c5a0510480a0bae07d846ebc"}}, +{"id":"view","key":"view","value":{"rev":"21-a2abdfc54ab732a906347090c68564a5"}}, +{"id":"vigilante","key":"vigilante","value":{"rev":"30-951541a8b2fc2364bb1ccd7cfae56482"}}, +{"id":"villain","key":"villain","value":{"rev":"10-8dbfc5db42230d8813e6cc61af14d575"}}, +{"id":"vine","key":"vine","value":{"rev":"17-e7ac5d190cacf0f2d17d27e37b2b9f5f"}}, +{"id":"vipe","key":"vipe","value":{"rev":"3-78996531221e08292b9ca3de6e19d578"}}, +{"id":"viralheat","key":"viralheat","value":{"rev":"3-b928ce797fd5955c766b6b7e9e9c8f54"}}, +{"id":"viralheat-sentiment","key":"viralheat-sentiment","value":{"rev":"3-5d083e0d141ecf36e06c7c2885b01b5c"}}, +{"id":"virustotal.js","key":"virustotal.js","value":{"rev":"3-074be49f7e877b154a2144ef844f78e9"}}, +{"id":"vk","key":"vk","value":{"rev":"9-48f53ea9ebe68c9d3af45eb601c71006"}}, +{"id":"vmcjs","key":"vmcjs","value":{"rev":"5-44d8dd906fa3530d2bfc2dfee7f498d4"}}, +{"id":"vogue","key":"vogue","value":{"rev":"38-891354d18638a26d5b5ba95933faae0e"}}, +{"id":"vogue-dtrejo","key":"vogue-dtrejo","value":{"rev":"3-3ef8d57d3b5c0aca297fe38c9040954f"}}, +{"id":"votizen-logger","key":"votizen-logger","value":{"rev":"4-ba0837a28693aba346fab885a3a8f315"}}, +{"id":"vows","key":"vows","value":{"rev":"80-43d6a81c184c06d73e692358e913821e"}}, +{"id":"vows-bdd","key":"vows-bdd","value":{"rev":"3-dc2a7013dd94b0b65a3ed3a8b69b680e"}}, +{"id":"vows-ext","key":"vows-ext","value":{"rev":"49-079067a01a681ca7df4dfaae74adb3fb"}}, +{"id":"vows-fluent","key":"vows-fluent","value":{"rev":"23-67625a035cedf90c8fed73722465ecea"}}, +{"id":"vows-is","key":"vows-is","value":{"rev":"68-45a13df422d08ab00cc8f785b6411741"}}, +{"id":"voyeur","key":"voyeur","value":{"rev":"5-56fe23f95df6ff648b67f1a9baf10d41"}}, +{"id":"vws.pubsub","key":"vws.pubsub","value":{"rev":"5-609497d66ab6a76c5201904e41b95715"}}, +{"id":"wabtools","key":"wabtools","value":{"rev":"7-b24cd7262720a29f59da103b7110325d"}}, +{"id":"wadey-ranger","key":"wadey-ranger","value":{"rev":"17-a0541bad0880ffc199e8b2ef4c80ddb8"}}, +{"id":"wagner","key":"wagner","value":{"rev":"3-4b76219928f409b7124e02c0518d6cb6"}}, +{"id":"wait","key":"wait","value":{"rev":"3-7f8a5f9c8e86da4f219353ae778868a9"}}, +{"id":"waiter","key":"waiter","value":{"rev":"5-680176b06719c9a8499725b0a617cdc9"}}, +{"id":"waitlist","key":"waitlist","value":{"rev":"17-f3b2a4cf58b940c3839debda23c12b8e"}}, +{"id":"wake_on_lan","key":"wake_on_lan","value":{"rev":"6-1295bb5c618495b74626aaaa1c644d32"}}, +{"id":"walk","key":"walk","value":{"rev":"22-c05e1e1252a59b1048a0b6464631d08b"}}, +{"id":"walker","key":"walker","value":{"rev":"18-e8a20efc286234fb20789dc68cd04cd1"}}, +{"id":"warp","key":"warp","value":{"rev":"19-c7f17d40291984cd27f1d57fe764a5d2"}}, +{"id":"watch","key":"watch","value":{"rev":"18-3bc43d36ea1dbf69b93d4ea3d9534d44"}}, +{"id":"watch-less","key":"watch-less","value":{"rev":"5-f69a778ee58c681ad3b24a766576c016"}}, +{"id":"watch-tree","key":"watch-tree","value":{"rev":"5-316b60e474c3ae6e97f7cdb06b65af78"}}, +{"id":"watch.js","key":"watch.js","value":{"rev":"11-8c02c7429f90ca5e756a131d85bd5a32"}}, +{"id":"watch_dir","key":"watch_dir","value":{"rev":"5-df0a592508e1e13f5d24c2863733a8b9"}}, +{"id":"watchable","key":"watchable","value":{"rev":"3-f8694ff0c3add9a1310f0980e24ea23b"}}, +{"id":"watchersto","key":"watchersto","value":{"rev":"5-06665e682f58f61831d41d08b4ea12e7"}}, +{"id":"watchman","key":"watchman","value":{"rev":"11-956ad2175d0c5b52e82988a697474244"}}, +{"id":"watchn","key":"watchn","value":{"rev":"15-9685afa8b501f8cd7e068beed1264cfe"}}, +{"id":"wave","key":"wave","value":{"rev":"7-d13054ac592b3b4f81147b6bc7a91ea1"}}, +{"id":"wax","key":"wax","value":{"rev":"71-2e8877b0b6df27c1375dcd7f6bbdb4b7"}}, +{"id":"waz-storage-js","key":"waz-storage-js","value":{"rev":"15-1aaa07353c3d25f5794fa004a23c4dfa"}}, +{"id":"wd","key":"wd","value":{"rev":"19-20c4ee8b83057ece691f9669e288059e"}}, +{"id":"weak","key":"weak","value":{"rev":"3-b774b8be74f33c843df631aa07854104"}}, +{"id":"web","key":"web","value":{"rev":"3-c571dee306020f6f92c7a3150e8023b1"}}, +{"id":"webapp","key":"webapp","value":{"rev":"5-60525be5734cf1d02a77508e5f46bafa"}}, +{"id":"webfonts","key":"webfonts","value":{"rev":"5-d7be242801702fd1eb728385b8982107"}}, +{"id":"webgenjs","key":"webgenjs","value":{"rev":"3-ac6be47eedcbb2561babdb9495d60f29"}}, +{"id":"webgl","key":"webgl","value":{"rev":"18-21cd40f6c7e4943a2d858ed813d3c45d"}}, +{"id":"webhookit-comment","key":"webhookit-comment","value":{"rev":"5-1fbed3d75bf485433bdcac4fac625eab"}}, +{"id":"webhookit-ejs","key":"webhookit-ejs","value":{"rev":"5-9b76f543e9c0941d0245cb3bfd2cc64e"}}, +{"id":"webhookit-email","key":"webhookit-email","value":{"rev":"5-d472fde4f101d55d029a29777bbdb952"}}, +{"id":"webhookit-http","key":"webhookit-http","value":{"rev":"13-9f6f05cdb03f45a2227b9cd820565e63"}}, +{"id":"webhookit-jsonparse","key":"webhookit-jsonparse","value":{"rev":"3-6d49bf8a9849130d9bbc5b0d6fb0bf67"}}, +{"id":"webhookit-jsonpath","key":"webhookit-jsonpath","value":{"rev":"5-7acaf50267274584dca1cc5c1e77ce2e"}}, +{"id":"webhookit-objectbuilder","key":"webhookit-objectbuilder","value":{"rev":"5-e63fb26621929f3ab8d8519556116b30"}}, +{"id":"webhookit-soupselect","key":"webhookit-soupselect","value":{"rev":"9-726f2f4794437632032058bc81e6ee5d"}}, +{"id":"webhookit-xml2js","key":"webhookit-xml2js","value":{"rev":"3-ec959e474ecb3a163f2991767594a60e"}}, +{"id":"webhookit-yql","key":"webhookit-yql","value":{"rev":"9-c6ae87a8cc55d33901485ee7c3895ef8"}}, +{"id":"webify","key":"webify","value":{"rev":"3-86810874abf2274d1387ee748987b627"}}, +{"id":"webjs","key":"webjs","value":{"rev":"103-593a1e4e69d8db6284ecf4fce01b4668"}}, +{"id":"webmake","key":"webmake","value":{"rev":"13-f6588093a487212a151d1c00c26de7b4"}}, +{"id":"webmetrics","key":"webmetrics","value":{"rev":"3-44a428fd2ecb1b1bf50c33157750dd16"}}, +{"id":"webrepl","key":"webrepl","value":{"rev":"21-d6dcdbb59186092d9a0f1977c69394a5"}}, +{"id":"webservice","key":"webservice","value":{"rev":"18-05038f1cf997cff1ed81e783485680aa"}}, +{"id":"webshell","key":"webshell","value":{"rev":"3-05c431cf961a9dbaee1dfd95237e189a"}}, +{"id":"websocket","key":"websocket","value":{"rev":"33-7c20d55a88f187d7b398525824159f67"}}, +{"id":"websocket-client","key":"websocket-client","value":{"rev":"12-26a3530b9e6d465f472c791db01c9fc3"}}, +{"id":"websocket-protocol","key":"websocket-protocol","value":{"rev":"3-e52a8496f70686c289087149aee8b359"}}, +{"id":"websocket-server","key":"websocket-server","value":{"rev":"46-9f69e2f9408eb196b3a1aa990e5b5ac2"}}, +{"id":"websockets","key":"websockets","value":{"rev":"3-5535fcb4ae144909f021ee067eec7b2a"}}, +{"id":"webworker","key":"webworker","value":{"rev":"16-f7a4c758b176c6e464c93b6a9f79283b"}}, +{"id":"weibo","key":"weibo","value":{"rev":"21-8a50310389b2f43d8a7cb14e138eb122"}}, +{"id":"weld","key":"weld","value":{"rev":"7-16601ac41d79b3a01e4d2615035376ed"}}, +{"id":"whatlang","key":"whatlang","value":{"rev":"5-f7b10a0f8c3b6579c81d1d1222aeccd7"}}, +{"id":"wheat","key":"wheat","value":{"rev":"16-f6a97282f521edb7f2b0e5edc9577ce0"}}, +{"id":"which","key":"which","value":{"rev":"7-e5fdcb208715f2201d3911caf8a67042"}}, +{"id":"whiskers","key":"whiskers","value":{"rev":"9-2cfd73cebeaf8ce3cb1591e825380621"}}, +{"id":"whiskey","key":"whiskey","value":{"rev":"49-55367718b9067ff2bcb7fbb89327587b"}}, +{"id":"whisperjs","key":"whisperjs","value":{"rev":"19-e2182c72ea24b8c40e12b0c1027eb60d"}}, +{"id":"wikimapia","key":"wikimapia","value":{"rev":"11-8d1a314e8c827236e21e0aabc6e5efd9"}}, +{"id":"wikiminute","key":"wikiminute","value":{"rev":"11-d031a2c7d41bcecb52ac9c7bb5e75e8e"}}, +{"id":"wikiwym","key":"wikiwym","value":{"rev":"3-c0fd4c9b6b93b3a8b14021c2ebae5b0c"}}, +{"id":"wiky","key":"wiky","value":{"rev":"6-be49acce152652e9219a32da1dfd01ea"}}, +{"id":"wildfile","key":"wildfile","value":{"rev":"9-16a05032f890f07c72a5f48c3a6ffbc0"}}, +{"id":"willful.js","key":"willful.js","value":{"rev":"3-3bb957b0a5fc1b4b6c15bace7e8f5902"}}, +{"id":"wilson","key":"wilson","value":{"rev":"14-d4bf88484f1b1cf86b07f4b74f26991d"}}, +{"id":"window","key":"window","value":{"rev":"3-ea84e74fd5556ff662ff47f40522cfa2"}}, +{"id":"windshaft","key":"windshaft","value":{"rev":"21-1d31e4eb7482d15b97c919a4b051ea9c"}}, +{"id":"windtunnel","key":"windtunnel","value":{"rev":"5-0d2ef7faed1b221a3eaa581480adad64"}}, +{"id":"wingrr","key":"wingrr","value":{"rev":"9-a599fad3e0c74895aa266c61805b76cb"}}, +{"id":"wings","key":"wings","value":{"rev":"3-cfcfd262d905cd3be1d1bae82fafd9f0"}}, +{"id":"winston","key":"winston","value":{"rev":"111-13acba5a9ba6d4f19469acb4122d72ea"}}, +{"id":"winston-amqp","key":"winston-amqp","value":{"rev":"5-61408e1dde45f974a995dd27905b8831"}}, +{"id":"winston-mongodb","key":"winston-mongodb","value":{"rev":"9-ae755237a8faa8f5a0b92029c236691a"}}, +{"id":"winston-redis","key":"winston-redis","value":{"rev":"3-1fb861edc109ed5cbd735320124ba103"}}, +{"id":"winston-riak","key":"winston-riak","value":{"rev":"15-3f2923a73386524d851244ace1bece98"}}, +{"id":"winston-syslog","key":"winston-syslog","value":{"rev":"9-7f256bd63aebec19edea47f80de21dfd"}}, +{"id":"winstoon","key":"winstoon","value":{"rev":"9-d719ca7abfeeaa468d1b431c24836089"}}, +{"id":"wirez","key":"wirez","value":{"rev":"5-5c5d0768485ed11c2b80a8a6a3699c39"}}, +{"id":"wobot","key":"wobot","value":{"rev":"9-176ed86fd9d94a7e94efb782c7512533"}}, +{"id":"word-generator","key":"word-generator","value":{"rev":"5-a2c67f11474a8925eb67f04369ac068a"}}, +{"id":"wordnik","key":"wordnik","value":{"rev":"3-4e371fbf7063ced50bbe726079fda1ec"}}, +{"id":"wordpress-auth","key":"wordpress-auth","value":{"rev":"5-05eef01542e00a88418d2885efb4c9ad"}}, +{"id":"wordwrap","key":"wordwrap","value":{"rev":"5-a728ce2cdeab69b71d40fe7c1c41d7c1"}}, +{"id":"wordy","key":"wordy","value":{"rev":"3-bc220ca3dbd008aee932c551cfbdcc6b"}}, +{"id":"worker","key":"worker","value":{"rev":"6-3b03aa764c9fac66ec5c1773e9abc43b"}}, +{"id":"worker-pool","key":"worker-pool","value":{"rev":"3-e3550e704b48f5799a4cc02af7d27355"}}, +{"id":"workflow","key":"workflow","value":{"rev":"3-817c6c77cbb2f332ea9bdddf3b565c00"}}, +{"id":"workhorse","key":"workhorse","value":{"rev":"30-c39ae2ddd867a137073a289c1709f229"}}, +{"id":"world-db","key":"world-db","value":{"rev":"6-eaef1beb6abbebd3e903a28a7f46aa81"}}, +{"id":"worm","key":"worm","value":{"rev":"7-00db15dc9cfd48777cce32fb93e1df6b"}}, +{"id":"wormhole","key":"wormhole","value":{"rev":"37-21e2db062666040c477a7042fc2ffc9d"}}, +{"id":"wrap","key":"wrap","value":{"rev":"3-aded14c091b730813bd24d92cae45cd6"}}, +{"id":"wrench","key":"wrench","value":{"rev":"12-57d3da63e34e59e1f5d1b3bde471e31f"}}, +{"id":"wsclient","key":"wsclient","value":{"rev":"17-f962faf4f6c9d4eda9111e90b2d0735d"}}, +{"id":"wscomm","key":"wscomm","value":{"rev":"47-80affda45da523e57c87b8d43ef73ec9"}}, +{"id":"wsscraper","key":"wsscraper","value":{"rev":"3-94a84fe9b3df46b8d6ad4851e389dae1"}}, +{"id":"wu","key":"wu","value":{"rev":"4-f307d3a00e7a1212b7949bcb96161088"}}, +{"id":"wunderapi","key":"wunderapi","value":{"rev":"17-31e3b991e97931022992b97f9441b9af"}}, +{"id":"wurfl-client","key":"wurfl-client","value":{"rev":"3-a8c3e454d6d9c9b23b7290eb64866e80"}}, +{"id":"wwwdude","key":"wwwdude","value":{"rev":"19-eb8192461b8864af59740f9b44e168ca"}}, +{"id":"x","key":"x","value":{"rev":"9-10403358980aba239b7a9af78175589d"}}, +{"id":"x-core","key":"x-core","value":{"rev":"13-f04b063855da231539d1945a35802d9e"}}, +{"id":"x11","key":"x11","value":{"rev":"5-e5b1435c0aa29207c90fdeaa87570bb7"}}, +{"id":"xappy-async_testing","key":"xappy-async_testing","value":{"rev":"3-747c934540267492b0e6d3bb6d65964c"}}, +{"id":"xappy-pg","key":"xappy-pg","value":{"rev":"4-119e8f93af1e4976900441ec5e3bb0b9"}}, +{"id":"xcbjs","key":"xcbjs","value":{"rev":"3-095a693f9ac7b4e2c319f79d95eb3e95"}}, +{"id":"xemplar","key":"xemplar","value":{"rev":"9-2ccde68ffac8e66aa8013b98d82ff20c"}}, +{"id":"xfer","key":"xfer","value":{"rev":"3-c1875506ed132c6a2b5e7d7eaff9df14"}}, +{"id":"xjs","key":"xjs","value":{"rev":"11-05d5cd002298894ed582a9f5bff5a762"}}, +{"id":"xjst","key":"xjst","value":{"rev":"11-68774970fc7f413ff620fb0d50d8a1d9"}}, +{"id":"xkcdbot","key":"xkcdbot","value":{"rev":"3-7cc9affb442c9ae4c7a109a0b72c2600"}}, +{"id":"xml","key":"xml","value":{"rev":"12-0d1a69f11767de47bfc4a0fce566e36e"}}, +{"id":"xml-markup","key":"xml-markup","value":{"rev":"6-100a92d1f7fe9444e285365dce8203de"}}, +{"id":"xml-simple","key":"xml-simple","value":{"rev":"3-d60e388df5b65128a5e000381643dd31"}}, +{"id":"xml-stream","key":"xml-stream","value":{"rev":"13-44d6ee47e00c91735e908e69c5dffc6b"}}, +{"id":"xml2js","key":"xml2js","value":{"rev":"27-434297bcd9db7628c57fcc9bbbe2671e"}}, +{"id":"xml2js-expat","key":"xml2js-expat","value":{"rev":"15-a8c5c0ba64584d07ed94c0a14dc55fe8"}}, +{"id":"xml2json","key":"xml2json","value":{"rev":"17-fa740417285834be1aa4d95e1ed6d9b9"}}, +{"id":"xmlbuilder","key":"xmlbuilder","value":{"rev":"32-63e3be32dda07c6e998866cddd8a879e"}}, +{"id":"xmlhttprequest","key":"xmlhttprequest","value":{"rev":"9-570fba8bfd5b0958c258cee7309c4b54"}}, +{"id":"xmlrpc","key":"xmlrpc","value":{"rev":"15-ae062e34a965e7543d4fd7b6c3f29cb7"}}, +{"id":"xmpp-client","key":"xmpp-client","value":{"rev":"6-2d123b4666b5deda71f071295cfca793"}}, +{"id":"xmpp-muc","key":"xmpp-muc","value":{"rev":"6-d95b8bca67f406a281a27aa4d89f6f46"}}, +{"id":"xmpp-server","key":"xmpp-server","value":{"rev":"9-44374bc3398cc74f2a36ff973fa0d35f"}}, +{"id":"xp","key":"xp","value":{"rev":"7-781a5e1da74332f25c441f627cd0b4ea"}}, +{"id":"xregexp","key":"xregexp","value":{"rev":"3-c34025fdeb13c18389e737a4b3d4ddf7"}}, +{"id":"xsd","key":"xsd","value":{"rev":"5-566590ccb8923453175a3f1f3b6cbf24"}}, +{"id":"ya-csv","key":"ya-csv","value":{"rev":"28-d485b812914b3c3f5d7e9c4bcee0c3ea"}}, +{"id":"yabble","key":"yabble","value":{"rev":"5-5370a53003a122fe40a16ed2b0e5cead"}}, +{"id":"yaconfig","key":"yaconfig","value":{"rev":"3-f82a452260b010cc5128818741c46017"}}, +{"id":"yah","key":"yah","value":{"rev":"3-cfc0c10f85a9e3076247ca350077e90f"}}, +{"id":"yajet","key":"yajet","value":{"rev":"5-6f7f24335436c84081adf0bbb020b151"}}, +{"id":"yajl","key":"yajl","value":{"rev":"3-8ac011e5a00368aad8d58d95a64c7254"}}, +{"id":"yaml","key":"yaml","value":{"rev":"16-732e5cb6dc10eefeb7dae959e677fb5b"}}, +{"id":"yaml-config","key":"yaml-config","value":{"rev":"3-fb817000005d48526a106ecda5ac5435"}}, +{"id":"yamlish","key":"yamlish","value":{"rev":"3-604fb4f1de9d5aa5ed48432c7db4a8a1"}}, +{"id":"yamlparser","key":"yamlparser","value":{"rev":"13-130a82262c7f742c2a1e26fc58983503"}}, +{"id":"yammer-js","key":"yammer-js","value":{"rev":"3-16ec240ab0b26fa9f0513ada8c769c1f"}}, +{"id":"yanc","key":"yanc","value":{"rev":"15-33d713f0dee42efe8306e6b2a43fe336"}}, +{"id":"yanlibs","key":"yanlibs","value":{"rev":"3-e481217d43b9f79b80e22538eabadabc"}}, +{"id":"yanop","key":"yanop","value":{"rev":"5-6c407ce6f1c18b6bac37ad5945ff8fed"}}, +{"id":"yanx","key":"yanx","value":{"rev":"6-f4c4d255526eaa922baa498f37d38fe0"}}, +{"id":"yasession","key":"yasession","value":{"rev":"7-6e2598123d41b33535b88e99eb87828f"}}, +{"id":"yelp","key":"yelp","value":{"rev":"3-5c769f488a65addba313ff3b6256c365"}}, +{"id":"yeti","key":"yeti","value":{"rev":"50-65338f573ed8f799ec9b1c9bd2643e34"}}, +{"id":"youtube","key":"youtube","value":{"rev":"7-5020698499af8946e9578864a21f6ac5"}}, +{"id":"youtube-dl","key":"youtube-dl","value":{"rev":"76-a42f09b7bf87e7e6157d5d9835cca8a7"}}, +{"id":"youtube-js","key":"youtube-js","value":{"rev":"5-e2d798a185490ad98cb57c2641c4658e"}}, +{"id":"yproject","key":"yproject","value":{"rev":"7-70cb1624de9e8321c67f1f348dc80ff4"}}, +{"id":"yql","key":"yql","value":{"rev":"18-d19123b254abfb097648c4a242513fd3"}}, +{"id":"yubico","key":"yubico","value":{"rev":"9-0e2bd84479a68e1f12c89800a4049053"}}, +{"id":"yui-cli","key":"yui-cli","value":{"rev":"7-0186f7278da8734861109799b9123197"}}, +{"id":"yui-compressor","key":"yui-compressor","value":{"rev":"12-5804d78bb24bb2d3555ca2e28ecc6b70"}}, +{"id":"yui-repl","key":"yui-repl","value":{"rev":"25-9b202e835a46a07be931e6529a4ccb61"}}, +{"id":"yui3","key":"yui3","value":{"rev":"93-4decc441f19acf0ab5abd1a81e3cbb40"}}, +{"id":"yui3-2in3","key":"yui3-2in3","value":{"rev":"10-dc0429fe818aceeca80d075613c9547a"}}, +{"id":"yui3-bare","key":"yui3-bare","value":{"rev":"33-60779e2088efe782b437ecc053c01e2f"}}, +{"id":"yui3-base","key":"yui3-base","value":{"rev":"33-89017bb5dfde621fc7d179f2939e3d1b"}}, +{"id":"yui3-core","key":"yui3-core","value":{"rev":"17-3759fa0072e24f4bb29e22144cb3dda3"}}, +{"id":"yui3-gallery","key":"yui3-gallery","value":{"rev":"38-9ce6f7a60b2f815337767249d1827951"}}, +{"id":"yui3-mocha","key":"yui3-mocha","value":{"rev":"3-83ff9c42a37f63de0c132ce6cb1ad282"}}, +{"id":"yuitest","key":"yuitest","value":{"rev":"17-b5dd4ad4e82b6b310d7a6e9103570779"}}, +{"id":"zap","key":"zap","value":{"rev":"15-9b9b7c6badb0a9fd9d469934e9be12c0"}}, +{"id":"zappa","key":"zappa","value":{"rev":"26-d193767b488e778db41455924001b1fb"}}, +{"id":"zen","key":"zen","value":{"rev":"7-23a260d4379816a5c931c2e823bda1ae"}}, +{"id":"zeppelin","key":"zeppelin","value":{"rev":"7-9db2e313fe323749e259be91edcdee8e"}}, +{"id":"zeromq","key":"zeromq","value":{"rev":"24-7cb4cec19fb3a03871900ac3558fcbef"}}, +{"id":"zest","key":"zest","value":{"rev":"5-080a2a69a93d66fcaae0da7ddaa9ceab"}}, +{"id":"zest-js","key":"zest-js","value":{"rev":"5-541454063618fa3a9d6f44e0147ea622"}}, +{"id":"zip","key":"zip","value":{"rev":"11-443da314322b6a1a93b40a38124610f2"}}, +{"id":"zipfile","key":"zipfile","value":{"rev":"32-e846d29fc615e8fbc610f44653a1e085"}}, +{"id":"zipper","key":"zipper","value":{"rev":"5-cde0a4a7f03c139dcd779f3ede55bd0e"}}, +{"id":"zippy","key":"zippy","value":{"rev":"7-3906ca62dd8020e9673a7c229944bd3f"}}, +{"id":"zipwith","key":"zipwith","value":{"rev":"3-58c50c6220d6493047f8333c5db22cc9"}}, +{"id":"zlib","key":"zlib","value":{"rev":"27-e0443f2d9a0c9db31f86a6c5b9ba78ba"}}, +{"id":"zlib-sync","key":"zlib-sync","value":{"rev":"3-b17a39dd23b3455d35ffd862004ed677"}}, +{"id":"zlibcontext","key":"zlibcontext","value":{"rev":"11-1c0c6b34e87adab1b6d5ee60be6a608c"}}, +{"id":"zlibstream","key":"zlibstream","value":{"rev":"5-44e30d87de9aaaa975c64d8dcdcd1a94"}}, +{"id":"zmq","key":"zmq","value":{"rev":"7-eae5d939fcdb7be5edfb328aefeaba4e"}}, +{"id":"zo","key":"zo","value":{"rev":"5-956f084373731805e5871f4716049529"}}, +{"id":"zombie","key":"zombie","value":{"rev":"109-9eec325353a47bfcc32a94719bf147da"}}, +{"id":"zombie-https","key":"zombie-https","value":{"rev":"3-6aff25d319be319343882575acef4890"}}, +{"id":"zoneinfo","key":"zoneinfo","value":{"rev":"15-d95d2041324d961fe26a0217cf485511"}}, +{"id":"zookeeper","key":"zookeeper","value":{"rev":"11-5a5ed278a01e4b508ffa6e9a02059898"}}, +{"id":"zoom","key":"zoom","value":{"rev":"3-9d0277ad580d64c9a4d48a40d22976f0"}}, +{"id":"zsock","key":"zsock","value":{"rev":"16-4f975b91f0f9c2d2a2501e362401c368"}}, +{"id":"zutil","key":"zutil","value":{"rev":"9-3e7bc6520008b4fcd5ee6eb9e8e5adf5"}} +]} diff --git a/node_modules/JSONStream/test/fixtures/couch_sample.json b/node_modules/JSONStream/test/fixtures/couch_sample.json new file mode 100644 index 0000000..b154c86 --- /dev/null +++ b/node_modules/JSONStream/test/fixtures/couch_sample.json @@ -0,0 +1,18 @@ +{"total_rows":129,"offset":0,"rows":[ + { "id":"change1_0.6995461115147918" + , "key":"change1_0.6995461115147918" + , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} + , "doc":{ + "_id": "change1_0.6995461115147918" + , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} + }, + { "id":"change2_0.6995461115147918" + , "key":"change2_0.6995461115147918" + , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} + , "doc":{ + "_id":"change2_0.6995461115147918" + , "_rev":"1-13677d36b98c0c075145bb8975105153" + , "hello":2 + } + }, +]} diff --git a/node_modules/JSONStream/test/fixtures/depth.json b/node_modules/JSONStream/test/fixtures/depth.json new file mode 100644 index 0000000..9b4bfb9 --- /dev/null +++ b/node_modules/JSONStream/test/fixtures/depth.json @@ -0,0 +1,15 @@ +{ + "total": 5, + "docs": [ + { + "key": { + "value": 0, + "some": "property" + } + }, + {"value": [1]}, + {"value": {"a":2}}, + {"blbl": [{}, {"a":0, "b":1, "value":"3"}, 10]}, + {"value": 4} + ] +} diff --git a/node_modules/JSONStream/test/fixtures/error.json b/node_modules/JSONStream/test/fixtures/error.json new file mode 100644 index 0000000..9736f3e --- /dev/null +++ b/node_modules/JSONStream/test/fixtures/error.json @@ -0,0 +1 @@ +{"error": "error_code", "message": "this is an error message"} diff --git a/node_modules/JSONStream/test/fixtures/header_footer.json b/node_modules/JSONStream/test/fixtures/header_footer.json new file mode 100644 index 0000000..6e4694d --- /dev/null +++ b/node_modules/JSONStream/test/fixtures/header_footer.json @@ -0,0 +1,19 @@ +{"total_rows":129,"offset":0,"rows":[ + { "id":"change1_0.6995461115147918" + , "key":"change1_0.6995461115147918" + , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} + , "doc":{ + "_id": "change1_0.6995461115147918" + , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} + }, + { "id":"change2_0.6995461115147918" + , "key":"change2_0.6995461115147918" + , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} + , "doc":{ + "_id":"change2_0.6995461115147918" + , "_rev":"1-13677d36b98c0c075145bb8975105153" + , "hello":2 + } + } +], +"foo": {"bar": "baz"}} diff --git a/node_modules/JSONStream/test/fn.js b/node_modules/JSONStream/test/fn.js new file mode 100644 index 0000000..4acc672 --- /dev/null +++ b/node_modules/JSONStream/test/fn.js @@ -0,0 +1,39 @@ + + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is') + +function fn (s) { + return !isNaN(parseInt(s, 10)) +} + +var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse(['rows', fn]) + , called = 0 + , ended = false + , parsed = [] + +fs.createReadStream(file).pipe(parser) + +parser.on('data', function (data) { + called ++ + it.has({ + id: it.typeof('string'), + value: {rev: it.typeof('string')}, + key:it.typeof('string') + }) + parsed.push(data) +}) + +parser.on('end', function () { + ended = true +}) + +process.on('exit', function () { + it(called).equal(expected.rows.length) + it(parsed).deepEqual(expected.rows) + console.error('PASSED') +}) diff --git a/node_modules/JSONStream/test/gen.js b/node_modules/JSONStream/test/gen.js new file mode 100644 index 0000000..c233722 --- /dev/null +++ b/node_modules/JSONStream/test/gen.js @@ -0,0 +1,135 @@ +return // dont run this test for now since tape is weird and broken on 0.10 + +var fs = require('fs') +var JSONStream = require('../') +var file = process.argv[2] || '/tmp/JSONStream-test-large.json' +var size = Number(process.argv[3] || 100000) +var tape = require('tape') +// if (process.title !== 'browser') { + tape('out of mem', function (t) { + t.plan(1) + ////////////////////////////////////////////////////// + // Produces a random number between arg1 and arg2 + ////////////////////////////////////////////////////// + var randomNumber = function (min, max) { + var number = Math.floor(Math.random() * (max - min + 1) + min); + return number; + }; + + ////////////////////////////////////////////////////// + // Produces a random string of a length between arg1 and arg2 + ////////////////////////////////////////////////////// + var randomString = function (min, max) { + + // add several spaces to increase chanses of creating 'words' + var chars = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + var result = ''; + + var randomLength = randomNumber(min, max); + + for (var i = randomLength; i > 0; --i) { + result += chars[Math.round(Math.random() * (chars.length - 1))]; + } + return result; + }; + + ////////////////////////////////////////////////////// + // Produces a random JSON document, as a string + ////////////////////////////////////////////////////// + var randomJsonDoc = function () { + + var doc = { + "CrashOccurenceID": randomNumber(10000, 50000), + "CrashID": randomNumber(1000, 10000), + "SiteName": randomString(10, 25), + "MachineName": randomString(10, 25), + "Date": randomString(26, 26), + "ProcessDuration": randomString(18, 18), + "ThreadIdentityName": null, + "WindowsIdentityName": randomString(15, 40), + "OperatingSystemName": randomString(35, 65), + "DetailedExceptionInformation": randomString(100, 800) + }; + + doc = JSON.stringify(doc); + doc = doc.replace(/\,/g, ',\n'); // add new lines after each attribute + return doc; + }; + + ////////////////////////////////////////////////////// + // generates test data + ////////////////////////////////////////////////////// + var generateTestData = function (cb) { + + console.log('generating large data file...'); + + var stream = fs.createWriteStream(file, { + encoding: 'utf8' + }); + + var i = 0; + var max = size; + var writing = false + var split = ',\n'; + var doc = randomJsonDoc(); + stream.write('['); + + function write () { + if(writing) return + writing = true + while(++i < max) { + if(Math.random() < 0.001) + console.log('generate..', i + ' / ' + size) + if(!stream.write(doc + split)) { + writing = false + return stream.once('drain', write) + } + } + stream.write(doc + ']') + stream.end(); + console.log('END') + } + write() + stream.on('close', cb) + }; + + ////////////////////////////////////////////////////// + // Shows that parsing 100000 instances using JSONStream fails + // + // After several seconds, you will get this crash + // FATAL ERROR: JS Allocation failed - process out of memory + ////////////////////////////////////////////////////// + var testJSONStreamParse_causesOutOfMem = function (done) { + var items = 0 + console.log('parsing data files using JSONStream...'); + + var parser = JSONStream.parse([true]); + var stream = fs.createReadStream(file); + stream.pipe(parser); + + parser.on('data', function (data) { + items++ + if(Math.random() < 0.01) console.log(items, '...') + }); + + parser.on('end', function () { + t.equal(items, size) + }); + + }; + + ////////////////////////////////////////////////////// + // main + ////////////////////////////////////////////////////// + + fs.stat(file, function (err, stat) { + console.log(stat) + if(err) + generateTestData(testJSONStreamParse_causesOutOfMem); + else + testJSONStreamParse_causesOutOfMem() + }) + + }) + +// } diff --git a/node_modules/JSONStream/test/header_footer.js b/node_modules/JSONStream/test/header_footer.js new file mode 100644 index 0000000..f18fc59 --- /dev/null +++ b/node_modules/JSONStream/test/header_footer.js @@ -0,0 +1,55 @@ + + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','header_footer.json') + , JSONStream = require('../') + , it = require('it-is') + +var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/]) + , called = 0 + , headerCalled = 0 + , footerCalled = 0 + , ended = false + , parsed = [] + +fs.createReadStream(file).pipe(parser) + +parser.on('header', function (data) { + headerCalled ++ + it(data).deepEqual({ + total_rows: 129, + offset: 0 + }) +}) + +parser.on('footer', function (data) { + footerCalled ++ + it(data).deepEqual({ + foo: { bar: 'baz' } + }) +}) + +parser.on('data', function (data) { + called ++ + it.has({ + id: it.typeof('string'), + value: {rev: it.typeof('string')}, + key:it.typeof('string') + }) + it(headerCalled).equal(1) + parsed.push(data) +}) + +parser.on('end', function () { + ended = true +}) + +process.on('exit', function () { + it(called).equal(expected.rows.length) + it(headerCalled).equal(1) + it(footerCalled).equal(1) + it(parsed).deepEqual(expected.rows) + console.error('PASSED') +}) diff --git a/node_modules/JSONStream/test/issues.js b/node_modules/JSONStream/test/issues.js new file mode 100644 index 0000000..ea4c743 --- /dev/null +++ b/node_modules/JSONStream/test/issues.js @@ -0,0 +1,34 @@ +var JSONStream = require('../'); +var test = require('tape') + +test('#66', function (t) { + var error = 0; + var stream = JSONStream + .parse() + .on('error', function (err) { + t.ok(err); + error++; + }) + .on('end', function () { + t.ok(error === 1); + t.end(); + }); + + stream.write('["foo":bar['); + stream.end(); + +}); + +test('#81 - failure to parse nested objects', function (t) { + var stream = JSONStream + .parse('.bar.foo') + .on('error', function (err) { + t.error(err); + }) + .on('end', function () { + t.end(); + }); + + stream.write('{"bar":{"foo":"baz"}}'); + stream.end(); +}); diff --git a/node_modules/JSONStream/test/keys.js b/node_modules/JSONStream/test/keys.js new file mode 100644 index 0000000..747723d --- /dev/null +++ b/node_modules/JSONStream/test/keys.js @@ -0,0 +1,105 @@ +var test = require('tape'); +var fs = require ('fs'); +var join = require('path').join; +var couch_sample_file = join(__dirname, 'fixtures','couch_sample.json'); +var JSONStream = require('../'); + +var fixture = { + obj: { + one: 1, + two: 2, + three: 3 + } +}; + +function assertFixtureKeys(stream, t) { + var keys = []; + var values = []; + stream.on('data', function(data) { + keys.push(data.key); + values.push(data.value); + }); + + stream.on('end', function() { + t.deepEqual(keys, ['one', 'two', 'three']); + t.deepEqual(values, [1,2,3]); + t.end(); + }); + stream.write(JSON.stringify(fixture)); + stream.end(); +} + +test('keys via string', function(t) { + var stream = JSONStream.parse('obj.$*'); + assertFixtureKeys(stream, t); +}); + +test('keys via array', function(t) { + var stream = JSONStream.parse(['obj',{emitKey: true}]); + assertFixtureKeys(stream, t); +}); + +test('path via array', function(t) { + var stream = JSONStream.parse(['obj',{emitPath: true}]); + + var paths = []; + var values = []; + stream.on('data', function(data) { + console.log(JSON.stringify(data)); + paths.push(data.path); + values.push(data.value); + }); + + stream.on('end', function() { + t.deepEqual(paths, [['obj', 'one'], ['obj', 'two'], ['obj', 'three']]); + t.deepEqual(values, [1,2,3]); + t.end(); + }); + stream.write(JSON.stringify(fixture)); + stream.end(); +}); + +test('advanced keys', function(t) { + var advanced = fs.readFileSync(couch_sample_file); + var stream = JSONStream.parse(['rows', true, 'doc', {emitKey: true}]); + + var keys = []; + var values = []; + stream.on('data', function(data) { + keys.push(data.key); + values.push(data.value); + }); + + stream.on('end', function() { + t.deepEqual(keys, [ + '_id', '_rev', 'hello', + '_id', '_rev', 'hello' + ]); + t.deepEqual(values, [ + "change1_0.6995461115147918", "1-e240bae28c7bb3667f02760f6398d508", 1, + "change2_0.6995461115147918", "1-13677d36b98c0c075145bb8975105153", 2 + ]); + t.end(); + }); + stream.write(advanced); + stream.end(); +}); + +test('parent keys', function(t) { + var stream = JSONStream.parse('$*'); + var d = null; + stream.on('data', function(data) { + if(d) t.fail('should only be called once'); + d = data; + }); + + stream.on('end', function() { + t.deepEqual(d,{ + key: 'obj', + value: fixture.obj + }); + t.end(); + }); + stream.write(JSON.stringify(fixture)); + stream.end(); +}) diff --git a/node_modules/JSONStream/test/map.js b/node_modules/JSONStream/test/map.js new file mode 100644 index 0000000..29b9d89 --- /dev/null +++ b/node_modules/JSONStream/test/map.js @@ -0,0 +1,40 @@ + +var test = require('tape') + +var JSONStream = require('../') + +test('map function', function (t) { + + var actual = [] + + stream = JSONStream.parse([true], function (e) { return e*10 }) + stream.on('data', function (v) { actual.push(v)}) + stream.on('end', function () { + t.deepEqual(actual, [10,20,30,40,50,60]) + t.end() + + }) + + stream.write(JSON.stringify([1,2,3,4,5,6], null, 2)) + stream.end() + +}) + +test('filter function', function (t) { + + var actual = [] + + stream = JSONStream + .parse([true], function (e) { return e%2 ? e : null}) + .on('data', function (v) { actual.push(v)}) + .on('end', function () { + t.deepEqual(actual, [1,3,5]) + t.end() + + }) + + stream.write(JSON.stringify([1,2,3,4,5,6], null, 2)) + stream.end() + +}) + diff --git a/node_modules/JSONStream/test/multiple_objects.js b/node_modules/JSONStream/test/multiple_objects.js new file mode 100644 index 0000000..22f6324 --- /dev/null +++ b/node_modules/JSONStream/test/multiple_objects.js @@ -0,0 +1,36 @@ +var fs = require ('fs'); +var net = require('net'); +var join = require('path').join; +var file = join(__dirname, 'fixtures','all_npm.json'); +var it = require('it-is'); +var JSONStream = require('../'); + +var str = fs.readFileSync(file); + +var datas = {} + +var server = net.createServer(function(client) { + var data_calls = 0; + var parser = JSONStream.parse(['rows', true, 'key']); + parser.on('data', function(data) { + ++ data_calls; + datas[data] = (datas[data] || 0) + 1 + it(data).typeof('string') + }); + + parser.on('end', function() { + console.log('END') + var min = Infinity + for (var d in datas) + min = min > datas[d] ? datas[d] : min + it(min).equal(3); + server.close(); + }); + client.pipe(parser); +}); +server.listen(9999); + +var client = net.connect({ port : 9999 }, function() { + var msgs = str + ' ' + str + '\n\n' + str + client.end(msgs); +}); diff --git a/node_modules/JSONStream/test/multiple_objects_error.js b/node_modules/JSONStream/test/multiple_objects_error.js new file mode 100644 index 0000000..83d113b --- /dev/null +++ b/node_modules/JSONStream/test/multiple_objects_error.js @@ -0,0 +1,29 @@ +var fs = require ('fs'); +var net = require('net'); +var join = require('path').join; +var file = join(__dirname, 'fixtures','all_npm.json'); +var it = require('it-is'); +var JSONStream = require('../'); + +var str = fs.readFileSync(file); + +var server = net.createServer(function(client) { + var data_calls = 0; + var parser = JSONStream.parse(); + parser.on('error', function(err) { + console.log(err); + server.close(); + }); + + parser.on('end', function() { + console.log('END'); + server.close(); + }); + client.pipe(parser); +}); +server.listen(9999); + +var client = net.connect({ port : 9999 }, function() { + var msgs = str + '}'; + client.end(msgs); +}); diff --git a/node_modules/JSONStream/test/null.js b/node_modules/JSONStream/test/null.js new file mode 100644 index 0000000..95dd60c --- /dev/null +++ b/node_modules/JSONStream/test/null.js @@ -0,0 +1,28 @@ +var JSONStream = require('../') + +var data = [ + {ID: 1, optional: null}, + {ID: 2, optional: null}, + {ID: 3, optional: 20}, + {ID: 4, optional: null}, + {ID: 5, optional: 'hello'}, + {ID: 6, optional: null} +] + + +var test = require('tape') + +test ('null properties', function (t) { + var actual = [] + var stream = + + JSONStream.parse('*.optional') + .on('data', function (v) { actual.push(v) }) + .on('end', function () { + t.deepEqual(actual, [20, 'hello']) + t.end() + }) + + stream.write(JSON.stringify(data, null, 2)) + stream.end() +}) diff --git a/node_modules/JSONStream/test/parsejson.js b/node_modules/JSONStream/test/parsejson.js new file mode 100644 index 0000000..e70dabc --- /dev/null +++ b/node_modules/JSONStream/test/parsejson.js @@ -0,0 +1,29 @@ + + +/* + sometimes jsonparse changes numbers slightly. +*/ + +var r = Math.random() + , Parser = require('jsonparse') + , p = new Parser() + , assert = require('assert') + , times = 20 + , bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from + , str + +while (times --) { + + assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON') + + p.onValue = function (v) { + console.error('parsed', v) + assert.equal(v,r) + } + console.error('correct', r) + str = JSON.stringify([r]) + p.write (bufferFrom ? Buffer.from(str) : new Buffer(str)) + + + +} diff --git a/node_modules/JSONStream/test/run.js b/node_modules/JSONStream/test/run.js new file mode 100644 index 0000000..7d62e73 --- /dev/null +++ b/node_modules/JSONStream/test/run.js @@ -0,0 +1,13 @@ +var readdirSync = require('fs').readdirSync +var spawnSync = require('child_process').spawnSync +var extname = require('path').extname + +var files = readdirSync(__dirname) +files.forEach(function(file){ + if (extname(file) !== '.js' || file === 'run.js') + return + console.log(`*** ${file} ***`) + var result = spawnSync(process.argv0, [file], { stdio: 'inherit', cwd: __dirname} ) + if (result.status !== 0) + process.exit(result.status) +}) diff --git a/node_modules/JSONStream/test/stringify.js b/node_modules/JSONStream/test/stringify.js new file mode 100644 index 0000000..b6de85e --- /dev/null +++ b/node_modules/JSONStream/test/stringify.js @@ -0,0 +1,41 @@ + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is').style('colour') + + function randomObj () { + return ( + Math.random () < 0.4 + ? {hello: 'eonuhckmqjk', + whatever: 236515, + lies: true, + nothing: [null], + stuff: [Math.random(),Math.random(),Math.random()] + } + : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] + ) + } + +var expected = [] + , stringify = JSONStream.stringify() + , es = require('event-stream') + , stringified = '' + , called = 0 + , count = 10 + , ended = false + +while (count --) + expected.push(randomObj()) + + es.connect( + es.readArray(expected), + stringify, + //JSONStream.parse([/./]), + es.writeArray(function (err, lines) { + + it(JSON.parse(lines.join(''))).deepEqual(expected) + console.error('PASSED') + }) + ) diff --git a/node_modules/JSONStream/test/stringify_object.js b/node_modules/JSONStream/test/stringify_object.js new file mode 100644 index 0000000..9490115 --- /dev/null +++ b/node_modules/JSONStream/test/stringify_object.js @@ -0,0 +1,47 @@ + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is').style('colour') + , es = require('event-stream') + , pending = 10 + , passed = true + + function randomObj () { + return ( + Math.random () < 0.4 + ? {hello: 'eonuhckmqjk', + whatever: 236515, + lies: true, + nothing: [null], + stuff: [Math.random(),Math.random(),Math.random()] + } + : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] + ) + } + +for (var ix = 0; ix < pending; ix++) (function (count) { + var expected = {} + , stringify = JSONStream.stringifyObject() + + es.connect( + stringify, + es.writeArray(function (err, lines) { + it(JSON.parse(lines.join(''))).deepEqual(expected) + if (--pending === 0) { + console.error('PASSED') + } + }) + ) + + while (count --) { + var key = Math.random().toString(16).slice(2) + expected[key] = randomObj() + stringify.write([ key, expected[key] ]) + } + + process.nextTick(function () { + stringify.end() + }) +})(ix) diff --git a/node_modules/JSONStream/test/test.js b/node_modules/JSONStream/test/test.js new file mode 100644 index 0000000..8ea7c2e --- /dev/null +++ b/node_modules/JSONStream/test/test.js @@ -0,0 +1,35 @@ + + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is') + +var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/]) + , called = 0 + , ended = false + , parsed = [] + +fs.createReadStream(file).pipe(parser) + +parser.on('data', function (data) { + called ++ + it.has({ + id: it.typeof('string'), + value: {rev: it.typeof('string')}, + key:it.typeof('string') + }) + parsed.push(data) +}) + +parser.on('end', function () { + ended = true +}) + +process.on('exit', function () { + it(called).equal(expected.rows.length) + it(parsed).deepEqual(expected.rows) + console.error('PASSED') +}) diff --git a/node_modules/JSONStream/test/test2.js b/node_modules/JSONStream/test/test2.js new file mode 100644 index 0000000..d09df7b --- /dev/null +++ b/node_modules/JSONStream/test/test2.js @@ -0,0 +1,29 @@ + + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, '..','package.json') + , JSONStream = require('../') + , it = require('it-is') + +var expected = JSON.parse(fs.readFileSync(file)) + , parser = JSONStream.parse([]) + , called = 0 + , ended = false + , parsed = [] + +fs.createReadStream(file).pipe(parser) + +parser.on('data', function (data) { + called ++ + it(data).deepEqual(expected) +}) + +parser.on('end', function () { + ended = true +}) + +process.on('exit', function () { + it(called).equal(1) + console.error('PASSED') +}) \ No newline at end of file diff --git a/node_modules/JSONStream/test/two-ways.js b/node_modules/JSONStream/test/two-ways.js new file mode 100644 index 0000000..8f3b89c --- /dev/null +++ b/node_modules/JSONStream/test/two-ways.js @@ -0,0 +1,41 @@ + +var fs = require ('fs') + , join = require('path').join + , file = join(__dirname, 'fixtures','all_npm.json') + , JSONStream = require('../') + , it = require('it-is').style('colour') + + function randomObj () { + return ( + Math.random () < 0.4 + ? {hello: 'eonuhckmqjk', + whatever: 236515, + lies: true, + nothing: [null], +// stuff: [Math.random(),Math.random(),Math.random()] + } + : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] + ) + } + +var expected = [] + , stringify = JSONStream.stringify() + , es = require('event-stream') + , stringified = '' + , called = 0 + , count = 10 + , ended = false + +while (count --) + expected.push(randomObj()) + + es.connect( + es.readArray(expected), + stringify, + JSONStream.parse([/./]), + es.writeArray(function (err, lines) { + + it(lines).has(expected) + console.error('PASSED') + }) + ) diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md new file mode 100644 index 0000000..cb5990c --- /dev/null +++ b/node_modules/accepts/HISTORY.md @@ -0,0 +1,243 @@ +1.3.8 / 2022-02-02 +================== + + * deps: mime-types@~2.1.34 + - deps: mime-db@~1.51.0 + * deps: negotiator@0.6.3 + +1.3.7 / 2019-04-29 +================== + + * deps: negotiator@0.6.2 + - Fix sorting charset, encoding, and language with extra parameters + +1.3.6 / 2019-04-28 +================== + + * deps: mime-types@~2.1.24 + - deps: mime-db@~1.40.0 + +1.3.5 / 2018-02-28 +================== + + * deps: mime-types@~2.1.18 + - deps: mime-db@~1.33.0 + +1.3.4 / 2017-08-22 +================== + + * deps: mime-types@~2.1.16 + - deps: mime-db@~1.29.0 + +1.3.3 / 2016-05-02 +================== + + * deps: mime-types@~2.1.11 + - deps: mime-db@~1.23.0 + * deps: negotiator@0.6.1 + - perf: improve `Accept` parsing speed + - perf: improve `Accept-Charset` parsing speed + - perf: improve `Accept-Encoding` parsing speed + - perf: improve `Accept-Language` parsing speed + +1.3.2 / 2016-03-08 +================== + + * deps: mime-types@~2.1.10 + - Fix extension of `application/dash+xml` + - Update primary extension for `audio/mp4` + - deps: mime-db@~1.22.0 + +1.3.1 / 2016-01-19 +================== + + * deps: mime-types@~2.1.9 + - deps: mime-db@~1.21.0 + +1.3.0 / 2015-09-29 +================== + + * deps: mime-types@~2.1.7 + - deps: mime-db@~1.19.0 + * deps: negotiator@0.6.0 + - Fix including type extensions in parameters in `Accept` parsing + - Fix parsing `Accept` parameters with quoted equals + - Fix parsing `Accept` parameters with quoted semicolons + - Lazy-load modules from main entry point + - perf: delay type concatenation until needed + - perf: enable strict mode + - perf: hoist regular expressions + - perf: remove closures getting spec properties + - perf: remove a closure from media type parsing + - perf: remove property delete from media type parsing + +1.2.13 / 2015-09-06 +=================== + + * deps: mime-types@~2.1.6 + - deps: mime-db@~1.18.0 + +1.2.12 / 2015-07-30 +=================== + + * deps: mime-types@~2.1.4 + - deps: mime-db@~1.16.0 + +1.2.11 / 2015-07-16 +=================== + + * deps: mime-types@~2.1.3 + - deps: mime-db@~1.15.0 + +1.2.10 / 2015-07-01 +=================== + + * deps: mime-types@~2.1.2 + - deps: mime-db@~1.14.0 + +1.2.9 / 2015-06-08 +================== + + * deps: mime-types@~2.1.1 + - perf: fix deopt during mapping + +1.2.8 / 2015-06-07 +================== + + * deps: mime-types@~2.1.0 + - deps: mime-db@~1.13.0 + * perf: avoid argument reassignment & argument slice + * perf: avoid negotiator recursive construction + * perf: enable strict mode + * perf: remove unnecessary bitwise operator + +1.2.7 / 2015-05-10 +================== + + * deps: negotiator@0.5.3 + - Fix media type parameter matching to be case-insensitive + +1.2.6 / 2015-05-07 +================== + + * deps: mime-types@~2.0.11 + - deps: mime-db@~1.9.1 + * deps: negotiator@0.5.2 + - Fix comparing media types with quoted values + - Fix splitting media types with quoted commas + +1.2.5 / 2015-03-13 +================== + + * deps: mime-types@~2.0.10 + - deps: mime-db@~1.8.0 + +1.2.4 / 2015-02-14 +================== + + * Support Node.js 0.6 + * deps: mime-types@~2.0.9 + - deps: mime-db@~1.7.0 + * deps: negotiator@0.5.1 + - Fix preference sorting to be stable for long acceptable lists + +1.2.3 / 2015-01-31 +================== + + * deps: mime-types@~2.0.8 + - deps: mime-db@~1.6.0 + +1.2.2 / 2014-12-30 +================== + + * deps: mime-types@~2.0.7 + - deps: mime-db@~1.5.0 + +1.2.1 / 2014-12-30 +================== + + * deps: mime-types@~2.0.5 + - deps: mime-db@~1.3.1 + +1.2.0 / 2014-12-19 +================== + + * deps: negotiator@0.5.0 + - Fix list return order when large accepted list + - Fix missing identity encoding when q=0 exists + - Remove dynamic building of Negotiator class + +1.1.4 / 2014-12-10 +================== + + * deps: mime-types@~2.0.4 + - deps: mime-db@~1.3.0 + +1.1.3 / 2014-11-09 +================== + + * deps: mime-types@~2.0.3 + - deps: mime-db@~1.2.0 + +1.1.2 / 2014-10-14 +================== + + * deps: negotiator@0.4.9 + - Fix error when media type has invalid parameter + +1.1.1 / 2014-09-28 +================== + + * deps: mime-types@~2.0.2 + - deps: mime-db@~1.1.0 + * deps: negotiator@0.4.8 + - Fix all negotiations to be case-insensitive + - Stable sort preferences of same quality according to client order + +1.1.0 / 2014-09-02 +================== + + * update `mime-types` + +1.0.7 / 2014-07-04 +================== + + * Fix wrong type returned from `type` when match after unknown extension + +1.0.6 / 2014-06-24 +================== + + * deps: negotiator@0.4.7 + +1.0.5 / 2014-06-20 +================== + + * fix crash when unknown extension given + +1.0.4 / 2014-06-19 +================== + + * use `mime-types` + +1.0.3 / 2014-06-11 +================== + + * deps: negotiator@0.4.6 + - Order by specificity when quality is the same + +1.0.2 / 2014-05-29 +================== + + * Fix interpretation when header not in request + * deps: pin negotiator@0.4.5 + +1.0.1 / 2014-01-18 +================== + + * Identity encoding isn't always acceptable + * deps: negotiator@~0.4.0 + +1.0.0 / 2013-12-27 +================== + + * Genesis diff --git a/node_modules/accepts/LICENSE b/node_modules/accepts/LICENSE new file mode 100644 index 0000000..0616607 --- /dev/null +++ b/node_modules/accepts/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/accepts/README.md b/node_modules/accepts/README.md new file mode 100644 index 0000000..82680c5 --- /dev/null +++ b/node_modules/accepts/README.md @@ -0,0 +1,140 @@ +# accepts + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). +Extracted from [koa](https://www.npmjs.com/package/koa) for general use. + +In addition to negotiator, it allows: + +- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` + as well as `('text/html', 'application/json')`. +- Allows type shorthands such as `json`. +- Returns `false` when no types match +- Treats non-existent headers as `*` + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install accepts +``` + +## API + +```js +var accepts = require('accepts') +``` + +### accepts(req) + +Create a new `Accepts` object for the given `req`. + +#### .charset(charsets) + +Return the first accepted charset. If nothing in `charsets` is accepted, +then `false` is returned. + +#### .charsets() + +Return the charsets that the request accepts, in the order of the client's +preference (most preferred first). + +#### .encoding(encodings) + +Return the first accepted encoding. If nothing in `encodings` is accepted, +then `false` is returned. + +#### .encodings() + +Return the encodings that the request accepts, in the order of the client's +preference (most preferred first). + +#### .language(languages) + +Return the first accepted language. If nothing in `languages` is accepted, +then `false` is returned. + +#### .languages() + +Return the languages that the request accepts, in the order of the client's +preference (most preferred first). + +#### .type(types) + +Return the first accepted type (and it is returned as the same text as what +appears in the `types` array). If nothing in `types` is accepted, then `false` +is returned. + +The `types` array can contain full MIME types or file extensions. Any value +that is not a full MIME types is passed to `require('mime-types').lookup`. + +#### .types() + +Return the types that the request accepts, in the order of the client's +preference (most preferred first). + +## Examples + +### Simple type negotiation + +This simple example shows how to use `accepts` to return a different typed +respond body based on what the client wants to accept. The server lists it's +preferences in order and will get back the best match between the client and +server. + +```js +var accepts = require('accepts') +var http = require('http') + +function app (req, res) { + var accept = accepts(req) + + // the order of this list is significant; should be server preferred order + switch (accept.type(['json', 'html'])) { + case 'json': + res.setHeader('Content-Type', 'application/json') + res.write('{"hello":"world!"}') + break + case 'html': + res.setHeader('Content-Type', 'text/html') + res.write('hello, world!') + break + default: + // the fallback is text/plain, so no need to specify it above + res.setHeader('Content-Type', 'text/plain') + res.write('hello, world!') + break + } + + res.end() +} + +http.createServer(app).listen(3000) +``` + +You can test this out with the cURL program: +```sh +curl -I -H'Accept: text/html' http://localhost:3000/ +``` + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master +[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master +[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml +[node-version-image]: https://badgen.net/npm/node/accepts +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/accepts +[npm-url]: https://npmjs.org/package/accepts +[npm-version-image]: https://badgen.net/npm/v/accepts diff --git a/node_modules/accepts/index.js b/node_modules/accepts/index.js new file mode 100644 index 0000000..e9b2f63 --- /dev/null +++ b/node_modules/accepts/index.js @@ -0,0 +1,238 @@ +/*! + * accepts + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var Negotiator = require('negotiator') +var mime = require('mime-types') + +/** + * Module exports. + * @public + */ + +module.exports = Accepts + +/** + * Create a new Accepts object for the given req. + * + * @param {object} req + * @public + */ + +function Accepts (req) { + if (!(this instanceof Accepts)) { + return new Accepts(req) + } + + this.headers = req.headers + this.negotiator = new Negotiator(req) +} + +/** + * Check if the given `type(s)` is acceptable, returning + * the best match when true, otherwise `undefined`, in which + * case you should respond with 406 "Not Acceptable". + * + * The `type` value may be a single mime type string + * such as "application/json", the extension name + * such as "json" or an array `["json", "html", "text/plain"]`. When a list + * or array is given the _best_ match, if any is returned. + * + * Examples: + * + * // Accept: text/html + * this.types('html'); + * // => "html" + * + * // Accept: text/*, application/json + * this.types('html'); + * // => "html" + * this.types('text/html'); + * // => "text/html" + * this.types('json', 'text'); + * // => "json" + * this.types('application/json'); + * // => "application/json" + * + * // Accept: text/*, application/json + * this.types('image/png'); + * this.types('png'); + * // => undefined + * + * // Accept: text/*;q=.5, application/json + * this.types(['html', 'json']); + * this.types('html', 'json'); + * // => "json" + * + * @param {String|Array} types... + * @return {String|Array|Boolean} + * @public + */ + +Accepts.prototype.type = +Accepts.prototype.types = function (types_) { + var types = types_ + + // support flattened arguments + if (types && !Array.isArray(types)) { + types = new Array(arguments.length) + for (var i = 0; i < types.length; i++) { + types[i] = arguments[i] + } + } + + // no types, return all requested types + if (!types || types.length === 0) { + return this.negotiator.mediaTypes() + } + + // no accept header, return first given type + if (!this.headers.accept) { + return types[0] + } + + var mimes = types.map(extToMime) + var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) + var first = accepts[0] + + return first + ? types[mimes.indexOf(first)] + : false +} + +/** + * Return accepted encodings or best fit based on `encodings`. + * + * Given `Accept-Encoding: gzip, deflate` + * an array sorted by quality is returned: + * + * ['gzip', 'deflate'] + * + * @param {String|Array} encodings... + * @return {String|Array} + * @public + */ + +Accepts.prototype.encoding = +Accepts.prototype.encodings = function (encodings_) { + var encodings = encodings_ + + // support flattened arguments + if (encodings && !Array.isArray(encodings)) { + encodings = new Array(arguments.length) + for (var i = 0; i < encodings.length; i++) { + encodings[i] = arguments[i] + } + } + + // no encodings, return all requested encodings + if (!encodings || encodings.length === 0) { + return this.negotiator.encodings() + } + + return this.negotiator.encodings(encodings)[0] || false +} + +/** + * Return accepted charsets or best fit based on `charsets`. + * + * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` + * an array sorted by quality is returned: + * + * ['utf-8', 'utf-7', 'iso-8859-1'] + * + * @param {String|Array} charsets... + * @return {String|Array} + * @public + */ + +Accepts.prototype.charset = +Accepts.prototype.charsets = function (charsets_) { + var charsets = charsets_ + + // support flattened arguments + if (charsets && !Array.isArray(charsets)) { + charsets = new Array(arguments.length) + for (var i = 0; i < charsets.length; i++) { + charsets[i] = arguments[i] + } + } + + // no charsets, return all requested charsets + if (!charsets || charsets.length === 0) { + return this.negotiator.charsets() + } + + return this.negotiator.charsets(charsets)[0] || false +} + +/** + * Return accepted languages or best fit based on `langs`. + * + * Given `Accept-Language: en;q=0.8, es, pt` + * an array sorted by quality is returned: + * + * ['es', 'pt', 'en'] + * + * @param {String|Array} langs... + * @return {Array|String} + * @public + */ + +Accepts.prototype.lang = +Accepts.prototype.langs = +Accepts.prototype.language = +Accepts.prototype.languages = function (languages_) { + var languages = languages_ + + // support flattened arguments + if (languages && !Array.isArray(languages)) { + languages = new Array(arguments.length) + for (var i = 0; i < languages.length; i++) { + languages[i] = arguments[i] + } + } + + // no languages, return all requested languages + if (!languages || languages.length === 0) { + return this.negotiator.languages() + } + + return this.negotiator.languages(languages)[0] || false +} + +/** + * Convert extnames to mime. + * + * @param {String} type + * @return {String} + * @private + */ + +function extToMime (type) { + return type.indexOf('/') === -1 + ? mime.lookup(type) + : type +} + +/** + * Check if mime is valid. + * + * @param {String} type + * @return {String} + * @private + */ + +function validMime (type) { + return typeof type === 'string' +} diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json new file mode 100644 index 0000000..0f2d15d --- /dev/null +++ b/node_modules/accepts/package.json @@ -0,0 +1,47 @@ +{ + "name": "accepts", + "description": "Higher-level content negotiation", + "version": "1.3.8", + "contributors": [ + "Douglas Christopher Wilson ", + "Jonathan Ong (http://jongleberry.com)" + ], + "license": "MIT", + "repository": "jshttp/accepts", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "devDependencies": { + "deep-equal": "1.0.1", + "eslint": "7.32.0", + "eslint-config-standard": "14.1.1", + "eslint-plugin-import": "2.25.4", + "eslint-plugin-markdown": "2.2.1", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-promise": "4.3.1", + "eslint-plugin-standard": "4.1.0", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "files": [ + "LICENSE", + "HISTORY.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + }, + "keywords": [ + "content", + "negotiation", + "accept", + "accepts" + ] +} diff --git a/node_modules/acorn-node/.travis.yml b/node_modules/acorn-node/.travis.yml new file mode 100644 index 0000000..24123d4 --- /dev/null +++ b/node_modules/acorn-node/.travis.yml @@ -0,0 +1,22 @@ +language: node_js +node_js: + - '12' + - '11' + - '10' + - '9' + - '8' + - '6' + - '4' + - '0.12' + - '0.10' + - '0.8' + - '0.6' +before_install: + - 'nvm install-latest-npm' +install: + - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;' +sudo: false +matrix: + fast_finish: true + allow_failures: + - node_js: "0.6" diff --git a/node_modules/acorn-node/CHANGELOG.md b/node_modules/acorn-node/CHANGELOG.md new file mode 100644 index 0000000..ce2c779 --- /dev/null +++ b/node_modules/acorn-node/CHANGELOG.md @@ -0,0 +1,94 @@ +# acorn-node change log + +All notable changes to this project will be documented in this file. + +This project adheres to [Semantic Versioning](http://semver.org/). + +## 1.8.2 + * Revert a breaking change in import.meta parsing. + +## 1.8.1 + * Fix crash in compiled private-class-elements code. + +## 1.8.0 + * Upgrade acorn to v7. + + For backwards compatibility, `acorn-node` still uses the `Import` node type for dynamic imports, _NOT_ `ImportExpression` like acorn v7 and estree. + * Add numeric separator support: + ```js + var a = 10_000_000_000_000_000_000_000_000n; + ``` + +## 1.7.0 + * Add class instance fields support: + ```js + class X { + pub = 1; + #priv = 2; + } + ``` + * Add class static fields support: + ```js + class X { + static pub = 1; + static #priv = 2; + } + ``` + * Add `export * as ns` support when `sourceType` is 'module': + ```js + export * as ns from './ns.mjs'; + ``` + +## 1.6.2 + + * Allow dynamic `import()` in scripts. + * Update minimum dependency versions, fixing a peerDependency warning. + * Add Node 10 and 11 to CI. + +## 1.6.1 + + * Update acorn-dynamic-import to v4. + +## 1.6.0 + + * Upgrade acorn to v6. + * Add bigint support. + +## 1.5.2 + + * Upgrade acorn to support optional catch binding in the AST walker. + +## 1.5.1 + + * Fix tests on Node <= 0.12. + +## 1.5.0 + + * Add tests for async iteration, optional catch binding, import.meta, + dynamic import, bigint (currently unsupported). + * Add import.meta support. (`sourceType: 'module'` only) + * Add dynamic import support. (`sourceType: 'module'` only) + * Fix optional catch binding support in the walker. + +## 1.4.0 + + * Upgrade acorn to 5.6, which supports optional catch bindings and other + new syntax features. + * Set ecmaVersion to 2019 to opt in to optional catch bindings etc. + +## 1.3.0 + + * Upgrade acorn to 5.4, which supports object spread and async iteration. + * Remove acorn5-object-spread plugin. + +## 1.2.0 + + * Expose `acorn/dist/walk` as `acorn-node/walk`. + +## 1.1.0 + + * Enable `allowHashBang` and `allowReturnOutsideFunction` by default. + +## 1.0.0 + + * Initial release. diff --git a/node_modules/acorn-node/LICENSE.md b/node_modules/acorn-node/LICENSE.md new file mode 100644 index 0000000..3698cf1 --- /dev/null +++ b/node_modules/acorn-node/LICENSE.md @@ -0,0 +1,95 @@ +# [Apache License 2.0](https://spdx.org/licenses/Apache-2.0) + +Copyright 2018 Renée Kooi + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +> http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +## acorn-bigint + +The code in the `lib/bigint` folder is compiled from code licensed as MIT: + +> Copyright (C) 2017-2018 by Adrian Heine +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +Find the source code at https://github.com/acornjs/acorn-bigint. + +## acorn-import-meta + +The code in the `lib/import-meta` folder is compiled from code licensed as MIT: + +> Copyright (C) 2017-2018 by Adrian Heine +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. + +Find the source code at https://github.com/acornjs/acorn-import-meta. + +## acorn-dynamic-import + +The code in the `lib/dynamic-import` folder is licensed as MIT: + +> MIT License +> +> Copyright (c) 2016 Jordan Gensler +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +Find the source code at https://github.com/kesne/acorn-dynamic-import. diff --git a/node_modules/acorn-node/README.md b/node_modules/acorn-node/README.md new file mode 100644 index 0000000..37e871f --- /dev/null +++ b/node_modules/acorn-node/README.md @@ -0,0 +1,65 @@ +# acorn-node + +[Acorn](https://github.com/acornjs/acorn) preloaded with plugins for syntax parity with recent Node versions. + +It also includes versions of the plugins compiled with [Bublé](https://github.com/rich-harris/buble), so they can be run on old Node versions (0.6 and up). + +[![npm][npm-image]][npm-url] +[![travis][travis-image]][travis-url] +[![standard][standard-image]][standard-url] + +[npm-image]: https://img.shields.io/npm/v/acorn-node.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/acorn-node +[travis-image]: https://img.shields.io/travis/browserify/acorn-node/master.svg?style=flat-square +[travis-url]: https://travis-ci.org/browserify/acorn-node +[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square +[standard-url]: http://npm.im/standard + +## Install + +``` +npm install acorn-node +``` + +## Usage + +```js +var acorn = require('acorn-node') +``` + +The API is the same as [acorn](https://github.com/acornjs/acorn), but the following syntax features are enabled by default: + + - Bigint syntax `10n` + - Numeric separators syntax `10_000` + - Public and private class instance fields + - Public and private class static fields + - Dynamic `import()` + - The `import.meta` property + - `export * as ns from` syntax + +And the following options have different defaults from acorn, to match Node modules: + + - `ecmaVersion: 2019` + - `allowHashBang: true` + - `allowReturnOutsideFunction: true` + +```js +var walk = require('acorn-node/walk') +``` + +The Acorn syntax tree walker. Comes preconfigured for the syntax plugins if necessary. +See the [acorn documentation](https://github.com/acornjs/acorn#distwalkjs) for details. + +## License + +The files in the repo root and the ./test folder are licensed as [Apache-2.0](LICENSE.md). + +The files in lib/ are generated from other packages: + +- lib/bigint: [acorn-bigint](https://github.com/acornjs/acorn-bigint]), MIT +- lib/class-private-elements: [acorn-class-private-elements](https://github.com/acornjs/acorn-class-private-elements), MIT +- lib/dynamic-import: [acorn-dynamic-import](https://github.com/acornjs/acorn-dynamic-import), MIT +- lib/export-ns-from: [acorn-export-ns-from](https://github.com/acornjs/acorn-export-ns-from), MIT +- lib/import-meta: [acorn-import-meta](https://github.com/acornjs/acorn-import-meta), MIT +- lib/numeric-separator: [acorn-numeric-separator](https://github.com/acornjs/acorn-numeric-separator]), MIT +- lib/static-class-features: [acorn-static-class-features](https://github.com/acornjs/acorn-static-class-features), MIT diff --git a/node_modules/acorn-node/build.js b/node_modules/acorn-node/build.js new file mode 100644 index 0000000..ca08f35 --- /dev/null +++ b/node_modules/acorn-node/build.js @@ -0,0 +1,36 @@ +var fs = require('fs') +var path = require('path') +var mkdirp = require('mkdirp') +var buble = require('buble') + +var HEADER = '/* Generated by `npm run build`, do not edit! */\n\n' + +function compile (name, output, fix) { + console.log(name, '→', output) + mkdirp.sync(path.dirname(path.join(__dirname, output))) + var source = fs.readFileSync(require.resolve(name), 'utf8') + if (fix) source = fix(source) + var result = buble.transform(source, { + transforms: { + dangerousForOf: true + } + }) + fs.writeFileSync(path.join(__dirname, output), HEADER + result.code, 'utf8') +} + +function privateClassElements (str) { + return str.replace('acorn-private-class-elements', '../private-class-elements') +} + +compile('acorn-bigint', './lib/bigint/index.js') +compile('acorn-numeric-separator', './lib/numeric-separator/index.js') +compile('acorn-dynamic-import', './lib/dynamic-import/index.js') +compile('acorn-import-meta', './lib/import-meta/index.js') +compile('acorn-export-ns-from', './lib/export-ns-from/index.js') +compile('acorn-class-fields', './lib/class-fields/index.js', privateClassElements) +compile('acorn-static-class-features', './lib/static-class-features/index.js', privateClassElements) +compile('acorn-private-class-elements', './lib/private-class-elements/index.js', function (str) { + return str.replace('class extends Parser', 'class Parser_ extends Parser') + // it also works with v7 + .replace('if (acorn.version.indexOf("6.") != 0 || acorn.version.indexOf("6.0.") == 0) {', 'if (false) {') +}) diff --git a/node_modules/acorn-node/index.js b/node_modules/acorn-node/index.js new file mode 100644 index 0000000..c0ec3bf --- /dev/null +++ b/node_modules/acorn-node/index.js @@ -0,0 +1,38 @@ +var acorn = require('acorn') +var xtend = require('xtend') + +var CJSParser = acorn.Parser + .extend(require('./lib/bigint')) + .extend(require('./lib/class-fields')) + .extend(require('./lib/static-class-features')) + .extend(require('./lib/numeric-separator')) + .extend(require('./lib/dynamic-import').default) +var ESModulesParser = CJSParser + .extend(require('./lib/export-ns-from')) + .extend(require('./lib/import-meta')) + +function mapOptions (opts) { + if (!opts) opts = {} + return xtend({ + ecmaVersion: 2020, + allowHashBang: true, + allowReturnOutsideFunction: true + }, opts) +} + +function getParser (opts) { + if (!opts) opts = {} + return opts.sourceType === 'module' ? ESModulesParser : CJSParser +} + +module.exports = exports = xtend(acorn, { + parse: function parse (src, opts) { + return getParser(opts).parse(src, mapOptions(opts)) + }, + parseExpressionAt: function parseExpressionAt (src, offset, opts) { + return getParser(opts).parseExpressionAt(src, offset, mapOptions(opts)) + }, + tokenizer: function tokenizer (src, opts) { + return getParser(opts).tokenizer(src, mapOptions(opts)) + } +}) diff --git a/node_modules/acorn-node/lib/bigint/index.js b/node_modules/acorn-node/lib/bigint/index.js new file mode 100644 index 0000000..40f6a9f --- /dev/null +++ b/node_modules/acorn-node/lib/bigint/index.js @@ -0,0 +1,71 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +var acorn = require("acorn") +var tt = acorn.tokTypes +var isIdentifierStart = acorn.isIdentifierStart + +module.exports = function(Parser) { + return /*@__PURE__*/(function (Parser) { + function anonymous () { + Parser.apply(this, arguments); + } + + if ( Parser ) anonymous.__proto__ = Parser; + anonymous.prototype = Object.create( Parser && Parser.prototype ); + anonymous.prototype.constructor = anonymous; + + anonymous.prototype.parseLiteral = function parseLiteral (value) { + var node = Parser.prototype.parseLiteral.call(this, value) + if (node.raw.charCodeAt(node.raw.length - 1) == 110) { node.bigint = this.getNumberInput(node.start, node.end) } + return node + }; + + anonymous.prototype.readRadixNumber = function readRadixNumber (radix) { + var start = this.pos + this.pos += 2 // 0x + var val = this.readInt(radix) + if (val === null) { this.raise(this.start + 2, ("Expected number in radix " + radix)) } + if (this.input.charCodeAt(this.pos) == 110) { + var str = this.getNumberInput(start, this.pos) + val = typeof BigInt !== "undefined" ? BigInt(str) : null + ++this.pos + } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number") } + return this.finishToken(tt.num, val) + }; + + anonymous.prototype.readNumber = function readNumber (startsWithDot) { + var start = this.pos + + // Not an int + if (startsWithDot) { return Parser.prototype.readNumber.call(this, startsWithDot) } + + // Legacy octal + if (this.input.charCodeAt(start) === 48 && this.input.charCodeAt(start + 1) !== 110) { + return Parser.prototype.readNumber.call(this, startsWithDot) + } + + if (this.readInt(10) === null) { this.raise(start, "Invalid number") } + + // Not a BigInt, reset and parse again + if (this.input.charCodeAt(this.pos) != 110) { + this.pos = start + return Parser.prototype.readNumber.call(this, startsWithDot) + } + + var str = this.getNumberInput(start, this.pos) + var val = typeof BigInt !== "undefined" ? BigInt(str) : null + ++this.pos + return this.finishToken(tt.num, val) + }; + + // This is basically a hook for acorn-numeric-separator + anonymous.prototype.getNumberInput = function getNumberInput (start, end) { + if (Parser.prototype.getNumberInput) { return Parser.prototype.getNumberInput.call(this, start, end) } + return this.input.slice(start, end) + }; + + return anonymous; + }(Parser)) +} diff --git a/node_modules/acorn-node/lib/class-fields/index.js b/node_modules/acorn-node/lib/class-fields/index.js new file mode 100644 index 0000000..e7f15ae --- /dev/null +++ b/node_modules/acorn-node/lib/class-fields/index.js @@ -0,0 +1,70 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +var acorn = require("acorn") +var tt = acorn.tokTypes +var privateClassElements = require("../private-class-elements") + +function maybeParseFieldValue(field) { + if (this.eat(tt.eq)) { + var oldInFieldValue = this._inFieldValue + this._inFieldValue = true + field.value = this.parseExpression() + this._inFieldValue = oldInFieldValue + } else { field.value = null } +} + +module.exports = function(Parser) { + Parser = privateClassElements(Parser) + return /*@__PURE__*/(function (Parser) { + function anonymous () { + Parser.apply(this, arguments); + } + + if ( Parser ) anonymous.__proto__ = Parser; + anonymous.prototype = Object.create( Parser && Parser.prototype ); + anonymous.prototype.constructor = anonymous; + + anonymous.prototype.parseClassElement = function parseClassElement (_constructorAllowsSuper) { + if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type == this.privateNameToken || this.type == tt.bracketL || this.type == tt.string)) { + var branch = this._branch() + if (branch.type == tt.bracketL) { + var count = 0 + do { + if (branch.eat(tt.bracketL)) { ++count } + else if (branch.eat(tt.bracketR)) { --count } + else { branch.next() } + } while (count > 0) + } else { branch.next() } + if (branch.type == tt.eq || branch.canInsertSemicolon() || branch.type == tt.semi) { + var node = this.startNode() + if (this.type == this.privateNameToken) { + this.parsePrivateClassElementName(node) + } else { + this.parsePropertyName(node) + } + if ((node.key.type === "Identifier" && node.key.name === "constructor") || + (node.key.type === "Literal" && node.key.value === "constructor")) { + this.raise(node.key.start, "Classes may not have a field called constructor") + } + maybeParseFieldValue.call(this, node) + this.finishNode(node, "FieldDefinition") + this.semicolon() + return node + } + } + + return Parser.prototype.parseClassElement.apply(this, arguments) + }; + + // Prohibit arguments in class field initializers + anonymous.prototype.parseIdent = function parseIdent (liberal, isBinding) { + var ident = Parser.prototype.parseIdent.call(this, liberal, isBinding) + if (this._inFieldValue && ident.name == "arguments") { this.raise(ident.start, "A class field initializer may not contain arguments") } + return ident + }; + + return anonymous; + }(Parser)) +} diff --git a/node_modules/acorn-node/lib/dynamic-import/index.js b/node_modules/acorn-node/lib/dynamic-import/index.js new file mode 100644 index 0000000..bb37198 --- /dev/null +++ b/node_modules/acorn-node/lib/dynamic-import/index.js @@ -0,0 +1,86 @@ +/* Generated by `npm run build`, do not edit! */ + +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DynamicImportKey = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }(); + +var _get = function () { + function get(object, property, receiver) { if (object === null) { object = Function.prototype; } var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } + + return get; +}(); + +exports['default'] = dynamicImport; + +var _acorn = require('acorn'); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) { Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } } /* eslint-disable no-underscore-dangle */ + + +var DynamicImportKey = exports.DynamicImportKey = 'Import'; + +// NOTE: This allows `yield import()` to parse correctly. +_acorn.tokTypes._import.startsExpr = true; + +function parseDynamicImport() { + var node = this.startNode(); + this.next(); + if (this.type !== _acorn.tokTypes.parenL) { + this.unexpected(); + } + return this.finishNode(node, DynamicImportKey); +} + +function parenAfter() { + return (/^(\s|\/\/.*|\/\*[^]*?\*\/)*\(/.test(this.input.slice(this.pos)) + ); +} + +function dynamicImport(Parser) { + return function (_Parser) { + _inherits(_class, _Parser); + + function _class() { + _classCallCheck(this, _class); + + return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); + } + + _createClass(_class, [{ + key: 'parseStatement', + value: function () { + function parseStatement(context, topLevel, exports) { + if (this.type === _acorn.tokTypes._import && parenAfter.call(this)) { + return this.parseExpressionStatement(this.startNode(), this.parseExpression()); + } + return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'parseStatement', this).call(this, context, topLevel, exports); + } + + return parseStatement; + }() + }, { + key: 'parseExprAtom', + value: function () { + function parseExprAtom(refDestructuringErrors) { + if (this.type === _acorn.tokTypes._import) { + return parseDynamicImport.call(this); + } + return _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'parseExprAtom', this).call(this, refDestructuringErrors); + } + + return parseExprAtom; + }() + }]); + + return _class; + }(Parser); +} \ No newline at end of file diff --git a/node_modules/acorn-node/lib/export-ns-from/index.js b/node_modules/acorn-node/lib/export-ns-from/index.js new file mode 100644 index 0000000..7196dc8 --- /dev/null +++ b/node_modules/acorn-node/lib/export-ns-from/index.js @@ -0,0 +1,43 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g + +var tt = require("acorn").tokTypes + +module.exports = function(Parser) { + return /*@__PURE__*/(function (Parser) { + function anonymous () { + Parser.apply(this, arguments); + } + + if ( Parser ) anonymous.__proto__ = Parser; + anonymous.prototype = Object.create( Parser && Parser.prototype ); + anonymous.prototype.constructor = anonymous; + + anonymous.prototype.parseExport = function parseExport (node, exports) { + skipWhiteSpace.lastIndex = this.pos + var skip = skipWhiteSpace.exec(this.input) + var next = this.input.charAt(this.pos + skip[0].length) + if (next !== "*") { return Parser.prototype.parseExport.call(this, node, exports) } + + this.next() + var specifier = this.startNode() + this.expect(tt.star) + if (this.eatContextual("as")) { + node.declaration = null + specifier.exported = this.parseIdent(true) + this.checkExport(exports, specifier.exported.name, this.lastTokStart) + node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")] + } + this.expectContextual("from") + if (this.type !== tt.string) { this.unexpected() } + node.source = this.parseExprAtom() + this.semicolon() + return this.finishNode(node, node.specifiers ? "ExportNamedDeclaration" : "ExportAllDeclaration") + }; + + return anonymous; + }(Parser)) +} diff --git a/node_modules/acorn-node/lib/import-meta/index.js b/node_modules/acorn-node/lib/import-meta/index.js new file mode 100644 index 0000000..bd4adf9 --- /dev/null +++ b/node_modules/acorn-node/lib/import-meta/index.js @@ -0,0 +1,55 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +var tt = require("acorn").tokTypes + +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g + +var nextTokenIsDot = function (parser) { + skipWhiteSpace.lastIndex = parser.pos + var skip = skipWhiteSpace.exec(parser.input) + var next = parser.pos + skip[0].length + return parser.input.slice(next, next + 1) === "." +} + +module.exports = function(Parser) { + return /*@__PURE__*/(function (Parser) { + function anonymous () { + Parser.apply(this, arguments); + } + + if ( Parser ) anonymous.__proto__ = Parser; + anonymous.prototype = Object.create( Parser && Parser.prototype ); + anonymous.prototype.constructor = anonymous; + + anonymous.prototype.parseExprAtom = function parseExprAtom (refDestructuringErrors) { + if (this.type !== tt._import || !nextTokenIsDot(this)) { return Parser.prototype.parseExprAtom.call(this, refDestructuringErrors) } + + if (!this.options.allowImportExportEverywhere && !this.inModule) { + this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'") + } + + var node = this.startNode() + node.meta = this.parseIdent(true) + this.expect(tt.dot) + node.property = this.parseIdent(true) + if (node.property.name !== "meta") { + this.raiseRecoverable(node.property.start, "The only valid meta property for import is import.meta") + } + return this.finishNode(node, "MetaProperty") + }; + + anonymous.prototype.parseStatement = function parseStatement (context, topLevel, exports) { + if (this.type !== tt._import || !nextTokenIsDot(this)) { + return Parser.prototype.parseStatement.call(this, context, topLevel, exports) + } + + var node = this.startNode() + var expr = this.parseExpression() + return this.parseExpressionStatement(node, expr) + }; + + return anonymous; + }(Parser)) +} diff --git a/node_modules/acorn-node/lib/numeric-separator/index.js b/node_modules/acorn-node/lib/numeric-separator/index.js new file mode 100644 index 0000000..ec3cfc4 --- /dev/null +++ b/node_modules/acorn-node/lib/numeric-separator/index.js @@ -0,0 +1,61 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +module.exports = function(Parser) { + return /*@__PURE__*/(function (Parser) { + function anonymous () { + Parser.apply(this, arguments); + } + + if ( Parser ) anonymous.__proto__ = Parser; + anonymous.prototype = Object.create( Parser && Parser.prototype ); + anonymous.prototype.constructor = anonymous; + + anonymous.prototype.readInt = function readInt (radix, len) { + // Hack: len is only != null for unicode escape sequences, + // where numeric separators are not allowed + if (len != null) { return Parser.prototype.readInt.call(this, radix, len) } + + var start = this.pos, total = 0, acceptUnderscore = false + for (;;) { + var code = this.input.charCodeAt(this.pos), val = (void 0) + if (code >= 97) { val = code - 97 + 10 } // a + else if (code == 95) { + if (!acceptUnderscore) { this.raise(this.pos, "Invalid numeric separator") } + ++this.pos + acceptUnderscore = false + continue + } else if (code >= 65) { val = code - 65 + 10 } // A + else if (code >= 48 && code <= 57) { val = code - 48 } // 0-9 + else { val = Infinity } + if (val >= radix) { break } + ++this.pos + total = total * radix + val + acceptUnderscore = true + } + if (this.pos === start) { return null } + if (!acceptUnderscore) { this.raise(this.pos - 1, "Invalid numeric separator") } + + return total + }; + + anonymous.prototype.readNumber = function readNumber (startsWithDot) { + var token = Parser.prototype.readNumber.call(this, startsWithDot) + var octal = this.end - this.start >= 2 && this.input.charCodeAt(this.start) === 48 + var stripped = this.getNumberInput(this.start, this.end) + if (stripped.length < this.end - this.start) { + if (octal) { this.raise(this.start, "Invalid number") } + this.value = parseFloat(stripped) + } + return token + }; + + // This is used by acorn-bigint + anonymous.prototype.getNumberInput = function getNumberInput (start, end) { + return this.input.slice(start, end).replace(/_/g, "") + }; + + return anonymous; + }(Parser)) +} diff --git a/node_modules/acorn-node/lib/private-class-elements/index.js b/node_modules/acorn-node/lib/private-class-elements/index.js new file mode 100644 index 0000000..364e1fc --- /dev/null +++ b/node_modules/acorn-node/lib/private-class-elements/index.js @@ -0,0 +1,135 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +var acorn = require("acorn") +if (false) { + throw new Error(("acorn-private-class-elements requires acorn@^6.1.0, not " + (acorn.version))) +} +var tt = acorn.tokTypes +var TokenType = acorn.TokenType + +module.exports = function(Parser) { + // Only load this plugin once. + if (Parser.prototype.parsePrivateName) { + return Parser + } + + // Make sure `Parser` comes from the same acorn as our `tt`, + // otherwise the comparisons fail. + var cur = Parser + while (cur && cur !== acorn.Parser) { + cur = cur.__proto__ + } + if (cur !== acorn.Parser) { + throw new Error("acorn-private-class-elements does not support mixing different acorn copies") + } + + Parser = /*@__PURE__*/(function (Parser) { + function Parser_ () { + Parser.apply(this, arguments); + } + + if ( Parser ) Parser_.__proto__ = Parser; + Parser_.prototype = Object.create( Parser && Parser.prototype ); + Parser_.prototype.constructor = Parser_; + + Parser_.prototype._branch = function _branch () { + this.__branch = this.__branch || new Parser({ecmaVersion: this.options.ecmaVersion}, this.input) + this.__branch.end = this.end + this.__branch.pos = this.pos + this.__branch.type = this.type + this.__branch.value = this.value + this.__branch.containsEsc = this.containsEsc + return this.__branch + }; + + Parser_.prototype.parsePrivateClassElementName = function parsePrivateClassElementName (element) { + element.computed = false + element.key = this.parsePrivateName() + if (element.key.name == "constructor") { this.raise(element.key.start, "Classes may not have a private element named constructor") } + var accept = {get: "set", set: "get"}[element.kind] + var privateBoundNames = this._privateBoundNamesStack[this._privateBoundNamesStack.length - 1] + if (Object.prototype.hasOwnProperty.call(privateBoundNames, element.key.name) && privateBoundNames[element.key.name] !== accept) { + this.raise(element.start, "Duplicate private element") + } + privateBoundNames[element.key.name] = element.kind || true + delete this._unresolvedPrivateNamesStack[this._unresolvedPrivateNamesStack.length - 1][element.key.name] + return element.key + }; + + Parser_.prototype.parsePrivateName = function parsePrivateName () { + var node = this.startNode() + node.name = this.value + this.next() + this.finishNode(node, "PrivateName") + if (this.options.allowReserved == "never") { this.checkUnreserved(node) } + return node + }; + + // Parse # token + Parser_.prototype.getTokenFromCode = function getTokenFromCode (code) { + if (code === 35) { + ++this.pos + var word = this.readWord1() + return this.finishToken(this.privateNameToken, word) + } + return Parser.prototype.getTokenFromCode.call(this, code) + }; + + // Manage stacks and check for undeclared private names + Parser_.prototype.parseClass = function parseClass (node, isStatement) { + this._privateBoundNamesStack = this._privateBoundNamesStack || [] + var privateBoundNames = Object.create(this._privateBoundNamesStack[this._privateBoundNamesStack.length - 1] || null) + this._privateBoundNamesStack.push(privateBoundNames) + this._unresolvedPrivateNamesStack = this._unresolvedPrivateNamesStack || [] + var unresolvedPrivateNames = Object.create(null) + this._unresolvedPrivateNamesStack.push(unresolvedPrivateNames) + var _return = Parser.prototype.parseClass.call(this, node, isStatement) + this._privateBoundNamesStack.pop() + this._unresolvedPrivateNamesStack.pop() + if (!this._unresolvedPrivateNamesStack.length) { + var names = Object.keys(unresolvedPrivateNames) + if (names.length) { + names.sort(function (n1, n2) { return unresolvedPrivateNames[n1] - unresolvedPrivateNames[n2]; }) + this.raise(unresolvedPrivateNames[names[0]], "Usage of undeclared private name") + } + } else { Object.assign(this._unresolvedPrivateNamesStack[this._unresolvedPrivateNamesStack.length - 1], unresolvedPrivateNames) } + return _return + }; + + // Parse private element access + Parser_.prototype.parseSubscript = function parseSubscript (base, startPos, startLoc, noCalls, maybeAsyncArrow) { + if (!this.eat(tt.dot)) { + return Parser.prototype.parseSubscript.call(this, base, startPos, startLoc, noCalls, maybeAsyncArrow) + } + var node = this.startNodeAt(startPos, startLoc) + node.object = base + node.computed = false + if (this.type == this.privateNameToken) { + node.property = this.parsePrivateName() + if (!this._privateBoundNamesStack.length || !this._privateBoundNamesStack[this._privateBoundNamesStack.length - 1][node.property.name]) { + this._unresolvedPrivateNamesStack[this._unresolvedPrivateNamesStack.length - 1][node.property.name] = node.property.start + } + } else { + node.property = this.parseIdent(true) + } + return this.finishNode(node, "MemberExpression") + }; + + // Prohibit delete of private class elements + Parser_.prototype.parseMaybeUnary = function parseMaybeUnary (refDestructuringErrors, sawUnary) { + var _return = Parser.prototype.parseMaybeUnary.call(this, refDestructuringErrors, sawUnary) + if (_return.operator == "delete") { + if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateName") { + this.raise(_return.start, "Private elements may not be deleted") + } + } + return _return + }; + + return Parser_; + }(Parser)) + Parser.prototype.privateNameToken = new TokenType("privateName") + return Parser +} diff --git a/node_modules/acorn-node/lib/static-class-features/index.js b/node_modules/acorn-node/lib/static-class-features/index.js new file mode 100644 index 0000000..3894491 --- /dev/null +++ b/node_modules/acorn-node/lib/static-class-features/index.js @@ -0,0 +1,139 @@ +/* Generated by `npm run build`, do not edit! */ + +"use strict" + +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g + +var acorn = require("acorn") +var tt = acorn.tokTypes + +function maybeParseFieldValue(field) { + if (this.eat(tt.eq)) { + var oldInFieldValue = this._inStaticFieldValue + this._inStaticFieldValue = true + field.value = this.parseExpression() + this._inStaticFieldValue = oldInFieldValue + } else { field.value = null } +} + +var privateClassElements = require("../private-class-elements") + +module.exports = function(Parser) { + var ExtendedParser = privateClassElements(Parser) + + return /*@__PURE__*/(function (ExtendedParser) { + function anonymous () { + ExtendedParser.apply(this, arguments); + } + + if ( ExtendedParser ) anonymous.__proto__ = ExtendedParser; + anonymous.prototype = Object.create( ExtendedParser && ExtendedParser.prototype ); + anonymous.prototype.constructor = anonymous; + + anonymous.prototype.parseClassElement = function parseClassElement (_constructorAllowsSuper) { + var this$1 = this; + + if (this.eat(tt.semi)) { return null } + + var node = this.startNode() + + var tryContextual = function (k, noLineBreak) { + if (typeof noLineBreak == "undefined") { noLineBreak = false } + var start = this$1.start, startLoc = this$1.startLoc + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== tt.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (node.key) { this$1.unexpected() } + node.computed = false + node.key = this$1.startNodeAt(start, startLoc) + node.key.name = k + this$1.finishNode(node.key, "Identifier") + return false + } + + node.static = tryContextual("static") + if (!node.static) { return ExtendedParser.prototype.parseClassElement.apply(this, arguments) } + + var isGenerator = this.eat(tt.star) + var isAsync = false + if (!isGenerator) { + // Special-case for `async`, since `parseClassMember` currently looks + // for `(` to determine whether `async` is a method name + if (this.options.ecmaVersion >= 8 && this.isContextual("async")) { + skipWhiteSpace.lastIndex = this.pos + var skip = skipWhiteSpace.exec(this.input) + var next = this.input.charAt(this.pos + skip[0].length) + if (next === ";" || next === "=") { + node.key = this.parseIdent(true) + node.computed = false + maybeParseFieldValue.call(this, node) + this.finishNode(node, "FieldDefinition") + this.semicolon() + return node + } else if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true + isGenerator = this.options.ecmaVersion >= 9 && this.eat(tt.star) + } + } else if (tryContextual("get")) { + node.kind = "get" + } else if (tryContextual("set")) { + node.kind = "set" + } + } + if (this.type === this.privateNameToken) { + this.parsePrivateClassElementName(node) + if (this.type !== tt.parenL) { + if (node.key.name === "prototype") { + this.raise(node.key.start, "Classes may not have a private static property named prototype") + } + maybeParseFieldValue.call(this, node) + this.finishNode(node, "FieldDefinition") + this.semicolon() + return node + } + } else if (!node.key) { + this.parsePropertyName(node) + if ((node.key.name || node.key.value) === "prototype" && !node.computed) { + this.raise(node.key.start, "Classes may not have a static property named prototype") + } + } + if (!node.kind) { node.kind = "method" } + this.parseClassMethod(node, isGenerator, isAsync) + if (!node.kind && (node.key.name || node.key.value) === "constructor" && !node.computed) { + this.raise(node.key.start, "Classes may not have a static field named constructor") + } + if (node.kind === "get" && node.value.params.length !== 0) { + this.raiseRecoverable(node.value.start, "getter should have no params") + } + if (node.kind === "set" && node.value.params.length !== 1) { + this.raiseRecoverable(node.value.start, "setter should have exactly one param") + } + if (node.kind === "set" && node.value.params[0].type === "RestElement") { + this.raiseRecoverable(node.value.params[0].start, "Setter cannot use rest params") + } + + return node + + }; + + // Parse public static fields + anonymous.prototype.parseClassMethod = function parseClassMethod (method, isGenerator, isAsync, _allowsDirectSuper) { + if (isGenerator || isAsync || method.kind != "method" || !method.static || this.options.ecmaVersion < 8 || this.type == tt.parenL) { + return ExtendedParser.prototype.parseClassMethod.apply(this, arguments) + } + maybeParseFieldValue.call(this, method) + delete method.kind + method = this.finishNode(method, "FieldDefinition") + this.semicolon() + return method + }; + + // Prohibit arguments in class field initializers + anonymous.prototype.parseIdent = function parseIdent (liberal, isBinding) { + var ident = ExtendedParser.prototype.parseIdent.call(this, liberal, isBinding) + if (this._inStaticFieldValue && ident.name == "arguments") { this.raise(ident.start, "A static class field initializer may not contain arguments") } + return ident + }; + + return anonymous; + }(ExtendedParser)) +} diff --git a/node_modules/acorn-node/node_modules/.bin/acorn b/node_modules/acorn-node/node_modules/.bin/acorn new file mode 100644 index 0000000..679bd16 --- /dev/null +++ b/node_modules/acorn-node/node_modules/.bin/acorn @@ -0,0 +1,16 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) + if command -v cygpath > /dev/null 2>&1; then + basedir=`cygpath -w "$basedir"` + fi + ;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" +else + exec node "$basedir/../acorn/bin/acorn" "$@" +fi diff --git a/node_modules/acorn-node/node_modules/.bin/acorn.cmd b/node_modules/acorn-node/node_modules/.bin/acorn.cmd new file mode 100644 index 0000000..a9324df --- /dev/null +++ b/node_modules/acorn-node/node_modules/.bin/acorn.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %* diff --git a/node_modules/acorn-node/node_modules/.bin/acorn.ps1 b/node_modules/acorn-node/node_modules/.bin/acorn.ps1 new file mode 100644 index 0000000..6f6dcdd --- /dev/null +++ b/node_modules/acorn-node/node_modules/.bin/acorn.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + } else { + & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../acorn/bin/acorn" $args + } else { + & "node$exe" "$basedir/../acorn/bin/acorn" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/acorn-node/node_modules/acorn/CHANGELOG.md b/node_modules/acorn-node/node_modules/acorn/CHANGELOG.md new file mode 100644 index 0000000..164fd27 --- /dev/null +++ b/node_modules/acorn-node/node_modules/acorn/CHANGELOG.md @@ -0,0 +1,620 @@ +## 7.4.0 (2020-08-03) + +### New features + +Add support for logical assignment operators. + +Add support for numeric separators. + +## 7.3.1 (2020-06-11) + +### Bug fixes + +Make the string in the `version` export match the actual library version. + +## 7.3.0 (2020-06-11) + +### Bug fixes + +Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail. + +### New features + +Add support for optional chaining (`?.`). + +## 7.2.0 (2020-05-09) + +### Bug fixes + +Fix precedence issue in parsing of async arrow functions. + +### New features + +Add support for nullish coalescing. + +Add support for `import.meta`. + +Support `export * as ...` syntax. + +Upgrade to Unicode 13. + +## 6.4.1 (2020-03-09) + +### Bug fixes + +More carefully check for valid UTF16 surrogate pairs in regexp validator. + +## 7.1.1 (2020-03-01) + +### Bug fixes + +Treat `\8` and `\9` as invalid escapes in template strings. + +Allow unicode escapes in property names that are keywords. + +Don't error on an exponential operator expression as argument to `await`. + +More carefully check for valid UTF16 surrogate pairs in regexp validator. + +## 7.1.0 (2019-09-24) + +### Bug fixes + +Disallow trailing object literal commas when ecmaVersion is less than 5. + +### New features + +Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on. + +## 7.0.0 (2019-08-13) + +### Breaking changes + +Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression). + +Makes 10 (ES2019) the default value for the `ecmaVersion` option. + +## 6.3.0 (2019-08-12) + +### New features + +`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard. + +## 6.2.1 (2019-07-21) + +### Bug fixes + +Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such. + +Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances. + +## 6.2.0 (2019-07-04) + +### Bug fixes + +Improve valid assignment checking in `for`/`in` and `for`/`of` loops. + +Disallow binding `let` in patterns. + +### New features + +Support bigint syntax with `ecmaVersion` >= 11. + +Support dynamic `import` syntax with `ecmaVersion` >= 11. + +Upgrade to Unicode version 12. + +## 6.1.1 (2019-02-27) + +### Bug fixes + +Fix bug that caused parsing default exports of with names to fail. + +## 6.1.0 (2019-02-08) + +### Bug fixes + +Fix scope checking when redefining a `var` as a lexical binding. + +### New features + +Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins. + +## 6.0.7 (2019-02-04) + +### Bug fixes + +Check that exported bindings are defined. + +Don't treat `\u180e` as a whitespace character. + +Check for duplicate parameter names in methods. + +Don't allow shorthand properties when they are generators or async methods. + +Forbid binding `await` in async arrow function's parameter list. + +## 6.0.6 (2019-01-30) + +### Bug fixes + +The content of class declarations and expressions is now always parsed in strict mode. + +Don't allow `let` or `const` to bind the variable name `let`. + +Treat class declarations as lexical. + +Don't allow a generator function declaration as the sole body of an `if` or `else`. + +Ignore `"use strict"` when after an empty statement. + +Allow string line continuations with special line terminator characters. + +Treat `for` bodies as part of the `for` scope when checking for conflicting bindings. + +Fix bug with parsing `yield` in a `for` loop initializer. + +Implement special cases around scope checking for functions. + +## 6.0.5 (2019-01-02) + +### Bug fixes + +Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type. + +Don't treat `let` as a keyword when the next token is `{` on the next line. + +Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on. + +## 6.0.4 (2018-11-05) + +### Bug fixes + +Further improvements to tokenizing regular expressions in corner cases. + +## 6.0.3 (2018-11-04) + +### Bug fixes + +Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression. + +Remove stray symlink in the package tarball. + +## 6.0.2 (2018-09-26) + +### Bug fixes + +Fix bug where default expressions could fail to parse inside an object destructuring assignment expression. + +## 6.0.1 (2018-09-14) + +### Bug fixes + +Fix wrong value in `version` export. + +## 6.0.0 (2018-09-14) + +### Bug fixes + +Better handle variable-redefinition checks for catch bindings and functions directly under if statements. + +Forbid `new.target` in top-level arrow functions. + +Fix issue with parsing a regexp after `yield` in some contexts. + +### New features + +The package now comes with TypeScript definitions. + +### Breaking changes + +The default value of the `ecmaVersion` option is now 9 (2018). + +Plugins work differently, and will have to be rewritten to work with this version. + +The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`). + +## 5.7.3 (2018-09-10) + +### Bug fixes + +Fix failure to tokenize regexps after expressions like `x.of`. + +Better error message for unterminated template literals. + +## 5.7.2 (2018-08-24) + +### Bug fixes + +Properly handle `allowAwaitOutsideFunction` in for statements. + +Treat function declarations at the top level of modules like let bindings. + +Don't allow async function declarations as the only statement under a label. + +## 5.7.0 (2018-06-15) + +### New features + +Upgraded to Unicode 11. + +## 5.6.0 (2018-05-31) + +### New features + +Allow U+2028 and U+2029 in string when ECMAVersion >= 10. + +Allow binding-less catch statements when ECMAVersion >= 10. + +Add `allowAwaitOutsideFunction` option for parsing top-level `await`. + +## 5.5.3 (2018-03-08) + +### Bug fixes + +A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps. + +## 5.5.2 (2018-03-08) + +### Bug fixes + +A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0. + +## 5.5.1 (2018-03-06) + +### Bug fixes + +Fix misleading error message for octal escapes in template strings. + +## 5.5.0 (2018-02-27) + +### New features + +The identifier character categorization is now based on Unicode version 10. + +Acorn will now validate the content of regular expressions, including new ES9 features. + +## 5.4.0 (2018-02-01) + +### Bug fixes + +Disallow duplicate or escaped flags on regular expressions. + +Disallow octal escapes in strings in strict mode. + +### New features + +Add support for async iteration. + +Add support for object spread and rest. + +## 5.3.0 (2017-12-28) + +### Bug fixes + +Fix parsing of floating point literals with leading zeroes in loose mode. + +Allow duplicate property names in object patterns. + +Don't allow static class methods named `prototype`. + +Disallow async functions directly under `if` or `else`. + +Parse right-hand-side of `for`/`of` as an assignment expression. + +Stricter parsing of `for`/`in`. + +Don't allow unicode escapes in contextual keywords. + +### New features + +Parsing class members was factored into smaller methods to allow plugins to hook into it. + +## 5.2.1 (2017-10-30) + +### Bug fixes + +Fix a token context corruption bug. + +## 5.2.0 (2017-10-30) + +### Bug fixes + +Fix token context tracking for `class` and `function` in property-name position. + +Make sure `%*` isn't parsed as a valid operator. + +Allow shorthand properties `get` and `set` to be followed by default values. + +Disallow `super` when not in callee or object position. + +### New features + +Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements. + +## 5.1.2 (2017-09-04) + +### Bug fixes + +Disable parsing of legacy HTML-style comments in modules. + +Fix parsing of async methods whose names are keywords. + +## 5.1.1 (2017-07-06) + +### Bug fixes + +Fix problem with disambiguating regexp and division after a class. + +## 5.1.0 (2017-07-05) + +### Bug fixes + +Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`. + +Parse zero-prefixed numbers with non-octal digits as decimal. + +Allow object/array patterns in rest parameters. + +Don't error when `yield` is used as a property name. + +Allow `async` as a shorthand object property. + +### New features + +Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9. + +## 5.0.3 (2017-04-01) + +### Bug fixes + +Fix spurious duplicate variable definition errors for named functions. + +## 5.0.2 (2017-03-30) + +### Bug fixes + +A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error. + +## 5.0.0 (2017-03-28) + +### Bug fixes + +Raise an error for duplicated lexical bindings. + +Fix spurious error when an assignement expression occurred after a spread expression. + +Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions. + +Allow labels in front or `var` declarations, even in strict mode. + +### Breaking changes + +Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`. + +## 4.0.11 (2017-02-07) + +### Bug fixes + +Allow all forms of member expressions to be parenthesized as lvalue. + +## 4.0.10 (2017-02-07) + +### Bug fixes + +Don't expect semicolons after default-exported functions or classes, even when they are expressions. + +Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode. + +## 4.0.9 (2017-02-06) + +### Bug fixes + +Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again. + +## 4.0.8 (2017-02-03) + +### Bug fixes + +Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet. + +## 4.0.7 (2017-02-02) + +### Bug fixes + +Accept invalidly rejected code like `(x).y = 2` again. + +Don't raise an error when a function _inside_ strict code has a non-simple parameter list. + +## 4.0.6 (2017-02-02) + +### Bug fixes + +Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check. + +## 4.0.5 (2017-02-02) + +### Bug fixes + +Disallow parenthesized pattern expressions. + +Allow keywords as export names. + +Don't allow the `async` keyword to be parenthesized. + +Properly raise an error when a keyword contains a character escape. + +Allow `"use strict"` to appear after other string literal expressions. + +Disallow labeled declarations. + +## 4.0.4 (2016-12-19) + +### Bug fixes + +Fix crash when `export` was followed by a keyword that can't be +exported. + +## 4.0.3 (2016-08-16) + +### Bug fixes + +Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode. + +Properly parse properties named `async` in ES2017 mode. + +Fix bug where reserved words were broken in ES2017 mode. + +## 4.0.2 (2016-08-11) + +### Bug fixes + +Don't ignore period or 'e' characters after octal numbers. + +Fix broken parsing for call expressions in default parameter values of arrow functions. + +## 4.0.1 (2016-08-08) + +### Bug fixes + +Fix false positives in duplicated export name errors. + +## 4.0.0 (2016-08-07) + +### Breaking changes + +The default `ecmaVersion` option value is now 7. + +A number of internal method signatures changed, so plugins might need to be updated. + +### Bug fixes + +The parser now raises errors on duplicated export names. + +`arguments` and `eval` can now be used in shorthand properties. + +Duplicate parameter names in non-simple argument lists now always produce an error. + +### New features + +The `ecmaVersion` option now also accepts year-style version numbers +(2015, etc). + +Support for `async`/`await` syntax when `ecmaVersion` is >= 8. + +Support for trailing commas in call expressions when `ecmaVersion` is >= 8. + +## 3.3.0 (2016-07-25) + +### Bug fixes + +Fix bug in tokenizing of regexp operator after a function declaration. + +Fix parser crash when parsing an array pattern with a hole. + +### New features + +Implement check against complex argument lists in functions that enable strict mode in ES7. + +## 3.2.0 (2016-06-07) + +### Bug fixes + +Improve handling of lack of unicode regexp support in host +environment. + +Properly reject shorthand properties whose name is a keyword. + +### New features + +Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object. + +## 3.1.0 (2016-04-18) + +### Bug fixes + +Properly tokenize the division operator directly after a function expression. + +Allow trailing comma in destructuring arrays. + +## 3.0.4 (2016-02-25) + +### Fixes + +Allow update expressions as left-hand-side of the ES7 exponential operator. + +## 3.0.2 (2016-02-10) + +### Fixes + +Fix bug that accidentally made `undefined` a reserved word when parsing ES7. + +## 3.0.0 (2016-02-10) + +### Breaking changes + +The default value of the `ecmaVersion` option is now 6 (used to be 5). + +Support for comprehension syntax (which was dropped from the draft spec) has been removed. + +### Fixes + +`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code. + +A parenthesized class or function expression after `export default` is now parsed correctly. + +### New features + +When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`). + +The identifier character ranges are now based on Unicode 8.0.0. + +Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled. + +## 2.7.0 (2016-01-04) + +### Fixes + +Stop allowing rest parameters in setters. + +Disallow `y` rexexp flag in ES5. + +Disallow `\00` and `\000` escapes in strict mode. + +Raise an error when an import name is a reserved word. + +## 2.6.2 (2015-11-10) + +### Fixes + +Don't crash when no options object is passed. + +## 2.6.0 (2015-11-09) + +### Fixes + +Add `await` as a reserved word in module sources. + +Disallow `yield` in a parameter default value for a generator. + +Forbid using a comma after a rest pattern in an array destructuring. + +### New features + +Support parsing stdin in command-line tool. + +## 2.5.0 (2015-10-27) + +### Fixes + +Fix tokenizer support in the command-line tool. + +Stop allowing `new.target` outside of functions. + +Remove legacy `guard` and `guardedHandler` properties from try nodes. + +Stop allowing multiple `__proto__` properties on an object literal in strict mode. + +Don't allow rest parameters to be non-identifier patterns. + +Check for duplicate paramter names in arrow functions. diff --git a/node_modules/acorn-node/node_modules/acorn/LICENSE b/node_modules/acorn-node/node_modules/acorn/LICENSE new file mode 100644 index 0000000..cc5272c --- /dev/null +++ b/node_modules/acorn-node/node_modules/acorn/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2012-2018 by various contributors (see AUTHORS) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/acorn-node/node_modules/acorn/README.md b/node_modules/acorn-node/node_modules/acorn/README.md new file mode 100644 index 0000000..52d2e9b --- /dev/null +++ b/node_modules/acorn-node/node_modules/acorn/README.md @@ -0,0 +1,269 @@ +# Acorn + +A tiny, fast JavaScript parser written in JavaScript. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE). + +You are welcome to +[report bugs](https://github.com/acornjs/acorn/issues) or create pull +requests on [github](https://github.com/acornjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is from [`npm`](https://www.npmjs.com/): + +```sh +npm install acorn +``` + +Alternately, you can download the source and build acorn yourself: + +```sh +git clone https://github.com/acornjs/acorn.git +cd acorn +npm install +``` + +## Interface + +**parse**`(input, options)` is the main interface to the library. The +`input` parameter is a string, `options` can be undefined or an object +setting some of the options listed below. The return value will be an +abstract syntax tree object as specified by the [ESTree +spec](https://github.com/estree/estree). + +```javascript +let acorn = require("acorn"); +console.log(acorn.parse("1 + 1")); +``` + +When encountering a syntax error, the parser will raise a +`SyntaxError` object with a meaningful message. The error object will +have a `pos` property that indicates the string offset at which the +error occurred, and a `loc` object that contains a `{line, column}` +object referring to that same position. + +Options can be provided by passing a second argument, which should be +an object containing any of these fields: + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019) or 11 + (2020, partial support). This influences support for strict mode, + the set of reserved words, and support for new syntax features. + Default is 10. + + **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being + implemented by Acorn. Other proposed new features can be implemented + through plugins. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. This influences global strict mode + and parsing of `import` and `export` declarations. + + **NOTE**: If set to `"module"`, then static `import` / `export` syntax + will be valid, even if `ecmaVersion` is less than 6. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowAwaitOutsideFunction**: By default, `await` expressions can + only appear inside `async` functions. Setting this option to + `true` allows to have top-level `await` expressions. They are + still not allowed in non-`async` functions, though. + +- **allowHashBang**: When this is enabled (off by default), if the + code starts with the characters `#!` (as in a shellscript), the + first line will be treated as a comment. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **ranges**: Nodes have their start and end characters offsets + recorded in `start` and `end` properties (directly on the node, + rather than the `loc` object, which holds line/column data. To also + add a + [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678) + `range` property holding a `[start, end]` array with the same + numbers, set the `ranges` option to `true`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added (regardless of the `location` option) directly to the + nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + that have a single `expression` property containing the expression + inside parentheses. + +**parseExpressionAt**`(input, offset, options)` will parse a single +expression in a string, and return its AST. It will not complain if +there is more of the string left after the expression. + +**tokenizer**`(input, options)` returns an object with a `getToken` +method that can be called repeatedly to get the next token, a `{start, +end, type, value}` object (with added `loc` property when the +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +var tokens = [...acorn.tokenizer(str)]; +``` + +**tokTypes** holds an object mapping names to the token type objects +that end up in the `type` properties of tokens. + +**getLineInfo**`(input, offset)` can be used to get a `{line, +column}` object for a given program string and offset. + +### The `Parser` class + +Instances of the **`Parser`** class contain all the state and logic +that drives a parse. It has static methods `parse`, +`parseExpressionAt`, and `tokenizer` that match the top-level +functions by the same name. + +When extending the parser with plugins, you need to call these methods +on the extended version of the class. To extend a parser with plugins, +you can use its static `extend` method. + +```javascript +var acorn = require("acorn"); +var jsx = require("acorn-jsx"); +var JSXParser = acorn.Parser.extend(jsx()); +JSXParser.parse("foo()"); +``` + +The `extend` method takes any number of plugin values, and returns a +new `Parser` class that includes the extra parser logic provided by +the plugins. + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version + to parse. Default is version 9. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "end" subobjects, each of which contains the one-based line and + zero-based column numbers in `{line, column}` form. + +- `--allow-hash-bang`: If the code starts with the characters #! (as + in a shellscript), the first line will be treated as a comment. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +The utility spits out the syntax tree as JSON data. + +## Existing plugins + + - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx) + +Plugins for ECMAScript proposals: + + - [`acorn-stage3`](https://github.com/acornjs/acorn-stage3): Parse most stage 3 proposals, bundling: + - [`acorn-class-fields`](https://github.com/acornjs/acorn-class-fields): Parse [class fields proposal](https://github.com/tc39/proposal-class-fields) + - [`acorn-import-meta`](https://github.com/acornjs/acorn-import-meta): Parse [import.meta proposal](https://github.com/tc39/proposal-import-meta) + - [`acorn-private-methods`](https://github.com/acornjs/acorn-private-methods): parse [private methods, getters and setters proposal](https://github.com/tc39/proposal-private-methods)n diff --git a/node_modules/acorn-node/node_modules/acorn/bin/acorn b/node_modules/acorn-node/node_modules/acorn/bin/acorn new file mode 100644 index 0000000..cf7df46 --- /dev/null +++ b/node_modules/acorn-node/node_modules/acorn/bin/acorn @@ -0,0 +1,4 @@ +#!/usr/bin/env node +'use strict'; + +require('../dist/bin.js'); diff --git a/node_modules/acorn-node/node_modules/acorn/dist/acorn.d.ts b/node_modules/acorn-node/node_modules/acorn/dist/acorn.d.ts new file mode 100644 index 0000000..bda5f80 --- /dev/null +++ b/node_modules/acorn-node/node_modules/acorn/dist/acorn.d.ts @@ -0,0 +1,209 @@ +export as namespace acorn +export = acorn + +declare namespace acorn { + function parse(input: string, options?: Options): Node + + function parseExpressionAt(input: string, pos?: number, options?: Options): Node + + function tokenizer(input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + + interface Options { + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 + sourceType?: 'script' | 'module' + onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + allowReserved?: boolean | 'never' + allowReturnOutsideFunction?: boolean + allowImportExportEverywhere?: boolean + allowAwaitOutsideFunction?: boolean + allowHashBang?: boolean + locations?: boolean + onToken?: ((token: Token) => any) | Token[] + onComment?: (( + isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, + endLoc?: Position + ) => void) | Comment[] + ranges?: boolean + program?: Node + sourceFile?: string + directSourceFile?: string + preserveParens?: boolean + } + + class Parser { + constructor(options: Options, input: string, startPos?: number) + parse(this: Parser): Node + static parse(this: typeof Parser, input: string, options?: Options): Node + static parseExpressionAt(this: typeof Parser, input: string, pos: number, options?: Options): Node + static tokenizer(this: typeof Parser, input: string, options?: Options): { + getToken(): Token + [Symbol.iterator](): Iterator + } + static extend(this: typeof Parser, ...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser + } + + interface Position { line: number; column: number; offset: number } + + const defaultOptions: Options + + function getLineInfo(input: string, offset: number): Position + + class SourceLocation { + start: Position + end: Position + source?: string | null + constructor(p: Parser, start: Position, end: Position) + } + + class Node { + type: string + start: number + end: number + loc?: SourceLocation + sourceFile?: string + range?: [number, number] + constructor(parser: Parser, pos: number, loc?: SourceLocation) + } + + class TokenType { + label: string + keyword: string + beforeExpr: boolean + startsExpr: boolean + isLoop: boolean + isAssign: boolean + prefix: boolean + postfix: boolean + binop: number + updateContext?: (prevType: TokenType) => void + constructor(label: string, conf?: any) + } + + const tokTypes: { + num: TokenType + regexp: TokenType + string: TokenType + name: TokenType + eof: TokenType + bracketL: TokenType + bracketR: TokenType + braceL: TokenType + braceR: TokenType + parenL: TokenType + parenR: TokenType + comma: TokenType + semi: TokenType + colon: TokenType + dot: TokenType + question: TokenType + arrow: TokenType + template: TokenType + ellipsis: TokenType + backQuote: TokenType + dollarBraceL: TokenType + eq: TokenType + assign: TokenType + incDec: TokenType + prefix: TokenType + logicalOR: TokenType + logicalAND: TokenType + bitwiseOR: TokenType + bitwiseXOR: TokenType + bitwiseAND: TokenType + equality: TokenType + relational: TokenType + bitShift: TokenType + plusMin: TokenType + modulo: TokenType + star: TokenType + slash: TokenType + starstar: TokenType + _break: TokenType + _case: TokenType + _catch: TokenType + _continue: TokenType + _debugger: TokenType + _default: TokenType + _do: TokenType + _else: TokenType + _finally: TokenType + _for: TokenType + _function: TokenType + _if: TokenType + _return: TokenType + _switch: TokenType + _throw: TokenType + _try: TokenType + _var: TokenType + _const: TokenType + _while: TokenType + _with: TokenType + _new: TokenType + _this: TokenType + _super: TokenType + _class: TokenType + _extends: TokenType + _export: TokenType + _import: TokenType + _null: TokenType + _true: TokenType + _false: TokenType + _in: TokenType + _instanceof: TokenType + _typeof: TokenType + _void: TokenType + _delete: TokenType + } + + class TokContext { + constructor(token: string, isExpr: boolean, preserveSpace: boolean, override?: (p: Parser) => void) + } + + const tokContexts: { + b_stat: TokContext + b_expr: TokContext + b_tmpl: TokContext + p_stat: TokContext + p_expr: TokContext + q_tmpl: TokContext + f_expr: TokContext + } + + function isIdentifierStart(code: number, astral?: boolean): boolean + + function isIdentifierChar(code: number, astral?: boolean): boolean + + interface AbstractToken { + } + + interface Comment extends AbstractToken { + type: string + value: string + start: number + end: number + loc?: SourceLocation + range?: [number, number] + } + + class Token { + type: TokenType + value: any + start: number + end: number + loc?: SourceLocation + range?: [number, number] + constructor(p: Parser) + } + + function isNewLine(code: number): boolean + + const lineBreak: RegExp + + const lineBreakG: RegExp + + const version: string +} diff --git a/node_modules/acorn-node/node_modules/acorn/dist/acorn.js b/node_modules/acorn-node/node_modules/acorn/dist/acorn.js new file mode 100644 index 0000000..0523f0e --- /dev/null +++ b/node_modules/acorn-node/node_modules/acorn/dist/acorn.js @@ -0,0 +1,5186 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.acorn = {})); +}(this, (function (exports) { 'use strict'; + + // Reserved word lists for various dialects of the language + + var reservedWords = { + 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" + }; + + // And the keywords + + var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; + + var keywords = { + 5: ecma5AndLessKeywords, + "5module": ecma5AndLessKeywords + " export import", + 6: ecma5AndLessKeywords + " const class extends export import super" + }; + + var keywordRelationalOperator = /^in(stanceof)?$/; + + // ## Character categories + + // Big ugly regular expressions that match characters in the + // whitespace, identifier, and identifier-start categories. These + // are only applied when a character is found to actually have a + // code point above 128. + // Generated by `bin/generate-identifier-regex.js`. + var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; + var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; + + var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); + var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + + nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + + // These are a run-length and offset encoded representation of the + // >0xffff code points that are a valid part of identifiers. The + // offset starts at 0x10000, and each pair of numbers represents an + // offset to the next range, and then a size of the range. They were + // generated by bin/generate-identifier-regex.js + + // eslint-disable-next-line comma-spacing + var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938]; + + // eslint-disable-next-line comma-spacing + var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239]; + + // This has a complexity linear to the value of the code. The + // assumption is that looking up astral identifier characters is + // rare. + function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } + } + } + + // Test whether a given character code starts an identifier. + + function isIdentifierStart(code, astral) { + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) + } + + // Test whether a given character is part of an identifier. + + function isIdentifierChar(code, astral) { + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) + } + + // ## Token types + + // The assignment of fine-grained, information-carrying type objects + // allows the tokenizer to store the information it has about a + // token in a way that is very cheap for the parser to look up. + + // All token type variables start with an underscore, to make them + // easy to recognize. + + // The `beforeExpr` property is used to disambiguate between regular + // expressions and divisions. It is set on all token types that can + // be followed by an expression (thus, a slash after them would be a + // regular expression). + // + // The `startsExpr` property is used to check if the token ends a + // `yield` expression. It is set on all token types that either can + // directly start an expression (like a quotation mark) or can + // continue an expression (like the body of a string). + // + // `isLoop` marks a keyword as starting a loop, which is important + // to know when parsing a label, in order to allow or disallow + // continue jumps to that label. + + var TokenType = function TokenType(label, conf) { + if ( conf === void 0 ) conf = {}; + + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; + }; + + function binop(name, prec) { + return new TokenType(name, {beforeExpr: true, binop: prec}) + } + var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true}; + + // Map keyword names to token types. + + var keywords$1 = {}; + + // Succinct definitions of keyword token types + function kw(name, options) { + if ( options === void 0 ) options = {}; + + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) + } + + var types = { + num: new TokenType("num", startsExpr), + regexp: new TokenType("regexp", startsExpr), + string: new TokenType("string", startsExpr), + name: new TokenType("name", startsExpr), + eof: new TokenType("eof"), + + // Punctuation token types. + bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}), + bracketR: new TokenType("]"), + braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}), + braceR: new TokenType("}"), + parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}), + parenR: new TokenType(")"), + comma: new TokenType(",", beforeExpr), + semi: new TokenType(";", beforeExpr), + colon: new TokenType(":", beforeExpr), + dot: new TokenType("."), + question: new TokenType("?", beforeExpr), + questionDot: new TokenType("?."), + arrow: new TokenType("=>", beforeExpr), + template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), + ellipsis: new TokenType("...", beforeExpr), + backQuote: new TokenType("`", startsExpr), + dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), + + // Operators. These carry several kinds of properties to help the + // parser use them properly (the presence of these properties is + // what categorizes them as operators). + // + // `binop`, when present, specifies that this operator is a binary + // operator, and will refer to its precedence. + // + // `prefix` and `postfix` mark the operator as a prefix or postfix + // unary operator. + // + // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as + // binary operators with a very low precedence, that should result + // in AssignmentExpression nodes. + + eq: new TokenType("=", {beforeExpr: true, isAssign: true}), + assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), + incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), + logicalOR: binop("||", 1), + logicalAND: binop("&&", 2), + bitwiseOR: binop("|", 3), + bitwiseXOR: binop("^", 4), + bitwiseAND: binop("&", 5), + equality: binop("==/!=/===/!==", 6), + relational: binop("/<=/>=", 7), + bitShift: binop("<>/>>>", 8), + plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), + modulo: binop("%", 10), + star: binop("*", 10), + slash: binop("/", 10), + starstar: new TokenType("**", {beforeExpr: true}), + coalesce: binop("??", 1), + + // Keyword token types. + _break: kw("break"), + _case: kw("case", beforeExpr), + _catch: kw("catch"), + _continue: kw("continue"), + _debugger: kw("debugger"), + _default: kw("default", beforeExpr), + _do: kw("do", {isLoop: true, beforeExpr: true}), + _else: kw("else", beforeExpr), + _finally: kw("finally"), + _for: kw("for", {isLoop: true}), + _function: kw("function", startsExpr), + _if: kw("if"), + _return: kw("return", beforeExpr), + _switch: kw("switch"), + _throw: kw("throw", beforeExpr), + _try: kw("try"), + _var: kw("var"), + _const: kw("const"), + _while: kw("while", {isLoop: true}), + _with: kw("with"), + _new: kw("new", {beforeExpr: true, startsExpr: true}), + _this: kw("this", startsExpr), + _super: kw("super", startsExpr), + _class: kw("class", startsExpr), + _extends: kw("extends", beforeExpr), + _export: kw("export"), + _import: kw("import", startsExpr), + _null: kw("null", startsExpr), + _true: kw("true", startsExpr), + _false: kw("false", startsExpr), + _in: kw("in", {beforeExpr: true, binop: 7}), + _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}), + _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), + _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), + _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) + }; + + // Matches a whole line break (where CRLF is considered a single + // line break). Used to count lines. + + var lineBreak = /\r\n?|\n|\u2028|\u2029/; + var lineBreakG = new RegExp(lineBreak.source, "g"); + + function isNewLine(code, ecma2019String) { + return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029)) + } + + var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/; + + var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; + + var ref = Object.prototype; + var hasOwnProperty = ref.hasOwnProperty; + var toString = ref.toString; + + // Checks if an object has a property. + + function has(obj, propName) { + return hasOwnProperty.call(obj, propName) + } + + var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" + ); }); + + function wordsRegexp(words) { + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + } + + // These are used when `options.locations` is on, for the + // `startLoc` and `endLoc` properties. + + var Position = function Position(line, col) { + this.line = line; + this.column = col; + }; + + Position.prototype.offset = function offset (n) { + return new Position(this.line, this.column + n) + }; + + var SourceLocation = function SourceLocation(p, start, end) { + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } + }; + + // The `getLineInfo` function is mostly useful when the + // `locations` option is off (for performance reasons) and you + // want to find the line/column position for a given character + // offset. `input` should be the code string that the offset refers + // into. + + function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur) + } + } + } + + // A second optional argument can be given to further configure + // the parser process. These options are recognized: + + var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must be + // either 3, 5, 6 (2015), 7 (2016), 8 (2017), 9 (2018), or 10 + // (2019). This influences support for strict mode, the set of + // reserved words, and support for new syntax features. The default + // is 10. + ecmaVersion: 10, + // `sourceType` indicates the mode the code should be parsed in. + // Can be either `"script"` or `"module"`. This influences global + // strict mode and parsing of `import` and `export` declarations. + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // the position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, await identifiers are allowed to appear at the top-level scope, + // but they are still not allowed in non-async functions. + allowAwaitOutsideFunction: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false + }; + + // Interpret and default an options object + + function getOptions(opts) { + var options = {}; + + for (var opt in defaultOptions) + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } + + if (options.ecmaVersion >= 2015) + { options.ecmaVersion -= 2009; } + + if (options.allowReserved == null) + { options.allowReserved = options.ecmaVersion < 5; } + + if (isArray(options.onToken)) { + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; + } + if (isArray(options.onComment)) + { options.onComment = pushComment(options, options.onComment); } + + return options + } + + function pushComment(options, array) { + return function(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text, + start: start, + end: end + }; + if (options.locations) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } + if (options.ranges) + { comment.range = [start, end]; } + array.push(comment); + } + } + + // Each scope gets a bitset that may contain these flags + var + SCOPE_TOP = 1, + SCOPE_FUNCTION = 2, + SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION, + SCOPE_ASYNC = 4, + SCOPE_GENERATOR = 8, + SCOPE_ARROW = 16, + SCOPE_SIMPLE_CATCH = 32, + SCOPE_SUPER = 64, + SCOPE_DIRECT_SUPER = 128; + + function functionFlags(async, generator) { + return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0) + } + + // Used in checkLVal and declareName to determine the type of a binding + var + BIND_NONE = 0, // Not a binding + BIND_VAR = 1, // Var-style binding + BIND_LEXICAL = 2, // Let- or const-style binding + BIND_FUNCTION = 3, // Function declaration + BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding + BIND_OUTSIDE = 5; // Special case for function names as bound inside the function + + var Parser = function Parser(options, input, startPos) { + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); + var reserved = ""; + if (options.allowReserved !== true) { + for (var v = options.ecmaVersion;; v--) + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType === "module") { reserved += " await"; } + } + this.reservedWords = wordsRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = wordsRegexp(reservedStrict); + this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // escape sequences must not be interpreted as keywords. + this.containsEsc = false; + + // Set up token state + + // The current position of the tokenizer in the input. + if (startPos) { + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Positions to delayed-check that yield/await does not exist in default parameters. + this.yieldPos = this.awaitPos = this.awaitIdentPos = 0; + // Labels in scope. + this.labels = []; + // Thus-far undefined exports. + this.undefinedExports = {}; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterScope(SCOPE_TOP); + + // For RegExp validation + this.regexpState = null; + }; + + var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true } }; + + Parser.prototype.parse = function parse () { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node) + }; + + prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; + prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 }; + prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 }; + prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 }; + prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; + prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; + + // Switch to a getter for 7.0.0. + Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 }; + + Parser.extend = function extend () { + var plugins = [], len = arguments.length; + while ( len-- ) plugins[ len ] = arguments[ len ]; + + var cls = this; + for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); } + return cls + }; + + Parser.parse = function parse (input, options) { + return new this(options, input).parse() + }; + + Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) { + var parser = new this(options, input, pos); + parser.nextToken(); + return parser.parseExpression() + }; + + Parser.tokenizer = function tokenizer (input, options) { + return new this(options, input) + }; + + Object.defineProperties( Parser.prototype, prototypeAccessors ); + + var pp = Parser.prototype; + + // ## Parser utilities + + var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; + pp.strictDirective = function(start) { + for (;;) { + // Try to find string literal. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + var match = literal.exec(this.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) === "use strict") { + skipWhiteSpace.lastIndex = start + match[0].length; + var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length; + var next = this.input.charAt(end); + return next === ";" || next === "}" || + (lineBreak.test(spaceAfter[0]) && + !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "=")) + } + start += match[0].length; + + // Skip semicolon, if any. + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this.input)[0].length; + if (this.input[start] === ";") + { start++; } + } + }; + + // Predicate that tests whether the next token is of the given + // type, and if yes, consumes it as a side effect. + + pp.eat = function(type) { + if (this.type === type) { + this.next(); + return true + } else { + return false + } + }; + + // Tests whether parsed token is a contextual keyword. + + pp.isContextual = function(name) { + return this.type === types.name && this.value === name && !this.containsEsc + }; + + // Consumes contextual keyword if possible. + + pp.eatContextual = function(name) { + if (!this.isContextual(name)) { return false } + this.next(); + return true + }; + + // Asserts that following token is given contextual keyword. + + pp.expectContextual = function(name) { + if (!this.eatContextual(name)) { this.unexpected(); } + }; + + // Test whether a semicolon can be inserted at the current position. + + pp.canInsertSemicolon = function() { + return this.type === types.eof || + this.type === types.braceR || + lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + pp.insertSemicolon = function() { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } + return true + } + }; + + // Consume a semicolon, or, failing that, see if we are allowed to + // pretend that there is a semicolon at this position. + + pp.semicolon = function() { + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } + }; + + pp.afterTrailingComma = function(tokType, notNext) { + if (this.type === tokType) { + if (this.options.onTrailingComma) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } + if (!notNext) + { this.next(); } + return true + } + }; + + // Expect a token of a given type. If found, consume it, otherwise, + // raise an unexpected token error. + + pp.expect = function(type) { + this.eat(type) || this.unexpected(); + }; + + // Raise an unexpected token error. + + pp.unexpected = function(pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); + }; + + function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; + } + + pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } + }; + + pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } + }; + + pp.checkYieldAwaitInDefaultParams = function() { + if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } + if (this.awaitPos) + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } + }; + + pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" + }; + + var pp$1 = Parser.prototype; + + // ### Statement parsing + + // Parse a program. Initializes the parser, reads any number of + // statements, and wraps them in a Program node. Optionally takes a + // `program` argument. If present, the statements will be appended + // to its body instead of creating a new node. + + pp$1.parseTopLevel = function(node) { + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this.parseStatement(null, true, exports); + node.body.push(stmt); + } + if (this.inModule) + { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1) + { + var name = list[i]; + + this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined")); + } } + this.adaptDirectivePrologue(node.body); + this.next(); + node.sourceType = this.options.sourceType; + return this.finishNode(node, "Program") + }; + + var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; + + pp$1.isLet = function(context) { + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + // For ambiguous cases, determine if a LexicalDeclaration (or only a + // Statement) is allowed here. If context is not empty then only a Statement + // is allowed. However, `let [` is an explicit negative lookahead for + // ExpressionStatement, so special-case it first. + if (nextCh === 91) { return true } // '[' + if (context) { return false } + + if (nextCh === 123) { return true } // '{' + if (isIdentifierStart(nextCh, true)) { + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } + } + return false + }; + + // check 'async [no LineTerminator here] function' + // - 'async /*foo*/ function' is OK. + // - 'async /*\n*/ function' is invalid. + pp$1.isAsyncFunction = function() { + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } + + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; + return !lineBreak.test(this.input.slice(this.pos, next)) && + this.input.slice(next, next + 8) === "function" && + (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) + }; + + // Parse a single statement. + // + // If expecting a statement and finding a slash operator, parse a + // regular expression literal. This is to handle cases like + // `if (foo) /blah/.exec(foo)`, where looking at the previous token + // does not help. + + pp$1.parseStatement = function(context, topLevel, exports) { + var starttype = this.type, node = this.startNode(), kind; + + if (this.isLet(context)) { + starttype = types._var; + kind = "let"; + } + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + // Function as sole body of either an if statement or a labeled statement + // works, but not when it is part of a labeled statement that is the sole + // body of an if statement. + if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } + return this.parseFunctionStatement(node, false, !context) + case types._class: + if (context) { this.unexpected(); } + return this.parseClass(node, true) + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (context && kind !== "var") { this.unexpected(); } + return this.parseVarStatement(node, kind) + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock(true, node) + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: + if (this.options.ecmaVersion > 10 && starttype === types._import) { + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 40 || nextCh === 46) // '(' or '.' + { return this.parseExpressionStatement(node, this.parseExpression()) } + } + + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } + if (!this.inModule) + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } + } + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + if (this.isAsyncFunction()) { + if (context) { this.unexpected(); } + this.next(); + return this.parseFunctionStatement(node, true, !context) + } + + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr, context) } + else { return this.parseExpressionStatement(node, expr) } + } + }; + + pp$1.parseBreakContinueStatement = function(node, keyword) { + var isBreak = keyword === "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } + else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } + } + } + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") + }; + + pp$1.parseDebuggerStatement = function(node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement") + }; + + pp$1.parseDoStatement = function(node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement("do"); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) + { this.eat(types.semi); } + else + { this.semicolon(); } + return this.finishNode(node, "DoWhileStatement") + }; + + // Disambiguating between a `for` and a `for`/`in` or `for`/`of` + // loop is non-trivial. Basically, we have to parse the init `var` + // statement or expression, disallowing the `in` operator (see + // the second parameter to `parseExpression`), and then check + // whether the next token is `in` or `of`. When there is no init + // part (semicolon immediately after the opening parenthesis), it + // is a regular `for` loop. + + pp$1.parseForStatement = function(node) { + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterScope(0); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init$1) + } + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); + return this.parseForIn(node, init) + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, init) + }; + + pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) { + this.next(); + return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) + }; + + pp$1.parseIfStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + // allow function declarations in branches, but only in non-strict mode + node.consequent = this.parseStatement("if"); + node.alternate = this.eat(types._else) ? this.parseStatement("if") : null; + return this.finishNode(node, "IfStatement") + }; + + pp$1.parseReturnStatement = function(node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) + { this.raise(this.start, "'return' outside of function"); } + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } + return this.finishNode(node, "ReturnStatement") + }; + + pp$1.parseSwitchStatement = function(node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterScope(0); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + var cur; + for (var sawDefault = false; this.type !== types.braceR;) { + if (this.type === types._case || this.type === types._default) { + var isCase = this.type === types._case; + if (cur) { this.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; + } + this.expect(types.colon); + } else { + if (!cur) { this.unexpected(); } + cur.consequent.push(this.parseStatement(null)); + } + } + this.exitScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement") + }; + + pp$1.parseThrowStatement = function(node) { + this.next(); + if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement") + }; + + // Reused empty array added for node fields that are always empty. + + var empty = []; + + pp$1.parseTryStatement = function(node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + if (this.eat(types.parenL)) { + clause.param = this.parseBindingAtom(); + var simple = clause.param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLVal(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types.parenR); + } else { + if (this.options.ecmaVersion < 10) { this.unexpected(); } + clause.param = null; + this.enterScope(0); + } + clause.body = this.parseBlock(false); + this.exitScope(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) + { this.raise(node.start, "Missing catch or finally clause"); } + return this.finishNode(node, "TryStatement") + }; + + pp$1.parseVarStatement = function(node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration") + }; + + pp$1.parseWhileStatement = function(node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement("while"); + this.labels.pop(); + return this.finishNode(node, "WhileStatement") + }; + + pp$1.parseWithStatement = function(node) { + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement("with"); + return this.finishNode(node, "WithStatement") + }; + + pp$1.parseEmptyStatement = function(node) { + this.next(); + return this.finishNode(node, "EmptyStatement") + }; + + pp$1.parseLabeledStatement = function(node, maybeName, expr, context) { + for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this.labels[i]; + if (label$1.statementStart === node.start) { + // Update information about previous labels on this node + label$1.statementStart = this.start; + label$1.kind = kind; + } else { break } + } + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label"); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement") + }; + + pp$1.parseExpressionStatement = function(node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement") + }; + + // Parse a semicolon-enclosed block of statements, handling `"use + // strict"` declarations when `allowStrict` is true (used for + // function bodies). + + pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) { + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; + if ( node === void 0 ) node = this.startNode(); + + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { this.enterScope(0); } + while (this.type !== types.braceR) { + var stmt = this.parseStatement(null); + node.body.push(stmt); + } + if (exitStrict) { this.strict = false; } + this.next(); + if (createNewLexicalScope) { this.exitScope(); } + return this.finishNode(node, "BlockStatement") + }; + + // Parse a regular `for` loop. The disambiguation code in + // `parseStatement` will already have parsed the init statement or + // expression. + + pp$1.parseFor = function(node, init) { + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, "ForStatement") + }; + + // Parse a `for`/`in` and `for`/`of` loop, which are almost + // same from parser's perspective. + + pp$1.parseForIn = function(node, init) { + var isForIn = this.type === types._in; + this.next(); + + if ( + init.type === "VariableDeclaration" && + init.declarations[0].init != null && + ( + !isForIn || + this.options.ecmaVersion < 8 || + this.strict || + init.kind !== "var" || + init.declarations[0].id.type !== "Identifier" + ) + ) { + this.raise( + init.start, + ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer") + ); + } else if (init.type === "AssignmentPattern") { + this.raise(init.start, "Invalid left-hand side in for-loop"); + } + node.left = init; + node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + node.body = this.parseStatement("for"); + this.exitScope(); + this.labels.pop(); + return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement") + }; + + // Parse a list of variable declarations. + + pp$1.parseVar = function(node, isFor, kind) { + node.declarations = []; + node.kind = kind; + for (;;) { + var decl = this.startNode(); + this.parseVarId(decl, kind); + if (this.eat(types.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(types.comma)) { break } + } + return node + }; + + pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + }; + + var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; + + // Parse a function declaration or literal (depending on the + // `statement & FUNC_STATEMENT`). + + // Remove `allowExpressionBody` for 7.0.0, as it is only called with false + pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) { + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { + if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT)) + { this.unexpected(); } + node.generator = this.eat(types.star); + } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + if (statement & FUNC_STATEMENT) { + node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent(); + if (node.id && !(statement & FUNC_HANGING_STATEMENT)) + // If it is a regular function declaration in sloppy mode, then it is + // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding + // mode depends on properties of the current scope (see + // treatFunctionsAsVar). + { this.checkLVal(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); } + } + + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(node.async, node.generator)); + + if (!(statement & FUNC_STATEMENT)) + { node.id = this.type === types.name ? this.parseIdent() : null; } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression") + }; + + pp$1.parseFunctionParams = function(node) { + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + }; + + // Parse a class declaration or literal (depending on the + // `isStatement` parameter). + + pp$1.parseClass = function(node, isStatement) { + this.next(); + + // ecma-262 14.6 Class Definitions + // A class definition is always strict mode code. + var oldStrict = this.strict; + this.strict = true; + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (this.type !== types.braceR) { + var element = this.parseClassElement(node.superClass !== null); + if (element) { + classBody.body.push(element); + if (element.type === "MethodDefinition" && element.kind === "constructor") { + if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); } + hadConstructor = true; + } + } + } + this.strict = oldStrict; + this.next(); + node.body = this.finishNode(classBody, "ClassBody"); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") + }; + + pp$1.parseClassElement = function(constructorAllowsSuper) { + var this$1 = this; + + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + var allowsDirectSuper = false; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + allowsDirectSuper = constructorAllowsSuper; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method + }; + + pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + return this.finishNode(method, "MethodDefinition") + }; + + pp$1.parseClassId = function(node, isStatement) { + if (this.type === types.name) { + node.id = this.parseIdent(); + if (isStatement) + { this.checkLVal(node.id, BIND_LEXICAL, false); } + } else { + if (isStatement === true) + { this.unexpected(); } + node.id = null; + } + }; + + pp$1.parseClassSuper = function(node) { + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; + }; + + // Parses module export declaration. + + pp$1.parseExport = function(node, exports) { + this.next(); + // export * from '...' + if (this.eat(types.star)) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseIdent(true); + this.checkExport(exports, node.exported.name, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); + } + return this.finishNode(node, "ExportDefaultDeclaration") + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(null); + if (node.declaration.type === "VariableDeclaration") + { this.checkVariableExport(exports, node.declaration.declarations); } + else + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; + } else { // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); + if (this.eatContextual("from")) { + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + } else { + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + // check for keywords used as local names + var spec = list[i]; + + this.checkUnreserved(spec.local); + // check if export is defined + this.checkLocalExport(spec.local); + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration") + }; + + pp$1.checkExport = function(exports, name, pos) { + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; + }; + + pp$1.checkPatternExport = function(exports, pat) { + var type = pat.type; + if (type === "Identifier") + { this.checkExport(exports, pat.name, pat.start); } + else if (type === "ObjectPattern") + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkPatternExport(exports, prop); + } } + else if (type === "ArrayPattern") + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this.checkPatternExport(exports, elt); } + } } + else if (type === "Property") + { this.checkPatternExport(exports, pat.value); } + else if (type === "AssignmentPattern") + { this.checkPatternExport(exports, pat.left); } + else if (type === "RestElement") + { this.checkPatternExport(exports, pat.argument); } + else if (type === "ParenthesizedExpression") + { this.checkPatternExport(exports, pat.expression); } + }; + + pp$1.checkVariableExport = function(exports, decls) { + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this.checkPatternExport(exports, decl.id); + } + }; + + pp$1.shouldParseExportStatement = function() { + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() + }; + + // Parses a comma-separated list of module exports. + + pp$1.parseExportSpecifiers = function(exports) { + var nodes = [], first = true; + // export { x, y as z } [from '...'] + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node = this.startNode(); + node.local = this.parseIdent(true); + node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; + this.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes + }; + + // Parses import declaration. + + pp$1.parseImport = function(node) { + this.next(); + // import '...' + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration") + }; + + // Parses a comma-separated list of module imports. + + pp$1.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, BIND_LEXICAL); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } + } + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); + return nodes + } + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var node$2 = this.startNode(); + node$2.imported = this.parseIdent(true); + if (this.eatContextual("as")) { + node$2.local = this.parseIdent(); + } else { + this.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; + } + this.checkLVal(node$2.local, BIND_LEXICAL); + nodes.push(this.finishNode(node$2, "ImportSpecifier")); + } + return nodes + }; + + // Set `ExpressionStatement#directive` property for directive prologues. + pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } + }; + pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) + }; + + var pp$2 = Parser.prototype; + + // Convert existing expression atom to assignable pattern + // if possible. + + pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + if (this.inAsync && node.name === "await") + { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); } + break + + case "ObjectPattern": + case "ArrayPattern": + case "RestElement": + break + + case "ObjectExpression": + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this.raise(prop.argument.start, "Unexpected token"); + } + } + break + + case "Property": + // AssignmentProperty has type === "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + + case "ArrayExpression": + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } + break + + case "AssignmentExpression": + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern + + case "AssignmentPattern": + break + + case "ParenthesizedExpression": + this.toAssignable(node.expression, isBinding, refDestructuringErrors); + break + + case "ChainExpression": + this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (!isBinding) { break } + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + return node + }; + + // Convert list of expression atoms to binding list. + + pp$2.toAssignableList = function(exprList, isBinding) { + var end = exprList.length; + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) { this.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } + } + return exprList + }; + + // Parses spread element. + + pp$2.parseSpread = function(refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); + return this.finishNode(node, "SpreadElement") + }; + + pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); + + return this.finishNode(node, "RestElement") + }; + + // Parses lvalue (assignable) atom. + + pp$2.parseBindingAtom = function() { + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") + + case types.braceL: + return this.parseObj(true) + } + } + return this.parseIdent() + }; + + pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { + var elts = [], first = true; + while (!this.eat(close)) { + if (first) { first = false; } + else { this.expect(types.comma); } + if (allowEmpty && this.type === types.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break + } else if (this.type === types.ellipsis) { + var rest = this.parseRestBinding(); + this.parseBindingListItem(rest); + elts.push(rest); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + this.expect(close); + break + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts + }; + + pp$2.parseBindingListItem = function(param) { + return param + }; + + // Parses assignment pattern around given atom if possible. + + pp$2.parseMaybeDefault = function(startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern") + }; + + // Verify that a node is an lval — something that can be assigned + // to. + // bindingType can be either: + // 'var' indicating that the lval creates a 'var' binding + // 'let' indicating that the lval creates a lexical ('let' or 'const') binding + // 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references + + pp$2.checkLVal = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "Identifier": + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (checkClashes) { + if (has(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } + break + + case "ChainExpression": + this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side"); + break + + case "MemberExpression": + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + break + + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this.checkLVal(prop, bindingType, checkClashes); + } + break + + case "Property": + // AssignmentProperty has type === "Property" + this.checkLVal(expr.value, bindingType, checkClashes); + break + + case "ArrayPattern": + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this.checkLVal(elem, bindingType, checkClashes); } + } + break + + case "AssignmentPattern": + this.checkLVal(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLVal(expr.argument, bindingType, checkClashes); + break + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, bindingType, checkClashes); + break + + default: + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); + } + }; + + // A recursive descent parser operates by defining functions for all + + var pp$3 = Parser.prototype; + + // Check if property name clashes with already added. + // Object/class getters and setters are not allowed to clash — + // either with each other or with an init property — and in + // strict mode, init properties are also not allowed to be repeated. + + pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } + if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) + { return } + var key = prop.key; + var name; + switch (key.type) { + case "Identifier": name = key.name; break + case "Literal": name = String(key.value); break + default: return + } + var kind = prop.kind; + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) { + if (refDestructuringErrors) { + if (refDestructuringErrors.doubleProto < 0) + { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; + } + return + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; + }; + + // ### Expression parsing + + // These nest, from the most general expression type at the top to + // 'atomic', nondivisible expression types at the bottom. Most of + // the functions will simply let the function(s) below them parse, + // and, *if* the syntactic construct they handle is present, wrap + // the AST node that the inner parser gave them in another node. + + // Parse a full expression. The optional arguments are used to + // forbid the `in` operator (in for loops initalization expressions) + // and provide reference for storing '=' operator inside shorthand + // property assignment in contexts where both object expression + // and object pattern might appear (so it's possible to raise + // delayed syntax error at correct position). + + pp$3.parseExpression = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); } + return this.finishNode(node, "SequenceExpression") + } + return expr + }; + + // Parse an assignment expression. This includes applications of + // operators like `+=`. + + pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { + if (this.isContextual("yield")) { + if (this.inGenerator) { return this.parseYield(noIn) } + // The tokenizer will assume an expression is allowed after + // `yield`, but this isn't that kind of yield + else { this.exprAllowed = false; } + } + + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; + } + + var startPos = this.start, startLoc = this.startLoc; + if (this.type === types.parenL || this.type === types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } + if (this.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; + } + if (refDestructuringErrors.shorthandAssign >= node.left.start) + { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression") + } else { + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } + } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } + return left + }; + + // Parse a ternary conditional (`?:`) operator. + + pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression") + } + return expr + }; + + // Start the precedence parser. + + pp$3.parseExprOps = function(noIn, refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) + }; + + // Parse binary operators with the operator precedence parsing + // algorithm. `left` is the left-hand side of the operator. + // `minPrec` provides context that allows the function to stop and + // defer further parser to one of its callers when it encounters an + // operator that has a lower precedence than the set it is parsing. + + pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { + if (prec > minPrec) { + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var coalesce = this.type === types.coalesce; + if (coalesce) { + // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. + // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. + prec = types.logicalAND.binop; + } + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); + if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) { + this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); + } + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) + } + } + return left + }; + + pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; + return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") + }; + + // Parse unary operators, both prefix and postfix. + + pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { + var startPos = this.start, startLoc = this.startLoc, expr; + if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) { + expr = this.parseAwait(); + sawUnary = true; + } else if (this.type.prefix) { + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } + else if (this.strict && node.operator === "delete" && + node.argument.type === "Identifier") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } else { + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + while (this.type.postfix && !this.canInsertSemicolon()) { + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.operator = this.value; + node$1.prefix = false; + node$1.argument = expr; + this.checkLVal(expr); + this.next(); + expr = this.finishNode(node$1, "UpdateExpression"); + } + } + + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } + else + { return expr } + }; + + // Parse call, dot, and `[]`-subscript expressions. + + pp$3.parseExprSubscripts = function(refDestructuringErrors) { + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") + { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result + }; + + pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && + this.potentialArrowAt === base.start; + var optionalChained = false; + + while (true) { + var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained); + + if (element.optional) { optionalChained = true; } + if (element === base || element.type === "ArrowFunctionExpression") { + if (optionalChained) { + var chainNode = this.startNodeAt(startPos, startLoc); + chainNode.expression = element; + element = this.finishNode(chainNode, "ChainExpression"); + } + return element + } + + base = element; + } + }; + + pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) { + var optionalSupported = this.options.ecmaVersion >= 11; + var optional = optionalSupported && this.eat(types.questionDot); + if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } + + var computed = this.eat(types.bracketL); + if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never"); + node.computed = !!computed; + if (computed) { this.expect(types.bracketR); } + if (optionalSupported) { + node.optional = optional; + } + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + if (this.awaitIdentPos > 0) + { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); } + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos; + var node$1 = this.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + if (optionalSupported) { + node$1.optional = optional; + } + base = this.finishNode(node$1, "CallExpression"); + } else if (this.type === types.backQuote) { + if (optional || optionalChained) { + this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); + } + var node$2 = this.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this.parseTemplate({isTagged: true}); + base = this.finishNode(node$2, "TaggedTemplateExpression"); + } + return base + }; + + // Parse an atomic expression — either a single token that is an + // expression, an expression started by a keyword like `function` or + // `new`, or an expression wrapped in punctuation like `()`, `[]`, + // or `{}`. + + pp$3.parseExprAtom = function(refDestructuringErrors) { + // If a division operator appears in an expression position, the + // tokenizer got confused, and we force it to read a regexp instead. + if (this.type === types.slash) { this.readRegexp(); } + + var node, canBeArrow = this.potentialArrowAt === this.start; + switch (this.type) { + case types._super: + if (!this.allowSuper) + { this.raise(this.start, "'super' keyword outside a method"); } + node = this.startNode(); + this.next(); + if (this.type === types.parenL && !this.allowDirectSuper) + { this.raise(node.start, "super() call outside constructor of a subclass"); } + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super ( Arguments ) + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") + + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") + + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(false); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) } + if (canBeArrow && !this.canInsertSemicolon()) { + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(false); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) + } + } + return id + + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; + return node + + case types.num: case types.string: + return this.parseLiteral(this.value) + + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal") + + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr + + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression") + + case types.braceL: + return this.parseObj(false, refDestructuringErrors) + + case types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, 0) + + case types._class: + return this.parseClass(this.startNode(), false) + + case types._new: + return this.parseNew() + + case types.backQuote: + return this.parseTemplate() + + case types._import: + if (this.options.ecmaVersion >= 11) { + return this.parseExprImport() + } else { + return this.unexpected() + } + + default: + this.unexpected(); + } + }; + + pp$3.parseExprImport = function() { + var node = this.startNode(); + + // Consume `import` as an identifier for `import.meta`. + // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`. + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); } + var meta = this.parseIdent(true); + + switch (this.type) { + case types.parenL: + return this.parseDynamicImport(node) + case types.dot: + node.meta = meta; + return this.parseImportMeta(node) + default: + this.unexpected(); + } + }; + + pp$3.parseDynamicImport = function(node) { + this.next(); // skip `(` + + // Parse node.source. + node.source = this.parseMaybeAssign(); + + // Verify ending. + if (!this.eat(types.parenR)) { + var errorPos = this.start; + if (this.eat(types.comma) && this.eat(types.parenR)) { + this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); + } else { + this.unexpected(errorPos); + } + } + + return this.finishNode(node, "ImportExpression") + }; + + pp$3.parseImportMeta = function(node) { + this.next(); // skip `.` + + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + + if (node.property.name !== "meta") + { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); } + if (containsEsc) + { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); } + if (this.options.sourceType !== "module") + { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } + + return this.finishNode(node, "MetaProperty") + }; + + pp$3.parseLiteral = function(value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); } + this.next(); + return this.finishNode(node, "Literal") + }; + + pp$3.parseParenExpression = function() { + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); + return val + }; + + pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; + if (this.options.ecmaVersion >= 6) { + this.next(); + + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + // Do not save awaitIdentPos to allow checking awaits nested in parameters + while (this.type !== types.parenR) { + first ? first = false : this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; + break + } else if (this.type === types.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRestBinding())); + if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } + break + } else { + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + return this.parseParenArrowList(startPos, startLoc, exprList) + } + + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression") + } else { + return val + } + }; + + pp$3.parseParenItem = function(item) { + return item + }; + + pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) + }; + + // New's precedence is slightly tricky. It must allow its argument to + // be a `[]` or dot subscript expression, but not a call — at least, + // not without wrapping it in parentheses. Thus, it uses the noCalls + // argument to parseSubscripts to prevent it from consuming the + // argument list. + + var empty$1 = []; + + pp$3.parseNew = function() { + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target") + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); } + if (containsEsc) + { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); } + if (!this.inNonArrowFunction()) + { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); } + return this.finishNode(node, "MetaProperty") + } + var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (isImport && node.callee.type === "ImportExpression") { + this.raise(startPos, "Cannot use new with import()"); + } + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty$1; } + return this.finishNode(node, "NewExpression") + }; + + // Parse template expression. + + pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; + } + this.next(); + elem.tail = this.type === types.backQuote; + return this.finishNode(elem, "TemplateElement") + }; + + pp$3.parseTemplate = function(ref) { + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; + + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; + while (!curElt.tail) { + if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); } + this.expect(types.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(types.braceR); + node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); + } + this.next(); + return this.finishNode(node, "TemplateLiteral") + }; + + pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) + }; + + // Parse an object literal or binding pattern. + + pp$3.parseObj = function(isPattern, refDestructuringErrors) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { + if (!first) { + this.expect(types.comma); + if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break } + } else { first = false; } + + var prop = this.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") + }; + + pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") + }; + + pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && + (prop.key.name === "get" || prop.key.name === "set") && + (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") + { this.raiseRecoverable(start, "getter should have no params"); } + else + { this.raiseRecoverable(start, "setter should have exactly one param"); } + } else { + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } + } + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + if (isGenerator || isAsync) { this.unexpected(); } + this.checkUnreserved(prop.key); + if (prop.key.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = startPos; } + prop.kind = "init"; + if (isPattern) { + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else { this.unexpected(); } + }; + + pp$3.parsePropertyName = function(prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); + return prop.key + } else { + prop.computed = false; + } + } + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") + }; + + // Initialize empty function node. + + pp$3.initFunction = function(node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } + if (this.options.ecmaVersion >= 8) { node.async = false; } + }; + + // Parse object or class method. + + pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { + var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.initFunction(node); + if (this.options.ecmaVersion >= 6) + { node.generator = isGenerator; } + if (this.options.ecmaVersion >= 8) + { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); + + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false, true); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "FunctionExpression") + }; + + // Parse arrow function expression with given parameters. + + pp$3.parseArrowExpression = function(node, params, isAsync) { + var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; + + this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW); + this.initFunction(node); + if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; } + + this.yieldPos = 0; + this.awaitPos = 0; + this.awaitIdentPos = 0; + + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true, false); + + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.awaitIdentPos = oldAwaitIdentPos; + return this.finishNode(node, "ArrowFunctionExpression") + }; + + // Parse function body and check parameters. + + pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) { + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); + } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } + + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params)); + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + if (this.strict && node.id) { this.checkLVal(node.id, BIND_OUTSIDE); } + node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; + } + this.exitScope(); + }; + + pp$3.isSimpleParamList = function(params) { + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } + return true + }; + + // Checks function params for various disallowed patterns such as using "eval" + // or "arguments" and duplicate parameters. + + pp$3.checkParams = function(node, allowDuplicates) { + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + } + }; + + // Parses a comma-separated list of expressions, and returns them as + // an array. `close` is the token type that ends the list, and + // `allowEmpty` can be turned on to allow subsequent commas with + // nothing in between them to be parsed as `null` (which is needed + // for array literals). + + pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(types.comma); + if (allowTrailingComma && this.afterTrailingComma(close)) { break } + } else { first = false; } + + var elt = (void 0); + if (allowEmpty && this.type === types.comma) + { elt = null; } + else if (this.type === types.ellipsis) { + elt = this.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this.start; } + } else { + elt = this.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); + } + return elts + }; + + pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); } + if (this.keywords.test(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") !== -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } + }; + + // Parse the next token as an identifier. If `liberal` is true (used + // when parsing properties), it will also convert keywords into + // identifiers. + + pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } + } else { + this.unexpected(); + } + this.next(!!liberal); + this.finishNode(node, "Identifier"); + if (!liberal) { + this.checkUnreserved(node); + if (node.name === "await" && !this.awaitIdentPos) + { this.awaitIdentPos = node.start; } + } + return node + }; + + // Parses yield expression inside generator. + + pp$3.parseYield = function(noIn) { + if (!this.yieldPos) { this.yieldPos = this.start; } + + var node = this.startNode(); + this.next(); + if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(noIn); + } + return this.finishNode(node, "YieldExpression") + }; + + pp$3.parseAwait = function() { + if (!this.awaitPos) { this.awaitPos = this.start; } + + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, false); + return this.finishNode(node, "AwaitExpression") + }; + + var pp$4 = Parser.prototype; + + // This function is used to raise exceptions on parse errors. It + // takes an offset integer (into the current `input`) to indicate + // the location of the error, attaches the position to the end + // of the error message, and then raises a `SyntaxError` with that + // message. + + pp$4.raise = function(pos, message) { + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; + throw err + }; + + pp$4.raiseRecoverable = pp$4.raise; + + pp$4.curPosition = function() { + if (this.options.locations) { + return new Position(this.curLine, this.pos - this.lineStart) + } + }; + + var pp$5 = Parser.prototype; + + var Scope = function Scope(flags) { + this.flags = flags; + // A list of var-declared names in the current lexical scope + this.var = []; + // A list of lexically-declared names in the current lexical scope + this.lexical = []; + // A list of lexically-declared FunctionDeclaration names in the current lexical scope + this.functions = []; + }; + + // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + + pp$5.enterScope = function(flags) { + this.scopeStack.push(new Scope(flags)); + }; + + pp$5.exitScope = function() { + this.scopeStack.pop(); + }; + + // The spec says: + // > At the top level of a function, or script, function declarations are + // > treated like var declarations rather than like lexical declarations. + pp$5.treatFunctionsAsVarInScope = function(scope) { + return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) + }; + + pp$5.declareName = function(name, bindingType, pos) { + var redeclared = false; + if (bindingType === BIND_LEXICAL) { + var scope = this.currentScope(); + redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1; + scope.lexical.push(name); + if (this.inModule && (scope.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + } else if (bindingType === BIND_SIMPLE_CATCH) { + var scope$1 = this.currentScope(); + scope$1.lexical.push(name); + } else if (bindingType === BIND_FUNCTION) { + var scope$2 = this.currentScope(); + if (this.treatFunctionsAsVar) + { redeclared = scope$2.lexical.indexOf(name) > -1; } + else + { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; } + scope$2.functions.push(name); + } else { + for (var i = this.scopeStack.length - 1; i >= 0; --i) { + var scope$3 = this.scopeStack[i]; + if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) || + !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) { + redeclared = true; + break + } + scope$3.var.push(name); + if (this.inModule && (scope$3.flags & SCOPE_TOP)) + { delete this.undefinedExports[name]; } + if (scope$3.flags & SCOPE_VAR) { break } + } + } + if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); } + }; + + pp$5.checkLocalExport = function(id) { + // scope.functions must be empty as Module code is always strict. + if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && + this.scopeStack[0].var.indexOf(id.name) === -1) { + this.undefinedExports[id.name] = id; + } + }; + + pp$5.currentScope = function() { + return this.scopeStack[this.scopeStack.length - 1] + }; + + pp$5.currentVarScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR) { return scope } + } + }; + + // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + pp$5.currentThisScope = function() { + for (var i = this.scopeStack.length - 1;; i--) { + var scope = this.scopeStack[i]; + if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope } + } + }; + + var Node = function Node(parser, pos, loc) { + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) + { this.loc = new SourceLocation(parser, loc); } + if (parser.options.directSourceFile) + { this.sourceFile = parser.options.directSourceFile; } + if (parser.options.ranges) + { this.range = [pos, 0]; } + }; + + // Start an AST node, attaching a start offset. + + var pp$6 = Parser.prototype; + + pp$6.startNode = function() { + return new Node(this, this.start, this.startLoc) + }; + + pp$6.startNodeAt = function(pos, loc) { + return new Node(this, pos, loc) + }; + + // Finish an AST node, adding `type` and `end` properties. + + function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) + { node.loc.end = loc; } + if (this.options.ranges) + { node.range[1] = pos; } + return node + } + + pp$6.finishNode = function(node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) + }; + + // Finish node at given position + + pp$6.finishNodeAt = function(node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc) + }; + + // The algorithm used to determine whether a regexp can appear at a + + var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; + }; + + var types$1 = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", false), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) + }; + + var pp$7 = Parser.prototype; + + pp$7.initialContext = function() { + return [types$1.b_stat] + }; + + pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType === types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) + { return true } + if (prevType === types.braceL) + { return parent === types$1.b_stat } + if (prevType === types._var || prevType === types._const || prevType === types.name) + { return false } + return !this.exprAllowed + }; + + pp$7.inGeneratorContext = function() { + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this.context[i]; + if (context.token === "function") + { return context.generator } + } + return false + }; + + pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType === types.dot) + { this.exprAllowed = false; } + else if (update = type.updateContext) + { update.call(this, prevType); } + else + { this.exprAllowed = type.beforeExpr; } + }; + + // Token-specific context update code + + types.parenR.updateContext = types.braceR.updateContext = function() { + if (this.context.length === 1) { + this.exprAllowed = true; + return + } + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); + } + this.exprAllowed = !out.isExpr; + }; + + types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; + }; + + types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; + }; + + types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; + }; + + types.incDec.updateContext = function() { + // tokExprAllowed stays unchanged + }; + + types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } + else + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; + }; + + types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; + }; + + types.star.updateContext = function(prevType) { + if (prevType === types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; + }; + + types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6 && prevType !== types.dot) { + if (this.value === "of" && !this.exprAllowed || + this.value === "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; + }; + + // This file contains Unicode properties extracted from the ECMAScript + // specification. The lists are extracted like so: + // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText) + + // #table-binary-unicode-properties + var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS"; + var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic"; + var ecma11BinaryProperties = ecma10BinaryProperties; + var unicodeBinaryProperties = { + 9: ecma9BinaryProperties, + 10: ecma10BinaryProperties, + 11: ecma11BinaryProperties + }; + + // #table-unicode-general-category-values + var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu"; + + // #table-unicode-script-values + var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb"; + var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd"; + var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"; + var unicodeScriptValues = { + 9: ecma9ScriptValues, + 10: ecma10ScriptValues, + 11: ecma11ScriptValues + }; + + var data = {}; + function buildUnicodeData(ecmaVersion) { + var d = data[ecmaVersion] = { + binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + nonBinary: { + General_Category: wordsRegexp(unicodeGeneralCategoryValues), + Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) + } + }; + d.nonBinary.Script_Extensions = d.nonBinary.Script; + + d.nonBinary.gc = d.nonBinary.General_Category; + d.nonBinary.sc = d.nonBinary.Script; + d.nonBinary.scx = d.nonBinary.Script_Extensions; + } + buildUnicodeData(9); + buildUnicodeData(10); + buildUnicodeData(11); + + var pp$8 = Parser.prototype; + + var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion]; + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; + }; + + RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + }; + + RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); + }; + + // If u flag is given, this returns the code point at the index (it combines a surrogate pair). + // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). + RegExpValidationState.prototype.at = function at (i, forceU) { + if ( forceU === void 0 ) forceU = false; + + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + var next = s.charCodeAt(i + 1); + return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c + }; + + RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) { + if ( forceU === void 0 ) forceU = false; + + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i), next; + if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || + (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { + return i + 1 + } + return i + 2 + }; + + RegExpValidationState.prototype.current = function current (forceU) { + if ( forceU === void 0 ) forceU = false; + + return this.at(this.pos, forceU) + }; + + RegExpValidationState.prototype.lookahead = function lookahead (forceU) { + if ( forceU === void 0 ) forceU = false; + + return this.at(this.nextIndex(this.pos, forceU), forceU) + }; + + RegExpValidationState.prototype.advance = function advance (forceU) { + if ( forceU === void 0 ) forceU = false; + + this.pos = this.nextIndex(this.pos, forceU); + }; + + RegExpValidationState.prototype.eat = function eat (ch, forceU) { + if ( forceU === void 0 ) forceU = false; + + if (this.current(forceU) === ch) { + this.advance(forceU); + return true + } + return false + }; + + function codePointToString(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) + } + + /** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpFlags = function(state) { + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) === -1) { + this.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this.raise(state.start, "Duplicate regular expression flag"); + } + } + }; + + /** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ + pp$8.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern + pp$8.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction + pp$8.regexp_disjunction = function(state) { + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative + pp$8.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term + pp$8.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion + pp$8.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier + pp$8.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix + pp$8.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) + }; + pp$8.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom + pp$8.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) + }; + pp$8.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom + pp$8.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier + pp$8.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter + pp$8.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter + // But eat eager. + pp$8.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter + pp$8.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false + }; + + // GroupSpecifier :: + // [empty] + // `?` GroupName + pp$8.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } + }; + + // GroupName :: + // `<` RegExpIdentifierName `>` + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false + }; + + // RegExpIdentifierName :: + // RegExpIdentifierStart + // RegExpIdentifierName RegExpIdentifierPart + // Note: this updates `state.lastStringValue` property with the eaten name. + pp$8.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString(state.lastIntValue); + } + return true + } + return false + }; + + // RegExpIdentifierStart :: + // UnicodeIDStart + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + pp$8.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ + } + + // RegExpIdentifierPart :: + // UnicodeIDContinue + // `$` + // `_` + // `\` RegExpUnicodeEscapeSequence[+U] + // + // + pp$8.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var forceU = this.options.ecmaVersion >= 11; + var ch = state.current(forceU); + state.advance(forceU); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false + }; + function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* */ || ch === 0x200D /* */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape + pp$8.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false + }; + pp$8.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape + pp$8.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state, false) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) + }; + pp$8.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false + }; + pp$8.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape + pp$8.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter + pp$8.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence + pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { + if ( forceU === void 0 ) forceU = false; + + var start = state.pos; + var switchU = forceU || state.switchU; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false + }; + function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape + pp$8.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape + pp$8.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape + pp$8.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false + }; + function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) + } + + // UnicodePropertyValueExpression :: + // UnicodePropertyName `=` UnicodePropertyValue + // LoneUnicodePropertyNameOrValue + pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false + }; + pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!has(state.unicodeProperties.nonBinary, name)) + { state.raise("Invalid property name"); } + if (!state.unicodeProperties.nonBinary[name].test(value)) + { state.raise("Invalid property value"); } + }; + pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (!state.unicodeProperties.binary.test(nameOrValue)) + { state.raise("Invalid property name"); } + }; + + // UnicodePropertyName :: + // UnicodePropertyNameCharacters + pp$8.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ + } + + // UnicodePropertyValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString(ch); + state.advance(); + } + return state.lastStringValue !== "" + }; + function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) + } + + // LoneUnicodePropertyNameOrValue :: + // UnicodePropertyValueCharacters + pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass + pp$8.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* ] */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges + // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash + pp$8.regexp_classRanges = function(state) { + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom + // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash + pp$8.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* ] */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape + pp$8.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter + pp$8.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits + pp$8.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start + }; + function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits + pp$8.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start + }; + function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) + } + function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence + // Allows only 0-377(octal) i.e. 0-255(decimal). + pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false + }; + + // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit + pp$8.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false + }; + function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ + } + + // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits + // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit + // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence + pp$8.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true + }; + + // Object type used to represent tokens. Note that normally, tokens + // simply exist as properties on the parser object. This is only + // used for the onToken callback and the external tokenizer. + + var Token = function Token(p) { + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } + if (p.options.ranges) + { this.range = [p.start, p.end]; } + }; + + // ## Tokenizer + + var pp$9 = Parser.prototype; + + // Move to the next token + + pp$9.next = function(ignoreEscapeSequenceInKeyword) { + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) + { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } + if (this.options.onToken) + { this.options.onToken(new Token(this)); } + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); + }; + + pp$9.getToken = function() { + this.next(); + return new Token(this) + }; + + // If we're in an ES6 environment, make parsers iterable + if (typeof Symbol !== "undefined") + { pp$9[Symbol.iterator] = function() { + var this$1 = this; + + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } + } + } + }; } + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + pp$9.curContext = function() { + return this.context[this.context.length - 1] + }; + + // Read a single token, updating the parser object's token-related + // properties. + + pp$9.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } + + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } + + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } + }; + + pp$9.readToken = function(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) + { return this.readWord() } + + return this.getTokenFromCode(code) + }; + + pp$9.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00 + }; + + pp$9.skipBlockComment = function() { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; + if (this.options.locations) { + lineBreakG.lastIndex = start; + var match; + while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this.curLine; + this.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } + }; + + pp$9.skipLineComment = function(startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this.input.charCodeAt(++this.pos); + } + if (this.options.onComment) + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + pp$9.skipSpace = function() { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32: case 160: // ' ' + ++this.pos; + break + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10: case 8232: case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break + case 47: // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: // '*' + this.skipBlockComment(); + break + case 47: + this.skipLineComment(2); + break + default: + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop + } + } + } + }; + + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + pp$9.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + pp$9.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' + this.pos += 3; + return this.finishToken(types.ellipsis) + } else { + ++this.pos; + return this.finishToken(types.dot) + } + }; + + pp$9.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) + }; + + pp$9.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; + + // exponentiation operator ** and **= + if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); + } + + if (next === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(tokentype, size) + }; + + pp$9.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (this.options.ecmaVersion >= 12) { + var next2 = this.input.charCodeAt(this.pos + 2); + if (next2 === 61) { return this.finishOp(types.assign, 3) } + } + return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) + }; + + pp$9.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) + }; + + pp$9.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) + }; + + pp$9.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken() + } + return this.finishOp(types.incDec, 2) + } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; + +pp$9.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) + } + if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && + this.input.charCodeAt(this.pos + 3) === 45) { + // `` line comment\n this.skipLineComment(3)\n this.skipSpace()\n return this.nextToken()\n }\n return this.finishOp(tt.incDec, 2)\n }\n if (next === 61) return this.finishOp(tt.assign, 2)\n return this.finishOp(tt.plusMin, 1)\n}\n\npp.readToken_lt_gt = function(code) { // '<>'\n let next = this.input.charCodeAt(this.pos + 1)\n let size = 1\n if (next === code) {\n size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2\n if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1)\n return this.finishOp(tt.bitShift, size)\n }\n if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&\n this.input.charCodeAt(this.pos + 3) === 45) {\n // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp$7.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1) + var size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp$7.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1) + var size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp.readToken_lt_gt = function(code) { // '<>' + let next = this.input.charCodeAt(this.pos + 1) + let size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // ` + +Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/v3/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm i async`, it can also be used directly in the browser. A ESM/MJS version is included in the main `async` package that should automatically be used with compatible bundlers such as Webpack and Rollup. + +A pure ESM version of Async is available as [`async-es`](https://www.npmjs.com/package/async-es). + +For Documentation, visit + +*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)* + + +```javascript +// for use with Node-style callbacks... +var async = require("async"); + +var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; +var configs = {}; + +async.forEachOf(obj, (value, key, callback) => { + fs.readFile(__dirname + value, "utf8", (err, data) => { + if (err) return callback(err); + try { + configs[key] = JSON.parse(data); + } catch (e) { + return callback(e); + } + callback(); + }); +}, err => { + if (err) console.error(err.message); + // configs is now a map of JSON data + doSomethingWith(configs); +}); +``` + +```javascript +var async = require("async"); + +// ...or ES2017 async functions +async.mapLimit(urls, 5, async function(url) { + const response = await fetch(url) + return response.body +}, (err, results) => { + if (err) throw err + // results is now an array of the response bodies + console.log(results) +}) +``` diff --git a/node_modules/async/all.js b/node_modules/async/all.js new file mode 100644 index 0000000..622b301 --- /dev/null +++ b/node_modules/async/all.js @@ -0,0 +1,119 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function every(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(every, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/allLimit.js b/node_modules/async/allLimit.js new file mode 100644 index 0000000..375e126 --- /dev/null +++ b/node_modules/async/allLimit.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everyLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everyLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/allSeries.js b/node_modules/async/allSeries.js new file mode 100644 index 0000000..9a6bf7d --- /dev/null +++ b/node_modules/async/allSeries.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everySeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everySeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/any.js b/node_modules/async/any.js new file mode 100644 index 0000000..a5bd328 --- /dev/null +++ b/node_modules/async/any.js @@ -0,0 +1,122 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function some(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(some, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/anyLimit.js b/node_modules/async/anyLimit.js new file mode 100644 index 0000000..3a8096f --- /dev/null +++ b/node_modules/async/anyLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/anySeries.js b/node_modules/async/anySeries.js new file mode 100644 index 0000000..51aad19 --- /dev/null +++ b/node_modules/async/anySeries.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/apply.js b/node_modules/async/apply.js new file mode 100644 index 0000000..d40784f --- /dev/null +++ b/node_modules/async/apply.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (fn, ...args) { + return (...callArgs) => fn(...args, ...callArgs); +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/applyEach.js b/node_modules/async/applyEach.js new file mode 100644 index 0000000..841842c --- /dev/null +++ b/node_modules/async/applyEach.js @@ -0,0 +1,57 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _applyEach = require('./internal/applyEach.js'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _map = require('./map.js'); + +var _map2 = _interopRequireDefault(_map); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ +exports.default = (0, _applyEach2.default)(_map2.default); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/applyEachSeries.js b/node_modules/async/applyEachSeries.js new file mode 100644 index 0000000..f5267f6 --- /dev/null +++ b/node_modules/async/applyEachSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _applyEach = require('./internal/applyEach.js'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _mapSeries = require('./mapSeries.js'); + +var _mapSeries2 = _interopRequireDefault(_mapSeries); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ +exports.default = (0, _applyEach2.default)(_mapSeries2.default); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/asyncify.js b/node_modules/async/asyncify.js new file mode 100644 index 0000000..ddc3f02 --- /dev/null +++ b/node_modules/async/asyncify.js @@ -0,0 +1,118 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncify; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + if ((0, _wrapAsync.isAsync)(func)) { + return function (...args /*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback); + }; + } + + return (0, _initialParams2.default)(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback); + } else { + callback(null, result); + } + }); +} + +function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + (0, _setImmediate2.default)(e => { + throw e; + }, err); + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/auto.js b/node_modules/async/auto.js new file mode 100644 index 0000000..163c4f2 --- /dev/null +++ b/node_modules/async/auto.js @@ -0,0 +1,333 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = auto; + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } + + function processQueue() { + if (canceled) return; + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while (readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = (0, _onlyOnce2.default)((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return; + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return; + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error('async.auto cannot execute tasks due to a recursive dependency'); + } + } + + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; + } + + return callback[_promiseCallback.PROMISE_SYMBOL]; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/autoInject.js b/node_modules/async/autoInject.js new file mode 100644 index 0000000..38eac15 --- /dev/null +++ b/node_modules/async/autoInject.js @@ -0,0 +1,182 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = autoInject; + +var _auto = require('./auto.js'); + +var _auto2 = _interopRequireDefault(_auto); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; +var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /(=.+)?(\s*)$/; + +function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index + 1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = endIndex === -1 ? string.length : endIndex; + } else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; +} + +function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); + } + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src); + let [, args] = match; + return args.replace(/\s/g, '').split(FN_ARG_SPLIT).map(arg => arg.replace(FN_ARG, '').trim()); +} + +/** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ +function autoInject(tasks, callback) { + var newTasks = {}; + + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn); + var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; + + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + (0, _wrapAsync2.default)(taskFn)(...newArgs); + } + }); + + return (0, _auto2.default)(newTasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/bower.json b/node_modules/async/bower.json new file mode 100644 index 0000000..390c650 --- /dev/null +++ b/node_modules/async/bower.json @@ -0,0 +1,17 @@ +{ + "name": "async", + "main": "dist/async.js", + "ignore": [ + "bower_components", + "lib", + "test", + "node_modules", + "perf", + "support", + "**/.*", + "*.config.js", + "*.json", + "index.js", + "Makefile" + ] +} diff --git a/node_modules/async/cargo.js b/node_modules/async/cargo.js new file mode 100644 index 0000000..d4abd21 --- /dev/null +++ b/node_modules/async/cargo.js @@ -0,0 +1,63 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = cargo; + +var _queue = require('./internal/queue.js'); + +var _queue2 = _interopRequireDefault(_queue); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ +function concat(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concat, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/concatLimit.js b/node_modules/async/concatLimit.js new file mode 100644 index 0000000..a27cc7d --- /dev/null +++ b/node_modules/async/concatLimit.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); +} +exports.default = (0, _awaitify2.default)(concatLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/concatSeries.js b/node_modules/async/concatSeries.js new file mode 100644 index 0000000..332de3f --- /dev/null +++ b/node_modules/async/concatSeries.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _concatLimit = require('./concatLimit.js'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatSeries(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concatSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/constant.js b/node_modules/async/constant.js new file mode 100644 index 0000000..ea406f6 --- /dev/null +++ b/node_modules/async/constant.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (...args) { + return function (...ignoredArgs /*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/detect.js b/node_modules/async/detect.js new file mode 100644 index 0000000..d5896ef --- /dev/null +++ b/node_modules/async/detect.js @@ -0,0 +1,96 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function detect(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detect, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/detectLimit.js b/node_modules/async/detectLimit.js new file mode 100644 index 0000000..c59843b --- /dev/null +++ b/node_modules/async/detectLimit.js @@ -0,0 +1,48 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detectLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/detectSeries.js b/node_modules/async/detectSeries.js new file mode 100644 index 0000000..b486899 --- /dev/null +++ b/node_modules/async/detectSeries.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); +} + +exports.default = (0, _awaitify2.default)(detectSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/dir.js b/node_modules/async/dir.js new file mode 100644 index 0000000..8e9fafd --- /dev/null +++ b/node_modules/async/dir.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _consoleFunc = require('./internal/consoleFunc.js'); + +var _consoleFunc2 = _interopRequireDefault(_consoleFunc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ +exports.default = (0, _consoleFunc2.default)('dir'); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js new file mode 100644 index 0000000..e58f8f2 --- /dev/null +++ b/node_modules/async/dist/async.js @@ -0,0 +1,6062 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.async = {})); +})(this, (function (exports) { 'use strict'; + + /** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ + function apply(fn, ...args) { + return (...callArgs) => fn(...args,...callArgs); + } + + function initialParams (fn) { + return function (...args/*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; + } + + /* istanbul ignore file */ + + var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; + var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; + var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + + function fallback(fn) { + setTimeout(fn, 0); + } + + function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); + } + + var _defer$1; + + if (hasQueueMicrotask) { + _defer$1 = queueMicrotask; + } else if (hasSetImmediate) { + _defer$1 = setImmediate; + } else if (hasNextTick) { + _defer$1 = process.nextTick; + } else { + _defer$1 = fallback; + } + + var setImmediate$1 = wrap(_defer$1); + + /** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ + function asyncify(func) { + if (isAsync(func)) { + return function (...args/*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback) + } + } + + return initialParams(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback) + } else { + callback(null, result); + } + }); + } + + function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); + } + + function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + setImmediate$1(e => { throw e }, err); + } + } + + function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; + } + + function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; + } + + function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; + } + + function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function') + return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; + } + + // conditionally promisify a function. + // only return a promise if a callback is omitted + function awaitify (asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined') + function awaitable (...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args) + } + + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err) + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }) + } + + return awaitable + } + + function applyEach$1 (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = awaitify(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + wrapAsync(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; + } + + function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = wrapAsync(iteratee); + + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); + } + + function isArrayLike(value) { + return value && + typeof value.length === 'number' && + value.length >= 0 && + value.length % 1 === 0; + } + + // A temporary value used to identify if the loop should be broken. + // See #1064, #1293 + const breakLoop = {}; + var breakLoop$1 = breakLoop; + + function once(fn) { + function wrapper (...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper + } + + function getIterator (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); + } + + function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? {value: coll[i], key: i} : null; + } + } + + function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return {value: item.value, key: i}; + } + } + + function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? {value: obj[key], key} : null; + }; + } + + function createIterator(coll) { + if (isArrayLike(coll)) { + return createArrayIterator(coll); + } + + var iterator = getIterator(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + } + + function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; + } + + // for async generators + function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({value, done: iterDone}) => { + //console.log('got value', value) + if (canceled || done) return + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } + + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return + if (err) return handleError(err) + + if (err === false) { + done = true; + canceled = true; + return + } + + if (result === breakLoop$1 || (done && running <= 0)) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } + + function handleError(err) { + if (canceled) return + awaiting = false; + done = true; + callback(err); + } + + replenish(); + } + + var eachOfLimit$2 = (limit) => { + return (obj, iteratee, callback) => { + callback = once(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1') + } + if (!obj) { + return callback(null); + } + if (isAsyncGenerator(obj)) { + return asyncEachOfLimit(obj, limit, iteratee, callback) + } + if (isAsyncIterable(obj)) { + return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) + } + var nextElem = createIterator(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + if (canceled) return + running -= 1; + if (err) { + done = true; + callback(err); + } + else if (err === false) { + done = true; + canceled = true; + } + else if (value === breakLoop$1 || (done && running <= 0)) { + done = true; + return callback(null); + } + else if (!looping) { + replenish(); + } + } + + function replenish () { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; + }; + + /** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachOfLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); + } + + var eachOfLimit$1 = awaitify(eachOfLimit, 4); + + // eachOf implementation optimized for array-likes + function eachOfArrayLike(coll, iteratee, callback) { + callback = once(callback); + var index = 0, + completed = 0, + {length} = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return + if (err) { + callback(err); + } else if ((++completed === length) || value === breakLoop$1) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, onlyOnce(iteratorCallback)); + } + } + + // a generic version of eachOf which can handle array, object, and iterator cases. + function eachOfGeneric (coll, iteratee, callback) { + return eachOfLimit$1(coll, Infinity, iteratee, callback); + } + + /** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ + function eachOf(coll, iteratee, callback) { + var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, wrapAsync(iteratee), callback); + } + + var eachOf$1 = awaitify(eachOf, 3); + + /** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function map (coll, iteratee, callback) { + return _asyncMap(eachOf$1, coll, iteratee, callback) + } + var map$1 = awaitify(map, 3); + + /** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ + var applyEach = applyEach$1(map$1); + + /** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachOfSeries(coll, iteratee, callback) { + return eachOfLimit$1(coll, 1, iteratee, callback) + } + var eachOfSeries$1 = awaitify(eachOfSeries, 3); + + /** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function mapSeries (coll, iteratee, callback) { + return _asyncMap(eachOfSeries$1, coll, iteratee, callback) + } + var mapSeries$1 = awaitify(mapSeries, 3); + + /** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ + var applyEachSeries = applyEach$1(mapSeries$1); + + const PROMISE_SYMBOL = Symbol('promiseCallback'); + + function promiseCallback () { + let resolve, reject; + function callback (err, ...args) { + if (err) return reject(err) + resolve(args.length > 1 ? args : args[0]); + } + + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, + reject = rej; + }); + + return callback + } + + /** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = once(callback || promiseCallback()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } + + function processQueue() { + if (canceled) return + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while(readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } + + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = onlyOnce((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = wrapAsync(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); + } + } + + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; + } + + return callback[PROMISE_SYMBOL] + } + + var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; + var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; + var FN_ARG_SPLIT = /,/; + var FN_ARG = /(=.+)?(\s*)$/; + + function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index+1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = (endIndex === -1) ? string.length : endIndex; + } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; + } + + function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); + } + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) + let [, args] = match; + return args + .replace(/\s/g, '') + .split(FN_ARG_SPLIT) + .map((arg) => arg.replace(FN_ARG, '').trim()); + } + + /** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ + function autoInject(tasks, callback) { + var newTasks = {}; + + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = isAsync(taskFn); + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); + + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + wrapAsync(taskFn)(...newArgs); + } + }); + + return auto(newTasks, callback); + } + + // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation + // used for queues. This implementation assumes that the node provided by the user can be modified + // to adjust the next and last properties. We implement only the minimal functionality + // for queue support. + class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } + + removeLink(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; + } + + empty () { + while(this.head) this.shift(); + return this; + } + + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; + node.next = newNode; + this.length += 1; + } + + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; + node.prev = newNode; + this.length += 1; + } + + unshift(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); + } + + push(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); + } + + shift() { + return this.head && this.removeLink(this.head); + } + + pop() { + return this.tail && this.removeLink(this.tail); + } + + toArray() { + return [...this] + } + + *[Symbol.iterator] () { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } + + remove (testFn) { + var curr = this.head; + while(curr) { + var {next} = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } + } + + function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; + } + + function queue$1(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } + + var _worker = wrapAsync(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; + + function on (event, handler) { + events[event].push(handler); + } + + function once (event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } + + function off (event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []) + if (!handler) return events[event] = [] + events[event] = events[event].filter(ev => ev !== handler); + } + + function trigger (event, ...args) { + events[event].forEach(handler => handler(...args)); + } + + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + + var res, rej; + function promiseCallback (err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res() + if (args.length <= 1) return res(args[0]) + res(args); + } + + var item = q._createTaskItem( + data, + rejectOnError ? promiseCallback : + (callback || promiseCallback) + ); + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + + if (!processingScheduled) { + processingScheduled = true; + setImmediate$1(() => { + processingScheduled = false; + q.process(); + }); + } + + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }) + } + } + + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback(err, ...args); + + if (err != null) { + trigger('error', err, task.data); + } + } + + if (numRunning <= (q.concurrency - q.buffer) ) { + trigger('unsaturated'); + } + + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } + + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + setImmediate$1(() => trigger('drain')); + return true + } + return false + } + + const eventMethod = (name) => (handler) => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err) + resolve(data); + }); + }) + } + off(name); + on(name, handler); + + }; + + var isProcessing = false; + var q = { + _tasks: new DLL(), + _createTaskItem (data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator] () { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, false, callback)) + } + return _insert(data, false, false, callback); + }, + pushAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, true, callback)) + } + return _insert(data, false, true, callback); + }, + kill () { + off(); + q._tasks.empty(); + }, + unshift (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, false, callback)) + } + return _insert(data, true, false, callback); + }, + unshiftAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, true, callback)) + } + return _insert(data, true, true, callback); + }, + remove (testFn) { + q._tasks.remove(testFn); + }, + process () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + trigger('empty'); + } + + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = onlyOnce(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length () { + return q._tasks.length; + }, + running () { + return numRunning; + }, + workersList () { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause () { + q.paused = true; + }, + resume () { + if (q.paused === false) { return; } + q.paused = false; + setImmediate$1(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + }, + }); + return q; + } + + /** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function reduce(coll, memo, iteratee, callback) { + callback = once(callback); + var _iteratee = wrapAsync(iteratee); + return eachOfSeries$1(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); + } + var reduce$1 = awaitify(reduce, 4); + + /** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ + function seq(...functions) { + var _functions = functions.map(wrapAsync); + return function (...args) { + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = promiseCallback(); + } + + reduce$1(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, + (err, results) => cb(err, ...results)); + + return cb[PROMISE_SYMBOL] + }; + } + + /** + * Creates a function which is a composition of the passed asynchronous + * functions. Each function consumes the return value of the function that + * follows. Composing functions `f()`, `g()`, and `h()` would produce the result + * of `f(g(h()))`, only this version uses callbacks to obtain the return values. + * + * If the last argument to the composed function is not a function, a promise + * is returned when you call it. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name compose + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} an asynchronous function that is the composed + * asynchronous `functions` + * @example + * + * function add1(n, callback) { + * setTimeout(function () { + * callback(null, n + 1); + * }, 10); + * } + * + * function mul3(n, callback) { + * setTimeout(function () { + * callback(null, n * 3); + * }, 10); + * } + * + * var add1mul3 = async.compose(mul3, add1); + * add1mul3(4, function (err, result) { + * // result now equals 15 + * }); + */ + function compose(...args) { + return seq(...args.reverse()); + } + + /** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function mapLimit (coll, limit, iteratee, callback) { + return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) + } + var mapLimit$1 = awaitify(mapLimit, 4); + + /** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ + function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); + } + var concatLimit$1 = awaitify(concatLimit, 4); + + /** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ + function concat(coll, iteratee, callback) { + return concatLimit$1(coll, Infinity, iteratee, callback) + } + var concat$1 = awaitify(concat, 3); + + /** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ + function concatSeries(coll, iteratee, callback) { + return concatLimit$1(coll, 1, iteratee, callback) + } + var concatSeries$1 = awaitify(concatSeries, 3); + + /** + * Returns a function that when called, calls-back with the values provided. + * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to + * [`auto`]{@link module:ControlFlow.auto}. + * + * @name constant + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {...*} arguments... - Any number of arguments to automatically invoke + * callback with. + * @returns {AsyncFunction} Returns a function that when invoked, automatically + * invokes the callback with the previous given arguments. + * @example + * + * async.waterfall([ + * async.constant(42), + * function (value, next) { + * // value === 42 + * }, + * //... + * ], callback); + * + * async.waterfall([ + * async.constant(filename, "utf8"), + * fs.readFile, + * function (fileData, next) { + * //... + * } + * //... + * ], callback); + * + * async.auto({ + * hostname: async.constant("https://server.net/"), + * port: findFreePort, + * launchServer: ["hostname", "port", function (options, cb) { + * startServer(options, cb); + * }], + * //... + * }, callback); + */ + function constant$1(...args) { + return function (...ignoredArgs/*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; + } + + function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = wrapAsync(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); + + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, breakLoop$1); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; + } + + /** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function detect(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) + } + var detect$1 = awaitify(detect, 3); + + /** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ + function detectLimit(coll, limit, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var detectLimit$1 = awaitify(detectLimit, 4); + + /** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ + function detectSeries(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) + } + + var detectSeries$1 = awaitify(detectSeries, 3); + + function consoleFunc(name) { + return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }) + } + + /** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ + var dir = consoleFunc('dir'); + + /** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ + function doWhilst(iteratee, test, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); + } + + var doWhilst$1 = awaitify(doWhilst, 3); + + /** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ + function doUntil(iteratee, test, callback) { + const _test = wrapAsync(test); + return doWhilst$1(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb (err, !truth)); + }, callback); + } + + function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); + } + + /** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ + function eachLimit$2(coll, iteratee, callback) { + return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); + } + + var each = awaitify(eachLimit$2, 3); + + /** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); + } + var eachLimit$1 = awaitify(eachLimit, 4); + + /** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ + function eachSeries(coll, iteratee, callback) { + return eachLimit$1(coll, 1, iteratee, callback) + } + var eachSeries$1 = awaitify(eachSeries, 3); + + /** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ + function ensureAsync(fn) { + if (isAsync(fn)) return fn; + return function (...args/*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + setImmediate$1(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; + } + + /** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function every(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) + } + var every$1 = awaitify(every, 3); + + /** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function everyLimit(coll, limit, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var everyLimit$1 = awaitify(everyLimit, 4); + + /** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function everySeries(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) + } + var everySeries$1 = awaitify(everySeries, 3); + + function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); + } + + function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({index, value: x}); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results + .sort((a, b) => a.index - b.index) + .map(v => v.value)); + }); + } + + function _filter(eachfn, coll, iteratee, callback) { + var filter = isArrayLike(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, wrapAsync(iteratee), callback); + } + + /** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function filter (coll, iteratee, callback) { + return _filter(eachOf$1, coll, iteratee, callback) + } + var filter$1 = awaitify(filter, 3); + + /** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ + function filterLimit (coll, limit, iteratee, callback) { + return _filter(eachOfLimit$2(limit), coll, iteratee, callback) + } + var filterLimit$1 = awaitify(filterLimit, 4); + + /** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ + function filterSeries (coll, iteratee, callback) { + return _filter(eachOfSeries$1, coll, iteratee, callback) + } + var filterSeries$1 = awaitify(filterSeries, 3); + + /** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ + function forever(fn, errback) { + var done = onlyOnce(errback); + var task = wrapAsync(ensureAsync(fn)); + + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); + } + var forever$1 = awaitify(forever, 2); + + /** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ + function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, {key, val}); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var {hasOwnProperty} = Object.prototype; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var {key} = mapResults[i]; + var {val} = mapResults[i]; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); + } + + var groupByLimit$1 = awaitify(groupByLimit, 4); + + /** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function groupBy (coll, iteratee, callback) { + return groupByLimit$1(coll, Infinity, iteratee, callback) + } + + /** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ + function groupBySeries (coll, iteratee, callback) { + return groupByLimit$1(coll, 1, iteratee, callback) + } + + /** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ + var log = consoleFunc('log'); + + /** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback); + var newObj = {}; + var _iteratee = wrapAsync(iteratee); + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); + } + + var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); + + /** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function mapValues(obj, iteratee, callback) { + return mapValuesLimit$1(obj, Infinity, iteratee, callback) + } + + /** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function mapValuesSeries(obj, iteratee, callback) { + return mapValuesLimit$1(obj, 1, iteratee, callback) + } + + /** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ + function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = wrapAsync(fn); + var memoized = initialParams((args, callback) => { + var key = hasher(...args); + if (key in memo) { + setImmediate$1(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + } + + /* istanbul ignore file */ + + /** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ + var _defer; + + if (hasNextTick) { + _defer = process.nextTick; + } else if (hasSetImmediate) { + _defer = setImmediate; + } else { + _defer = fallback; + } + + var nextTick = wrap(_defer); + + var _parallel = awaitify((eachfn, tasks, callback) => { + var results = isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, (task, key, taskCb) => { + wrapAsync(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); + }, 3); + + /** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function parallel(tasks, callback) { + return _parallel(eachOf$1, tasks, callback); + } + + /** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ + function parallelLimit(tasks, limit, callback) { + return _parallel(eachOfLimit$2(limit), tasks, callback); + } + + /** + * A queue of tasks for the worker function to complete. + * @typedef {Iterable} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {number} payload - an integer that specifies how many items are + * passed to the worker function at a time. only applies if this is a + * [cargo]{@link module:ControlFlow.cargo} object + * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns + * a promise that rejects if an error occurs. + * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns + * a promise that rejects if an error occurs. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a function that sets a callback that is + * called when the number of running workers hits the `concurrency` limit, and + * further tasks will be queued. If the callback is omitted, `q.saturated()` + * returns a promise for the next occurrence. + * @property {Function} unsaturated - a function that sets a callback that is + * called when the number of running workers is less than the `concurrency` & + * `buffer` limits, and further tasks will not be queued. If the callback is + * omitted, `q.unsaturated()` returns a promise for the next occurrence. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a function that sets a callback that is called + * when the last item from the `queue` is given to a `worker`. If the callback + * is omitted, `q.empty()` returns a promise for the next occurrence. + * @property {Function} drain - a function that sets a callback that is called + * when the last item from the `queue` has returned from the `worker`. If the + * callback is omitted, `q.drain()` returns a promise for the next occurrence. + * @property {Function} error - a function that sets a callback that is called + * when a task errors. Has the signature `function(error, task)`. If the + * callback is omitted, `error()` returns a promise that rejects on the next + * error. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + * + * @example + * const q = async.queue(worker, 2) + * q.push(item1) + * q.push(item2) + * q.push(item3) + * // queues are iterable, spread into an array to inspect + * const items = [...q] // [item1, item2, item3] + * // or use for of + * for (let item of q) { + * console.log(item) + * } + * + * q.drain(() => { + * console.log('all done') + * }) + * // or + * await q.drain() + */ + + /** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain(function() { + * console.log('all items have been processed'); + * }); + * // or await the end + * await q.drain() + * + * // assign an error callback + * q.error(function(err, task) { + * console.error('task experienced an error'); + * }); + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * // callback is optional + * q.push({name: 'bar'}); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ + function queue (worker, concurrency) { + var _worker = wrapAsync(worker); + return queue$1((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); + } + + // Binary min-heap implementation used for priority queue. + // Implementation is stable, i.e. push time is considered for equal priorities + class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } + + get length() { + return this.heap.length; + } + + empty () { + this.heap = []; + return this; + } + + percUp(index) { + let p; + + while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; + + index = p; + } + } + + percDown(index) { + let l; + + while ((l=leftChi(index)) < this.heap.length) { + if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { + l = l+1; + } + + if (smaller(this.heap[index], this.heap[l])) { + break; + } + + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; + + index = l; + } + } + + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length-1); + } + + unshift(node) { + return this.heap.push(node); + } + + shift() { + let [top] = this.heap; + + this.heap[0] = this.heap[this.heap.length-1]; + this.heap.pop(); + this.percDown(0); + + return top; + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator] () { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } + + remove (testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } + + this.heap.splice(j); + + for (let i = parent(this.heap.length-1); i >= 0; i--) { + this.percDown(i); + } + + return this; + } + } + + function leftChi(i) { + return (i<<1)+1; + } + + function parent(i) { + return ((i+1)>>1)-1; + } + + function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } + else { + return x.pushCount < y.pushCount; + } + } + + /** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, + * except this returns a promise that rejects if an error occurs. + * * The `unshift` and `unshiftAsync` methods were removed. + */ + function priorityQueue(worker, concurrency) { + // Start with a normal queue + var q = queue(worker, concurrency); + + var { + push, + pushAsync + } = q; + + q._tasks = new Heap(); + q._createTaskItem = ({data, priority}, callback) => { + return { + data, + priority, + callback + }; + }; + + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return {data: tasks, priority}; + } + return tasks.map(data => { return {data, priority}; }); + } + + // Override push to accept second parameter representing priority + q.push = function(data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; + + q.pushAsync = function(data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; + + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; + + return q; + } + + /** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ + function race(tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + wrapAsync(tasks[i])(callback); + } + } + + var race$1 = awaitify(race, 2); + + /** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ + function reduceRight (array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return reduce$1(reversed, memo, iteratee, callback); + } + + /** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ + function reflect(fn) { + var _fn = wrapAsync(fn); + return initialParams(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0){ + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); + + return _fn.apply(this, args); + }); + } + + /** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ + function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(reflect); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = reflect.call(this, tasks[key]); + }); + } + return results; + } + + function reject$2(eachfn, arr, _iteratee, callback) { + const iteratee = wrapAsync(_iteratee); + return _filter(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); + } + + /** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function reject (coll, iteratee, callback) { + return reject$2(eachOf$1, coll, iteratee, callback) + } + var reject$1 = awaitify(reject, 3); + + /** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function rejectLimit (coll, limit, iteratee, callback) { + return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) + } + var rejectLimit$1 = awaitify(rejectLimit, 4); + + /** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ + function rejectSeries (coll, iteratee, callback) { + return reject$2(eachOfSeries$1, coll, iteratee, callback) + } + var rejectSeries$1 = awaitify(rejectSeries, 3); + + function constant(value) { + return function () { + return value; + } + } + + /** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ + const DEFAULT_TIMES = 5; + const DEFAULT_INTERVAL = 0; + + function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || promiseCallback(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || promiseCallback(); + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = wrapAsync(task); + + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } + + retryAttempt(); + return callback[PROMISE_SYMBOL] + } + + function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } + } + + /** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ + function retryable (opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = (opts && opts.arity) || task.length; + if (isAsync(task)) { + arity += 1; + } + var _task = wrapAsync(task); + return initialParams((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = promiseCallback(); + } + function taskFn(cb) { + _task(...args, cb); + } + + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); + + return callback[PROMISE_SYMBOL] + }); + } + + /** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function series(tasks, callback) { + return _parallel(eachOfSeries$1, tasks, callback); + } + + /** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function some(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) + } + var some$1 = awaitify(some, 3); + + /** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function someLimit(coll, limit, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) + } + var someLimit$1 = awaitify(someLimit, 4); + + /** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ + function someSeries(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) + } + var someSeries$1 = awaitify(someSeries, 3); + + /** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ + function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return map$1(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, {value: x, criteria}); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + } + var sortBy$1 = awaitify(sortBy, 3); + + /** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ + function timeout(asyncFn, milliseconds, info) { + var fn = wrapAsync(asyncFn); + + return initialParams((args, callback) => { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); + } + + function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; + } + + /** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ + function timesLimit(count, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(range(count), limit, _iteratee, callback); + } + + /** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ + function times (n, iteratee, callback) { + return timesLimit(n, Infinity, iteratee, callback) + } + + /** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ + function timesSeries (n, iteratee, callback) { + return timesLimit(n, 1, iteratee, callback) + } + + /** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ + function transform (coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = once(callback || promiseCallback()); + var _iteratee = wrapAsync(iteratee); + + eachOf$1(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[PROMISE_SYMBOL] + } + + /** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ + function tryEach(tasks, callback) { + var error = null; + var result; + return eachSeries$1(tasks, (task, taskCb) => { + wrapAsync(task)((err, ...args) => { + if (err === false) return taskCb(err); + + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); + } + + var tryEach$1 = awaitify(tryEach); + + /** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ + function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; + } + + /** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ + function whilst(test, iteratee, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); + } + var whilst$1 = awaitify(whilst, 3); + + /** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ + function until(test, iteratee, callback) { + const _test = wrapAsync(test); + return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); + } + + /** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ + function waterfall (tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = wrapAsync(tasks[taskIndex++]); + task(...args, onlyOnce(next)); + } + + function next(err, ...args) { + if (err === false) return + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } + + nextTask([]); + } + + var waterfall$1 = awaitify(waterfall); + + /** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + + + var index = { + apply, + applyEach, + applyEachSeries, + asyncify, + auto, + autoInject, + cargo: cargo$1, + cargoQueue: cargo, + compose, + concat: concat$1, + concatLimit: concatLimit$1, + concatSeries: concatSeries$1, + constant: constant$1, + detect: detect$1, + detectLimit: detectLimit$1, + detectSeries: detectSeries$1, + dir, + doUntil, + doWhilst: doWhilst$1, + each, + eachLimit: eachLimit$1, + eachOf: eachOf$1, + eachOfLimit: eachOfLimit$1, + eachOfSeries: eachOfSeries$1, + eachSeries: eachSeries$1, + ensureAsync, + every: every$1, + everyLimit: everyLimit$1, + everySeries: everySeries$1, + filter: filter$1, + filterLimit: filterLimit$1, + filterSeries: filterSeries$1, + forever: forever$1, + groupBy, + groupByLimit: groupByLimit$1, + groupBySeries, + log, + map: map$1, + mapLimit: mapLimit$1, + mapSeries: mapSeries$1, + mapValues, + mapValuesLimit: mapValuesLimit$1, + mapValuesSeries, + memoize, + nextTick, + parallel, + parallelLimit, + priorityQueue, + queue, + race: race$1, + reduce: reduce$1, + reduceRight, + reflect, + reflectAll, + reject: reject$1, + rejectLimit: rejectLimit$1, + rejectSeries: rejectSeries$1, + retry, + retryable, + seq, + series, + setImmediate: setImmediate$1, + some: some$1, + someLimit: someLimit$1, + someSeries: someSeries$1, + sortBy: sortBy$1, + timeout, + times, + timesLimit, + timesSeries, + transform, + tryEach: tryEach$1, + unmemoize, + until, + waterfall: waterfall$1, + whilst: whilst$1, + + // aliases + all: every$1, + allLimit: everyLimit$1, + allSeries: everySeries$1, + any: some$1, + anyLimit: someLimit$1, + anySeries: someSeries$1, + find: detect$1, + findLimit: detectLimit$1, + findSeries: detectSeries$1, + flatMap: concat$1, + flatMapLimit: concatLimit$1, + flatMapSeries: concatSeries$1, + forEach: each, + forEachSeries: eachSeries$1, + forEachLimit: eachLimit$1, + forEachOf: eachOf$1, + forEachOfSeries: eachOfSeries$1, + forEachOfLimit: eachOfLimit$1, + inject: reduce$1, + foldl: reduce$1, + foldr: reduceRight, + select: filter$1, + selectLimit: filterLimit$1, + selectSeries: filterSeries$1, + wrapSync: asyncify, + during: whilst$1, + doDuring: doWhilst$1 + }; + + exports.all = every$1; + exports.allLimit = everyLimit$1; + exports.allSeries = everySeries$1; + exports.any = some$1; + exports.anyLimit = someLimit$1; + exports.anySeries = someSeries$1; + exports.apply = apply; + exports.applyEach = applyEach; + exports.applyEachSeries = applyEachSeries; + exports.asyncify = asyncify; + exports.auto = auto; + exports.autoInject = autoInject; + exports.cargo = cargo$1; + exports.cargoQueue = cargo; + exports.compose = compose; + exports.concat = concat$1; + exports.concatLimit = concatLimit$1; + exports.concatSeries = concatSeries$1; + exports.constant = constant$1; + exports.default = index; + exports.detect = detect$1; + exports.detectLimit = detectLimit$1; + exports.detectSeries = detectSeries$1; + exports.dir = dir; + exports.doDuring = doWhilst$1; + exports.doUntil = doUntil; + exports.doWhilst = doWhilst$1; + exports.during = whilst$1; + exports.each = each; + exports.eachLimit = eachLimit$1; + exports.eachOf = eachOf$1; + exports.eachOfLimit = eachOfLimit$1; + exports.eachOfSeries = eachOfSeries$1; + exports.eachSeries = eachSeries$1; + exports.ensureAsync = ensureAsync; + exports.every = every$1; + exports.everyLimit = everyLimit$1; + exports.everySeries = everySeries$1; + exports.filter = filter$1; + exports.filterLimit = filterLimit$1; + exports.filterSeries = filterSeries$1; + exports.find = detect$1; + exports.findLimit = detectLimit$1; + exports.findSeries = detectSeries$1; + exports.flatMap = concat$1; + exports.flatMapLimit = concatLimit$1; + exports.flatMapSeries = concatSeries$1; + exports.foldl = reduce$1; + exports.foldr = reduceRight; + exports.forEach = each; + exports.forEachLimit = eachLimit$1; + exports.forEachOf = eachOf$1; + exports.forEachOfLimit = eachOfLimit$1; + exports.forEachOfSeries = eachOfSeries$1; + exports.forEachSeries = eachSeries$1; + exports.forever = forever$1; + exports.groupBy = groupBy; + exports.groupByLimit = groupByLimit$1; + exports.groupBySeries = groupBySeries; + exports.inject = reduce$1; + exports.log = log; + exports.map = map$1; + exports.mapLimit = mapLimit$1; + exports.mapSeries = mapSeries$1; + exports.mapValues = mapValues; + exports.mapValuesLimit = mapValuesLimit$1; + exports.mapValuesSeries = mapValuesSeries; + exports.memoize = memoize; + exports.nextTick = nextTick; + exports.parallel = parallel; + exports.parallelLimit = parallelLimit; + exports.priorityQueue = priorityQueue; + exports.queue = queue; + exports.race = race$1; + exports.reduce = reduce$1; + exports.reduceRight = reduceRight; + exports.reflect = reflect; + exports.reflectAll = reflectAll; + exports.reject = reject$1; + exports.rejectLimit = rejectLimit$1; + exports.rejectSeries = rejectSeries$1; + exports.retry = retry; + exports.retryable = retryable; + exports.select = filter$1; + exports.selectLimit = filterLimit$1; + exports.selectSeries = filterSeries$1; + exports.seq = seq; + exports.series = series; + exports.setImmediate = setImmediate$1; + exports.some = some$1; + exports.someLimit = someLimit$1; + exports.someSeries = someSeries$1; + exports.sortBy = sortBy$1; + exports.timeout = timeout; + exports.times = times; + exports.timesLimit = timesLimit; + exports.timesSeries = timesSeries; + exports.transform = transform; + exports.tryEach = tryEach$1; + exports.unmemoize = unmemoize; + exports.until = until; + exports.waterfall = waterfall$1; + exports.whilst = whilst$1; + exports.wrapSync = asyncify; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/node_modules/async/dist/async.min.js b/node_modules/async/dist/async.min.js new file mode 100644 index 0000000..f5c464e --- /dev/null +++ b/node_modules/async/dist/async.min.js @@ -0,0 +1 @@ +(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e="undefined"==typeof globalThis?e||self:globalThis,t(e.async={}))})(this,function(e){"use strict";function t(e,...t){return(...n)=>e(...t,...n)}function n(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}function a(e){setTimeout(e,0)}function i(e){return(t,...n)=>e(()=>t(...n))}function r(e){return d(e)?function(...t){const n=t.pop(),a=e.apply(this,t);return s(a,n)}:n(function(t,n){var a;try{a=e.apply(this,t)}catch(t){return n(t)}return a&&"function"==typeof a.then?s(a,n):void n(null,a)})}function s(e,t){return e.then(e=>{l(t,null,e)},e=>{l(t,e&&(e instanceof Error||e.message)?e:new Error(e))})}function l(e,t,n){try{e(t,n)}catch(e){_e(t=>{throw t},e)}}function d(e){return"AsyncFunction"===e[Symbol.toStringTag]}function u(e){return"AsyncGenerator"===e[Symbol.toStringTag]}function p(e){return"function"==typeof e[Symbol.asyncIterator]}function c(e){if("function"!=typeof e)throw new Error("expected a function");return d(e)?r(e):e}function o(e,t){function n(...n){return"function"==typeof n[t-1]?e.apply(this,n):new Promise((a,i)=>{n[t-1]=(e,...t)=>e?i(e):void a(1{c(e).apply(i,n.concat(t))},a)});return i}}function f(e,t,n,a){t=t||[];var i=[],r=0,s=c(n);return e(t,(e,t,n)=>{var a=r++;s(e,(e,t)=>{i[a]=t,n(e)})},e=>{a(e,i)})}function y(e){return e&&"number"==typeof e.length&&0<=e.length&&0==e.length%1}function m(e){function t(...t){if(null!==e){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function g(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function k(e){var t=-1,n=e.length;return function a(){return++t=t||u||l||(u=!0,e.next().then(({value:e,done:t})=>{if(!(d||l))return u=!1,t?(l=!0,void(0>=p&&a(null))):void(p++,n(e,c,r),c++,i())}).catch(s))}function r(e,t){return p-=1,d?void 0:e?s(e):!1===e?(l=!0,void(d=!0)):t===be||l&&0>=p?(l=!0,a(null)):void i()}function s(e){d||(u=!1,l=!0,a(e))}let l=!1,d=!1,u=!1,p=0,c=0;i()}function O(e,t,n){function a(e,t){!1===e&&(l=!0);!0===l||(e?n(e):(++r===s||t===be)&&n(null))}n=m(n);var i=0,r=0,{length:s}=e,l=!1;for(0===s&&n(null);i{t=e,n=a}),e}function A(e,t,n){function a(e,t){k.push(()=>l(e,t))}function i(){if(!f){if(0===k.length&&0===h)return n(null,o);for(;k.length&&he()),i()}function l(e,t){if(!y){var a=L((t,...a)=>{if(h--,!1===t)return void(f=!0);if(2>a.length&&([a]=a),t){var i={};if(Object.keys(o).forEach(e=>{i[e]=o[e]}),i[e]=a,y=!0,g=Object.create(null),f)return;n(t,i)}else o[e]=a,s(e)});h++;var i=c(t[t.length-1]);1{0==--S[e]&&v.push(e)});if(t!==p)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function u(t){var n=[];return Object.keys(e).forEach(a=>{const i=e[a];Array.isArray(i)&&0<=i.indexOf(t)&&n.push(a)}),n}"number"!=typeof t&&(n=t,t=null),n=m(n||b());var p=Object.keys(e).length;if(!p)return n(null);t||(t=p);var o={},h=0,f=!1,y=!1,g=Object.create(null),k=[],v=[],S={};return Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n))return a(t,[n]),void v.push(t);var i=n.slice(0,n.length-1),s=i.length;return 0===s?(a(t,n),void v.push(t)):void(S[t]=s,i.forEach(l=>{if(!e[l])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+l+"` in "+i.join(", "));r(l,()=>{s--,0===s&&a(t,n)})}))}),d(),i(),n[Ce]}function I(e){let t="",n=0,a=e.indexOf("*/");for(;ne.replace(Ne,"").trim())}function j(e,t){var n={};return Object.keys(e).forEach(t=>{function a(e,t){var n=i.map(t=>e[t]);n.push(t),c(r)(...n)}var i,r=e[t],s=d(r),l=!s&&1===r.length||s&&0===r.length;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(0{r(e,n),t(...a)};f[e].push(n)}function r(e,t){return e?t?void(f[e]=f[e].filter(e=>e!==t)):f[e]=[]:Object.keys(f).forEach(e=>f[e]=[])}function s(e,...t){f[e].forEach(e=>e(...t))}function l(e,t,n,a){function i(e,...t){return e?n?s(e):r():1>=t.length?r(t[0]):void r(t)}if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");k.started=!0;var r,s,l=k._createTaskItem(e,n?i:a||i);if(t?k._tasks.unshift(l):k._tasks.push(l),y||(y=!0,_e(()=>{y=!1,k.process()})),n||!a)return new Promise((e,t)=>{r=e,s=t})}function d(e){return function(t,...n){o-=1;for(var a=0,r=e.length;as("drain")),!0)}if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var p=c(e),o=0,h=[];const f={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};var y=!1;const m=e=>t=>t?void(r(e),a(e,t)):new Promise((t,n)=>{i(e,(e,a)=>e?n(e):void t(a))});var g=!1,k={_tasks:new Ve,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*k._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!1,!1,t)):l(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!1,!0,t)):l(e,!1,!0,t)},kill(){r(),k._tasks.empty()},unshift(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!0,!1,t)):l(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?u(e)?void 0:e.map(e=>l(e,!0,!0,t)):l(e,!0,!0,t)},remove(e){k._tasks.remove(e)},process(){var e=Math.min;if(!g){for(g=!0;!k.paused&&o{t.apply(n,e.concat((e,...t)=>{a(e,t)}))},(e,t)=>a(e,...t)),a[Ce]}}function P(...e){return C(...e.reverse())}function R(...e){return function(...t){var n=t.pop();return n(null,...e)}}function z(e,t){return(n,a,i,r)=>{var s,l=!1;const d=c(i);n(a,(n,a,i)=>{d(n,(a,r)=>a||!1===a?i(a):e(r)&&!s?(l=!0,s=t(!0,n),i(null,be)):void i())},e=>e?r(e):void r(null,l?s:t(!1)))}}function N(e){return(t,...n)=>c(t)(...n,(t,...n)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}function V(e,t,n){const a=c(t);return Xe(e,(...e)=>{const t=e.pop();a(...e,(e,n)=>t(e,!n))},n)}function Y(e){return(t,n,a)=>e(t,a)}function q(e){return d(e)?e:function(...t){var n=t.pop(),a=!0;t.push((...e)=>{a?_e(()=>n(...e)):n(...e)}),e.apply(this,t),a=!1}}function D(e,t,n,a){var r=Array(t.length);e(t,(e,t,a)=>{n(e,(e,n)=>{r[t]=!!n,a(e)})},e=>{if(e)return a(e);for(var n=[],s=0;s{n(e,(n,r)=>n?a(n):void(r&&i.push({index:t,value:e}),a(n)))},e=>e?a(e):void a(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value)))}function U(e,t,n,a){var i=y(t)?D:Q;return i(e,t,c(n),a)}function G(e,t,n){return dt(e,1/0,t,n)}function W(e,t,n){return dt(e,1,t,n)}function H(e,t,n){return pt(e,1/0,t,n)}function J(e,t,n){return pt(e,1,t,n)}function K(e,t=e=>e){var a=Object.create(null),r=Object.create(null),s=c(e),l=n((e,n)=>{var d=t(...e);d in a?_e(()=>n(null,...a[d])):d in r?r[d].push(n):(r[d]=[n],s(...e,(e,...t)=>{e||(a[d]=t);var n=r[d];delete r[d];for(var s=0,u=n.length;s{n(e[0],t)},t,1)}function ee(e){return(e<<1)+1}function te(e){return(e+1>>1)-1}function ne(e,t){return e.priority===t.priority?e.pushCount({data:e,priority:t})):{data:e,priority:t}}var a=$(e,t),{push:i,pushAsync:r}=a;return a._tasks=new ht,a._createTaskItem=({data:e,priority:t},n)=>({data:e,priority:t,callback:n}),a.push=function(e,t=0,a){return i(n(e,t),a)},a.pushAsync=function(e,t=0,a){return r(n(e,t),a)},delete a.unshift,delete a.unshiftAsync,a}function ie(e,t,n,a){var i=[...e].reverse();return qe(i,t,n,a)}function re(e){var t=c(e);return n(function a(e,n){return e.push((e,...t)=>{let a={};if(e&&(a.error=e),0=t.length&&([i]=t),a.value=i}n(null,a)}),t.apply(this,e)})}function se(e){var t;return Array.isArray(e)?t=e.map(re):(t={},Object.keys(e).forEach(n=>{t[n]=re.call(this,e[n])})),t}function le(e,t,n,a){const i=c(n);return U(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},a)}function de(e){return function(){return e}}function ue(e,t,n){function a(){r((e,...t)=>{!1===e||(e&&s++arguments.length&&"function"==typeof e?(n=t||b(),t=e):(pe(i,e),n=n||b()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var r=c(t),s=1;return a(),n[Ce]}function pe(e,n){if("object"==typeof n)e.times=+n.times||kt,e.intervalFunc="function"==typeof n.interval?n.interval:de(+n.interval||vt),e.errorFilter=n.errorFilter;else if("number"==typeof n||"string"==typeof n)e.times=+n||kt;else throw new Error("Invalid arguments for async.retry")}function ce(e,t){t||(t=e,e=null);let a=e&&e.arity||t.length;d(t)&&(a+=1);var i=c(t);return n((t,n)=>{function r(e){i(...t,e)}return(t.length{function s(){var t=e.name||"anonymous",n=new Error("Callback function \""+t+"\" timed out.");n.code="ETIMEDOUT",a&&(n.info=a),d=!0,r(n)}var l,d=!1;n.push((...e)=>{d||(r(...e),clearTimeout(l))}),l=setTimeout(s,t),i(...n)})}function fe(e){for(var t=Array(e);e--;)t[e]=e;return t}function ye(e,t,n,a){var i=c(n);return De(fe(e),t,i,a)}function me(e,t,n){return ye(e,1/0,t,n)}function ge(e,t,n){return ye(e,1,t,n)}function ke(e,t,n,a){3>=arguments.length&&"function"==typeof t&&(a=n,n=t,t=Array.isArray(e)?[]:{}),a=m(a||b());var i=c(n);return Me(e,(e,n,a)=>{i(t,e,n,a)},e=>a(e,t)),a[Ce]}function ve(e){return(...t)=>(e.unmemoized||e)(...t)}function Se(e,t,n){const a=c(e);return _t(e=>a((t,n)=>e(t,!n)),t,n)}var xe,Le="function"==typeof queueMicrotask&&queueMicrotask,Ee="function"==typeof setImmediate&&setImmediate,Oe="object"==typeof process&&"function"==typeof process.nextTick;xe=Le?queueMicrotask:Ee?setImmediate:Oe?process.nextTick:a;var _e=i(xe);var be={},Ae=e=>(t,n,a)=>{function i(e,t){if(!d)if(c-=1,e)l=!0,a(e);else if(!1===e)l=!0,d=!0;else{if(t===be||l&&0>=c)return l=!0,a(null);o||r()}}function r(){for(o=!0;c=c&&a(null));c+=1,n(t.value,t.key,L(i))}o=!1}if(a=m(a),0>=e)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return a(null);if(u(t))return E(t,e,n,a);if(p(t))return E(t[Symbol.asyncIterator](),e,n,a);var s=x(t),l=!1,d=!1,c=0,o=!1;r()},Ie=o(function i(e,t,n,a){return Ae(t)(e,c(n),a)},4),Me=o(function a(e,t,n){var i=y(e)?O:_;return i(e,c(t),n)},3),je=o(function a(e,t,n){return f(Me,e,t,n)},3),we=h(je),Be=o(function a(e,t,n){return Ie(e,1,t,n)},3),Te=o(function a(e,t,n){return f(Be,e,t,n)},3),Fe=h(Te);const Ce=Symbol("promiseCallback");var Pe=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Re=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,ze=/,/,Ne=/(=.+)?(\s*)$/;class Ve{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):w(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):w(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}var Ye,qe=o(function i(e,t,n,a){a=m(a);var r=c(n);return Be(e,(e,n,a)=>{r(t,e,(e,n)=>{t=n,a(e)})},e=>a(e,t))},4),De=o(function i(e,t,n,a){return f(Ae(t),e,n,a)},4),Qe=o(function i(e,t,n,a){var r=c(n);return De(e,t,(e,t)=>{r(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],r=0;re,(e,t)=>t)(Me,e,t,n)},3),He=o(function i(e,t,n,a){return z(e=>e,(e,t)=>t)(Ae(t),e,n,a)},4),Je=o(function a(e,t,n){return z(e=>e,(e,t)=>t)(Ae(1),e,t,n)},3),Ke=N("dir"),Xe=o(function a(e,t,n){function i(e,...t){return e?n(e):void(!1===e||(s=t,d(...t,r)))}function r(e,t){return e?n(e):!1===e?void 0:t?void l(i):n(null,...s)}n=L(n);var s,l=c(e),d=c(t);return r(null,!0)},3),Ze=o(function a(e,t,n){return Me(e,Y(c(t)),n)},3),$e=o(function i(e,t,n,a){return Ae(t)(e,Y(c(n)),a)},4),et=o(function a(e,t,n){return $e(e,1,t,n)},3),tt=o(function a(e,t,n){return z(e=>!e,e=>!e)(Me,e,t,n)},3),nt=o(function i(e,t,n,a){return z(e=>!e,e=>!e)(Ae(t),e,n,a)},4),at=o(function a(e,t,n){return z(e=>!e,e=>!e)(Be,e,t,n)},3),it=o(function a(e,t,n){return U(Me,e,t,n)},3),rt=o(function i(e,t,n,a){return U(Ae(t),e,n,a)},4),st=o(function a(e,t,n){return U(Be,e,t,n)},3),lt=o(function n(e,t){function a(e){return e?i(e):void(!1===e||r(a))}var i=L(t),r=c(q(e));return a()},2),dt=o(function i(e,t,n,a){var r=c(n);return De(e,t,(e,t)=>{r(e,(n,a)=>n?t(n):t(n,{key:a,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:r}=Object.prototype,s=0;s{s(e,t,(e,a)=>e?n(e):void(r[t]=a,n(e)))},e=>a(e,r))},4);Ye=Oe?process.nextTick:Ee?setImmediate:a;var ct=i(Ye),ot=o((e,t,n)=>{var a=y(t)?[]:{};e(t,(e,t,n)=>{c(e)((e,...i)=>{2>i.length&&([i]=i),a[t]=i,n(e)})},e=>n(e,a))},3);class ht{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){for(let n;0e)(Me,e,t,n)},3),xt=o(function i(e,t,n,a){return z(Boolean,e=>e)(Ae(t),e,n,a)},4),Lt=o(function a(e,t,n){return z(Boolean,e=>e)(Be,e,t,n)},3),Et=o(function a(e,t,n){function i(e,t){var n=e.criteria,a=t.criteria;return na?1:0}var r=c(t);return je(e,(e,t)=>{r(e,(n,a)=>n?t(n):void t(n,{value:e,criteria:a}))},(e,t)=>e?n(e):void n(null,t.sort(i).map(e=>e.value)))},3),Ot=o(function n(e,t){var a,i=null;return et(e,(e,t)=>{c(e)((e,...n)=>!1===e?t(e):void(2>n.length?[a]=n:a=n,i=e,t(e?null:{})))},()=>t(i,a))}),_t=o(function a(e,t,n){function i(e,...t){if(e)return n(e);d=t;!1===e||l(r)}function r(e,t){return e?n(e):!1===e?void 0:t?void s(i):n(null,...d)}n=L(n);var s=c(t),l=c(e),d=[];return l(r)},3),bt=o(function n(e,t){function a(t){var n=c(e[r++]);n(...t,L(i))}function i(n,...i){return!1===n?void 0:n||r===e.length?t(n,...i):void a(i)}if(t=m(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;a([])});e.all=tt,e.allLimit=nt,e.allSeries=at,e.any=St,e.anyLimit=xt,e.anySeries=Lt,e.apply=t,e.applyEach=we,e.applyEachSeries=Fe,e.asyncify=r,e.auto=A,e.autoInject=j,e.cargo=T,e.cargoQueue=F,e.compose=P,e.concat=Ue,e.concatLimit=Qe,e.concatSeries=Ge,e.constant=R,e.default={apply:t,applyEach:we,applyEachSeries:Fe,asyncify:r,auto:A,autoInject:j,cargo:T,cargoQueue:F,compose:P,concat:Ue,concatLimit:Qe,concatSeries:Ge,constant:R,detect:We,detectLimit:He,detectSeries:Je,dir:Ke,doUntil:V,doWhilst:Xe,each:Ze,eachLimit:$e,eachOf:Me,eachOfLimit:Ie,eachOfSeries:Be,eachSeries:et,ensureAsync:q,every:tt,everyLimit:nt,everySeries:at,filter:it,filterLimit:rt,filterSeries:st,forever:lt,groupBy:G,groupByLimit:dt,groupBySeries:W,log:ut,map:je,mapLimit:De,mapSeries:Te,mapValues:H,mapValuesLimit:pt,mapValuesSeries:J,memoize:K,nextTick:ct,parallel:X,parallelLimit:Z,priorityQueue:ae,queue:$,race:ft,reduce:qe,reduceRight:ie,reflect:re,reflectAll:se,reject:yt,rejectLimit:mt,rejectSeries:gt,retry:ue,retryable:ce,seq:C,series:oe,setImmediate:_e,some:St,someLimit:xt,someSeries:Lt,sortBy:Et,timeout:he,times:me,timesLimit:ye,timesSeries:ge,transform:ke,tryEach:Ot,unmemoize:ve,until:Se,waterfall:bt,whilst:_t,all:tt,allLimit:nt,allSeries:at,any:St,anyLimit:xt,anySeries:Lt,find:We,findLimit:He,findSeries:Je,flatMap:Ue,flatMapLimit:Qe,flatMapSeries:Ge,forEach:Ze,forEachSeries:et,forEachLimit:$e,forEachOf:Me,forEachOfSeries:Be,forEachOfLimit:Ie,inject:qe,foldl:qe,foldr:ie,select:it,selectLimit:rt,selectSeries:st,wrapSync:r,during:_t,doDuring:Xe},e.detect=We,e.detectLimit=He,e.detectSeries=Je,e.dir=Ke,e.doDuring=Xe,e.doUntil=V,e.doWhilst=Xe,e.during=_t,e.each=Ze,e.eachLimit=$e,e.eachOf=Me,e.eachOfLimit=Ie,e.eachOfSeries=Be,e.eachSeries=et,e.ensureAsync=q,e.every=tt,e.everyLimit=nt,e.everySeries=at,e.filter=it,e.filterLimit=rt,e.filterSeries=st,e.find=We,e.findLimit=He,e.findSeries=Je,e.flatMap=Ue,e.flatMapLimit=Qe,e.flatMapSeries=Ge,e.foldl=qe,e.foldr=ie,e.forEach=Ze,e.forEachLimit=$e,e.forEachOf=Me,e.forEachOfLimit=Ie,e.forEachOfSeries=Be,e.forEachSeries=et,e.forever=lt,e.groupBy=G,e.groupByLimit=dt,e.groupBySeries=W,e.inject=qe,e.log=ut,e.map=je,e.mapLimit=De,e.mapSeries=Te,e.mapValues=H,e.mapValuesLimit=pt,e.mapValuesSeries=J,e.memoize=K,e.nextTick=ct,e.parallel=X,e.parallelLimit=Z,e.priorityQueue=ae,e.queue=$,e.race=ft,e.reduce=qe,e.reduceRight=ie,e.reflect=re,e.reflectAll=se,e.reject=yt,e.rejectLimit=mt,e.rejectSeries=gt,e.retry=ue,e.retryable=ce,e.select=it,e.selectLimit=rt,e.selectSeries=st,e.seq=C,e.series=oe,e.setImmediate=_e,e.some=St,e.someLimit=xt,e.someSeries=Lt,e.sortBy=Et,e.timeout=he,e.times=me,e.timesLimit=ye,e.timesSeries=ge,e.transform=ke,e.tryEach=Ot,e.unmemoize=ve,e.until=Se,e.waterfall=bt,e.whilst=_t,e.wrapSync=r,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/node_modules/async/dist/async.mjs b/node_modules/async/dist/async.mjs new file mode 100644 index 0000000..41c63c1 --- /dev/null +++ b/node_modules/async/dist/async.mjs @@ -0,0 +1,5949 @@ +/** + * Creates a continuation function with some arguments already applied. + * + * Useful as a shorthand when combined with other control flow functions. Any + * arguments passed to the returned function are added to the arguments + * originally passed to apply. + * + * @name apply + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {Function} fn - The function you want to eventually apply all + * arguments to. Invokes with (arguments...). + * @param {...*} arguments... - Any number of arguments to automatically apply + * when the continuation is called. + * @returns {Function} the partially-applied function + * @example + * + * // using apply + * async.parallel([ + * async.apply(fs.writeFile, 'testfile1', 'test1'), + * async.apply(fs.writeFile, 'testfile2', 'test2') + * ]); + * + * + * // the same process without using apply + * async.parallel([ + * function(callback) { + * fs.writeFile('testfile1', 'test1', callback); + * }, + * function(callback) { + * fs.writeFile('testfile2', 'test2', callback); + * } + * ]); + * + * // It's possible to pass any number of additional arguments when calling the + * // continuation: + * + * node> var fn = async.apply(sys.puts, 'one'); + * node> fn('two', 'three'); + * one + * two + * three + */ +function apply(fn, ...args) { + return (...callArgs) => fn(...args,...callArgs); +} + +function initialParams (fn) { + return function (...args/*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; +} + +/* istanbul ignore file */ + +var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; +var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); +} + +var _defer$1; + +if (hasQueueMicrotask) { + _defer$1 = queueMicrotask; +} else if (hasSetImmediate) { + _defer$1 = setImmediate; +} else if (hasNextTick) { + _defer$1 = process.nextTick; +} else { + _defer$1 = fallback; +} + +var setImmediate$1 = wrap(_defer$1); + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + if (isAsync(func)) { + return function (...args/*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback) + } + } + + return initialParams(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback) + } else { + callback(null, result); + } + }); +} + +function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + setImmediate$1(e => { throw e }, err); + } +} + +function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; +} + +function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; +} + +function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; +} + +function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function') + return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; +} + +// conditionally promisify a function. +// only return a promise if a callback is omitted +function awaitify (asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined') + function awaitable (...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args) + } + + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err) + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }) + } + + return awaitable +} + +function applyEach$1 (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = awaitify(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + wrapAsync(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; +} + +function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = wrapAsync(iteratee); + + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); +} + +function isArrayLike(value) { + return value && + typeof value.length === 'number' && + value.length >= 0 && + value.length % 1 === 0; +} + +// A temporary value used to identify if the loop should be broken. +// See #1064, #1293 +const breakLoop = {}; +var breakLoop$1 = breakLoop; + +function once(fn) { + function wrapper (...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper +} + +function getIterator (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); +} + +function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? {value: coll[i], key: i} : null; + } +} + +function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) + return null; + i++; + return {value: item.value, key: i}; + } +} + +function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? {value: obj[key], key} : null; + }; +} + +function createIterator(coll) { + if (isArrayLike(coll)) { + return createArrayIterator(coll); + } + + var iterator = getIterator(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); +} + +function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; +} + +// for async generators +function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({value, done: iterDone}) => { + //console.log('got value', value) + if (canceled || done) return + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } + + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return + if (err) return handleError(err) + + if (err === false) { + done = true; + canceled = true; + return + } + + if (result === breakLoop$1 || (done && running <= 0)) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } + + function handleError(err) { + if (canceled) return + awaiting = false; + done = true; + callback(err); + } + + replenish(); +} + +var eachOfLimit$2 = (limit) => { + return (obj, iteratee, callback) => { + callback = once(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1') + } + if (!obj) { + return callback(null); + } + if (isAsyncGenerator(obj)) { + return asyncEachOfLimit(obj, limit, iteratee, callback) + } + if (isAsyncIterable(obj)) { + return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) + } + var nextElem = createIterator(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + if (canceled) return + running -= 1; + if (err) { + done = true; + callback(err); + } + else if (err === false) { + done = true; + canceled = true; + } + else if (value === breakLoop$1 || (done && running <= 0)) { + done = true; + return callback(null); + } + else if (!looping) { + replenish(); + } + } + + function replenish () { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; +}; + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, wrapAsync(iteratee), callback); +} + +var eachOfLimit$1 = awaitify(eachOfLimit, 4); + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = once(callback); + var index = 0, + completed = 0, + {length} = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return + if (err) { + callback(err); + } else if ((++completed === length) || value === breakLoop$1) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, onlyOnce(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +function eachOfGeneric (coll, iteratee, callback) { + return eachOfLimit$1(coll, Infinity, iteratee, callback); +} + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ +function eachOf(coll, iteratee, callback) { + var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, wrapAsync(iteratee), callback); +} + +var eachOf$1 = awaitify(eachOf, 3); + +/** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function map (coll, iteratee, callback) { + return _asyncMap(eachOf$1, coll, iteratee, callback) +} +var map$1 = awaitify(map, 3); + +/** + * Applies the provided arguments to each function in the array, calling + * `callback` after all functions have completed. If you only provide the first + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. The results + * for each of the applied async functions are passed to the final callback + * as an array. + * + * @name applyEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s + * to all call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - Returns a function that takes no args other than + * an optional callback, that is the result of applying the `args` to each + * of the functions. + * @example + * + * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') + * + * appliedFn((err, results) => { + * // results[0] is the results for `enableSearch` + * // results[1] is the results for `updateSchema` + * }); + * + * // partial application example: + * async.each( + * buckets, + * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), + * callback + * ); + */ +var applyEach = applyEach$1(map$1); + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfSeries(coll, iteratee, callback) { + return eachOfLimit$1(coll, 1, iteratee, callback) +} +var eachOfSeries$1 = awaitify(eachOfSeries, 3); + +/** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapSeries (coll, iteratee, callback) { + return _asyncMap(eachOfSeries$1, coll, iteratee, callback) +} +var mapSeries$1 = awaitify(mapSeries, 3); + +/** + * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. + * + * @name applyEachSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.applyEach]{@link module:ControlFlow.applyEach} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all + * call with the same arguments + * @param {...*} [args] - any number of separate arguments to pass to the + * function. + * @param {Function} [callback] - the final argument should be the callback, + * called when all functions have completed processing. + * @returns {AsyncFunction} - A function, that when called, is the result of + * appling the `args` to the list of functions. It takes no args, other than + * a callback. + */ +var applyEachSeries = applyEach$1(mapSeries$1); + +const PROMISE_SYMBOL = Symbol('promiseCallback'); + +function promiseCallback () { + let resolve, reject; + function callback (err, ...args) { + if (err) return reject(err) + resolve(args.length > 1 ? args : args[0]); + } + + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, + reject = rej; + }); + + return callback +} + +/** + * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on + * their requirements. Each function can optionally depend on other functions + * being completed first, and each function is run as soon as its requirements + * are satisfied. + * + * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence + * will stop. Further tasks will not execute (so any other functions depending + * on it will not run), and the main `callback` is immediately called with the + * error. + * + * {@link AsyncFunction}s also receive an object containing the results of functions which + * have completed so far as the first argument, if they have dependencies. If a + * task function has no dependencies, it will only be passed a callback. + * + * @name auto + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Object} tasks - An object. Each of its properties is either a + * function or an array of requirements, with the {@link AsyncFunction} itself the last item + * in the array. The object's key of a property serves as the name of the task + * defined by that property, i.e. can be used when specifying requirements for + * other tasks. The function receives one or two arguments: + * * a `results` object, containing the results of the previously executed + * functions, only passed if the task has any dependencies, + * * a `callback(err, result)` function, which must be called when finished, + * passing an `error` (which can be `null`) and the result of the function's + * execution. + * @param {number} [concurrency=Infinity] - An optional `integer` for + * determining the maximum number of tasks that can be run in parallel. By + * default, as many as possible. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback. Results are always returned; however, if an + * error occurs, no further `tasks` will be performed, and the results object + * will only contain partial results. Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * @example + * + * //Using Callbacks + * async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }, function(err, results) { + * if (err) { + * console.log('err = ', err); + * } + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }); + * + * //Using Promises + * async.auto({ + * get_data: function(callback) { + * console.log('in get_data'); + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * console.log('in make_folder'); + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }).then(results => { + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * }).catch(err => { + * console.log('err = ', err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.auto({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: ['get_data', 'make_folder', function(results, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(results, callback) { + * // once the file is written let's email a link to it... + * callback(null, {'file':results.write_file, 'email':'user@example.com'}); + * }] + * }); + * console.log('results = ', results); + * // results = { + * // get_data: ['data', 'converted to array'] + * // make_folder; 'folder', + * // write_file: 'filename' + * // email_link: { file: 'filename', email: 'user@example.com' } + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function auto(tasks, concurrency, callback) { + if (typeof concurrency !== 'number') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = once(callback || promiseCallback()); + var numTasks = Object.keys(tasks).length; + if (!numTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = numTasks; + } + + var results = {}; + var runningTasks = 0; + var canceled = false; + var hasError = false; + + var listeners = Object.create(null); + + var readyTasks = []; + + // for cycle detection: + var readyToCheck = []; // tasks that have been identified as reachable + // without the possibility of returning to an ancestor task + var uncheckedDependencies = {}; + + Object.keys(tasks).forEach(key => { + var task = tasks[key]; + if (!Array.isArray(task)) { + // no dependencies + enqueueTask(key, [task]); + readyToCheck.push(key); + return; + } + + var dependencies = task.slice(0, task.length - 1); + var remainingDependencies = dependencies.length; + if (remainingDependencies === 0) { + enqueueTask(key, task); + readyToCheck.push(key); + return; + } + uncheckedDependencies[key] = remainingDependencies; + + dependencies.forEach(dependencyName => { + if (!tasks[dependencyName]) { + throw new Error('async.auto task `' + key + + '` has a non-existent dependency `' + + dependencyName + '` in ' + + dependencies.join(', ')); + } + addListener(dependencyName, () => { + remainingDependencies--; + if (remainingDependencies === 0) { + enqueueTask(key, task); + } + }); + }); + }); + + checkForDeadlocks(); + processQueue(); + + function enqueueTask(key, task) { + readyTasks.push(() => runTask(key, task)); + } + + function processQueue() { + if (canceled) return + if (readyTasks.length === 0 && runningTasks === 0) { + return callback(null, results); + } + while(readyTasks.length && runningTasks < concurrency) { + var run = readyTasks.shift(); + run(); + } + + } + + function addListener(taskName, fn) { + var taskListeners = listeners[taskName]; + if (!taskListeners) { + taskListeners = listeners[taskName] = []; + } + + taskListeners.push(fn); + } + + function taskComplete(taskName) { + var taskListeners = listeners[taskName] || []; + taskListeners.forEach(fn => fn()); + processQueue(); + } + + + function runTask(key, task) { + if (hasError) return; + + var taskCallback = onlyOnce((err, ...result) => { + runningTasks--; + if (err === false) { + canceled = true; + return + } + if (result.length < 2) { + [result] = result; + } + if (err) { + var safeResults = {}; + Object.keys(results).forEach(rkey => { + safeResults[rkey] = results[rkey]; + }); + safeResults[key] = result; + hasError = true; + listeners = Object.create(null); + if (canceled) return + callback(err, safeResults); + } else { + results[key] = result; + taskComplete(key); + } + }); + + runningTasks++; + var taskFn = wrapAsync(task[task.length - 1]); + if (task.length > 1) { + taskFn(results, taskCallback); + } else { + taskFn(taskCallback); + } + } + + function checkForDeadlocks() { + // Kahn's algorithm + // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm + // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html + var currentTask; + var counter = 0; + while (readyToCheck.length) { + currentTask = readyToCheck.pop(); + counter++; + getDependents(currentTask).forEach(dependent => { + if (--uncheckedDependencies[dependent] === 0) { + readyToCheck.push(dependent); + } + }); + } + + if (counter !== numTasks) { + throw new Error( + 'async.auto cannot execute tasks due to a recursive dependency' + ); + } + } + + function getDependents(taskName) { + var result = []; + Object.keys(tasks).forEach(key => { + const task = tasks[key]; + if (Array.isArray(task) && task.indexOf(taskName) >= 0) { + result.push(key); + } + }); + return result; + } + + return callback[PROMISE_SYMBOL] +} + +var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; +var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; +var FN_ARG_SPLIT = /,/; +var FN_ARG = /(=.+)?(\s*)$/; + +function stripComments(string) { + let stripped = ''; + let index = 0; + let endBlockComment = string.indexOf('*/'); + while (index < string.length) { + if (string[index] === '/' && string[index+1] === '/') { + // inline comment + let endIndex = string.indexOf('\n', index); + index = (endIndex === -1) ? string.length : endIndex; + } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { + // block comment + let endIndex = string.indexOf('*/', index); + if (endIndex !== -1) { + index = endIndex + 2; + endBlockComment = string.indexOf('*/', index); + } else { + stripped += string[index]; + index++; + } + } else { + stripped += string[index]; + index++; + } + } + return stripped; +} + +function parseParams(func) { + const src = stripComments(func.toString()); + let match = src.match(FN_ARGS); + if (!match) { + match = src.match(ARROW_FN_ARGS); + } + if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) + let [, args] = match; + return args + .replace(/\s/g, '') + .split(FN_ARG_SPLIT) + .map((arg) => arg.replace(FN_ARG, '').trim()); +} + +/** + * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent + * tasks are specified as parameters to the function, after the usual callback + * parameter, with the parameter names matching the names of the tasks it + * depends on. This can provide even more readable task graphs which can be + * easier to maintain. + * + * If a final callback is specified, the task results are similarly injected, + * specified as named parameters after the initial error parameter. + * + * The autoInject function is purely syntactic sugar and its semantics are + * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. + * + * @name autoInject + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.auto]{@link module:ControlFlow.auto} + * @category Control Flow + * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of + * the form 'func([dependencies...], callback). The object's key of a property + * serves as the name of the task defined by that property, i.e. can be used + * when specifying requirements for other tasks. + * * The `callback` parameter is a `callback(err, result)` which must be called + * when finished, passing an `error` (which can be `null`) and the result of + * the function's execution. The remaining parameters name other tasks on + * which the task is dependent, and the results from those tasks are the + * arguments of those parameters. + * @param {Function} [callback] - An optional callback which is called when all + * the tasks have been completed. It receives the `err` argument if any `tasks` + * pass an error to their callback, and a `results` object with any completed + * task results, similar to `auto`. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // The example from `auto` can be rewritten as follows: + * async.autoInject({ + * get_data: function(callback) { + * // async code to get some data + * callback(null, 'data', 'converted to array'); + * }, + * make_folder: function(callback) { + * // async code to create a directory to store a file in + * // this is run at the same time as getting the data + * callback(null, 'folder'); + * }, + * write_file: function(get_data, make_folder, callback) { + * // once there is some data and the directory exists, + * // write the data to a file in the directory + * callback(null, 'filename'); + * }, + * email_link: function(write_file, callback) { + * // once the file is written let's email a link to it... + * // write_file contains the filename returned by write_file. + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * } + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + * + * // If you are using a JS minifier that mangles parameter names, `autoInject` + * // will not work with plain functions, since the parameter names will be + * // collapsed to a single letter identifier. To work around this, you can + * // explicitly specify the names of the parameters your task function needs + * // in an array, similar to Angular.js dependency injection. + * + * // This still has an advantage over plain `auto`, since the results a task + * // depends on are still spread into arguments. + * async.autoInject({ + * //... + * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { + * callback(null, 'filename'); + * }], + * email_link: ['write_file', function(write_file, callback) { + * callback(null, {'file':write_file, 'email':'user@example.com'}); + * }] + * //... + * }, function(err, results) { + * console.log('err = ', err); + * console.log('email_link = ', results.email_link); + * }); + */ +function autoInject(tasks, callback) { + var newTasks = {}; + + Object.keys(tasks).forEach(key => { + var taskFn = tasks[key]; + var params; + var fnIsAsync = isAsync(taskFn); + var hasNoDeps = + (!fnIsAsync && taskFn.length === 1) || + (fnIsAsync && taskFn.length === 0); + + if (Array.isArray(taskFn)) { + params = [...taskFn]; + taskFn = params.pop(); + + newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); + } else if (hasNoDeps) { + // no dependencies, use the function as-is + newTasks[key] = taskFn; + } else { + params = parseParams(taskFn); + if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { + throw new Error("autoInject task functions require explicit parameters."); + } + + // remove callback param + if (!fnIsAsync) params.pop(); + + newTasks[key] = params.concat(newTask); + } + + function newTask(results, taskCb) { + var newArgs = params.map(name => results[name]); + newArgs.push(taskCb); + wrapAsync(taskFn)(...newArgs); + } + }); + + return auto(newTasks, callback); +} + +// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation +// used for queues. This implementation assumes that the node provided by the user can be modified +// to adjust the next and last properties. We implement only the minimal functionality +// for queue support. +class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } + + removeLink(node) { + if (node.prev) node.prev.next = node.next; + else this.head = node.next; + if (node.next) node.next.prev = node.prev; + else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; + } + + empty () { + while(this.head) this.shift(); + return this; + } + + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode; + else this.tail = newNode; + node.next = newNode; + this.length += 1; + } + + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode; + else this.head = newNode; + node.prev = newNode; + this.length += 1; + } + + unshift(node) { + if (this.head) this.insertBefore(this.head, node); + else setInitial(this, node); + } + + push(node) { + if (this.tail) this.insertAfter(this.tail, node); + else setInitial(this, node); + } + + shift() { + return this.head && this.removeLink(this.head); + } + + pop() { + return this.tail && this.removeLink(this.tail); + } + + toArray() { + return [...this] + } + + *[Symbol.iterator] () { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } + + remove (testFn) { + var curr = this.head; + while(curr) { + var {next} = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } +} + +function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; +} + +function queue$1(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } + + var _worker = wrapAsync(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; + + function on (event, handler) { + events[event].push(handler); + } + + function once (event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } + + function off (event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []) + if (!handler) return events[event] = [] + events[event] = events[event].filter(ev => ev !== handler); + } + + function trigger (event, ...args) { + events[event].forEach(handler => handler(...args)); + } + + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + + var res, rej; + function promiseCallback (err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res() + if (args.length <= 1) return res(args[0]) + res(args); + } + + var item = q._createTaskItem( + data, + rejectOnError ? promiseCallback : + (callback || promiseCallback) + ); + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + + if (!processingScheduled) { + processingScheduled = true; + setImmediate$1(() => { + processingScheduled = false; + q.process(); + }); + } + + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }) + } + } + + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback(err, ...args); + + if (err != null) { + trigger('error', err, task.data); + } + } + + if (numRunning <= (q.concurrency - q.buffer) ) { + trigger('unsaturated'); + } + + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } + + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + setImmediate$1(() => trigger('drain')); + return true + } + return false + } + + const eventMethod = (name) => (handler) => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err) + resolve(data); + }); + }) + } + off(name); + on(name, handler); + + }; + + var isProcessing = false; + var q = { + _tasks: new DLL(), + _createTaskItem (data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator] () { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, false, callback)) + } + return _insert(data, false, false, callback); + }, + pushAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, false, true, callback)) + } + return _insert(data, false, true, callback); + }, + kill () { + off(); + q._tasks.empty(); + }, + unshift (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, false, callback)) + } + return _insert(data, true, false, callback); + }, + unshiftAsync (data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return + return data.map(datum => _insert(datum, true, true, callback)) + } + return _insert(data, true, true, callback); + }, + remove (testFn) { + q._tasks.remove(testFn); + }, + process () { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while(!q.paused && numRunning < q.concurrency && q._tasks.length){ + var tasks = [], data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + trigger('empty'); + } + + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = onlyOnce(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length () { + return q._tasks.length; + }, + running () { + return numRunning; + }, + workersList () { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause () { + q.paused = true; + }, + resume () { + if (q.paused === false) { return; } + q.paused = false; + setImmediate$1(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + }, + }); + return q; +} + +/** + * Creates a `cargo` object with the specified payload. Tasks added to the + * cargo will be processed altogether (up to the `payload` limit). If the + * `worker` is in progress, the task is queued until it becomes available. Once + * the `worker` has completed some tasks, each callback of those tasks is + * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) + * for how `cargo` and `queue` work. + * + * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers + * at a time, cargo passes an array of tasks to a single worker, repeating + * when the worker is finished. + * + * @name cargo + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An asynchronous function for processing an array + * of queued tasks. Invoked with `(tasks, callback)`. + * @param {number} [payload=Infinity] - An optional `integer` for determining + * how many tasks should be processed per round; if omitted, the default is + * unlimited. + * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can + * attached as certain properties to listen for specific events during the + * lifecycle of the cargo and inner queue. + * @example + * + * // create a cargo object with payload 2 + * var cargo = async.cargo(function(tasks, callback) { + * for (var i=0; i { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = once(callback); + var _iteratee = wrapAsync(iteratee); + return eachOfSeries$1(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +var reduce$1 = awaitify(reduce, 4); + +/** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ +function seq(...functions) { + var _functions = functions.map(wrapAsync); + return function (...args) { + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = promiseCallback(); + } + + reduce$1(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, + (err, results) => cb(err, ...results)); + + return cb[PROMISE_SYMBOL] + }; +} + +/** + * Creates a function which is a composition of the passed asynchronous + * functions. Each function consumes the return value of the function that + * follows. Composing functions `f()`, `g()`, and `h()` would produce the result + * of `f(g(h()))`, only this version uses callbacks to obtain the return values. + * + * If the last argument to the composed function is not a function, a promise + * is returned when you call it. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name compose + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} an asynchronous function that is the composed + * asynchronous `functions` + * @example + * + * function add1(n, callback) { + * setTimeout(function () { + * callback(null, n + 1); + * }, 10); + * } + * + * function mul3(n, callback) { + * setTimeout(function () { + * callback(null, n * 3); + * }, 10); + * } + * + * var add1mul3 = async.compose(mul3, add1); + * add1mul3(4, function (err, result) { + * // result now equals 15 + * }); + */ +function compose(...args) { + return seq(...args.reverse()); +} + +/** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapLimit (coll, limit, iteratee, callback) { + return _asyncMap(eachOfLimit$2(limit), coll, iteratee, callback) +} +var mapLimit$1 = awaitify(mapLimit, 4); + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); +} +var concatLimit$1 = awaitify(concatLimit, 4); + +/** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ +function concat(coll, iteratee, callback) { + return concatLimit$1(coll, Infinity, iteratee, callback) +} +var concat$1 = awaitify(concat, 3); + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatSeries(coll, iteratee, callback) { + return concatLimit$1(coll, 1, iteratee, callback) +} +var concatSeries$1 = awaitify(concatSeries, 3); + +/** + * Returns a function that when called, calls-back with the values provided. + * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to + * [`auto`]{@link module:ControlFlow.auto}. + * + * @name constant + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {...*} arguments... - Any number of arguments to automatically invoke + * callback with. + * @returns {AsyncFunction} Returns a function that when invoked, automatically + * invokes the callback with the previous given arguments. + * @example + * + * async.waterfall([ + * async.constant(42), + * function (value, next) { + * // value === 42 + * }, + * //... + * ], callback); + * + * async.waterfall([ + * async.constant(filename, "utf8"), + * fs.readFile, + * function (fileData, next) { + * //... + * } + * //... + * ], callback); + * + * async.auto({ + * hostname: async.constant("https://server.net/"), + * port: findFreePort, + * launchServer: ["hostname", "port", function (options, cb) { + * startServer(options, cb); + * }], + * //... + * }, callback); + */ +function constant$1(...args) { + return function (...ignoredArgs/*, callback*/) { + var callback = ignoredArgs.pop(); + return callback(null, ...args); + }; +} + +function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = wrapAsync(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); + + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, breakLoop$1); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; +} + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function detect(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) +} +var detect$1 = awaitify(detect, 3); + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectLimit(coll, limit, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(limit), coll, iteratee, callback) +} +var detectLimit$1 = awaitify(detectLimit, 4); + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectSeries(coll, iteratee, callback) { + return _createTester(bool => bool, (res, item) => item)(eachOfLimit$2(1), coll, iteratee, callback) +} + +var detectSeries$1 = awaitify(detectSeries, 3); + +function consoleFunc(name) { + return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }) +} + +/** + * Logs the result of an [`async` function]{@link AsyncFunction} to the + * `console` using `console.dir` to display the properties of the resulting object. + * Only works in Node.js or in browsers that support `console.dir` and + * `console.error` (such as FF and Chrome). + * If multiple arguments are returned from the async function, + * `console.dir` is called on each argument in order. + * + * @name dir + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, {hello: name}); + * }, 1000); + * }; + * + * // in the node repl + * node> async.dir(hello, 'world'); + * {hello: 'world'} + */ +var dir = consoleFunc('dir'); + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doWhilst(iteratee, test, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); +} + +var doWhilst$1 = awaitify(doWhilst, 3); + +/** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doUntil(iteratee, test, callback) { + const _test = wrapAsync(test); + return doWhilst$1(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb (err, !truth)); + }, callback); +} + +function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); +} + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ +function eachLimit$2(coll, iteratee, callback) { + return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); +} + +var each = awaitify(eachLimit$2, 3); + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachLimit(coll, limit, iteratee, callback) { + return eachOfLimit$2(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); +} +var eachLimit$1 = awaitify(eachLimit, 4); + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachSeries(coll, iteratee, callback) { + return eachLimit$1(coll, 1, iteratee, callback) +} +var eachSeries$1 = awaitify(eachSeries, 3); + +/** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ +function ensureAsync(fn) { + if (isAsync(fn)) return fn; + return function (...args/*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + setImmediate$1(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; +} + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function every(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) +} +var every$1 = awaitify(every, 3); + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everyLimit(coll, limit, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfLimit$2(limit), coll, iteratee, callback) +} +var everyLimit$1 = awaitify(everyLimit, 4); + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everySeries(coll, iteratee, callback) { + return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) +} +var everySeries$1 = awaitify(everySeries, 3); + +function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); +} + +function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({index, value: x}); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results + .sort((a, b) => a.index - b.index) + .map(v => v.value)); + }); +} + +function _filter(eachfn, coll, iteratee, callback) { + var filter = isArrayLike(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, wrapAsync(iteratee), callback); +} + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function filter (coll, iteratee, callback) { + return _filter(eachOf$1, coll, iteratee, callback) +} +var filter$1 = awaitify(filter, 3); + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ +function filterLimit (coll, limit, iteratee, callback) { + return _filter(eachOfLimit$2(limit), coll, iteratee, callback) +} +var filterLimit$1 = awaitify(filterLimit, 4); + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ +function filterSeries (coll, iteratee, callback) { + return _filter(eachOfSeries$1, coll, iteratee, callback) +} +var filterSeries$1 = awaitify(filterSeries, 3); + +/** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ +function forever(fn, errback) { + var done = onlyOnce(errback); + var task = wrapAsync(ensureAsync(fn)); + + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); +} +var forever$1 = awaitify(forever, 2); + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, {key, val}); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var {hasOwnProperty} = Object.prototype; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var {key} = mapResults[i]; + var {val} = mapResults[i]; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); +} + +var groupByLimit$1 = awaitify(groupByLimit, 4); + +/** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function groupBy (coll, iteratee, callback) { + return groupByLimit$1(coll, Infinity, iteratee, callback) +} + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupBySeries (coll, iteratee, callback) { + return groupByLimit$1(coll, 1, iteratee, callback) +} + +/** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ +var log = consoleFunc('log'); + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesLimit(obj, limit, iteratee, callback) { + callback = once(callback); + var newObj = {}; + var _iteratee = wrapAsync(iteratee); + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); +} + +var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); + +/** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function mapValues(obj, iteratee, callback) { + return mapValuesLimit$1(obj, Infinity, iteratee, callback) +} + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesSeries(obj, iteratee, callback) { + return mapValuesLimit$1(obj, 1, iteratee, callback) +} + +/** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ +function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = wrapAsync(fn); + var memoized = initialParams((args, callback) => { + var key = hasher(...args); + if (key in memo) { + setImmediate$1(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; +} + +/* istanbul ignore file */ + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +var _defer; + +if (hasNextTick) { + _defer = process.nextTick; +} else if (hasSetImmediate) { + _defer = setImmediate; +} else { + _defer = fallback; +} + +var nextTick = wrap(_defer); + +var _parallel = awaitify((eachfn, tasks, callback) => { + var results = isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, (task, key, taskCb) => { + wrapAsync(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); +}, 3); + +/** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function parallel(tasks, callback) { + return _parallel(eachOf$1, tasks, callback); +} + +/** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ +function parallelLimit(tasks, limit, callback) { + return _parallel(eachOfLimit$2(limit), tasks, callback); +} + +/** + * A queue of tasks for the worker function to complete. + * @typedef {Iterable} QueueObject + * @memberOf module:ControlFlow + * @property {Function} length - a function returning the number of items + * waiting to be processed. Invoke with `queue.length()`. + * @property {boolean} started - a boolean indicating whether or not any + * items have been pushed and processed by the queue. + * @property {Function} running - a function returning the number of items + * currently being processed. Invoke with `queue.running()`. + * @property {Function} workersList - a function returning the array of items + * currently being processed. Invoke with `queue.workersList()`. + * @property {Function} idle - a function returning false if there are items + * waiting or being processed, or true if not. Invoke with `queue.idle()`. + * @property {number} concurrency - an integer for determining how many `worker` + * functions should be run in parallel. This property can be changed after a + * `queue` is created to alter the concurrency on-the-fly. + * @property {number} payload - an integer that specifies how many items are + * passed to the worker function at a time. only applies if this is a + * [cargo]{@link module:ControlFlow.cargo} object + * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` + * once the `worker` has finished processing the task. Instead of a single task, + * a `tasks` array can be submitted. The respective callback is used for every + * task in the list. Invoke with `queue.push(task, [callback])`, + * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. + * Invoke with `queue.unshift(task, [callback])`. + * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns + * a promise that rejects if an error occurs. + * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns + * a promise that rejects if an error occurs. + * @property {Function} remove - remove items from the queue that match a test + * function. The test function will be passed an object with a `data` property, + * and a `priority` property, if this is a + * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. + * Invoked with `queue.remove(testFn)`, where `testFn` is of the form + * `function ({data, priority}) {}` and returns a Boolean. + * @property {Function} saturated - a function that sets a callback that is + * called when the number of running workers hits the `concurrency` limit, and + * further tasks will be queued. If the callback is omitted, `q.saturated()` + * returns a promise for the next occurrence. + * @property {Function} unsaturated - a function that sets a callback that is + * called when the number of running workers is less than the `concurrency` & + * `buffer` limits, and further tasks will not be queued. If the callback is + * omitted, `q.unsaturated()` returns a promise for the next occurrence. + * @property {number} buffer - A minimum threshold buffer in order to say that + * the `queue` is `unsaturated`. + * @property {Function} empty - a function that sets a callback that is called + * when the last item from the `queue` is given to a `worker`. If the callback + * is omitted, `q.empty()` returns a promise for the next occurrence. + * @property {Function} drain - a function that sets a callback that is called + * when the last item from the `queue` has returned from the `worker`. If the + * callback is omitted, `q.drain()` returns a promise for the next occurrence. + * @property {Function} error - a function that sets a callback that is called + * when a task errors. Has the signature `function(error, task)`. If the + * callback is omitted, `error()` returns a promise that rejects on the next + * error. + * @property {boolean} paused - a boolean for determining whether the queue is + * in a paused state. + * @property {Function} pause - a function that pauses the processing of tasks + * until `resume()` is called. Invoke with `queue.pause()`. + * @property {Function} resume - a function that resumes the processing of + * queued tasks when the queue is paused. Invoke with `queue.resume()`. + * @property {Function} kill - a function that removes the `drain` callback and + * empties remaining tasks from the queue forcing it to go idle. No more tasks + * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. + * + * @example + * const q = async.queue(worker, 2) + * q.push(item1) + * q.push(item2) + * q.push(item3) + * // queues are iterable, spread into an array to inspect + * const items = [...q] // [item1, item2, item3] + * // or use for of + * for (let item of q) { + * console.log(item) + * } + * + * q.drain(() => { + * console.log('all done') + * }) + * // or + * await q.drain() + */ + +/** + * Creates a `queue` object with the specified `concurrency`. Tasks added to the + * `queue` are processed in parallel (up to the `concurrency` limit). If all + * `worker`s are in progress, the task is queued until one becomes available. + * Once a `worker` completes a `task`, that `task`'s callback is called. + * + * @name queue + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. Invoked with (task, callback). + * @param {number} [concurrency=1] - An `integer` for determining how many + * `worker` functions should be run in parallel. If omitted, the concurrency + * defaults to `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be + * attached as certain properties to listen for specific events during the + * lifecycle of the queue. + * @example + * + * // create a queue object with concurrency 2 + * var q = async.queue(function(task, callback) { + * console.log('hello ' + task.name); + * callback(); + * }, 2); + * + * // assign a callback + * q.drain(function() { + * console.log('all items have been processed'); + * }); + * // or await the end + * await q.drain() + * + * // assign an error callback + * q.error(function(err, task) { + * console.error('task experienced an error'); + * }); + * + * // add some items to the queue + * q.push({name: 'foo'}, function(err) { + * console.log('finished processing foo'); + * }); + * // callback is optional + * q.push({name: 'bar'}); + * + * // add some items to the queue (batch-wise) + * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { + * console.log('finished processing item'); + * }); + * + * // add some items to the front of the queue + * q.unshift({name: 'bar'}, function (err) { + * console.log('finished processing bar'); + * }); + */ +function queue (worker, concurrency) { + var _worker = wrapAsync(worker); + return queue$1((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); +} + +// Binary min-heap implementation used for priority queue. +// Implementation is stable, i.e. push time is considered for equal priorities +class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } + + get length() { + return this.heap.length; + } + + empty () { + this.heap = []; + return this; + } + + percUp(index) { + let p; + + while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; + + index = p; + } + } + + percDown(index) { + let l; + + while ((l=leftChi(index)) < this.heap.length) { + if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { + l = l+1; + } + + if (smaller(this.heap[index], this.heap[l])) { + break; + } + + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; + + index = l; + } + } + + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length-1); + } + + unshift(node) { + return this.heap.push(node); + } + + shift() { + let [top] = this.heap; + + this.heap[0] = this.heap[this.heap.length-1]; + this.heap.pop(); + this.percDown(0); + + return top; + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator] () { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } + + remove (testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } + + this.heap.splice(j); + + for (let i = parent(this.heap.length-1); i >= 0; i--) { + this.percDown(i); + } + + return this; + } +} + +function leftChi(i) { + return (i<<1)+1; +} + +function parent(i) { + return ((i+1)>>1)-1; +} + +function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } + else { + return x.pushCount < y.pushCount; + } +} + +/** + * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and + * completed in ascending priority order. + * + * @name priorityQueue + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.queue]{@link module:ControlFlow.queue} + * @category Control Flow + * @param {AsyncFunction} worker - An async function for processing a queued task. + * If you want to handle errors from an individual task, pass a callback to + * `q.push()`. + * Invoked with (task, callback). + * @param {number} concurrency - An `integer` for determining how many `worker` + * functions should be run in parallel. If omitted, the concurrency defaults to + * `1`. If the concurrency is `0`, an error is thrown. + * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three + * differences between `queue` and `priorityQueue` objects: + * * `push(task, priority, [callback])` - `priority` should be a number. If an + * array of `tasks` is given, all tasks will be assigned the same priority. + * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, + * except this returns a promise that rejects if an error occurs. + * * The `unshift` and `unshiftAsync` methods were removed. + */ +function priorityQueue(worker, concurrency) { + // Start with a normal queue + var q = queue(worker, concurrency); + + var { + push, + pushAsync + } = q; + + q._tasks = new Heap(); + q._createTaskItem = ({data, priority}, callback) => { + return { + data, + priority, + callback + }; + }; + + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return {data: tasks, priority}; + } + return tasks.map(data => { return {data, priority}; }); + } + + // Override push to accept second parameter representing priority + q.push = function(data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; + + q.pushAsync = function(data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; + + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; + + return q; +} + +/** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ +function race(tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + wrapAsync(tasks[i])(callback); + } +} + +var race$1 = awaitify(race, 2); + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function reduceRight (array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return reduce$1(reversed, memo, iteratee, callback); +} + +/** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ +function reflect(fn) { + var _fn = wrapAsync(fn); + return initialParams(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0){ + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); + + return _fn.apply(this, args); + }); +} + +/** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ +function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(reflect); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = reflect.call(this, tasks[key]); + }); + } + return results; +} + +function reject$2(eachfn, arr, _iteratee, callback) { + const iteratee = wrapAsync(_iteratee); + return _filter(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); +} + +/** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function reject (coll, iteratee, callback) { + return reject$2(eachOf$1, coll, iteratee, callback) +} +var reject$1 = awaitify(reject, 3); + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectLimit (coll, limit, iteratee, callback) { + return reject$2(eachOfLimit$2(limit), coll, iteratee, callback) +} +var rejectLimit$1 = awaitify(rejectLimit, 4); + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectSeries (coll, iteratee, callback) { + return reject$2(eachOfSeries$1, coll, iteratee, callback) +} +var rejectSeries$1 = awaitify(rejectSeries, 3); + +function constant(value) { + return function () { + return value; + } +} + +/** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ +const DEFAULT_TIMES = 5; +const DEFAULT_INTERVAL = 0; + +function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || promiseCallback(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || promiseCallback(); + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = wrapAsync(task); + + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return + if (err && attempt++ < options.times && + (typeof options.errorFilter != 'function' || + options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } + + retryAttempt(); + return callback[PROMISE_SYMBOL] +} + +function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? + t.interval : + constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } +} + +/** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ +function retryable (opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = (opts && opts.arity) || task.length; + if (isAsync(task)) { + arity += 1; + } + var _task = wrapAsync(task); + return initialParams((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = promiseCallback(); + } + function taskFn(cb) { + _task(...args, cb); + } + + if (opts) retry(opts, taskFn, callback); + else retry(taskFn, callback); + + return callback[PROMISE_SYMBOL] + }); +} + +/** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function series(tasks, callback) { + return _parallel(eachOfSeries$1, tasks, callback); +} + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function some(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) +} +var some$1 = awaitify(some, 3); + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someLimit(coll, limit, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfLimit$2(limit), coll, iteratee, callback) +} +var someLimit$1 = awaitify(someLimit, 4); + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someSeries(coll, iteratee, callback) { + return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) +} +var someSeries$1 = awaitify(someSeries, 3); + +/** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function sortBy (coll, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return map$1(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, {value: x, criteria}); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } +} +var sortBy$1 = awaitify(sortBy, 3); + +/** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ +function timeout(asyncFn, milliseconds, info) { + var fn = wrapAsync(asyncFn); + + return initialParams((args, callback) => { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); +} + +function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; +} + +/** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesLimit(count, limit, iteratee, callback) { + var _iteratee = wrapAsync(iteratee); + return mapLimit$1(range(count), limit, _iteratee, callback); +} + +/** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ +function times (n, iteratee, callback) { + return timesLimit(n, Infinity, iteratee, callback) +} + +/** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesSeries (n, iteratee, callback) { + return timesLimit(n, 1, iteratee, callback) +} + +/** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function transform (coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = once(callback || promiseCallback()); + var _iteratee = wrapAsync(iteratee); + + eachOf$1(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[PROMISE_SYMBOL] +} + +/** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + return eachSeries$1(tasks, (task, taskCb) => { + wrapAsync(task)((err, ...args) => { + if (err === false) return taskCb(err); + + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); +} + +var tryEach$1 = awaitify(tryEach); + +/** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ +function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; +} + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = onlyOnce(callback); + var _fn = wrapAsync(iteratee); + var _test = wrapAsync(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); +} +var whilst$1 = awaitify(whilst, 3); + +/** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ +function until(test, iteratee, callback) { + const _test = wrapAsync(test); + return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); +} + +/** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ +function waterfall (tasks, callback) { + callback = once(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = wrapAsync(tasks[taskIndex++]); + task(...args, onlyOnce(next)); + } + + function next(err, ...args) { + if (err === false) return + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } + + nextTask([]); +} + +var waterfall$1 = awaitify(waterfall); + +/** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + + +var index = { + apply, + applyEach, + applyEachSeries, + asyncify, + auto, + autoInject, + cargo: cargo$1, + cargoQueue: cargo, + compose, + concat: concat$1, + concatLimit: concatLimit$1, + concatSeries: concatSeries$1, + constant: constant$1, + detect: detect$1, + detectLimit: detectLimit$1, + detectSeries: detectSeries$1, + dir, + doUntil, + doWhilst: doWhilst$1, + each, + eachLimit: eachLimit$1, + eachOf: eachOf$1, + eachOfLimit: eachOfLimit$1, + eachOfSeries: eachOfSeries$1, + eachSeries: eachSeries$1, + ensureAsync, + every: every$1, + everyLimit: everyLimit$1, + everySeries: everySeries$1, + filter: filter$1, + filterLimit: filterLimit$1, + filterSeries: filterSeries$1, + forever: forever$1, + groupBy, + groupByLimit: groupByLimit$1, + groupBySeries, + log, + map: map$1, + mapLimit: mapLimit$1, + mapSeries: mapSeries$1, + mapValues, + mapValuesLimit: mapValuesLimit$1, + mapValuesSeries, + memoize, + nextTick, + parallel, + parallelLimit, + priorityQueue, + queue, + race: race$1, + reduce: reduce$1, + reduceRight, + reflect, + reflectAll, + reject: reject$1, + rejectLimit: rejectLimit$1, + rejectSeries: rejectSeries$1, + retry, + retryable, + seq, + series, + setImmediate: setImmediate$1, + some: some$1, + someLimit: someLimit$1, + someSeries: someSeries$1, + sortBy: sortBy$1, + timeout, + times, + timesLimit, + timesSeries, + transform, + tryEach: tryEach$1, + unmemoize, + until, + waterfall: waterfall$1, + whilst: whilst$1, + + // aliases + all: every$1, + allLimit: everyLimit$1, + allSeries: everySeries$1, + any: some$1, + anyLimit: someLimit$1, + anySeries: someSeries$1, + find: detect$1, + findLimit: detectLimit$1, + findSeries: detectSeries$1, + flatMap: concat$1, + flatMapLimit: concatLimit$1, + flatMapSeries: concatSeries$1, + forEach: each, + forEachSeries: eachSeries$1, + forEachLimit: eachLimit$1, + forEachOf: eachOf$1, + forEachOfSeries: eachOfSeries$1, + forEachOfLimit: eachOfLimit$1, + inject: reduce$1, + foldl: reduce$1, + foldr: reduceRight, + select: filter$1, + selectLimit: filterLimit$1, + selectSeries: filterSeries$1, + wrapSync: asyncify, + during: whilst$1, + doDuring: doWhilst$1 +}; + +export { every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, apply, applyEach, applyEachSeries, asyncify, auto, autoInject, cargo$1 as cargo, cargo as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant$1 as constant, index as default, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doWhilst$1 as doDuring, doUntil, doWhilst$1 as doWhilst, whilst$1 as during, each, eachLimit$1 as eachLimit, eachOf$1 as eachOf, eachOfLimit$1 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, reduce$1 as foldl, reduceRight as foldr, each as forEach, eachLimit$1 as forEachLimit, eachOf$1 as forEachOf, eachOfLimit$1 as forEachOfLimit, eachOfSeries$1 as forEachOfSeries, eachSeries$1 as forEachSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, reduce$1 as inject, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel, parallelLimit, priorityQueue, queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$1 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, asyncify as wrapSync }; diff --git a/node_modules/async/doDuring.js b/node_modules/async/doDuring.js new file mode 100644 index 0000000..c72766d --- /dev/null +++ b/node_modules/async/doDuring.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doWhilst(iteratee, test, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); +} + +exports.default = (0, _awaitify2.default)(doWhilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/doUntil.js b/node_modules/async/doUntil.js new file mode 100644 index 0000000..519900e --- /dev/null +++ b/node_modules/async/doUntil.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = doUntil; + +var _doWhilst = require('./doWhilst.js'); + +var _doWhilst2 = _interopRequireDefault(_doWhilst); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the + * argument ordering differs from `until`. + * + * @name doUntil + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee` + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doUntil(iteratee, test, callback) { + const _test = (0, _wrapAsync2.default)(test); + return (0, _doWhilst2.default)(iteratee, (...args) => { + const cb = args.pop(); + _test(...args, (err, truth) => cb(err, !truth)); + }, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/doWhilst.js b/node_modules/async/doWhilst.js new file mode 100644 index 0000000..c72766d --- /dev/null +++ b/node_modules/async/doWhilst.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in + * the order of operations, the arguments `test` and `iteratee` are switched. + * + * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + * + * @name doWhilst + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} iteratee - A function which is called each time `test` + * passes. Invoked with (callback). + * @param {AsyncFunction} test - asynchronous truth test to perform after each + * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the + * non-error args from the previous callback of `iteratee`. + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. + * `callback` will be passed an error and any arguments passed to the final + * `iteratee`'s callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + */ +function doWhilst(iteratee, test, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results; + + function next(err, ...args) { + if (err) return callback(err); + if (err === false) return; + results = args; + _test(...args, check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return check(null, true); +} + +exports.default = (0, _awaitify2.default)(doWhilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/during.js b/node_modules/async/during.js new file mode 100644 index 0000000..4165543 --- /dev/null +++ b/node_modules/async/during.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); +} +exports.default = (0, _awaitify2.default)(whilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/each.js b/node_modules/async/each.js new file mode 100644 index 0000000..fdfcbd8 --- /dev/null +++ b/node_modules/async/each.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ +function eachLimit(coll, iteratee, callback) { + return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} + +exports.default = (0, _awaitify2.default)(eachLimit, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachLimit.js b/node_modules/async/eachLimit.js new file mode 100644 index 0000000..7f5928c --- /dev/null +++ b/node_modules/async/eachLimit.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +exports.default = (0, _awaitify2.default)(eachLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachOf.js b/node_modules/async/eachOf.js new file mode 100644 index 0000000..9ed20f6 --- /dev/null +++ b/node_modules/async/eachOf.js @@ -0,0 +1,185 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isArrayLike = require('./internal/isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _breakLoop = require('./internal/breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback); + var index = 0, + completed = 0, + { length } = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return; + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +function eachOfGeneric(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); +} + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ +function eachOf(coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOf, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachOfLimit.js b/node_modules/async/eachOfLimit.js new file mode 100644 index 0000000..a596e5a --- /dev/null +++ b/node_modules/async/eachOfLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit2 = require('./internal/eachOfLimit.js'); + +var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOfLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachOfSeries.js b/node_modules/async/eachOfSeries.js new file mode 100644 index 0000000..04243ad --- /dev/null +++ b/node_modules/async/eachOfSeries.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfSeries(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachOfSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/eachSeries.js b/node_modules/async/eachSeries.js new file mode 100644 index 0000000..b04896e --- /dev/null +++ b/node_modules/async/eachSeries.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachLimit = require('./eachLimit.js'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachSeries(coll, iteratee, callback) { + return (0, _eachLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/ensureAsync.js b/node_modules/async/ensureAsync.js new file mode 100644 index 0000000..749c5da --- /dev/null +++ b/node_modules/async/ensureAsync.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = ensureAsync; + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wrap an async function and ensure it calls its callback on a later tick of + * the event loop. If the function already calls its callback on a next tick, + * no extra deferral is added. This is useful for preventing stack overflows + * (`RangeError: Maximum call stack size exceeded`) and generally keeping + * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + * contained. ES2017 `async` functions are returned as-is -- they are immune + * to Zalgo's corrupting influences, as they always resolve on a later tick. + * + * @name ensureAsync + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - an async function, one that expects a node-style + * callback as its last argument. + * @returns {AsyncFunction} Returns a wrapped function with the exact same call + * signature as the function passed in. + * @example + * + * function sometimesAsync(arg, callback) { + * if (cache[arg]) { + * return callback(null, cache[arg]); // this would be synchronous!! + * } else { + * doSomeIO(arg, callback); // this IO would be asynchronous + * } + * } + * + * // this has a risk of stack overflows if many results are cached in a row + * async.mapSeries(args, sometimesAsync, done); + * + * // this will defer sometimesAsync's callback if necessary, + * // preventing stack overflows + * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + */ +function ensureAsync(fn) { + if ((0, _wrapAsync.isAsync)(fn)) return fn; + return function (...args /*, callback*/) { + var callback = args.pop(); + var sync = true; + args.push((...innerArgs) => { + if (sync) { + (0, _setImmediate2.default)(() => callback(...innerArgs)); + } else { + callback(...innerArgs); + } + }); + fn.apply(this, args); + sync = false; + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/every.js b/node_modules/async/every.js new file mode 100644 index 0000000..622b301 --- /dev/null +++ b/node_modules/async/every.js @@ -0,0 +1,119 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if every element in `coll` satisfies an async test. If any + * iteratee call returns `false`, the main `callback` is immediately called. + * + * @name every + * @static + * @memberOf module:Collections + * @method + * @alias all + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.every(fileList, fileExists, function(err, result) { + * console.log(result); + * // true + * // result is true since every file exists + * }); + * + * async.every(withMissingFileList, fileExists, function(err, result) { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }); + * + * // Using Promises + * async.every(fileList, fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.every(withMissingFileList, fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since NOT every file exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.every(fileList, fileExists); + * console.log(result); + * // true + * // result is true since every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.every(withMissingFileList, fileExists); + * console.log(result); + * // false + * // result is false since NOT every file exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function every(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(every, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/everyLimit.js b/node_modules/async/everyLimit.js new file mode 100644 index 0000000..375e126 --- /dev/null +++ b/node_modules/async/everyLimit.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. + * + * @name everyLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in parallel. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everyLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everyLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/everySeries.js b/node_modules/async/everySeries.js new file mode 100644 index 0000000..9a6bf7d --- /dev/null +++ b/node_modules/async/everySeries.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. + * + * @name everySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.every]{@link module:Collections.every} + * @alias allSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collection in series. + * The iteratee must complete with a boolean result value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result will be either `true` or `false` + * depending on the values of the async tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function everySeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(everySeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/filter.js b/node_modules/async/filter.js new file mode 100644 index 0000000..2c9a63d --- /dev/null +++ b/node_modules/async/filter.js @@ -0,0 +1,93 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function filter(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filter, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/filterLimit.js b/node_modules/async/filterLimit.js new file mode 100644 index 0000000..d3b3f50 --- /dev/null +++ b/node_modules/async/filterLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ +function filterLimit(coll, limit, iteratee, callback) { + return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/filterSeries.js b/node_modules/async/filterSeries.js new file mode 100644 index 0000000..019a2d0 --- /dev/null +++ b/node_modules/async/filterSeries.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ +function filterSeries(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/find.js b/node_modules/async/find.js new file mode 100644 index 0000000..d5896ef --- /dev/null +++ b/node_modules/async/find.js @@ -0,0 +1,96 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns the first value in `coll` that passes an async truth test. The + * `iteratee` is applied in parallel, meaning the first iteratee to return + * `true` will fire the detect `callback` with that result. That means the + * result might not be the first item in the original `coll` (in terms of order) + * that passes the test. + + * If order within the original `coll` is important, then look at + * [`detectSeries`]{@link module:Collections.detectSeries}. + * + * @name detect + * @static + * @memberOf module:Collections + * @method + * @alias find + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * } + *); + * + * // Using Promises + * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) + * .then(result => { + * console.log(result); + * // dir1/file1.txt + * // result now equals the first file in the list that exists + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); + * console.log(result); + * // dir1/file1.txt + * // result now equals the file in the list that exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function detect(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detect, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/findLimit.js b/node_modules/async/findLimit.js new file mode 100644 index 0000000..c59843b --- /dev/null +++ b/node_modules/async/findLimit.js @@ -0,0 +1,48 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a + * time. + * + * @name detectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findLimit + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(detectLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/findSeries.js b/node_modules/async/findSeries.js new file mode 100644 index 0000000..b486899 --- /dev/null +++ b/node_modules/async/findSeries.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. + * + * @name detectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.detect]{@link module:Collections.detect} + * @alias findSeries + * @category Collections + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. + * The iteratee must complete with a boolean value as its result. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the `iteratee` functions have finished. + * Result will be the first item in the array that passes the truth test + * (iteratee) or the value `undefined` if none passed. Invoked with + * (err, result). + * @returns {Promise} a promise, if a callback is omitted + */ +function detectSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); +} + +exports.default = (0, _awaitify2.default)(detectSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/flatMap.js b/node_modules/async/flatMap.js new file mode 100644 index 0000000..4540a79 --- /dev/null +++ b/node_modules/async/flatMap.js @@ -0,0 +1,115 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _concatLimit = require('./concatLimit.js'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies `iteratee` to each item in `coll`, concatenating the results. Returns + * the concatenated list. The `iteratee`s are called in parallel, and the + * results are concatenated as they return. The results array will be returned in + * the original order of `coll` passed to the `iteratee` function. + * + * @name concat + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @alias flatMap + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * let directoryList = ['dir1','dir2','dir3']; + * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; + * + * // Using callbacks + * async.concat(directoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.concat(directoryList, fs.readdir) + * .then(results => { + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Error Handling + * async.concat(withMissingDirectoryList, fs.readdir) + * .then(results => { + * console.log(results); + * }).catch(err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.concat(directoryList, fs.readdir); + * console.log(results); + * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] + * } catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.concat(withMissingDirectoryList, fs.readdir); + * console.log(results); + * } catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4 does not exist + * } + * } + * + */ +function concat(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concat, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/flatMapLimit.js b/node_modules/async/flatMapLimit.js new file mode 100644 index 0000000..a27cc7d --- /dev/null +++ b/node_modules/async/flatMapLimit.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. + * + * @name concatLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapLimit + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, + * which should use an array as its result. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatLimit(coll, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { + if (err) return iterCb(err); + return iterCb(err, args); + }); + }, (err, mapResults) => { + var result = []; + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + result = result.concat(...mapResults[i]); + } + } + + return callback(err, result); + }); +} +exports.default = (0, _awaitify2.default)(concatLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/flatMapSeries.js b/node_modules/async/flatMapSeries.js new file mode 100644 index 0000000..332de3f --- /dev/null +++ b/node_modules/async/flatMapSeries.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _concatLimit = require('./concatLimit.js'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. + * + * @name concatSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.concat]{@link module:Collections.concat} + * @category Collection + * @alias flatMapSeries + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. + * The iteratee should complete with an array an array of results. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is an array + * containing the concatenated results of the `iteratee` function. Invoked with + * (err, results). + * @returns A Promise, if no callback is passed + */ +function concatSeries(coll, iteratee, callback) { + return (0, _concatLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(concatSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/foldl.js b/node_modules/async/foldl.js new file mode 100644 index 0000000..8a69548 --- /dev/null +++ b/node_modules/async/foldl.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; + * + * // asynchronous function that computes the file size in bytes + * // file size is added to the memoized value, then returned + * function getFileSizeInBytes(memo, file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, memo + stat.size); + * }); + * } + * + * // Using callbacks + * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.reduce(fileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +exports.default = (0, _awaitify2.default)(reduce, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/foldr.js b/node_modules/async/foldr.js new file mode 100644 index 0000000..5be1b68 --- /dev/null +++ b/node_modules/async/foldr.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduceRight; + +var _reduce = require('./reduce.js'); + +var _reduce2 = _interopRequireDefault(_reduce); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function reduceRight(array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return (0, _reduce2.default)(reversed, memo, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEach.js b/node_modules/async/forEach.js new file mode 100644 index 0000000..fdfcbd8 --- /dev/null +++ b/node_modules/async/forEach.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Applies the function `iteratee` to each item in `coll`, in parallel. + * The `iteratee` is called with an item from the list, and a callback for when + * it has finished. If the `iteratee` passes an error to its `callback`, the + * main `callback` (for the `each` function) is immediately called with the + * error. + * + * Note, that since this function applies `iteratee` to each item in parallel, + * there is no guarantee that the iteratee functions will complete in order. + * + * @name each + * @static + * @memberOf module:Collections + * @method + * @alias forEach + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to + * each item in `coll`. Invoked with (item, callback). + * The array index is not passed to the iteratee. + * If you need the index, use `eachOf`. + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; + * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; + * + * // asynchronous function that deletes a file + * const deleteFile = function(file, callback) { + * fs.unlink(file, callback); + * }; + * + * // Using callbacks + * async.each(fileList, deleteFile, function(err) { + * if( err ) { + * console.log(err); + * } else { + * console.log('All files have been deleted successfully'); + * } + * }); + * + * // Error Handling + * async.each(withMissingFileList, deleteFile, function(err){ + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using Promises + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.each(fileList, deleteFile) + * .then( () => { + * console.log('All files have been deleted successfully'); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * }); + * + * // Using async/await + * async () => { + * try { + * await async.each(files, deleteFile); + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * await async.each(withMissingFileList, deleteFile); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * // since dir4/file2.txt does not exist + * // dir1/file1.txt could have been deleted + * } + * } + * + */ +function eachLimit(coll, iteratee, callback) { + return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} + +exports.default = (0, _awaitify2.default)(eachLimit, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachLimit.js b/node_modules/async/forEachLimit.js new file mode 100644 index 0000000..7f5928c --- /dev/null +++ b/node_modules/async/forEachLimit.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _withoutIndex = require('./internal/withoutIndex.js'); + +var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. + * + * @name eachLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfLimit`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); +} +exports.default = (0, _awaitify2.default)(eachLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachOf.js b/node_modules/async/forEachOf.js new file mode 100644 index 0000000..9ed20f6 --- /dev/null +++ b/node_modules/async/forEachOf.js @@ -0,0 +1,185 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isArrayLike = require('./internal/isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _breakLoop = require('./internal/breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// eachOf implementation optimized for array-likes +function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback); + var index = 0, + completed = 0, + { length } = coll, + canceled = false; + if (length === 0) { + callback(null); + } + + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return; + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + + for (; index < length; index++) { + iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); + } +} + +// a generic version of eachOf which can handle array, object, and iterator cases. +function eachOfGeneric(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); +} + +/** + * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument + * to the iteratee. + * + * @name eachOf + * @static + * @memberOf module:Collections + * @method + * @alias forEachOf + * @category Collection + * @see [async.each]{@link module:Collections.each} + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each + * item in `coll`. + * The `key` is the item's key, or index in the case of an array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * // dev.json is a file containing a valid json object config for dev environment + * // dev.json is a file containing a valid json object config for test environment + * // prod.json is a file containing a valid json object config for prod environment + * // invalid.json is a file with a malformed json object + * + * let configs = {}; //global variable + * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; + * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; + * + * // asynchronous function that reads a json file and parses the contents as json object + * function parseFile(file, key, callback) { + * fs.readFile(file, "utf8", function(err, data) { + * if (err) return calback(err); + * try { + * configs[key] = JSON.parse(data); + * } catch (e) { + * return callback(e); + * } + * callback(); + * }); + * } + * + * // Using callbacks + * async.forEachOf(validConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * } else { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { + * if (err) { + * console.error(err); + * // JSON parse error exception + * } else { + * console.log(configs); + * } + * }); + * + * // Using Promises + * async.forEachOf(validConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * }).catch( err => { + * console.error(err); + * }); + * + * //Error handing + * async.forEachOf(invalidConfigFileMap, parseFile) + * .then( () => { + * console.log(configs); + * }).catch( err => { + * console.error(err); + * // JSON parse error exception + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.forEachOf(validConfigFileMap, parseFile); + * console.log(configs); + * // configs is now a map of JSON data, e.g. + * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} + * } + * catch (err) { + * console.log(err); + * } + * } + * + * //Error handing + * async () => { + * try { + * let result = await async.forEachOf(invalidConfigFileMap, parseFile); + * console.log(configs); + * } + * catch (err) { + * console.log(err); + * // JSON parse error exception + * } + * } + * + */ +function eachOf(coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOf, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachOfLimit.js b/node_modules/async/forEachOfLimit.js new file mode 100644 index 0000000..a596e5a --- /dev/null +++ b/node_modules/async/forEachOfLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit2 = require('./internal/eachOfLimit.js'); + +var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a + * time. + * + * @name eachOfLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. The `key` is the item's key, or index in the case of an + * array. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); +} + +exports.default = (0, _awaitify2.default)(eachOfLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachOfSeries.js b/node_modules/async/forEachOfSeries.js new file mode 100644 index 0000000..04243ad --- /dev/null +++ b/node_modules/async/forEachOfSeries.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. + * + * @name eachOfSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.eachOf]{@link module:Collections.eachOf} + * @alias forEachOfSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * Invoked with (item, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachOfSeries(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachOfSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forEachSeries.js b/node_modules/async/forEachSeries.js new file mode 100644 index 0000000..b04896e --- /dev/null +++ b/node_modules/async/forEachSeries.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachLimit = require('./eachLimit.js'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. + * + * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item + * in series and therefore the iteratee functions will complete in order. + + * @name eachSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.each]{@link module:Collections.each} + * @alias forEachSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each + * item in `coll`. + * The array index is not passed to the iteratee. + * If you need the index, use `eachOfSeries`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all + * `iteratee` functions have finished, or an error occurs. Invoked with (err). + * @returns {Promise} a promise, if a callback is omitted + */ +function eachSeries(coll, iteratee, callback) { + return (0, _eachLimit2.default)(coll, 1, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(eachSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/forever.js b/node_modules/async/forever.js new file mode 100644 index 0000000..2292518 --- /dev/null +++ b/node_modules/async/forever.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _ensureAsync = require('./ensureAsync.js'); + +var _ensureAsync2 = _interopRequireDefault(_ensureAsync); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls the asynchronous function `fn` with a callback parameter that allows it + * to call itself again, in series, indefinitely. + + * If an error is passed to the callback then `errback` is called with the + * error, and execution stops, otherwise it will never be called. + * + * @name forever + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} fn - an async function to call repeatedly. + * Invoked with (next). + * @param {Function} [errback] - when `fn` passes an error to it's callback, + * this function will be called, and execution stops. Invoked with (err). + * @returns {Promise} a promise that rejects if an error occurs and an errback + * is not passed + * @example + * + * async.forever( + * function(next) { + * // next is suitable for passing to things that need a callback(err [, whatever]); + * // it will result in this function being called again. + * }, + * function(err) { + * // if next is called with a value in its first parameter, it will appear + * // in here as 'err', and execution will stop. + * } + * ); + */ +function forever(fn, errback) { + var done = (0, _onlyOnce2.default)(errback); + var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn)); + + function next(err) { + if (err) return done(err); + if (err === false) return; + task(next); + } + return next(); +} +exports.default = (0, _awaitify2.default)(forever, 2); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/groupBy.js b/node_modules/async/groupBy.js new file mode 100644 index 0000000..f295763 --- /dev/null +++ b/node_modules/async/groupBy.js @@ -0,0 +1,108 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = groupBy; + +var _groupByLimit = require('./groupByLimit.js'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new object, where each value corresponds to an array of items, from + * `coll`, that returned the corresponding key. That is, the keys of the object + * correspond to the values passed to the `iteratee` callback. + * + * Note: Since this function applies the `iteratee` to each item in parallel, + * there is no guarantee that the `iteratee` functions will complete in order. + * However, the values for each key in the `result` will be in the same order as + * the original `coll`. For Objects, the values will roughly be in the order of + * the original Objects' keys (but this can vary across JavaScript engines). + * + * @name groupBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * const files = ['dir1/file1.txt','dir2','dir4'] + * + * // asynchronous function that detects file type as none, file, or directory + * function detectFile(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(null, 'none'); + * } + * callback(null, stat.isDirectory() ? 'directory' : 'file'); + * }); + * } + * + * //Using callbacks + * async.groupBy(files, detectFile, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * }); + * + * // Using Promises + * async.groupBy(files, detectFile) + * .then( result => { + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.groupBy(files, detectFile); + * console.log(result); + * // { + * // file: [ 'dir1/file1.txt' ], + * // none: [ 'dir4' ], + * // directory: [ 'dir2'] + * // } + * // result is object containing the files grouped by type + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function groupBy(coll, iteratee, callback) { + return (0, _groupByLimit2.default)(coll, Infinity, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/groupByLimit.js b/node_modules/async/groupByLimit.js new file mode 100644 index 0000000..30fd290 --- /dev/null +++ b/node_modules/async/groupByLimit.js @@ -0,0 +1,71 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. + * + * @name groupByLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whoses + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupByLimit(coll, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { + if (err) return iterCb(err); + return iterCb(err, { key, val }); + }); + }, (err, mapResults) => { + var result = {}; + // from MDN, handle object having an `hasOwnProperty` prop + var { hasOwnProperty } = Object.prototype; + + for (var i = 0; i < mapResults.length; i++) { + if (mapResults[i]) { + var { key } = mapResults[i]; + var { val } = mapResults[i]; + + if (hasOwnProperty.call(result, key)) { + result[key].push(val); + } else { + result[key] = [val]; + } + } + } + + return callback(err, result); + }); +} + +exports.default = (0, _awaitify2.default)(groupByLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/groupBySeries.js b/node_modules/async/groupBySeries.js new file mode 100644 index 0000000..e2a5287 --- /dev/null +++ b/node_modules/async/groupBySeries.js @@ -0,0 +1,36 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = groupBySeries; + +var _groupByLimit = require('./groupByLimit.js'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. + * + * @name groupBySeries + * @static + * @memberOf module:Collections + * @method + * @see [async.groupBy]{@link module:Collections.groupBy} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a `key` to group the value under. + * Invoked with (value, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Result is an `Object` whose + * properties are arrays of values which returned the corresponding key. + * @returns {Promise} a promise, if no callback is passed + */ +function groupBySeries(coll, iteratee, callback) { + return (0, _groupByLimit2.default)(coll, 1, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/index.js b/node_modules/async/index.js new file mode 100644 index 0000000..6154647 --- /dev/null +++ b/node_modules/async/index.js @@ -0,0 +1,588 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.doDuring = exports.during = exports.wrapSync = undefined; +exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.flatMapSeries = exports.flatMapLimit = exports.flatMap = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.doWhilst = exports.doUntil = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargoQueue = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; + +var _apply = require('./apply'); + +var _apply2 = _interopRequireDefault(_apply); + +var _applyEach = require('./applyEach'); + +var _applyEach2 = _interopRequireDefault(_applyEach); + +var _applyEachSeries = require('./applyEachSeries'); + +var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries); + +var _asyncify = require('./asyncify'); + +var _asyncify2 = _interopRequireDefault(_asyncify); + +var _auto = require('./auto'); + +var _auto2 = _interopRequireDefault(_auto); + +var _autoInject = require('./autoInject'); + +var _autoInject2 = _interopRequireDefault(_autoInject); + +var _cargo = require('./cargo'); + +var _cargo2 = _interopRequireDefault(_cargo); + +var _cargoQueue = require('./cargoQueue'); + +var _cargoQueue2 = _interopRequireDefault(_cargoQueue); + +var _compose = require('./compose'); + +var _compose2 = _interopRequireDefault(_compose); + +var _concat = require('./concat'); + +var _concat2 = _interopRequireDefault(_concat); + +var _concatLimit = require('./concatLimit'); + +var _concatLimit2 = _interopRequireDefault(_concatLimit); + +var _concatSeries = require('./concatSeries'); + +var _concatSeries2 = _interopRequireDefault(_concatSeries); + +var _constant = require('./constant'); + +var _constant2 = _interopRequireDefault(_constant); + +var _detect = require('./detect'); + +var _detect2 = _interopRequireDefault(_detect); + +var _detectLimit = require('./detectLimit'); + +var _detectLimit2 = _interopRequireDefault(_detectLimit); + +var _detectSeries = require('./detectSeries'); + +var _detectSeries2 = _interopRequireDefault(_detectSeries); + +var _dir = require('./dir'); + +var _dir2 = _interopRequireDefault(_dir); + +var _doUntil = require('./doUntil'); + +var _doUntil2 = _interopRequireDefault(_doUntil); + +var _doWhilst = require('./doWhilst'); + +var _doWhilst2 = _interopRequireDefault(_doWhilst); + +var _each = require('./each'); + +var _each2 = _interopRequireDefault(_each); + +var _eachLimit = require('./eachLimit'); + +var _eachLimit2 = _interopRequireDefault(_eachLimit); + +var _eachOf = require('./eachOf'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _eachOfLimit = require('./eachOfLimit'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _eachOfSeries = require('./eachOfSeries'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _eachSeries = require('./eachSeries'); + +var _eachSeries2 = _interopRequireDefault(_eachSeries); + +var _ensureAsync = require('./ensureAsync'); + +var _ensureAsync2 = _interopRequireDefault(_ensureAsync); + +var _every = require('./every'); + +var _every2 = _interopRequireDefault(_every); + +var _everyLimit = require('./everyLimit'); + +var _everyLimit2 = _interopRequireDefault(_everyLimit); + +var _everySeries = require('./everySeries'); + +var _everySeries2 = _interopRequireDefault(_everySeries); + +var _filter = require('./filter'); + +var _filter2 = _interopRequireDefault(_filter); + +var _filterLimit = require('./filterLimit'); + +var _filterLimit2 = _interopRequireDefault(_filterLimit); + +var _filterSeries = require('./filterSeries'); + +var _filterSeries2 = _interopRequireDefault(_filterSeries); + +var _forever = require('./forever'); + +var _forever2 = _interopRequireDefault(_forever); + +var _groupBy = require('./groupBy'); + +var _groupBy2 = _interopRequireDefault(_groupBy); + +var _groupByLimit = require('./groupByLimit'); + +var _groupByLimit2 = _interopRequireDefault(_groupByLimit); + +var _groupBySeries = require('./groupBySeries'); + +var _groupBySeries2 = _interopRequireDefault(_groupBySeries); + +var _log = require('./log'); + +var _log2 = _interopRequireDefault(_log); + +var _map = require('./map'); + +var _map2 = _interopRequireDefault(_map); + +var _mapLimit = require('./mapLimit'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _mapSeries = require('./mapSeries'); + +var _mapSeries2 = _interopRequireDefault(_mapSeries); + +var _mapValues = require('./mapValues'); + +var _mapValues2 = _interopRequireDefault(_mapValues); + +var _mapValuesLimit = require('./mapValuesLimit'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +var _mapValuesSeries = require('./mapValuesSeries'); + +var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries); + +var _memoize = require('./memoize'); + +var _memoize2 = _interopRequireDefault(_memoize); + +var _nextTick = require('./nextTick'); + +var _nextTick2 = _interopRequireDefault(_nextTick); + +var _parallel = require('./parallel'); + +var _parallel2 = _interopRequireDefault(_parallel); + +var _parallelLimit = require('./parallelLimit'); + +var _parallelLimit2 = _interopRequireDefault(_parallelLimit); + +var _priorityQueue = require('./priorityQueue'); + +var _priorityQueue2 = _interopRequireDefault(_priorityQueue); + +var _queue = require('./queue'); + +var _queue2 = _interopRequireDefault(_queue); + +var _race = require('./race'); + +var _race2 = _interopRequireDefault(_race); + +var _reduce = require('./reduce'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _reduceRight = require('./reduceRight'); + +var _reduceRight2 = _interopRequireDefault(_reduceRight); + +var _reflect = require('./reflect'); + +var _reflect2 = _interopRequireDefault(_reflect); + +var _reflectAll = require('./reflectAll'); + +var _reflectAll2 = _interopRequireDefault(_reflectAll); + +var _reject = require('./reject'); + +var _reject2 = _interopRequireDefault(_reject); + +var _rejectLimit = require('./rejectLimit'); + +var _rejectLimit2 = _interopRequireDefault(_rejectLimit); + +var _rejectSeries = require('./rejectSeries'); + +var _rejectSeries2 = _interopRequireDefault(_rejectSeries); + +var _retry = require('./retry'); + +var _retry2 = _interopRequireDefault(_retry); + +var _retryable = require('./retryable'); + +var _retryable2 = _interopRequireDefault(_retryable); + +var _seq = require('./seq'); + +var _seq2 = _interopRequireDefault(_seq); + +var _series = require('./series'); + +var _series2 = _interopRequireDefault(_series); + +var _setImmediate = require('./setImmediate'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _some = require('./some'); + +var _some2 = _interopRequireDefault(_some); + +var _someLimit = require('./someLimit'); + +var _someLimit2 = _interopRequireDefault(_someLimit); + +var _someSeries = require('./someSeries'); + +var _someSeries2 = _interopRequireDefault(_someSeries); + +var _sortBy = require('./sortBy'); + +var _sortBy2 = _interopRequireDefault(_sortBy); + +var _timeout = require('./timeout'); + +var _timeout2 = _interopRequireDefault(_timeout); + +var _times = require('./times'); + +var _times2 = _interopRequireDefault(_times); + +var _timesLimit = require('./timesLimit'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +var _timesSeries = require('./timesSeries'); + +var _timesSeries2 = _interopRequireDefault(_timesSeries); + +var _transform = require('./transform'); + +var _transform2 = _interopRequireDefault(_transform); + +var _tryEach = require('./tryEach'); + +var _tryEach2 = _interopRequireDefault(_tryEach); + +var _unmemoize = require('./unmemoize'); + +var _unmemoize2 = _interopRequireDefault(_unmemoize); + +var _until = require('./until'); + +var _until2 = _interopRequireDefault(_until); + +var _waterfall = require('./waterfall'); + +var _waterfall2 = _interopRequireDefault(_waterfall); + +var _whilst = require('./whilst'); + +var _whilst2 = _interopRequireDefault(_whilst); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * An "async function" in the context of Async is an asynchronous function with + * a variable number of parameters, with the final parameter being a callback. + * (`function (arg1, arg2, ..., callback) {}`) + * The final callback is of the form `callback(err, results...)`, which must be + * called once the function is completed. The callback should be called with a + * Error as its first argument to signal that an error occurred. + * Otherwise, if no error occurred, it should be called with `null` as the first + * argument, and any additional `result` arguments that may apply, to signal + * successful completion. + * The callback must be called exactly once, ideally on a later tick of the + * JavaScript event loop. + * + * This type of function is also referred to as a "Node-style async function", + * or a "continuation passing-style function" (CPS). Most of the methods of this + * library are themselves CPS/Node-style async functions, or functions that + * return CPS/Node-style async functions. + * + * Wherever we accept a Node-style async function, we also directly accept an + * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. + * In this case, the `async` function will not be passed a final callback + * argument, and any thrown error will be used as the `err` argument of the + * implicit callback, and the return value will be used as the `result` value. + * (i.e. a `rejected` of the returned Promise becomes the `err` callback + * argument, and a `resolved` value becomes the `result`.) + * + * Note, due to JavaScript limitations, we can only detect native `async` + * functions and not transpilied implementations. + * Your environment must have `async`/`await` support for this to work. + * (e.g. Node > v7.6, or a recent version of a modern browser). + * If you are using `async` functions through a transpiler (e.g. Babel), you + * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, + * because the `async function` will be compiled to an ordinary function that + * returns a promise. + * + * @typedef {Function} AsyncFunction + * @static + */ + +/** + * Async is a utility module which provides straight-forward, powerful functions + * for working with asynchronous JavaScript. Although originally designed for + * use with [Node.js](http://nodejs.org) and installable via + * `npm install --save async`, it can also be used directly in the browser. + * @module async + * @see AsyncFunction + */ + +/** + * A collection of `async` functions for manipulating collections, such as + * arrays and objects. + * @module Collections + */ + +/** + * A collection of `async` functions for controlling the flow through a script. + * @module ControlFlow + */ + +/** + * A collection of `async` utility functions. + * @module Utils + */ + +exports.default = { + apply: _apply2.default, + applyEach: _applyEach2.default, + applyEachSeries: _applyEachSeries2.default, + asyncify: _asyncify2.default, + auto: _auto2.default, + autoInject: _autoInject2.default, + cargo: _cargo2.default, + cargoQueue: _cargoQueue2.default, + compose: _compose2.default, + concat: _concat2.default, + concatLimit: _concatLimit2.default, + concatSeries: _concatSeries2.default, + constant: _constant2.default, + detect: _detect2.default, + detectLimit: _detectLimit2.default, + detectSeries: _detectSeries2.default, + dir: _dir2.default, + doUntil: _doUntil2.default, + doWhilst: _doWhilst2.default, + each: _each2.default, + eachLimit: _eachLimit2.default, + eachOf: _eachOf2.default, + eachOfLimit: _eachOfLimit2.default, + eachOfSeries: _eachOfSeries2.default, + eachSeries: _eachSeries2.default, + ensureAsync: _ensureAsync2.default, + every: _every2.default, + everyLimit: _everyLimit2.default, + everySeries: _everySeries2.default, + filter: _filter2.default, + filterLimit: _filterLimit2.default, + filterSeries: _filterSeries2.default, + forever: _forever2.default, + groupBy: _groupBy2.default, + groupByLimit: _groupByLimit2.default, + groupBySeries: _groupBySeries2.default, + log: _log2.default, + map: _map2.default, + mapLimit: _mapLimit2.default, + mapSeries: _mapSeries2.default, + mapValues: _mapValues2.default, + mapValuesLimit: _mapValuesLimit2.default, + mapValuesSeries: _mapValuesSeries2.default, + memoize: _memoize2.default, + nextTick: _nextTick2.default, + parallel: _parallel2.default, + parallelLimit: _parallelLimit2.default, + priorityQueue: _priorityQueue2.default, + queue: _queue2.default, + race: _race2.default, + reduce: _reduce2.default, + reduceRight: _reduceRight2.default, + reflect: _reflect2.default, + reflectAll: _reflectAll2.default, + reject: _reject2.default, + rejectLimit: _rejectLimit2.default, + rejectSeries: _rejectSeries2.default, + retry: _retry2.default, + retryable: _retryable2.default, + seq: _seq2.default, + series: _series2.default, + setImmediate: _setImmediate2.default, + some: _some2.default, + someLimit: _someLimit2.default, + someSeries: _someSeries2.default, + sortBy: _sortBy2.default, + timeout: _timeout2.default, + times: _times2.default, + timesLimit: _timesLimit2.default, + timesSeries: _timesSeries2.default, + transform: _transform2.default, + tryEach: _tryEach2.default, + unmemoize: _unmemoize2.default, + until: _until2.default, + waterfall: _waterfall2.default, + whilst: _whilst2.default, + + // aliases + all: _every2.default, + allLimit: _everyLimit2.default, + allSeries: _everySeries2.default, + any: _some2.default, + anyLimit: _someLimit2.default, + anySeries: _someSeries2.default, + find: _detect2.default, + findLimit: _detectLimit2.default, + findSeries: _detectSeries2.default, + flatMap: _concat2.default, + flatMapLimit: _concatLimit2.default, + flatMapSeries: _concatSeries2.default, + forEach: _each2.default, + forEachSeries: _eachSeries2.default, + forEachLimit: _eachLimit2.default, + forEachOf: _eachOf2.default, + forEachOfSeries: _eachOfSeries2.default, + forEachOfLimit: _eachOfLimit2.default, + inject: _reduce2.default, + foldl: _reduce2.default, + foldr: _reduceRight2.default, + select: _filter2.default, + selectLimit: _filterLimit2.default, + selectSeries: _filterSeries2.default, + wrapSync: _asyncify2.default, + during: _whilst2.default, + doDuring: _doWhilst2.default +}; +exports.apply = _apply2.default; +exports.applyEach = _applyEach2.default; +exports.applyEachSeries = _applyEachSeries2.default; +exports.asyncify = _asyncify2.default; +exports.auto = _auto2.default; +exports.autoInject = _autoInject2.default; +exports.cargo = _cargo2.default; +exports.cargoQueue = _cargoQueue2.default; +exports.compose = _compose2.default; +exports.concat = _concat2.default; +exports.concatLimit = _concatLimit2.default; +exports.concatSeries = _concatSeries2.default; +exports.constant = _constant2.default; +exports.detect = _detect2.default; +exports.detectLimit = _detectLimit2.default; +exports.detectSeries = _detectSeries2.default; +exports.dir = _dir2.default; +exports.doUntil = _doUntil2.default; +exports.doWhilst = _doWhilst2.default; +exports.each = _each2.default; +exports.eachLimit = _eachLimit2.default; +exports.eachOf = _eachOf2.default; +exports.eachOfLimit = _eachOfLimit2.default; +exports.eachOfSeries = _eachOfSeries2.default; +exports.eachSeries = _eachSeries2.default; +exports.ensureAsync = _ensureAsync2.default; +exports.every = _every2.default; +exports.everyLimit = _everyLimit2.default; +exports.everySeries = _everySeries2.default; +exports.filter = _filter2.default; +exports.filterLimit = _filterLimit2.default; +exports.filterSeries = _filterSeries2.default; +exports.forever = _forever2.default; +exports.groupBy = _groupBy2.default; +exports.groupByLimit = _groupByLimit2.default; +exports.groupBySeries = _groupBySeries2.default; +exports.log = _log2.default; +exports.map = _map2.default; +exports.mapLimit = _mapLimit2.default; +exports.mapSeries = _mapSeries2.default; +exports.mapValues = _mapValues2.default; +exports.mapValuesLimit = _mapValuesLimit2.default; +exports.mapValuesSeries = _mapValuesSeries2.default; +exports.memoize = _memoize2.default; +exports.nextTick = _nextTick2.default; +exports.parallel = _parallel2.default; +exports.parallelLimit = _parallelLimit2.default; +exports.priorityQueue = _priorityQueue2.default; +exports.queue = _queue2.default; +exports.race = _race2.default; +exports.reduce = _reduce2.default; +exports.reduceRight = _reduceRight2.default; +exports.reflect = _reflect2.default; +exports.reflectAll = _reflectAll2.default; +exports.reject = _reject2.default; +exports.rejectLimit = _rejectLimit2.default; +exports.rejectSeries = _rejectSeries2.default; +exports.retry = _retry2.default; +exports.retryable = _retryable2.default; +exports.seq = _seq2.default; +exports.series = _series2.default; +exports.setImmediate = _setImmediate2.default; +exports.some = _some2.default; +exports.someLimit = _someLimit2.default; +exports.someSeries = _someSeries2.default; +exports.sortBy = _sortBy2.default; +exports.timeout = _timeout2.default; +exports.times = _times2.default; +exports.timesLimit = _timesLimit2.default; +exports.timesSeries = _timesSeries2.default; +exports.transform = _transform2.default; +exports.tryEach = _tryEach2.default; +exports.unmemoize = _unmemoize2.default; +exports.until = _until2.default; +exports.waterfall = _waterfall2.default; +exports.whilst = _whilst2.default; +exports.all = _every2.default; +exports.allLimit = _everyLimit2.default; +exports.allSeries = _everySeries2.default; +exports.any = _some2.default; +exports.anyLimit = _someLimit2.default; +exports.anySeries = _someSeries2.default; +exports.find = _detect2.default; +exports.findLimit = _detectLimit2.default; +exports.findSeries = _detectSeries2.default; +exports.flatMap = _concat2.default; +exports.flatMapLimit = _concatLimit2.default; +exports.flatMapSeries = _concatSeries2.default; +exports.forEach = _each2.default; +exports.forEachSeries = _eachSeries2.default; +exports.forEachLimit = _eachLimit2.default; +exports.forEachOf = _eachOf2.default; +exports.forEachOfSeries = _eachOfSeries2.default; +exports.forEachOfLimit = _eachOfLimit2.default; +exports.inject = _reduce2.default; +exports.foldl = _reduce2.default; +exports.foldr = _reduceRight2.default; +exports.select = _filter2.default; +exports.selectLimit = _filterLimit2.default; +exports.selectSeries = _filterSeries2.default; +exports.wrapSync = _asyncify2.default; +exports.during = _whilst2.default; +exports.doDuring = _doWhilst2.default; \ No newline at end of file diff --git a/node_modules/async/inject.js b/node_modules/async/inject.js new file mode 100644 index 0000000..8a69548 --- /dev/null +++ b/node_modules/async/inject.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; + * + * // asynchronous function that computes the file size in bytes + * // file size is added to the memoized value, then returned + * function getFileSizeInBytes(memo, file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, memo + stat.size); + * }); + * } + * + * // Using callbacks + * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.reduce(fileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +exports.default = (0, _awaitify2.default)(reduce, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/DoublyLinkedList.js b/node_modules/async/internal/DoublyLinkedList.js new file mode 100644 index 0000000..419ce44 --- /dev/null +++ b/node_modules/async/internal/DoublyLinkedList.js @@ -0,0 +1,92 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation +// used for queues. This implementation assumes that the node provided by the user can be modified +// to adjust the next and last properties. We implement only the minimal functionality +// for queue support. +class DLL { + constructor() { + this.head = this.tail = null; + this.length = 0; + } + + removeLink(node) { + if (node.prev) node.prev.next = node.next;else this.head = node.next; + if (node.next) node.next.prev = node.prev;else this.tail = node.prev; + + node.prev = node.next = null; + this.length -= 1; + return node; + } + + empty() { + while (this.head) this.shift(); + return this; + } + + insertAfter(node, newNode) { + newNode.prev = node; + newNode.next = node.next; + if (node.next) node.next.prev = newNode;else this.tail = newNode; + node.next = newNode; + this.length += 1; + } + + insertBefore(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) node.prev.next = newNode;else this.head = newNode; + node.prev = newNode; + this.length += 1; + } + + unshift(node) { + if (this.head) this.insertBefore(this.head, node);else setInitial(this, node); + } + + push(node) { + if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node); + } + + shift() { + return this.head && this.removeLink(this.head); + } + + pop() { + return this.tail && this.removeLink(this.tail); + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator]() { + var cur = this.head; + while (cur) { + yield cur.data; + cur = cur.next; + } + } + + remove(testFn) { + var curr = this.head; + while (curr) { + var { next } = curr; + if (testFn(curr)) { + this.removeLink(curr); + } + curr = next; + } + return this; + } +} + +exports.default = DLL; +function setInitial(dll, node) { + dll.length = 1; + dll.head = dll.tail = node; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/Heap.js b/node_modules/async/internal/Heap.js new file mode 100644 index 0000000..7867c92 --- /dev/null +++ b/node_modules/async/internal/Heap.js @@ -0,0 +1,120 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Binary min-heap implementation used for priority queue. +// Implementation is stable, i.e. push time is considered for equal priorities +class Heap { + constructor() { + this.heap = []; + this.pushCount = Number.MIN_SAFE_INTEGER; + } + + get length() { + return this.heap.length; + } + + empty() { + this.heap = []; + return this; + } + + percUp(index) { + let p; + + while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) { + let t = this.heap[index]; + this.heap[index] = this.heap[p]; + this.heap[p] = t; + + index = p; + } + } + + percDown(index) { + let l; + + while ((l = leftChi(index)) < this.heap.length) { + if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) { + l = l + 1; + } + + if (smaller(this.heap[index], this.heap[l])) { + break; + } + + let t = this.heap[index]; + this.heap[index] = this.heap[l]; + this.heap[l] = t; + + index = l; + } + } + + push(node) { + node.pushCount = ++this.pushCount; + this.heap.push(node); + this.percUp(this.heap.length - 1); + } + + unshift(node) { + return this.heap.push(node); + } + + shift() { + let [top] = this.heap; + + this.heap[0] = this.heap[this.heap.length - 1]; + this.heap.pop(); + this.percDown(0); + + return top; + } + + toArray() { + return [...this]; + } + + *[Symbol.iterator]() { + for (let i = 0; i < this.heap.length; i++) { + yield this.heap[i].data; + } + } + + remove(testFn) { + let j = 0; + for (let i = 0; i < this.heap.length; i++) { + if (!testFn(this.heap[i])) { + this.heap[j] = this.heap[i]; + j++; + } + } + + this.heap.splice(j); + + for (let i = parent(this.heap.length - 1); i >= 0; i--) { + this.percDown(i); + } + + return this; + } +} + +exports.default = Heap; +function leftChi(i) { + return (i << 1) + 1; +} + +function parent(i) { + return (i + 1 >> 1) - 1; +} + +function smaller(x, y) { + if (x.priority !== y.priority) { + return x.priority < y.priority; + } else { + return x.pushCount < y.pushCount; + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/applyEach.js b/node_modules/async/internal/applyEach.js new file mode 100644 index 0000000..5444912 --- /dev/null +++ b/node_modules/async/internal/applyEach.js @@ -0,0 +1,29 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (eachfn) { + return function applyEach(fns, ...callArgs) { + const go = (0, _awaitify2.default)(function (callback) { + var that = this; + return eachfn(fns, (fn, cb) => { + (0, _wrapAsync2.default)(fn).apply(that, callArgs.concat(cb)); + }, callback); + }); + return go; + }; +}; + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/asyncEachOfLimit.js b/node_modules/async/internal/asyncEachOfLimit.js new file mode 100644 index 0000000..34dd82b --- /dev/null +++ b/node_modules/async/internal/asyncEachOfLimit.js @@ -0,0 +1,75 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncEachOfLimit; + +var _breakLoop = require('./breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// for async generators +function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + + function replenish() { + //console.log('replenish') + if (running >= limit || awaiting || done) return; + //console.log('replenish awaiting') + awaiting = true; + generator.next().then(({ value, done: iterDone }) => { + //console.log('got value', value) + if (canceled || done) return; + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + //console.log('done nextCb') + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError); + } + + function iterateeCallback(err, result) { + //console.log('iterateeCallback') + running -= 1; + if (canceled) return; + if (err) return handleError(err); + + if (err === false) { + done = true; + canceled = true; + return; + } + + if (result === _breakLoop2.default || done && running <= 0) { + done = true; + //console.log('done iterCb') + return callback(null); + } + replenish(); + } + + function handleError(err) { + if (canceled) return; + awaiting = false; + done = true; + callback(err); + } + + replenish(); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/awaitify.js b/node_modules/async/internal/awaitify.js new file mode 100644 index 0000000..bb7a609 --- /dev/null +++ b/node_modules/async/internal/awaitify.js @@ -0,0 +1,28 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = awaitify; +// conditionally promisify a function. +// only return a promise if a callback is omitted +function awaitify(asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error('arity is undefined'); + function awaitable(...args) { + if (typeof args[arity - 1] === 'function') { + return asyncFn.apply(this, args); + } + + return new Promise((resolve, reject) => { + args[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err); + resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args); + }); + } + + return awaitable; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/breakLoop.js b/node_modules/async/internal/breakLoop.js new file mode 100644 index 0000000..87413dd --- /dev/null +++ b/node_modules/async/internal/breakLoop.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// A temporary value used to identify if the loop should be broken. +// See #1064, #1293 +const breakLoop = {}; +exports.default = breakLoop; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/consoleFunc.js b/node_modules/async/internal/consoleFunc.js new file mode 100644 index 0000000..748d54b --- /dev/null +++ b/node_modules/async/internal/consoleFunc.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = consoleFunc; + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function consoleFunc(name) { + return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => { + /* istanbul ignore else */ + if (typeof console === 'object') { + /* istanbul ignore else */ + if (err) { + /* istanbul ignore else */ + if (console.error) { + console.error(err); + } + } else if (console[name]) { + /* istanbul ignore else */ + resultArgs.forEach(x => console[name](x)); + } + } + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/createTester.js b/node_modules/async/internal/createTester.js new file mode 100644 index 0000000..cafdf62 --- /dev/null +++ b/node_modules/async/internal/createTester.js @@ -0,0 +1,40 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _createTester; + +var _breakLoop = require('./breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _createTester(check, getResult) { + return (eachfn, arr, _iteratee, cb) => { + var testPassed = false; + var testResult; + const iteratee = (0, _wrapAsync2.default)(_iteratee); + eachfn(arr, (value, _, callback) => { + iteratee(value, (err, result) => { + if (err || err === false) return callback(err); + + if (check(result) && !testResult) { + testPassed = true; + testResult = getResult(true, value); + return callback(null, _breakLoop2.default); + } + callback(); + }); + }, err => { + if (err) return cb(err); + cb(null, testPassed ? testResult : getResult(false)); + }); + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/eachOfLimit.js b/node_modules/async/internal/eachOfLimit.js new file mode 100644 index 0000000..ceed60f --- /dev/null +++ b/node_modules/async/internal/eachOfLimit.js @@ -0,0 +1,90 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _once = require('./once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _iterator = require('./iterator.js'); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _onlyOnce = require('./onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./wrapAsync.js'); + +var _asyncEachOfLimit = require('./asyncEachOfLimit.js'); + +var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit); + +var _breakLoop = require('./breakLoop.js'); + +var _breakLoop2 = _interopRequireDefault(_breakLoop); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = limit => { + return (obj, iteratee, callback) => { + callback = (0, _once2.default)(callback); + if (limit <= 0) { + throw new RangeError('concurrency limit cannot be less than 1'); + } + if (!obj) { + return callback(null); + } + if ((0, _wrapAsync.isAsyncGenerator)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback); + } + if ((0, _wrapAsync.isAsyncIterable)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback); + } + var nextElem = (0, _iterator2.default)(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + + function iterateeCallback(err, value) { + if (canceled) return; + running -= 1; + if (err) { + done = true; + callback(err); + } else if (err === false) { + done = true; + canceled = true; + } else if (value === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } else if (!looping) { + replenish(); + } + } + + function replenish() { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback)); + } + looping = false; + } + + replenish(); + }; +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/filter.js b/node_modules/async/internal/filter.js new file mode 100644 index 0000000..065c211 --- /dev/null +++ b/node_modules/async/internal/filter.js @@ -0,0 +1,55 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _filter; + +var _isArrayLike = require('./isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function filterArray(eachfn, arr, iteratee, callback) { + var truthValues = new Array(arr.length); + eachfn(arr, (x, index, iterCb) => { + iteratee(x, (err, v) => { + truthValues[index] = !!v; + iterCb(err); + }); + }, err => { + if (err) return callback(err); + var results = []; + for (var i = 0; i < arr.length; i++) { + if (truthValues[i]) results.push(arr[i]); + } + callback(null, results); + }); +} + +function filterGeneric(eachfn, coll, iteratee, callback) { + var results = []; + eachfn(coll, (x, index, iterCb) => { + iteratee(x, (err, v) => { + if (err) return iterCb(err); + if (v) { + results.push({ index, value: x }); + } + iterCb(err); + }); + }, err => { + if (err) return callback(err); + callback(null, results.sort((a, b) => a.index - b.index).map(v => v.value)); + }); +} + +function _filter(eachfn, coll, iteratee, callback) { + var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric; + return filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/getIterator.js b/node_modules/async/internal/getIterator.js new file mode 100644 index 0000000..f518fce --- /dev/null +++ b/node_modules/async/internal/getIterator.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/initialParams.js b/node_modules/async/internal/initialParams.js new file mode 100644 index 0000000..04c0eff --- /dev/null +++ b/node_modules/async/internal/initialParams.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (fn) { + return function (...args /*, callback*/) { + var callback = args.pop(); + return fn.call(this, args, callback); + }; +}; + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/isArrayLike.js b/node_modules/async/internal/isArrayLike.js new file mode 100644 index 0000000..a4c4c8a --- /dev/null +++ b/node_modules/async/internal/isArrayLike.js @@ -0,0 +1,10 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = isArrayLike; +function isArrayLike(value) { + return value && typeof value.length === 'number' && value.length >= 0 && value.length % 1 === 0; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/iterator.js b/node_modules/async/internal/iterator.js new file mode 100644 index 0000000..5778b1e --- /dev/null +++ b/node_modules/async/internal/iterator.js @@ -0,0 +1,57 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = createIterator; + +var _isArrayLike = require('./isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _getIterator = require('./getIterator.js'); + +var _getIterator2 = _interopRequireDefault(_getIterator); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function createArrayIterator(coll) { + var i = -1; + var len = coll.length; + return function next() { + return ++i < len ? { value: coll[i], key: i } : null; + }; +} + +function createES2015Iterator(iterator) { + var i = -1; + return function next() { + var item = iterator.next(); + if (item.done) return null; + i++; + return { value: item.value, key: i }; + }; +} + +function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i = -1; + var len = okeys.length; + return function next() { + var key = okeys[++i]; + if (key === '__proto__') { + return next(); + } + return i < len ? { value: obj[key], key } : null; + }; +} + +function createIterator(coll) { + if ((0, _isArrayLike2.default)(coll)) { + return createArrayIterator(coll); + } + + var iterator = (0, _getIterator2.default)(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/map.js b/node_modules/async/internal/map.js new file mode 100644 index 0000000..acab1e7 --- /dev/null +++ b/node_modules/async/internal/map.js @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _asyncMap; + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _asyncMap(eachfn, arr, iteratee, callback) { + arr = arr || []; + var results = []; + var counter = 0; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + + return eachfn(arr, (value, _, iterCb) => { + var index = counter++; + _iteratee(value, (err, v) => { + results[index] = v; + iterCb(err); + }); + }, err => { + callback(err, results); + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/once.js b/node_modules/async/internal/once.js new file mode 100644 index 0000000..a8b5792 --- /dev/null +++ b/node_modules/async/internal/once.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = once; +function once(fn) { + function wrapper(...args) { + if (fn === null) return; + var callFn = fn; + fn = null; + callFn.apply(this, args); + } + Object.assign(wrapper, fn); + return wrapper; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/onlyOnce.js b/node_modules/async/internal/onlyOnce.js new file mode 100644 index 0000000..c95a92d --- /dev/null +++ b/node_modules/async/internal/onlyOnce.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = onlyOnce; +function onlyOnce(fn) { + return function (...args) { + if (fn === null) throw new Error("Callback was already called."); + var callFn = fn; + fn = null; + callFn.apply(this, args); + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/parallel.js b/node_modules/async/internal/parallel.js new file mode 100644 index 0000000..57fbd0d --- /dev/null +++ b/node_modules/async/internal/parallel.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isArrayLike = require('./isArrayLike.js'); + +var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = (0, _awaitify2.default)((eachfn, tasks, callback) => { + var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; + + eachfn(tasks, (task, key, taskCb) => { + (0, _wrapAsync2.default)(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, err => callback(err, results)); +}, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/promiseCallback.js b/node_modules/async/internal/promiseCallback.js new file mode 100644 index 0000000..17a8301 --- /dev/null +++ b/node_modules/async/internal/promiseCallback.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +const PROMISE_SYMBOL = Symbol('promiseCallback'); + +function promiseCallback() { + let resolve, reject; + function callback(err, ...args) { + if (err) return reject(err); + resolve(args.length > 1 ? args : args[0]); + } + + callback[PROMISE_SYMBOL] = new Promise((res, rej) => { + resolve = res, reject = rej; + }); + + return callback; +} + +exports.promiseCallback = promiseCallback; +exports.PROMISE_SYMBOL = PROMISE_SYMBOL; \ No newline at end of file diff --git a/node_modules/async/internal/queue.js b/node_modules/async/internal/queue.js new file mode 100644 index 0000000..7414e03 --- /dev/null +++ b/node_modules/async/internal/queue.js @@ -0,0 +1,294 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = queue; + +var _onlyOnce = require('./onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _setImmediate = require('./setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _DoublyLinkedList = require('./DoublyLinkedList.js'); + +var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } else if (concurrency === 0) { + throw new RangeError('Concurrency must not be zero'); + } + + var _worker = (0, _wrapAsync2.default)(worker); + var numRunning = 0; + var workersList = []; + const events = { + error: [], + drain: [], + saturated: [], + unsaturated: [], + empty: [] + }; + + function on(event, handler) { + events[event].push(handler); + } + + function once(event, handler) { + const handleAndRemove = (...args) => { + off(event, handleAndRemove); + handler(...args); + }; + events[event].push(handleAndRemove); + } + + function off(event, handler) { + if (!event) return Object.keys(events).forEach(ev => events[ev] = []); + if (!handler) return events[event] = []; + events[event] = events[event].filter(ev => ev !== handler); + } + + function trigger(event, ...args) { + events[event].forEach(handler => handler(...args)); + } + + var processingScheduled = false; + function _insert(data, insertAtFront, rejectOnError, callback) { + if (callback != null && typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + + var res, rej; + function promiseCallback(err, ...args) { + // we don't care about the error, let the global error handler + // deal with it + if (err) return rejectOnError ? rej(err) : res(); + if (args.length <= 1) return res(args[0]); + res(args); + } + + var item = q._createTaskItem(data, rejectOnError ? promiseCallback : callback || promiseCallback); + + if (insertAtFront) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + + if (!processingScheduled) { + processingScheduled = true; + (0, _setImmediate2.default)(() => { + processingScheduled = false; + q.process(); + }); + } + + if (rejectOnError || !callback) { + return new Promise((resolve, reject) => { + res = resolve; + rej = reject; + }); + } + } + + function _createCB(tasks) { + return function (err, ...args) { + numRunning -= 1; + + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + + var index = workersList.indexOf(task); + if (index === 0) { + workersList.shift(); + } else if (index > 0) { + workersList.splice(index, 1); + } + + task.callback(err, ...args); + + if (err != null) { + trigger('error', err, task.data); + } + } + + if (numRunning <= q.concurrency - q.buffer) { + trigger('unsaturated'); + } + + if (q.idle()) { + trigger('drain'); + } + q.process(); + }; + } + + function _maybeDrain(data) { + if (data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + (0, _setImmediate2.default)(() => trigger('drain')); + return true; + } + return false; + } + + const eventMethod = name => handler => { + if (!handler) { + return new Promise((resolve, reject) => { + once(name, (err, data) => { + if (err) return reject(err); + resolve(data); + }); + }); + } + off(name); + on(name, handler); + }; + + var isProcessing = false; + var q = { + _tasks: new _DoublyLinkedList2.default(), + _createTaskItem(data, callback) { + return { + data, + callback + }; + }, + *[Symbol.iterator]() { + yield* q._tasks[Symbol.iterator](); + }, + concurrency, + payload, + buffer: concurrency / 4, + started: false, + paused: false, + push(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, false, false, callback)); + } + return _insert(data, false, false, callback); + }, + pushAsync(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, false, true, callback)); + } + return _insert(data, false, true, callback); + }, + kill() { + off(); + q._tasks.empty(); + }, + unshift(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, true, false, callback)); + } + return _insert(data, true, false, callback); + }, + unshiftAsync(data, callback) { + if (Array.isArray(data)) { + if (_maybeDrain(data)) return; + return data.map(datum => _insert(datum, true, true, callback)); + } + return _insert(data, true, true, callback); + }, + remove(testFn) { + q._tasks.remove(testFn); + }, + process() { + // Avoid trying to start too many processing operations. This can occur + // when callbacks resolve synchronously (#1267). + if (isProcessing) { + return; + } + isProcessing = true; + while (!q.paused && numRunning < q.concurrency && q._tasks.length) { + var tasks = [], + data = []; + var l = q._tasks.length; + if (q.payload) l = Math.min(l, q.payload); + for (var i = 0; i < l; i++) { + var node = q._tasks.shift(); + tasks.push(node); + workersList.push(node); + data.push(node.data); + } + + numRunning += 1; + + if (q._tasks.length === 0) { + trigger('empty'); + } + + if (numRunning === q.concurrency) { + trigger('saturated'); + } + + var cb = (0, _onlyOnce2.default)(_createCB(tasks)); + _worker(data, cb); + } + isProcessing = false; + }, + length() { + return q._tasks.length; + }, + running() { + return numRunning; + }, + workersList() { + return workersList; + }, + idle() { + return q._tasks.length + numRunning === 0; + }, + pause() { + q.paused = true; + }, + resume() { + if (q.paused === false) { + return; + } + q.paused = false; + (0, _setImmediate2.default)(q.process); + } + }; + // define these as fixed properties, so people get useful errors when updating + Object.defineProperties(q, { + saturated: { + writable: false, + value: eventMethod('saturated') + }, + unsaturated: { + writable: false, + value: eventMethod('unsaturated') + }, + empty: { + writable: false, + value: eventMethod('empty') + }, + drain: { + writable: false, + value: eventMethod('drain') + }, + error: { + writable: false, + value: eventMethod('error') + } + }); + return q; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/range.js b/node_modules/async/internal/range.js new file mode 100644 index 0000000..cc7b3a9 --- /dev/null +++ b/node_modules/async/internal/range.js @@ -0,0 +1,14 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = range; +function range(size) { + var result = Array(size); + while (size--) { + result[size] = size; + } + return result; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/reject.js b/node_modules/async/internal/reject.js new file mode 100644 index 0000000..9d9bc80 --- /dev/null +++ b/node_modules/async/internal/reject.js @@ -0,0 +1,26 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reject; + +var _filter = require('./filter.js'); + +var _filter2 = _interopRequireDefault(_filter); + +var _wrapAsync = require('./wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function reject(eachfn, arr, _iteratee, callback) { + const iteratee = (0, _wrapAsync2.default)(_iteratee); + return (0, _filter2.default)(eachfn, arr, (value, cb) => { + iteratee(value, (err, v) => { + cb(err, !v); + }); + }, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/setImmediate.js b/node_modules/async/internal/setImmediate.js new file mode 100644 index 0000000..513efd1 --- /dev/null +++ b/node_modules/async/internal/setImmediate.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fallback = fallback; +exports.wrap = wrap; +/* istanbul ignore file */ + +var hasQueueMicrotask = exports.hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; +var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate; +var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; + +function fallback(fn) { + setTimeout(fn, 0); +} + +function wrap(defer) { + return (fn, ...args) => defer(() => fn(...args)); +} + +var _defer; + +if (hasQueueMicrotask) { + _defer = queueMicrotask; +} else if (hasSetImmediate) { + _defer = setImmediate; +} else if (hasNextTick) { + _defer = process.nextTick; +} else { + _defer = fallback; +} + +exports.default = wrap(_defer); \ No newline at end of file diff --git a/node_modules/async/internal/withoutIndex.js b/node_modules/async/internal/withoutIndex.js new file mode 100644 index 0000000..fa91c2d --- /dev/null +++ b/node_modules/async/internal/withoutIndex.js @@ -0,0 +1,10 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = _withoutIndex; +function _withoutIndex(iteratee) { + return (value, index, callback) => iteratee(value, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/internal/wrapAsync.js b/node_modules/async/internal/wrapAsync.js new file mode 100644 index 0000000..ad4d619 --- /dev/null +++ b/node_modules/async/internal/wrapAsync.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isAsyncIterable = exports.isAsyncGenerator = exports.isAsync = undefined; + +var _asyncify = require('../asyncify.js'); + +var _asyncify2 = _interopRequireDefault(_asyncify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function isAsync(fn) { + return fn[Symbol.toStringTag] === 'AsyncFunction'; +} + +function isAsyncGenerator(fn) { + return fn[Symbol.toStringTag] === 'AsyncGenerator'; +} + +function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === 'function'; +} + +function wrapAsync(asyncFn) { + if (typeof asyncFn !== 'function') throw new Error('expected a function'); + return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; +} + +exports.default = wrapAsync; +exports.isAsync = isAsync; +exports.isAsyncGenerator = isAsyncGenerator; +exports.isAsyncIterable = isAsyncIterable; \ No newline at end of file diff --git a/node_modules/async/log.js b/node_modules/async/log.js new file mode 100644 index 0000000..332b9da --- /dev/null +++ b/node_modules/async/log.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _consoleFunc = require('./internal/consoleFunc.js'); + +var _consoleFunc2 = _interopRequireDefault(_consoleFunc); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Logs the result of an `async` function to the `console`. Only works in + * Node.js or in browsers that support `console.log` and `console.error` (such + * as FF and Chrome). If multiple arguments are returned from the async + * function, `console.log` is called on each argument in order. + * + * @name log + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} function - The function you want to eventually apply + * all arguments to. + * @param {...*} arguments... - Any number of arguments to apply to the function. + * @example + * + * // in a module + * var hello = function(name, callback) { + * setTimeout(function() { + * callback(null, 'hello ' + name); + * }, 1000); + * }; + * + * // in the node repl + * node> async.log(hello, 'world'); + * 'hello world' + */ +exports.default = (0, _consoleFunc2.default)('log'); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/map.js b/node_modules/async/map.js new file mode 100644 index 0000000..c4b7a5a --- /dev/null +++ b/node_modules/async/map.js @@ -0,0 +1,142 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('./internal/map.js'); + +var _map3 = _interopRequireDefault(_map2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces a new collection of values by mapping each value in `coll` through + * the `iteratee` function. The `iteratee` is called with an item from `coll` + * and a callback for when it has finished processing. Each of these callbacks + * takes 2 arguments: an `error`, and the transformed item from `coll`. If + * `iteratee` passes an error to its callback, the main `callback` (for the + * `map` function) is immediately called with the error. + * + * Note, that since this function applies the `iteratee` to each item in + * parallel, there is no guarantee that the `iteratee` functions will complete + * in order. However, the results array will be in the same order as the + * original `coll`. + * + * If `map` is passed an Object, the results will be an Array. The results + * will roughly be in the order of the original Objects' keys (but this can + * vary across JavaScript engines). + * + * @name map + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an Array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.map(fileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * }); + * + * // Using Promises + * async.map(fileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.map(withMissingFileList, getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.map(fileList, getFileSizeInBytes); + * console.log(results); + * // results is now an array of the file size in bytes for each file, e.g. + * // [ 1000, 2000, 3000] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let results = await async.map(withMissingFileList, getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function map(coll, iteratee, callback) { + return (0, _map3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(map, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapLimit.js b/node_modules/async/mapLimit.js new file mode 100644 index 0000000..6ad3572 --- /dev/null +++ b/node_modules/async/mapLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('./internal/map.js'); + +var _map3 = _interopRequireDefault(_map2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. + * + * @name mapLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapLimit(coll, limit, iteratee, callback) { + return (0, _map3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(mapLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapSeries.js b/node_modules/async/mapSeries.js new file mode 100644 index 0000000..8dfdd8a --- /dev/null +++ b/node_modules/async/mapSeries.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('./internal/map.js'); + +var _map3 = _interopRequireDefault(_map2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. + * + * @name mapSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.map]{@link module:Collections.map} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with the transformed item. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. Results is an array of the + * transformed items from the `coll`. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function mapSeries(coll, iteratee, callback) { + return (0, _map3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(mapSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapValues.js b/node_modules/async/mapValues.js new file mode 100644 index 0000000..3d0470e --- /dev/null +++ b/node_modules/async/mapValues.js @@ -0,0 +1,152 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapValues; + +var _mapValuesLimit = require('./mapValuesLimit.js'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. + * + * Produces a new Object by mapping each value of `obj` through the `iteratee` + * function. The `iteratee` is called each `value` and `key` from `obj` and a + * callback for when it has finished processing. Each of these callbacks takes + * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` + * passes an error to its callback, the main `callback` (for the `mapValues` + * function) is immediately called with the error. + * + * Note, the order of the keys in the result is not guaranteed. The keys will + * be roughly in the order they complete, (but this is very engine-specific) + * + * @name mapValues + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file3.txt' + * }; + * + * const withMissingFileMap = { + * f1: 'file1.txt', + * f2: 'file2.txt', + * f3: 'file4.txt' + * }; + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, key, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * }); + * + * // Error handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.mapValues(fileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * }).catch (err => { + * console.log(err); + * }); + * + * // Error Handling + * async.mapValues(withMissingFileMap, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch (err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.mapValues(fileMap, getFileSizeInBytes); + * console.log(result); + * // result is now a map of file size in bytes for each file, e.g. + * // { + * // f1: 1000, + * // f2: 2000, + * // f3: 3000 + * // } + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function mapValues(obj, iteratee, callback) { + return (0, _mapValuesLimit2.default)(obj, Infinity, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapValuesLimit.js b/node_modules/async/mapValuesLimit.js new file mode 100644 index 0000000..f59e36f --- /dev/null +++ b/node_modules/async/mapValuesLimit.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a + * time. + * + * @name mapValuesLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesLimit(obj, limit, iteratee, callback) { + callback = (0, _once2.default)(callback); + var newObj = {}; + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfLimit2.default)(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { + if (err) return next(err); + newObj[key] = result; + next(err); + }); + }, err => callback(err, newObj)); +} + +exports.default = (0, _awaitify2.default)(mapValuesLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/mapValuesSeries.js b/node_modules/async/mapValuesSeries.js new file mode 100644 index 0000000..5f05bf2 --- /dev/null +++ b/node_modules/async/mapValuesSeries.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = mapValuesSeries; + +var _mapValuesLimit = require('./mapValuesLimit.js'); + +var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. + * + * @name mapValuesSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.mapValues]{@link module:Collections.mapValues} + * @category Collection + * @param {Object} obj - A collection to iterate over. + * @param {AsyncFunction} iteratee - A function to apply to each value and key + * in `coll`. + * The iteratee should complete with the transformed value as its result. + * Invoked with (value, key, callback). + * @param {Function} [callback] - A callback which is called when all `iteratee` + * functions have finished, or an error occurs. `result` is a new object consisting + * of each key from `obj`, with each transformed value on the right-hand side. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function mapValuesSeries(obj, iteratee, callback) { + return (0, _mapValuesLimit2.default)(obj, 1, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/memoize.js b/node_modules/async/memoize.js new file mode 100644 index 0000000..6535d4e --- /dev/null +++ b/node_modules/async/memoize.js @@ -0,0 +1,91 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = memoize; + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Caches the results of an async function. When creating a hash to store + * function results against, the callback is omitted from the hash and an + * optional hash function can be used. + * + * **Note: if the async function errs, the result will not be cached and + * subsequent calls will call the wrapped function.** + * + * If no hash function is specified, the first argument is used as a hash key, + * which may work reasonably if it is a string or a data type that converts to a + * distinct string. Note that objects and arrays will not behave reasonably. + * Neither will cases where the other arguments are significant. In such cases, + * specify your own hash function. + * + * The cache of results is exposed as the `memo` property of the function + * returned by `memoize`. + * + * @name memoize + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function to proxy and cache results from. + * @param {Function} hasher - An optional function for generating a custom hash + * for storing results. It has all the arguments applied to it apart from the + * callback, and must be synchronous. + * @returns {AsyncFunction} a memoized version of `fn` + * @example + * + * var slow_fn = function(name, callback) { + * // do something + * callback(null, result); + * }; + * var fn = async.memoize(slow_fn); + * + * // fn can now be used as if it were slow_fn + * fn('some name', function() { + * // callback + * }); + */ +function memoize(fn, hasher = v => v) { + var memo = Object.create(null); + var queues = Object.create(null); + var _fn = (0, _wrapAsync2.default)(fn); + var memoized = (0, _initialParams2.default)((args, callback) => { + var key = hasher(...args); + if (key in memo) { + (0, _setImmediate2.default)(() => callback(null, ...memo[key])); + } else if (key in queues) { + queues[key].push(callback); + } else { + queues[key] = [callback]; + _fn(...args, (err, ...resultArgs) => { + // #1465 don't memoize if an error occurred + if (!err) { + memo[key] = resultArgs; + } + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i](err, ...resultArgs); + } + }); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/nextTick.js b/node_modules/async/nextTick.js new file mode 100644 index 0000000..8ebfda9 --- /dev/null +++ b/node_modules/async/nextTick.js @@ -0,0 +1,52 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _setImmediate = require('./internal/setImmediate.js'); + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `process.nextTick`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name nextTick + * @static + * @memberOf module:Utils + * @method + * @see [async.setImmediate]{@link module:Utils.setImmediate} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +var _defer; /* istanbul ignore file */ + + +if (_setImmediate.hasNextTick) { + _defer = process.nextTick; +} else if (_setImmediate.hasSetImmediate) { + _defer = setImmediate; +} else { + _defer = _setImmediate.fallback; +} + +exports.default = (0, _setImmediate.wrap)(_defer); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/package.json b/node_modules/async/package.json new file mode 100644 index 0000000..af98905 --- /dev/null +++ b/node_modules/async/package.json @@ -0,0 +1,75 @@ +{ + "name": "async", + "description": "Higher-order functions and common patterns for asynchronous code", + "version": "3.2.5", + "main": "dist/async.js", + "author": "Caolan McMahon", + "homepage": "https://caolan.github.io/async/", + "repository": { + "type": "git", + "url": "https://github.com/caolan/async.git" + }, + "bugs": { + "url": "https://github.com/caolan/async/issues" + }, + "keywords": [ + "async", + "callback", + "module", + "utility" + ], + "devDependencies": { + "@babel/eslint-parser": "^7.16.5", + "@babel/core": "7.23.2", + "babel-minify": "^0.5.0", + "babel-plugin-add-module-exports": "^1.0.4", + "babel-plugin-istanbul": "^6.1.1", + "babel-plugin-syntax-async-generators": "^6.13.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", + "babel-preset-es2015": "^6.3.13", + "babel-preset-es2017": "^6.22.0", + "babel-register": "^6.26.0", + "babelify": "^10.0.0", + "benchmark": "^2.1.1", + "bluebird": "^3.4.6", + "browserify": "^17.0.0", + "chai": "^4.2.0", + "cheerio": "^0.22.0", + "es6-promise": "^4.2.8", + "eslint": "^8.6.0", + "eslint-plugin-prefer-arrow": "^1.2.3", + "fs-extra": "^11.1.1", + "jsdoc": "^3.6.2", + "karma": "^6.3.12", + "karma-browserify": "^8.1.0", + "karma-firefox-launcher": "^2.1.2", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.0", + "karma-safari-launcher": "^1.0.0", + "mocha": "^6.1.4", + "native-promise-only": "^0.8.0-a", + "nyc": "^15.1.0", + "rollup": "^4.2.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-npm": "^2.0.0", + "rsvp": "^4.8.5", + "semver": "^7.3.5", + "yargs": "^17.3.1" + }, + "scripts": { + "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert", + "jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js", + "lint": "eslint --fix .", + "mocha-browser-test": "karma start", + "mocha-node-test": "mocha", + "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", + "test": "npm run lint && npm run mocha-node-test" + }, + "license": "MIT", + "nyc": { + "exclude": [ + "test" + ] + }, + "module": "dist/async.mjs" +} \ No newline at end of file diff --git a/node_modules/async/parallel.js b/node_modules/async/parallel.js new file mode 100644 index 0000000..2c7976f --- /dev/null +++ b/node_modules/async/parallel.js @@ -0,0 +1,180 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parallel; + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _parallel2 = require('./internal/parallel.js'); + +var _parallel3 = _interopRequireDefault(_parallel2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Run the `tasks` collection of functions in parallel, without waiting until + * the previous function has completed. If any of the functions pass an error to + * its callback, the main `callback` is immediately called with the value of the + * error. Once the `tasks` have completed, the results are passed to the final + * `callback` as an array. + * + * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about + * parallel execution of code. If your tasks do not use any timers or perform + * any I/O, they will actually be executed in series. Any synchronous setup + * sections for each task will happen one after the other. JavaScript remains + * single-threaded. + * + * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the + * execution of other tasks when a task fails. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.parallel}. + * + * @name parallel + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * + * //Using Callbacks + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.parallel([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] even though + * // the second function had a shorter timeout. + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function parallel(tasks, callback) { + return (0, _parallel3.default)(_eachOf2.default, tasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/parallelLimit.js b/node_modules/async/parallelLimit.js new file mode 100644 index 0000000..4337957 --- /dev/null +++ b/node_modules/async/parallelLimit.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = parallelLimit; + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _parallel = require('./internal/parallel.js'); + +var _parallel2 = _interopRequireDefault(_parallel); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a + * time. + * + * @name parallelLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.parallel]{@link module:ControlFlow.parallel} + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of + * [async functions]{@link AsyncFunction} to run. + * Each async function can complete with any number of optional `result` values. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed successfully. This function gets a results array + * (or object) containing all the result arguments passed to the task callbacks. + * Invoked with (err, results). + * @returns {Promise} a promise, if a callback is not passed + */ +function parallelLimit(tasks, limit, callback) { + return (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/priorityQueue.js b/node_modules/async/priorityQueue.js new file mode 100644 index 0000000..16c4daa --- /dev/null +++ b/node_modules/async/priorityQueue.js @@ -0,0 +1,60 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (worker, concurrency) { + // Start with a normal queue + var q = (0, _queue2.default)(worker, concurrency); + + var { + push, + pushAsync + } = q; + + q._tasks = new _Heap2.default(); + q._createTaskItem = ({ data, priority }, callback) => { + return { + data, + priority, + callback + }; + }; + + function createDataItems(tasks, priority) { + if (!Array.isArray(tasks)) { + return { data: tasks, priority }; + } + return tasks.map(data => { + return { data, priority }; + }); + } + + // Override push to accept second parameter representing priority + q.push = function (data, priority = 0, callback) { + return push(createDataItems(data, priority), callback); + }; + + q.pushAsync = function (data, priority = 0, callback) { + return pushAsync(createDataItems(data, priority), callback); + }; + + // Remove unshift functions + delete q.unshift; + delete q.unshiftAsync; + + return q; +}; + +var _queue = require('./queue.js'); + +var _queue2 = _interopRequireDefault(_queue); + +var _Heap = require('./internal/Heap.js'); + +var _Heap2 = _interopRequireDefault(_Heap); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/queue.js b/node_modules/async/queue.js new file mode 100644 index 0000000..c01340d --- /dev/null +++ b/node_modules/async/queue.js @@ -0,0 +1,24 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (worker, concurrency) { + var _worker = (0, _wrapAsync2.default)(worker); + return (0, _queue2.default)((items, cb) => { + _worker(items[0], cb); + }, concurrency, 1); +}; + +var _queue = require('./internal/queue.js'); + +var _queue2 = _interopRequireDefault(_queue); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/race.js b/node_modules/async/race.js new file mode 100644 index 0000000..aa167be --- /dev/null +++ b/node_modules/async/race.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Runs the `tasks` array of functions in parallel, without waiting until the + * previous function has completed. Once any of the `tasks` complete or pass an + * error to its callback, the main `callback` is immediately called. It's + * equivalent to `Promise.race()`. + * + * @name race + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} + * to run. Each function can complete with an optional `result` value. + * @param {Function} callback - A callback to run once any of the functions have + * completed. This function gets an error or result from the first function that + * completed. Invoked with (err, result). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.race([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ], + * // main callback + * function(err, result) { + * // the result will be equal to 'two' as it finishes earlier + * }); + */ +function race(tasks, callback) { + callback = (0, _once2.default)(callback); + if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); + if (!tasks.length) return callback(); + for (var i = 0, l = tasks.length; i < l; i++) { + (0, _wrapAsync2.default)(tasks[i])(callback); + } +} + +exports.default = (0, _awaitify2.default)(race, 2); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reduce.js b/node_modules/async/reduce.js new file mode 100644 index 0000000..8a69548 --- /dev/null +++ b/node_modules/async/reduce.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Reduces `coll` into a single value using an async `iteratee` to return each + * successive step. `memo` is the initial state of the reduction. This function + * only operates in series. + * + * For performance reasons, it may make sense to split a call to this function + * into a parallel map, and then use the normal `Array.prototype.reduce` on the + * results. This function is for situations where each step in the reduction + * needs to be async; if you can get the data before reducing it, then it's + * probably a good idea to do so. + * + * @name reduce + * @static + * @memberOf module:Collections + * @method + * @alias inject + * @alias foldl + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * // file4.txt does not exist + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; + * + * // asynchronous function that computes the file size in bytes + * // file size is added to the memoized value, then returned + * function getFileSizeInBytes(memo, file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, memo + stat.size); + * }); + * } + * + * // Using callbacks + * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(result); + * } + * }); + * + * // Using Promises + * async.reduce(fileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * }).catch( err => { + * console.log(err); + * }); + * + * // Error Handling + * async.reduce(withMissingFileList, 0, getFileSizeInBytes) + * .then( result => { + * console.log(result); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.reduce(fileList, 0, getFileSizeInBytes); + * console.log(result); + * // 6000 + * // which is the sum of the file sizes of the three files + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // Error Handling + * async () => { + * try { + * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); + * console.log(result); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function reduce(coll, memo, iteratee, callback) { + callback = (0, _once2.default)(callback); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { + _iteratee(memo, x, (err, v) => { + memo = v; + iterCb(err); + }); + }, err => callback(err, memo)); +} +exports.default = (0, _awaitify2.default)(reduce, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reduceRight.js b/node_modules/async/reduceRight.js new file mode 100644 index 0000000..5be1b68 --- /dev/null +++ b/node_modules/async/reduceRight.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduceRight; + +var _reduce = require('./reduce.js'); + +var _reduce2 = _interopRequireDefault(_reduce); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. + * + * @name reduceRight + * @static + * @memberOf module:Collections + * @method + * @see [async.reduce]{@link module:Collections.reduce} + * @alias foldr + * @category Collection + * @param {Array} array - A collection to iterate over. + * @param {*} memo - The initial state of the reduction. + * @param {AsyncFunction} iteratee - A function applied to each item in the + * array to produce the next step in the reduction. + * The `iteratee` should complete with the next state of the reduction. + * If the iteratee completes with an error, the reduction is stopped and the + * main `callback` is immediately called with the error. + * Invoked with (memo, item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the reduced value. Invoked with + * (err, result). + * @returns {Promise} a promise, if no callback is passed + */ +function reduceRight(array, memo, iteratee, callback) { + var reversed = [...array].reverse(); + return (0, _reduce2.default)(reversed, memo, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reflect.js b/node_modules/async/reflect.js new file mode 100644 index 0000000..3954495 --- /dev/null +++ b/node_modules/async/reflect.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reflect; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wraps the async function in another function that always completes with a + * result object, even when it errors. + * + * The result object has either the property `error` or `value`. + * + * @name reflect + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} fn - The async function you want to wrap + * @returns {Function} - A function that always passes null to it's callback as + * the error. The second argument to the callback will be an `object` with + * either an `error` or a `value` property. + * @example + * + * async.parallel([ + * async.reflect(function(callback) { + * // do some stuff ... + * callback(null, 'one'); + * }), + * async.reflect(function(callback) { + * // do some more stuff but error ... + * callback('bad stuff happened'); + * }), + * async.reflect(function(callback) { + * // do some more stuff ... + * callback(null, 'two'); + * }) + * ], + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = 'bad stuff happened' + * // results[2].value = 'two' + * }); + */ +function reflect(fn) { + var _fn = (0, _wrapAsync2.default)(fn); + return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) { + args.push((error, ...cbArgs) => { + let retVal = {}; + if (error) { + retVal.error = error; + } + if (cbArgs.length > 0) { + var value = cbArgs; + if (cbArgs.length <= 1) { + [value] = cbArgs; + } + retVal.value = value; + } + reflectCallback(null, retVal); + }); + + return _fn.apply(this, args); + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reflectAll.js b/node_modules/async/reflectAll.js new file mode 100644 index 0000000..b78d598 --- /dev/null +++ b/node_modules/async/reflectAll.js @@ -0,0 +1,93 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reflectAll; + +var _reflect = require('./reflect.js'); + +var _reflect2 = _interopRequireDefault(_reflect); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A helper function that wraps an array or an object of functions with `reflect`. + * + * @name reflectAll + * @static + * @memberOf module:Utils + * @method + * @see [async.reflect]{@link module:Utils.reflect} + * @category Util + * @param {Array|Object|Iterable} tasks - The collection of + * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. + * @returns {Array} Returns an array of async functions, each wrapped in + * `async.reflect` + * @example + * + * let tasks = [ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * // do some more stuff but error ... + * callback(new Error('bad stuff happened')); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results[0].value = 'one' + * // results[1].error = Error('bad stuff happened') + * // results[2].value = 'two' + * }); + * + * // an example using an object instead of an array + * let tasks = { + * one: function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * two: function(callback) { + * callback('two'); + * }, + * three: function(callback) { + * setTimeout(function() { + * callback(null, 'three'); + * }, 100); + * } + * }; + * + * async.parallel(async.reflectAll(tasks), + * // optional callback + * function(err, results) { + * // values + * // results.one.value = 'one' + * // results.two.error = 'two' + * // results.three.value = 'three' + * }); + */ +function reflectAll(tasks) { + var results; + if (Array.isArray(tasks)) { + results = tasks.map(_reflect2.default); + } else { + results = {}; + Object.keys(tasks).forEach(key => { + results[key] = _reflect2.default.call(this, tasks[key]); + }); + } + return results; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/reject.js b/node_modules/async/reject.js new file mode 100644 index 0000000..895949b --- /dev/null +++ b/node_modules/async/reject.js @@ -0,0 +1,87 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject2 = require('./internal/reject.js'); + +var _reject3 = _interopRequireDefault(_reject2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. + * + * @name reject + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.reject(fileList, fileExists, function(err, results) { + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }); + * + * // Using Promises + * async.reject(fileList, fileExists) + * .then( results => { + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.reject(fileList, fileExists); + * console.log(results); + * // [ 'dir3/file6.txt' ] + * // results now equals an array of the non-existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function reject(coll, iteratee, callback) { + return (0, _reject3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(reject, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/rejectLimit.js b/node_modules/async/rejectLimit.js new file mode 100644 index 0000000..ce10edf --- /dev/null +++ b/node_modules/async/rejectLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject2 = require('./internal/reject.js'); + +var _reject3 = _interopRequireDefault(_reject2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a + * time. + * + * @name rejectLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectLimit(coll, limit, iteratee, callback) { + return (0, _reject3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(rejectLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/rejectSeries.js b/node_modules/async/rejectSeries.js new file mode 100644 index 0000000..c08e413 --- /dev/null +++ b/node_modules/async/rejectSeries.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _reject2 = require('./internal/reject.js'); + +var _reject3 = _interopRequireDefault(_reject2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. + * + * @name rejectSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.reject]{@link module:Collections.reject} + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - An async truth test to apply to each item in + * `coll`. + * The should complete with a boolean value as its `result`. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback is passed + */ +function rejectSeries(coll, iteratee, callback) { + return (0, _reject3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(rejectSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/retry.js b/node_modules/async/retry.js new file mode 100644 index 0000000..a4b0235 --- /dev/null +++ b/node_modules/async/retry.js @@ -0,0 +1,159 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = retry; + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function constant(value) { + return function () { + return value; + }; +} + +/** + * Attempts to get a successful response from `task` no more than `times` times + * before returning an error. If the task is successful, the `callback` will be + * passed the result of the successful task. If all attempts fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name retry + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @see [async.retryable]{@link module:ControlFlow.retryable} + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an + * object with `times` and `interval` or a number. + * * `times` - The number of attempts to make before giving up. The default + * is `5`. + * * `interval` - The time to wait between retries, in milliseconds. The + * default is `0`. The interval may also be specified as a function of the + * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). + * * If `opts` is a number, the number specifies the number of times to retry, + * with the default interval of `0`. + * @param {AsyncFunction} task - An async function to retry. + * Invoked with (callback). + * @param {Function} [callback] - An optional callback which is called when the + * task has succeeded, or after the final failed attempt. It receives the `err` + * and `result` arguments of the last attempt at completing the `task`. Invoked + * with (err, results). + * @returns {Promise} a promise if no callback provided + * + * @example + * + * // The `retry` function can be used as a stand-alone control flow by passing + * // a callback, as shown below: + * + * // try calling apiMethod 3 times + * async.retry(3, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 3 times, waiting 200 ms between each retry + * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod 10 times with exponential backoff + * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) + * async.retry({ + * times: 10, + * interval: function(retryCount) { + * return 50 * Math.pow(2, retryCount); + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod the default 5 times no delay between each retry + * async.retry(apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * + * // to retry individual methods that are not as reliable within other + * // control flow functions, use the `retryable` wrapper: + * async.auto({ + * users: api.getUsers.bind(api), + * payments: async.retryable(3, api.getPayments.bind(api)) + * }, function(err, results) { + * // do something with the results + * }); + * + */ +const DEFAULT_TIMES = 5; +const DEFAULT_INTERVAL = 0; + +function retry(opts, task, callback) { + var options = { + times: DEFAULT_TIMES, + intervalFunc: constant(DEFAULT_INTERVAL) + }; + + if (arguments.length < 3 && typeof opts === 'function') { + callback = task || (0, _promiseCallback.promiseCallback)(); + task = opts; + } else { + parseTimes(options, opts); + callback = callback || (0, _promiseCallback.promiseCallback)(); + } + + if (typeof task !== 'function') { + throw new Error("Invalid arguments for async.retry"); + } + + var _task = (0, _wrapAsync2.default)(task); + + var attempt = 1; + function retryAttempt() { + _task((err, ...args) => { + if (err === false) return; + if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { + setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); + } else { + callback(err, ...args); + } + }); + } + + retryAttempt(); + return callback[_promiseCallback.PROMISE_SYMBOL]; +} + +function parseTimes(acc, t) { + if (typeof t === 'object') { + acc.times = +t.times || DEFAULT_TIMES; + + acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; + } else if (typeof t === 'number' || typeof t === 'string') { + acc.times = +t || DEFAULT_TIMES; + } else { + throw new Error("Invalid arguments for async.retry"); + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/retryable.js b/node_modules/async/retryable.js new file mode 100644 index 0000000..68256c3 --- /dev/null +++ b/node_modules/async/retryable.js @@ -0,0 +1,77 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = retryable; + +var _retry = require('./retry.js'); + +var _retry2 = _interopRequireDefault(_retry); + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method + * wraps a task and makes it retryable, rather than immediately calling it + * with retries. + * + * @name retryable + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.retry]{@link module:ControlFlow.retry} + * @category Control Flow + * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional + * options, exactly the same as from `retry`, except for a `opts.arity` that + * is the arity of the `task` function, defaulting to `task.length` + * @param {AsyncFunction} task - the asynchronous function to wrap. + * This function will be passed any arguments passed to the returned wrapper. + * Invoked with (...args, callback). + * @returns {AsyncFunction} The wrapped function, which when invoked, will + * retry on an error, based on the parameters specified in `opts`. + * This function will accept the same parameters as `task`. + * @example + * + * async.auto({ + * dep1: async.retryable(3, getFromFlakyService), + * process: ["dep1", async.retryable(3, function (results, cb) { + * maybeProcessData(results.dep1, cb); + * })] + * }, callback); + */ +function retryable(opts, task) { + if (!task) { + task = opts; + opts = null; + } + let arity = opts && opts.arity || task.length; + if ((0, _wrapAsync.isAsync)(task)) { + arity += 1; + } + var _task = (0, _wrapAsync2.default)(task); + return (0, _initialParams2.default)((args, callback) => { + if (args.length < arity - 1 || callback == null) { + args.push(callback); + callback = (0, _promiseCallback.promiseCallback)(); + } + function taskFn(cb) { + _task(...args, cb); + } + + if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback); + + return callback[_promiseCallback.PROMISE_SYMBOL]; + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/select.js b/node_modules/async/select.js new file mode 100644 index 0000000..2c9a63d --- /dev/null +++ b/node_modules/async/select.js @@ -0,0 +1,93 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns a new array of all the values in `coll` which pass an async truth + * test. This operation is performed in parallel, but the results array will be + * in the same order as the original. + * + * @name filter + * @static + * @memberOf module:Collections + * @method + * @alias select + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * + * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.filter(files, fileExists, function(err, results) { + * if(err) { + * console.log(err); + * } else { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * }); + * + * // Using Promises + * async.filter(files, fileExists) + * .then(results => { + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let results = await async.filter(files, fileExists); + * console.log(results); + * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] + * // results is now an array of the existing files + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function filter(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filter, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/selectLimit.js b/node_modules/async/selectLimit.js new file mode 100644 index 0000000..d3b3f50 --- /dev/null +++ b/node_modules/async/selectLimit.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a + * time. + * + * @name filterLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results). + * @returns {Promise} a promise, if no callback provided + */ +function filterLimit(coll, limit, iteratee, callback) { + return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/selectSeries.js b/node_modules/async/selectSeries.js new file mode 100644 index 0000000..019a2d0 --- /dev/null +++ b/node_modules/async/selectSeries.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _filter2 = require('./internal/filter.js'); + +var _filter3 = _interopRequireDefault(_filter2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. + * + * @name filterSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.filter]{@link module:Collections.filter} + * @alias selectSeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {Function} iteratee - A truth test to apply to each item in `coll`. + * The `iteratee` is passed a `callback(err, truthValue)`, which must be called + * with a boolean argument once it has completed. Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Invoked with (err, results) + * @returns {Promise} a promise, if no callback provided + */ +function filterSeries(coll, iteratee, callback) { + return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(filterSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/seq.js b/node_modules/async/seq.js new file mode 100644 index 0000000..e7881cd --- /dev/null +++ b/node_modules/async/seq.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = seq; + +var _reduce = require('./reduce.js'); + +var _reduce2 = _interopRequireDefault(_reduce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Version of the compose function that is more natural to read. Each function + * consumes the return value of the previous function. It is the equivalent of + * [compose]{@link module:ControlFlow.compose} with the arguments reversed. + * + * Each function is executed with the `this` binding of the composed function. + * + * @name seq + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.compose]{@link module:ControlFlow.compose} + * @category Control Flow + * @param {...AsyncFunction} functions - the asynchronous functions to compose + * @returns {Function} a function that composes the `functions` in order + * @example + * + * // Requires lodash (or underscore), express3 and dresende's orm2. + * // Part of an app, that fetches cats of the logged user. + * // This example uses `seq` function to avoid overnesting and error + * // handling clutter. + * app.get('/cats', function(request, response) { + * var User = request.models.User; + * async.seq( + * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) + * function(user, fn) { + * user.getCats(fn); // 'getCats' has signature (callback(err, data)) + * } + * )(req.session.user_id, function (err, cats) { + * if (err) { + * console.error(err); + * response.json({ status: 'error', message: err.message }); + * } else { + * response.json({ status: 'ok', message: 'Cats found', data: cats }); + * } + * }); + * }); + */ +function seq(...functions) { + var _functions = functions.map(_wrapAsync2.default); + return function (...args) { + var that = this; + + var cb = args[args.length - 1]; + if (typeof cb == 'function') { + args.pop(); + } else { + cb = (0, _promiseCallback.promiseCallback)(); + } + + (0, _reduce2.default)(_functions, args, (newargs, fn, iterCb) => { + fn.apply(that, newargs.concat((err, ...nextargs) => { + iterCb(err, nextargs); + })); + }, (err, results) => cb(err, ...results)); + + return cb[_promiseCallback.PROMISE_SYMBOL]; + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/series.js b/node_modules/async/series.js new file mode 100644 index 0000000..60c17ed --- /dev/null +++ b/node_modules/async/series.js @@ -0,0 +1,186 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = series; + +var _parallel2 = require('./internal/parallel.js'); + +var _parallel3 = _interopRequireDefault(_parallel2); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Run the functions in the `tasks` collection in series, each one running once + * the previous function has completed. If any functions in the series pass an + * error to its callback, no more functions are run, and `callback` is + * immediately called with the value of the error. Otherwise, `callback` + * receives an array of results when `tasks` have completed. + * + * It is also possible to use an object instead of an array. Each property will + * be run as a function, and the results will be passed to the final `callback` + * as an object instead of an array. This can be a more readable way of handling + * results from {@link async.series}. + * + * **Note** that while many implementations preserve the order of object + * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) + * explicitly states that + * + * > The mechanics and order of enumerating the properties is not specified. + * + * So if you rely on the order in which your series of functions are executed, + * and want this to work on all platforms, consider using an array. + * + * @name series + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing + * [async functions]{@link AsyncFunction} to run in series. + * Each function can complete with any number of optional `result` values. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This function gets a results array (or object) + * containing all the result arguments passed to the `task` callbacks. Invoked + * with (err, result). + * @return {Promise} a promise, if no callback is passed + * @example + * + * //Using Callbacks + * async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ], function(err, results) { + * console.log(results); + * // results is equal to ['one','two'] + * }); + * + * // an example using objects instead of arrays + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }, function(err, results) { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }); + * + * //Using Promises + * async.series([ + * function(callback) { + * setTimeout(function() { + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * callback(null, 'two'); + * }, 100); + * } + * ]).then(results => { + * console.log(results); + * // results is equal to ['one','two'] + * }).catch(err => { + * console.log(err); + * }); + * + * // an example using an object instead of an array + * async.series({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }).then(results => { + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * }).catch(err => { + * console.log(err); + * }); + * + * //Using async/await + * async () => { + * try { + * let results = await async.series([ + * function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 'one'); + * }, 200); + * }, + * function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 'two'); + * }, 100); + * } + * ]); + * console.log(results); + * // results is equal to ['one','two'] + * } + * catch (err) { + * console.log(err); + * } + * } + * + * // an example using an object instead of an array + * async () => { + * try { + * let results = await async.parallel({ + * one: function(callback) { + * setTimeout(function() { + * // do some async task + * callback(null, 1); + * }, 200); + * }, + * two: function(callback) { + * setTimeout(function() { + * // then do another async task + * callback(null, 2); + * }, 100); + * } + * }); + * console.log(results); + * // results is equal to: { one: 1, two: 2 } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function series(tasks, callback) { + return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/setImmediate.js b/node_modules/async/setImmediate.js new file mode 100644 index 0000000..eea8677 --- /dev/null +++ b/node_modules/async/setImmediate.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls `callback` on a later loop around the event loop. In Node.js this just + * calls `setImmediate`. In the browser it will use `setImmediate` if + * available, otherwise `setTimeout(callback, 0)`, which means other higher + * priority events may precede the execution of `callback`. + * + * This is used internally for browser-compatibility purposes. + * + * @name setImmediate + * @static + * @memberOf module:Utils + * @method + * @see [async.nextTick]{@link module:Utils.nextTick} + * @category Util + * @param {Function} callback - The function to call on a later loop around + * the event loop. Invoked with (args...). + * @param {...*} args... - any number of additional arguments to pass to the + * callback on the next tick. + * @example + * + * var call_order = []; + * async.nextTick(function() { + * call_order.push('two'); + * // call_order now equals ['one','two'] + * }); + * call_order.push('one'); + * + * async.setImmediate(function (a, b, c) { + * // a, b, and c equal 1, 2, and 3 + * }, 1, 2, 3); + */ +exports.default = _setImmediate2.default; +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/some.js b/node_modules/async/some.js new file mode 100644 index 0000000..a5bd328 --- /dev/null +++ b/node_modules/async/some.js @@ -0,0 +1,122 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns `true` if at least one element in the `coll` satisfies an async test. + * If any iteratee call returns `true`, the main `callback` is immediately + * called. + * + * @name some + * @static + * @memberOf module:Collections + * @method + * @alias any + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // dir1 is a directory that contains file1.txt, file2.txt + * // dir2 is a directory that contains file3.txt, file4.txt + * // dir3 is a directory that contains file5.txt + * // dir4 does not exist + * + * // asynchronous function that checks if a file exists + * function fileExists(file, callback) { + * fs.access(file, fs.constants.F_OK, (err) => { + * callback(null, !err); + * }); + * } + * + * // Using callbacks + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + *); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, + * function(err, result) { + * console.log(result); + * // false + * // result is false since none of the files exists + * } + *); + * + * // Using Promises + * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) + * .then( result => { + * console.log(result); + * // true + * // result is true since some file in the list exists + * }).catch( err => { + * console.log(err); + * }); + * + * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) + * .then( result => { + * console.log(result); + * // false + * // result is false since none of the files exists + * }).catch( err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); + * console.log(result); + * // true + * // result is true since some file in the list exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + * async () => { + * try { + * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); + * console.log(result); + * // false + * // result is false since none of the files exists + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function some(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(some, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/someLimit.js b/node_modules/async/someLimit.js new file mode 100644 index 0000000..3a8096f --- /dev/null +++ b/node_modules/async/someLimit.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfLimit = require('./internal/eachOfLimit.js'); + +var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. + * + * @name someLimit + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anyLimit + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in parallel. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someLimit(coll, limit, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someLimit, 4); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/someSeries.js b/node_modules/async/someSeries.js new file mode 100644 index 0000000..51aad19 --- /dev/null +++ b/node_modules/async/someSeries.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createTester = require('./internal/createTester.js'); + +var _createTester2 = _interopRequireDefault(_createTester); + +var _eachOfSeries = require('./eachOfSeries.js'); + +var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. + * + * @name someSeries + * @static + * @memberOf module:Collections + * @method + * @see [async.some]{@link module:Collections.some} + * @alias anySeries + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async truth test to apply to each item + * in the collections in series. + * The iteratee should complete with a boolean `result` value. + * Invoked with (item, callback). + * @param {Function} [callback] - A callback which is called as soon as any + * iteratee returns `true`, or after all the iteratee functions have finished. + * Result will be either `true` or `false` depending on the values of the async + * tests. Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + */ +function someSeries(coll, iteratee, callback) { + return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); +} +exports.default = (0, _awaitify2.default)(someSeries, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/sortBy.js b/node_modules/async/sortBy.js new file mode 100644 index 0000000..0988b61 --- /dev/null +++ b/node_modules/async/sortBy.js @@ -0,0 +1,190 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map = require('./map.js'); + +var _map2 = _interopRequireDefault(_map); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sorts a list by the results of running each `coll` value through an async + * `iteratee`. + * + * @name sortBy + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {AsyncFunction} iteratee - An async function to apply to each item in + * `coll`. + * The iteratee should complete with a value to use as the sort criteria as + * its `result`. + * Invoked with (item, callback). + * @param {Function} callback - A callback which is called after all the + * `iteratee` functions have finished, or an error occurs. Results is the items + * from the original `coll` sorted by the values returned by the `iteratee` + * calls. Invoked with (err, results). + * @returns {Promise} a promise, if no callback passed + * @example + * + * // bigfile.txt is a file that is 251100 bytes in size + * // mediumfile.txt is a file that is 11000 bytes in size + * // smallfile.txt is a file that is 121 bytes in size + * + * // asynchronous function that returns the file size in bytes + * function getFileSizeInBytes(file, callback) { + * fs.stat(file, function(err, stat) { + * if (err) { + * return callback(err); + * } + * callback(null, stat.size); + * }); + * } + * + * // Using callbacks + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // By modifying the callback parameter the + * // sorting order can be influenced: + * + * // ascending order + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) return callback(getFileSizeErr); + * callback(null, fileSize); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * } + * ); + * + * // descending order + * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { + * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { + * if (getFileSizeErr) { + * return callback(getFileSizeErr); + * } + * callback(null, fileSize * -1); + * }); + * }, function(err, results) { + * if (err) { + * console.log(err); + * } else { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] + * } + * } + * ); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, + * function(err, results) { + * if (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } else { + * console.log(results); + * } + * } + * ); + * + * // Using Promises + * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * }).catch( err => { + * console.log(err); + * }); + * + * // Error handling + * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) + * .then( results => { + * console.log(results); + * }).catch( err => { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * }); + * + * // Using async/await + * (async () => { + * try { + * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * // results is now the original array of files sorted by + * // file size (ascending by default), e.g. + * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * // Error handling + * async () => { + * try { + * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); + * console.log(results); + * } + * catch (err) { + * console.log(err); + * // [ Error: ENOENT: no such file or directory ] + * } + * } + * + */ +function sortBy(coll, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _map2.default)(coll, (x, iterCb) => { + _iteratee(x, (err, criteria) => { + if (err) return iterCb(err); + iterCb(err, { value: x, criteria }); + }); + }, (err, results) => { + if (err) return callback(err); + callback(null, results.sort(comparator).map(v => v.value)); + }); + + function comparator(left, right) { + var a = left.criteria, + b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } +} +exports.default = (0, _awaitify2.default)(sortBy, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/timeout.js b/node_modules/async/timeout.js new file mode 100644 index 0000000..46bb233 --- /dev/null +++ b/node_modules/async/timeout.js @@ -0,0 +1,89 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timeout; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Sets a time limit on an asynchronous function. If the function does not call + * its callback within the specified milliseconds, it will be called with a + * timeout error. The code property for the error object will be `'ETIMEDOUT'`. + * + * @name timeout + * @static + * @memberOf module:Utils + * @method + * @category Util + * @param {AsyncFunction} asyncFn - The async function to limit in time. + * @param {number} milliseconds - The specified time limit. + * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) + * to timeout Error for more information.. + * @returns {AsyncFunction} Returns a wrapped function that can be used with any + * of the control flow functions. + * Invoke this function with the same parameters as you would `asyncFunc`. + * @example + * + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); + */ +function timeout(asyncFn, milliseconds, info) { + var fn = (0, _wrapAsync2.default)(asyncFn); + + return (0, _initialParams2.default)((args, callback) => { + var timedOut = false; + var timer; + + function timeoutCallback() { + var name = asyncFn.name || 'anonymous'; + var error = new Error('Callback function "' + name + '" timed out.'); + error.code = 'ETIMEDOUT'; + if (info) { + error.info = info; + } + timedOut = true; + callback(error); + } + + args.push((...cbArgs) => { + if (!timedOut) { + callback(...cbArgs); + clearTimeout(timer); + } + }); + + // setup timer and call original function + timer = setTimeout(timeoutCallback, milliseconds); + fn(...args); + }); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/times.js b/node_modules/async/times.js new file mode 100644 index 0000000..ca7df51 --- /dev/null +++ b/node_modules/async/times.js @@ -0,0 +1,50 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = times; + +var _timesLimit = require('./timesLimit.js'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calls the `iteratee` function `n` times, and accumulates results in the same + * manner you would use with [map]{@link module:Collections.map}. + * + * @name times + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.map]{@link module:Collections.map} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + * @example + * + * // Pretend this is some complicated async factory + * var createUser = function(id, callback) { + * callback(null, { + * id: 'user' + id + * }); + * }; + * + * // generate 5 users + * async.times(5, function(n, next) { + * createUser(n, function(err, user) { + * next(err, user); + * }); + * }, function(err, users) { + * // we should now have 5 users + * }); + */ +function times(n, iteratee, callback) { + return (0, _timesLimit2.default)(n, Infinity, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/timesLimit.js b/node_modules/async/timesLimit.js new file mode 100644 index 0000000..f76de25 --- /dev/null +++ b/node_modules/async/timesLimit.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timesLimit; + +var _mapLimit = require('./mapLimit.js'); + +var _mapLimit2 = _interopRequireDefault(_mapLimit); + +var _range = require('./internal/range.js'); + +var _range2 = _interopRequireDefault(_range); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a + * time. + * + * @name timesLimit + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} count - The number of times to run the function. + * @param {number} limit - The maximum number of async operations at a time. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see [async.map]{@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesLimit(count, limit, iteratee, callback) { + var _iteratee = (0, _wrapAsync2.default)(iteratee); + return (0, _mapLimit2.default)((0, _range2.default)(count), limit, _iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/timesSeries.js b/node_modules/async/timesSeries.js new file mode 100644 index 0000000..776b4f3 --- /dev/null +++ b/node_modules/async/timesSeries.js @@ -0,0 +1,32 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = timesSeries; + +var _timesLimit = require('./timesLimit.js'); + +var _timesLimit2 = _interopRequireDefault(_timesLimit); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. + * + * @name timesSeries + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.times]{@link module:ControlFlow.times} + * @category Control Flow + * @param {number} n - The number of times to run the function. + * @param {AsyncFunction} iteratee - The async function to call `n` times. + * Invoked with the iteration index and a callback: (n, next). + * @param {Function} callback - see {@link module:Collections.map}. + * @returns {Promise} a promise, if no callback is provided + */ +function timesSeries(n, iteratee, callback) { + return (0, _timesLimit2.default)(n, 1, iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/transform.js b/node_modules/async/transform.js new file mode 100644 index 0000000..75dadea --- /dev/null +++ b/node_modules/async/transform.js @@ -0,0 +1,173 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = transform; + +var _eachOf = require('./eachOf.js'); + +var _eachOf2 = _interopRequireDefault(_eachOf); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _promiseCallback = require('./internal/promiseCallback.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * A relative of `reduce`. Takes an Object or Array, and iterates over each + * element in parallel, each step potentially mutating an `accumulator` value. + * The type of the accumulator defaults to the type of collection passed in. + * + * @name transform + * @static + * @memberOf module:Collections + * @method + * @category Collection + * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. + * @param {*} [accumulator] - The initial state of the transform. If omitted, + * it will default to an empty Object or Array, depending on the type of `coll` + * @param {AsyncFunction} iteratee - A function applied to each item in the + * collection that potentially modifies the accumulator. + * Invoked with (accumulator, item, key, callback). + * @param {Function} [callback] - A callback which is called after all the + * `iteratee` functions have finished. Result is the transformed accumulator. + * Invoked with (err, result). + * @returns {Promise} a promise, if no callback provided + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileList = ['file1.txt','file2.txt','file3.txt']; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileList, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * }); + * + * // Using Promises + * async.transform(fileList, transformFileSize) + * .then(result => { + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * (async () => { + * try { + * let result = await async.transform(fileList, transformFileSize); + * console.log(result); + * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] + * } + * catch (err) { + * console.log(err); + * } + * })(); + * + * @example + * + * // file1.txt is a file that is 1000 bytes in size + * // file2.txt is a file that is 2000 bytes in size + * // file3.txt is a file that is 3000 bytes in size + * + * // helper function that returns human-readable size format from bytes + * function formatBytes(bytes, decimals = 2) { + * // implementation not included for brevity + * return humanReadbleFilesize; + * } + * + * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; + * + * // asynchronous function that returns the file size, transformed to human-readable format + * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. + * function transformFileSize(acc, value, key, callback) { + * fs.stat(value, function(err, stat) { + * if (err) { + * return callback(err); + * } + * acc[key] = formatBytes(stat.size); + * callback(null); + * }); + * } + * + * // Using callbacks + * async.transform(fileMap, transformFileSize, function(err, result) { + * if(err) { + * console.log(err); + * } else { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * }); + * + * // Using Promises + * async.transform(fileMap, transformFileSize) + * .then(result => { + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * }).catch(err => { + * console.log(err); + * }); + * + * // Using async/await + * async () => { + * try { + * let result = await async.transform(fileMap, transformFileSize); + * console.log(result); + * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } + * } + * catch (err) { + * console.log(err); + * } + * } + * + */ +function transform(coll, accumulator, iteratee, callback) { + if (arguments.length <= 3 && typeof accumulator === 'function') { + callback = iteratee; + iteratee = accumulator; + accumulator = Array.isArray(coll) ? [] : {}; + } + callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); + var _iteratee = (0, _wrapAsync2.default)(iteratee); + + (0, _eachOf2.default)(coll, (v, k, cb) => { + _iteratee(accumulator, v, k, cb); + }, err => callback(err, accumulator)); + return callback[_promiseCallback.PROMISE_SYMBOL]; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/tryEach.js b/node_modules/async/tryEach.js new file mode 100644 index 0000000..7e63f9d --- /dev/null +++ b/node_modules/async/tryEach.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _eachSeries = require('./eachSeries.js'); + +var _eachSeries2 = _interopRequireDefault(_eachSeries); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * It runs each task in series but stops whenever any of the functions were + * successful. If one of the tasks were successful, the `callback` will be + * passed the result of the successful task. If all tasks fail, the callback + * will be passed the error and result (if any) of the final attempt. + * + * @name tryEach + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to + * run, each function is passed a `callback(err, result)` it must call on + * completion with an error `err` (which can be `null`) and an optional `result` + * value. + * @param {Function} [callback] - An optional callback which is called when one + * of the tasks has succeeded, or all have failed. It receives the `err` and + * `result` arguments of the last attempt at completing the `task`. Invoked with + * (err, results). + * @returns {Promise} a promise, if no callback is passed + * @example + * async.tryEach([ + * function getDataFromFirstWebsite(callback) { + * // Try getting the data from the first website + * callback(err, data); + * }, + * function getDataFromSecondWebsite(callback) { + * // First website failed, + * // Try getting the data from the backup website + * callback(err, data); + * } + * ], + * // optional callback + * function(err, results) { + * Now do something with the data. + * }); + * + */ +function tryEach(tasks, callback) { + var error = null; + var result; + return (0, _eachSeries2.default)(tasks, (task, taskCb) => { + (0, _wrapAsync2.default)(task)((err, ...args) => { + if (err === false) return taskCb(err); + + if (args.length < 2) { + [result] = args; + } else { + result = args; + } + error = err; + taskCb(err ? null : {}); + }); + }, () => callback(error, result)); +} + +exports.default = (0, _awaitify2.default)(tryEach); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/unmemoize.js b/node_modules/async/unmemoize.js new file mode 100644 index 0000000..badd7ae --- /dev/null +++ b/node_modules/async/unmemoize.js @@ -0,0 +1,25 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = unmemoize; +/** + * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, + * unmemoized form. Handy for testing. + * + * @name unmemoize + * @static + * @memberOf module:Utils + * @method + * @see [async.memoize]{@link module:Utils.memoize} + * @category Util + * @param {AsyncFunction} fn - the memoized function + * @returns {AsyncFunction} a function that calls the original unmemoized function + */ +function unmemoize(fn) { + return (...args) => { + return (fn.unmemoized || fn)(...args); + }; +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/until.js b/node_modules/async/until.js new file mode 100644 index 0000000..4b69b97 --- /dev/null +++ b/node_modules/async/until.js @@ -0,0 +1,61 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = until; + +var _whilst = require('./whilst.js'); + +var _whilst2 = _interopRequireDefault(_whilst); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. `callback` will be passed an error and any + * arguments passed to the final `iteratee`'s callback. + * + * The inverse of [whilst]{@link module:ControlFlow.whilst}. + * + * @name until + * @static + * @memberOf module:ControlFlow + * @method + * @see [async.whilst]{@link module:ControlFlow.whilst} + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` fails. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has passed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if a callback is not passed + * + * @example + * const results = [] + * let finished = false + * async.until(function test(cb) { + * cb(null, finished) + * }, function iter(next) { + * fetchPage(url, (err, body) => { + * if (err) return next(err) + * results = results.concat(body.objects) + * finished = !!body.next + * next(err) + * }) + * }, function done (err) { + * // all pages have been fetched + * }) + */ +function until(test, iteratee, callback) { + const _test = (0, _wrapAsync2.default)(test); + return (0, _whilst2.default)(cb => _test((err, truth) => cb(err, !truth)), iteratee, callback); +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/waterfall.js b/node_modules/async/waterfall.js new file mode 100644 index 0000000..c3242f7 --- /dev/null +++ b/node_modules/async/waterfall.js @@ -0,0 +1,105 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _once = require('./internal/once.js'); + +var _once2 = _interopRequireDefault(_once); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Runs the `tasks` array of functions in series, each passing their results to + * the next in the array. However, if any of the `tasks` pass an error to their + * own callback, the next function is not executed, and the main `callback` is + * immediately called with the error. + * + * @name waterfall + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} + * to run. + * Each function should complete with any number of `result` values. + * The `result` values will be passed as arguments, in order, to the next task. + * @param {Function} [callback] - An optional callback to run once all the + * functions have completed. This will be passed the results of the last task's + * callback. Invoked with (err, [results]). + * @returns {Promise} a promise, if a callback is omitted + * @example + * + * async.waterfall([ + * function(callback) { + * callback(null, 'one', 'two'); + * }, + * function(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * }, + * function(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + * ], function (err, result) { + * // result now equals 'done' + * }); + * + * // Or, with named functions: + * async.waterfall([ + * myFirstFunction, + * mySecondFunction, + * myLastFunction, + * ], function (err, result) { + * // result now equals 'done' + * }); + * function myFirstFunction(callback) { + * callback(null, 'one', 'two'); + * } + * function mySecondFunction(arg1, arg2, callback) { + * // arg1 now equals 'one' and arg2 now equals 'two' + * callback(null, 'three'); + * } + * function myLastFunction(arg1, callback) { + * // arg1 now equals 'three' + * callback(null, 'done'); + * } + */ +function waterfall(tasks, callback) { + callback = (0, _once2.default)(callback); + if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); + if (!tasks.length) return callback(); + var taskIndex = 0; + + function nextTask(args) { + var task = (0, _wrapAsync2.default)(tasks[taskIndex++]); + task(...args, (0, _onlyOnce2.default)(next)); + } + + function next(err, ...args) { + if (err === false) return; + if (err || taskIndex === tasks.length) { + return callback(err, ...args); + } + nextTask(args); + } + + nextTask([]); +} + +exports.default = (0, _awaitify2.default)(waterfall); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/whilst.js b/node_modules/async/whilst.js new file mode 100644 index 0000000..4165543 --- /dev/null +++ b/node_modules/async/whilst.js @@ -0,0 +1,78 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _onlyOnce = require('./internal/onlyOnce.js'); + +var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + +var _awaitify = require('./internal/awaitify.js'); + +var _awaitify2 = _interopRequireDefault(_awaitify); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when + * stopped, or an error occurs. + * + * @name whilst + * @static + * @memberOf module:ControlFlow + * @method + * @category Control Flow + * @param {AsyncFunction} test - asynchronous truth test to perform before each + * execution of `iteratee`. Invoked with (callback). + * @param {AsyncFunction} iteratee - An async function which is called each time + * `test` passes. Invoked with (callback). + * @param {Function} [callback] - A callback which is called after the test + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s + * callback. Invoked with (err, [results]); + * @returns {Promise} a promise, if no callback is passed + * @example + * + * var count = 0; + * async.whilst( + * function test(cb) { cb(null, count < 5); }, + * function iter(callback) { + * count++; + * setTimeout(function() { + * callback(null, count); + * }, 1000); + * }, + * function (err, n) { + * // 5 seconds have passed, n = 5 + * } + * ); + */ +function whilst(test, iteratee, callback) { + callback = (0, _onlyOnce2.default)(callback); + var _fn = (0, _wrapAsync2.default)(iteratee); + var _test = (0, _wrapAsync2.default)(test); + var results = []; + + function next(err, ...rest) { + if (err) return callback(err); + results = rest; + if (err === false) return; + _test(check); + } + + function check(err, truth) { + if (err) return callback(err); + if (err === false) return; + if (!truth) return callback(null, ...results); + _fn(next); + } + + return _test(check); +} +exports.default = (0, _awaitify2.default)(whilst, 3); +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/async/wrapSync.js b/node_modules/async/wrapSync.js new file mode 100644 index 0000000..ddc3f02 --- /dev/null +++ b/node_modules/async/wrapSync.js @@ -0,0 +1,118 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = asyncify; + +var _initialParams = require('./internal/initialParams.js'); + +var _initialParams2 = _interopRequireDefault(_initialParams); + +var _setImmediate = require('./internal/setImmediate.js'); + +var _setImmediate2 = _interopRequireDefault(_setImmediate); + +var _wrapAsync = require('./internal/wrapAsync.js'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Take a sync function and make it async, passing its return value to a + * callback. This is useful for plugging sync functions into a waterfall, + * series, or other async functions. Any arguments passed to the generated + * function will be passed to the wrapped function (except for the final + * callback argument). Errors thrown will be passed to the callback. + * + * If the function passed to `asyncify` returns a Promise, that promises's + * resolved/rejected state will be used to call the callback, rather than simply + * the synchronous return value. + * + * This also means you can asyncify ES2017 `async` functions. + * + * @name asyncify + * @static + * @memberOf module:Utils + * @method + * @alias wrapSync + * @category Util + * @param {Function} func - The synchronous function, or Promise-returning + * function to convert to an {@link AsyncFunction}. + * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be + * invoked with `(args..., callback)`. + * @example + * + * // passing a regular synchronous function + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(JSON.parse), + * function (data, next) { + * // data is the result of parsing the text. + * // If there was a parsing error, it would have been caught. + * } + * ], callback); + * + * // passing a function returning a promise + * async.waterfall([ + * async.apply(fs.readFile, filename, "utf8"), + * async.asyncify(function (contents) { + * return db.model.create(contents); + * }), + * function (model, next) { + * // `model` is the instantiated model object. + * // If there was an error, this function would be skipped. + * } + * ], callback); + * + * // es2017 example, though `asyncify` is not needed if your JS environment + * // supports async functions out of the box + * var q = async.queue(async.asyncify(async function(file) { + * var intermediateStep = await processFile(file); + * return await somePromise(intermediateStep) + * })); + * + * q.push(files); + */ +function asyncify(func) { + if ((0, _wrapAsync.isAsync)(func)) { + return function (...args /*, callback*/) { + const callback = args.pop(); + const promise = func.apply(this, args); + return handlePromise(promise, callback); + }; + } + + return (0, _initialParams2.default)(function (args, callback) { + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (result && typeof result.then === 'function') { + return handlePromise(result, callback); + } else { + callback(null, result); + } + }); +} + +function handlePromise(promise, callback) { + return promise.then(value => { + invokeCallback(callback, null, value); + }, err => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); +} + +function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + (0, _setImmediate2.default)(e => { + throw e; + }, err); + } +} +module.exports = exports.default; \ No newline at end of file diff --git a/node_modules/babel-core/browser-polyfill.js b/node_modules/babel-core/browser-polyfill.js new file mode 100644 index 0000000..74decca --- /dev/null +++ b/node_modules/babel-core/browser-polyfill.js @@ -0,0 +1,4412 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 2 ? $$[2] : undefined + , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) + , inc = 1; + if(from < to && to < from + count){ + inc = -1; + from += count - 1; + to += count - 1; + } + while(count-- > 0){ + if(from in O)O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; +},{"76":76,"79":79,"80":80}],6:[function(_dereq_,module,exports){ +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +'use strict'; +var toObject = _dereq_(80) + , toIndex = _dereq_(76) + , toLength = _dereq_(79); +module.exports = [].fill || function fill(value /*, start = 0, end = @length */){ + var O = toObject(this) + , length = toLength(O.length) + , $$ = arguments + , $$len = $$.length + , index = toIndex($$len > 1 ? $$[1] : undefined, length) + , end = $$len > 2 ? $$[2] : undefined + , endPos = end === undefined ? length : toIndex(end, length); + while(endPos > index)O[index++] = value; + return O; +}; +},{"76":76,"79":79,"80":80}],7:[function(_dereq_,module,exports){ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = _dereq_(78) + , toLength = _dereq_(79) + , toIndex = _dereq_(76); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index; + } return !IS_INCLUDES && -1; + }; +}; +},{"76":76,"78":78,"79":79}],8:[function(_dereq_,module,exports){ +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = _dereq_(17) + , IObject = _dereq_(34) + , toObject = _dereq_(80) + , toLength = _dereq_(79) + , asc = _dereq_(9); +module.exports = function(TYPE){ + var IS_MAP = TYPE == 1 + , IS_FILTER = TYPE == 2 + , IS_SOME = TYPE == 3 + , IS_EVERY = TYPE == 4 + , IS_FIND_INDEX = TYPE == 6 + , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function($this, callbackfn, that){ + var O = toObject($this) + , self = IObject(O) + , f = ctx(callbackfn, that, 3) + , length = toLength(self.length) + , index = 0 + , result = IS_MAP ? asc($this, length) : IS_FILTER ? asc($this, 0) : undefined + , val, res; + for(;length > index; index++)if(NO_HOLES || index in self){ + val = self[index]; + res = f(val, index, O); + if(TYPE){ + if(IS_MAP)result[index] = res; // map + else if(res)switch(TYPE){ + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if(IS_EVERY)return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; +},{"17":17,"34":34,"79":79,"80":80,"9":9}],9:[function(_dereq_,module,exports){ +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var isObject = _dereq_(38) + , isArray = _dereq_(36) + , SPECIES = _dereq_(83)('species'); +module.exports = function(original, length){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return new (C === undefined ? Array : C)(length); +}; +},{"36":36,"38":38,"83":83}],10:[function(_dereq_,module,exports){ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = _dereq_(11) + , TAG = _dereq_(83)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = (O = Object(it))[TAG]) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; +},{"11":11,"83":83}],11:[function(_dereq_,module,exports){ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; +},{}],12:[function(_dereq_,module,exports){ +'use strict'; +var $ = _dereq_(46) + , hide = _dereq_(31) + , redefineAll = _dereq_(60) + , ctx = _dereq_(17) + , strictNew = _dereq_(69) + , defined = _dereq_(18) + , forOf = _dereq_(27) + , $iterDefine = _dereq_(42) + , step = _dereq_(44) + , ID = _dereq_(82)('id') + , $has = _dereq_(30) + , isObject = _dereq_(38) + , setSpecies = _dereq_(65) + , DESCRIPTORS = _dereq_(19) + , isExtensible = Object.isExtensible || isObject + , SIZE = DESCRIPTORS ? '_s' : 'size' + , id = 0; + +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!$has(it, ID)){ + // can't set id to frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add id + if(!create)return 'E'; + // add missing object id + hide(it, ID, ++id); + // return object id with prefix + } return 'O' + it[ID]; +}; + +var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + strictNew(that, C, NAME); + that._i = $.create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)$.setDesc(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; +},{"17":17,"18":18,"19":19,"27":27,"30":30,"31":31,"38":38,"42":42,"44":44,"46":46,"60":60,"65":65,"69":69,"82":82}],13:[function(_dereq_,module,exports){ +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var forOf = _dereq_(27) + , classof = _dereq_(10); +module.exports = function(NAME){ + return function toJSON(){ + if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); + var arr = []; + forOf(this, false, arr.push, arr); + return arr; + }; +}; +},{"10":10,"27":27}],14:[function(_dereq_,module,exports){ +'use strict'; +var hide = _dereq_(31) + , redefineAll = _dereq_(60) + , anObject = _dereq_(4) + , isObject = _dereq_(38) + , strictNew = _dereq_(69) + , forOf = _dereq_(27) + , createArrayMethod = _dereq_(8) + , $has = _dereq_(30) + , WEAK = _dereq_(82)('weak') + , isExtensible = Object.isExtensible || isObject + , arrayFind = createArrayMethod(5) + , arrayFindIndex = createArrayMethod(6) + , id = 0; + +// fallback for frozen keys +var frozenStore = function(that){ + return that._l || (that._l = new FrozenStore); +}; +var FrozenStore = function(){ + this.a = []; +}; +var findFrozen = function(store, key){ + return arrayFind(store.a, function(it){ + return it[0] === key; + }); +}; +FrozenStore.prototype = { + get: function(key){ + var entry = findFrozen(this, key); + if(entry)return entry[1]; + }, + has: function(key){ + return !!findFrozen(this, key); + }, + set: function(key, value){ + var entry = findFrozen(this, key); + if(entry)entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function(key){ + var index = arrayFindIndex(this.a, function(it){ + return it[0] === key; + }); + if(~index)this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + strictNew(that, C, NAME); + that._i = id++; // collection id + that._l = undefined; // leak store for frozen objects + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function(key){ + if(!isObject(key))return false; + if(!isExtensible(key))return frozenStore(this)['delete'](key); + return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key){ + if(!isObject(key))return false; + if(!isExtensible(key))return frozenStore(this).has(key); + return $has(key, WEAK) && $has(key[WEAK], this._i); + } + }); + return C; + }, + def: function(that, key, value){ + if(!isExtensible(anObject(key))){ + frozenStore(that).set(key, value); + } else { + $has(key, WEAK) || hide(key, WEAK, {}); + key[WEAK][that._i] = value; + } return that; + }, + frozenStore: frozenStore, + WEAK: WEAK +}; +},{"27":27,"30":30,"31":31,"38":38,"4":4,"60":60,"69":69,"8":8,"82":82}],15:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(29) + , $export = _dereq_(22) + , redefine = _dereq_(61) + , redefineAll = _dereq_(60) + , forOf = _dereq_(27) + , strictNew = _dereq_(69) + , isObject = _dereq_(38) + , fails = _dereq_(24) + , $iterDetect = _dereq_(43) + , setToStringTag = _dereq_(66); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO; + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + strictNew(target, C, NAME); + var that = new Base; + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + IS_WEAK || instance.forEach(function(val, key){ + BUGGY_ZERO = 1 / key === -Infinity; + }); + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; +},{"22":22,"24":24,"27":27,"29":29,"38":38,"43":43,"60":60,"61":61,"66":66,"69":69}],16:[function(_dereq_,module,exports){ +var core = module.exports = {version: '1.2.6'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef +},{}],17:[function(_dereq_,module,exports){ +// optional / simple context binding +var aFunction = _dereq_(2); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; +},{"2":2}],18:[function(_dereq_,module,exports){ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; +},{}],19:[function(_dereq_,module,exports){ +// Thank's IE8 for his funny defineProperty +module.exports = !_dereq_(24)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"24":24}],20:[function(_dereq_,module,exports){ +var isObject = _dereq_(38) + , document = _dereq_(29).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; +},{"29":29,"38":38}],21:[function(_dereq_,module,exports){ +// all enumerable object keys, includes symbols +var $ = _dereq_(46); +module.exports = function(it){ + var keys = $.getKeys(it) + , getSymbols = $.getSymbols; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = $.isEnum + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key); + } + return keys; +}; +},{"46":46}],22:[function(_dereq_,module,exports){ +var global = _dereq_(29) + , core = _dereq_(16) + , hide = _dereq_(31) + , redefine = _dereq_(61) + , ctx = _dereq_(17) + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && key in target; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target && !own)redefine(target, key, out); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +module.exports = $export; +},{"16":16,"17":17,"29":29,"31":31,"61":61}],23:[function(_dereq_,module,exports){ +var MATCH = _dereq_(83)('match'); +module.exports = function(KEY){ + var re = /./; + try { + '/./'[KEY](re); + } catch(e){ + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch(f){ /* empty */ } + } return true; +}; +},{"83":83}],24:[function(_dereq_,module,exports){ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; +},{}],25:[function(_dereq_,module,exports){ +'use strict'; +var hide = _dereq_(31) + , redefine = _dereq_(61) + , fails = _dereq_(24) + , defined = _dereq_(18) + , wks = _dereq_(83); + +module.exports = function(KEY, length, exec){ + var SYMBOL = wks(KEY) + , original = ''[KEY]; + if(fails(function(){ + var O = {}; + O[SYMBOL] = function(){ return 7; }; + return ''[KEY](O) != 7; + })){ + redefine(String.prototype, KEY, exec(defined, SYMBOL, original)); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function(string, arg){ return original.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function(string){ return original.call(string, this); } + ); + } +}; +},{"18":18,"24":24,"31":31,"61":61,"83":83}],26:[function(_dereq_,module,exports){ +'use strict'; +// 21.2.5.3 get RegExp.prototype.flags +var anObject = _dereq_(4); +module.exports = function(){ + var that = anObject(this) + , result = ''; + if(that.global) result += 'g'; + if(that.ignoreCase) result += 'i'; + if(that.multiline) result += 'm'; + if(that.unicode) result += 'u'; + if(that.sticky) result += 'y'; + return result; +}; +},{"4":4}],27:[function(_dereq_,module,exports){ +var ctx = _dereq_(17) + , call = _dereq_(40) + , isArrayIter = _dereq_(35) + , anObject = _dereq_(4) + , toLength = _dereq_(79) + , getIterFn = _dereq_(84); +module.exports = function(iterable, entries, fn, that){ + var iterFn = getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + call(iterator, f, step.value, entries); + } +}; +},{"17":17,"35":35,"4":4,"40":40,"79":79,"84":84}],28:[function(_dereq_,module,exports){ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = _dereq_(78) + , getNames = _dereq_(46).getNames + , toString = {}.toString; + +var windowNames = typeof window == 'object' && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return getNames(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.get = function getOwnPropertyNames(it){ + if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it); + return getNames(toIObject(it)); +}; +},{"46":46,"78":78}],29:[function(_dereq_,module,exports){ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef +},{}],30:[function(_dereq_,module,exports){ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; +},{}],31:[function(_dereq_,module,exports){ +var $ = _dereq_(46) + , createDesc = _dereq_(59); +module.exports = _dereq_(19) ? function(object, key, value){ + return $.setDesc(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; +},{"19":19,"46":46,"59":59}],32:[function(_dereq_,module,exports){ +module.exports = _dereq_(29).document && document.documentElement; +},{"29":29}],33:[function(_dereq_,module,exports){ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; +},{}],34:[function(_dereq_,module,exports){ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = _dereq_(11); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; +},{"11":11}],35:[function(_dereq_,module,exports){ +// check on default Array iterator +var Iterators = _dereq_(45) + , ITERATOR = _dereq_(83)('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; +},{"45":45,"83":83}],36:[function(_dereq_,module,exports){ +// 7.2.2 IsArray(argument) +var cof = _dereq_(11); +module.exports = Array.isArray || function(arg){ + return cof(arg) == 'Array'; +}; +},{"11":11}],37:[function(_dereq_,module,exports){ +// 20.1.2.3 Number.isInteger(number) +var isObject = _dereq_(38) + , floor = Math.floor; +module.exports = function isInteger(it){ + return !isObject(it) && isFinite(it) && floor(it) === it; +}; +},{"38":38}],38:[function(_dereq_,module,exports){ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; +},{}],39:[function(_dereq_,module,exports){ +// 7.2.8 IsRegExp(argument) +var isObject = _dereq_(38) + , cof = _dereq_(11) + , MATCH = _dereq_(83)('match'); +module.exports = function(it){ + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; +},{"11":11,"38":38,"83":83}],40:[function(_dereq_,module,exports){ +// call something on iterator step with safe closing on error +var anObject = _dereq_(4); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; +},{"4":4}],41:[function(_dereq_,module,exports){ +'use strict'; +var $ = _dereq_(46) + , descriptor = _dereq_(59) + , setToStringTag = _dereq_(66) + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +_dereq_(31)(IteratorPrototype, _dereq_(83)('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; +},{"31":31,"46":46,"59":59,"66":66,"83":83}],42:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(48) + , $export = _dereq_(22) + , redefine = _dereq_(61) + , hide = _dereq_(31) + , has = _dereq_(30) + , Iterators = _dereq_(45) + , $iterCreate = _dereq_(41) + , setToStringTag = _dereq_(66) + , getProto = _dereq_(46).getProto + , ITERATOR = _dereq_(83)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , methods, key; + // Fix native + if($native){ + var IteratorPrototype = getProto($default.call(new Base)); + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // FF fix + if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: !DEF_VALUES ? $default : getMethod('entries') + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; +},{"22":22,"30":30,"31":31,"41":41,"45":45,"46":46,"48":48,"61":61,"66":66,"83":83}],43:[function(_dereq_,module,exports){ +var ITERATOR = _dereq_(83)('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ safe = true; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; +},{"83":83}],44:[function(_dereq_,module,exports){ +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; +},{}],45:[function(_dereq_,module,exports){ +module.exports = {}; +},{}],46:[function(_dereq_,module,exports){ +var $Object = Object; +module.exports = { + create: $Object.create, + getProto: $Object.getPrototypeOf, + isEnum: {}.propertyIsEnumerable, + getDesc: $Object.getOwnPropertyDescriptor, + setDesc: $Object.defineProperty, + setDescs: $Object.defineProperties, + getKeys: $Object.keys, + getNames: $Object.getOwnPropertyNames, + getSymbols: $Object.getOwnPropertySymbols, + each: [].forEach +}; +},{}],47:[function(_dereq_,module,exports){ +var $ = _dereq_(46) + , toIObject = _dereq_(78); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = $.getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; +},{"46":46,"78":78}],48:[function(_dereq_,module,exports){ +module.exports = false; +},{}],49:[function(_dereq_,module,exports){ +// 20.2.2.14 Math.expm1(x) +module.exports = Math.expm1 || function expm1(x){ + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +}; +},{}],50:[function(_dereq_,module,exports){ +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x){ + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; +},{}],51:[function(_dereq_,module,exports){ +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x){ + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; +},{}],52:[function(_dereq_,module,exports){ +var global = _dereq_(29) + , macrotask = _dereq_(75).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = _dereq_(11)(process) == 'process' + , head, last, notify; + +var flush = function(){ + var parent, domain, fn; + if(isNode && (parent = process.domain)){ + process.domain = null; + parent.exit(); + } + while(head){ + domain = head.domain; + fn = head.fn; + if(domain)domain.enter(); + fn(); // <- currently we use it only for Promise - try / catch not required + if(domain)domain.exit(); + head = head.next; + } last = undefined; + if(parent)parent.enter(); +}; + +// Node.js +if(isNode){ + notify = function(){ + process.nextTick(flush); + }; +// browsers with MutationObserver +} else if(Observer){ + var toggle = 1 + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = -toggle; + }; +// environments with maybe non-completely correct, but existent Promise +} else if(Promise && Promise.resolve){ + notify = function(){ + Promise.resolve().then(flush); + }; +// for other environments - macrotask based on: +// - setImmediate +// - MessageChannel +// - window.postMessag +// - onreadystatechange +// - setTimeout +} else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; +} + +module.exports = function asap(fn){ + var task = {fn: fn, next: undefined, domain: isNode && process.domain}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; +}; +},{"11":11,"29":29,"75":75}],53:[function(_dereq_,module,exports){ +// 19.1.2.1 Object.assign(target, source, ...) +var $ = _dereq_(46) + , toObject = _dereq_(80) + , IObject = _dereq_(34); + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = _dereq_(24)(function(){ + var a = Object.assign + , A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return a({}, A)[S] != 7 || Object.keys(a({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , $$ = arguments + , $$len = $$.length + , index = 1 + , getKeys = $.getKeys + , getSymbols = $.getSymbols + , isEnum = $.isEnum; + while($$len > index){ + var S = IObject($$[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } + return T; +} : Object.assign; +},{"24":24,"34":34,"46":46,"80":80}],54:[function(_dereq_,module,exports){ +// most Object methods by ES6 should accept primitives +var $export = _dereq_(22) + , core = _dereq_(16) + , fails = _dereq_(24); +module.exports = function(KEY, exec){ + var fn = (core.Object || {})[KEY] || Object[KEY] + , exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); +}; +},{"16":16,"22":22,"24":24}],55:[function(_dereq_,module,exports){ +var $ = _dereq_(46) + , toIObject = _dereq_(78) + , isEnum = $.isEnum; +module.exports = function(isEntries){ + return function(it){ + var O = toIObject(it) + , keys = $.getKeys(O) + , length = keys.length + , i = 0 + , result = [] + , key; + while(length > i)if(isEnum.call(O, key = keys[i++])){ + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; +},{"46":46,"78":78}],56:[function(_dereq_,module,exports){ +// all object keys, includes non-enumerable and symbols +var $ = _dereq_(46) + , anObject = _dereq_(4) + , Reflect = _dereq_(29).Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ + var keys = $.getNames(anObject(it)) + , getSymbols = $.getSymbols; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; +},{"29":29,"4":4,"46":46}],57:[function(_dereq_,module,exports){ +'use strict'; +var path = _dereq_(58) + , invoke = _dereq_(33) + , aFunction = _dereq_(2); +module.exports = function(/* ...pargs */){ + var fn = aFunction(this) + , length = arguments.length + , pargs = Array(length) + , i = 0 + , _ = path._ + , holder = false; + while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; + return function(/* ...args */){ + var that = this + , $$ = arguments + , $$len = $$.length + , j = 0, k = 0, args; + if(!holder && !$$len)return invoke(fn, pargs, that); + args = pargs.slice(); + if(holder)for(;length > j; j++)if(args[j] === _)args[j] = $$[k++]; + while($$len > k)args.push($$[k++]); + return invoke(fn, args, that); + }; +}; +},{"2":2,"33":33,"58":58}],58:[function(_dereq_,module,exports){ +module.exports = _dereq_(29); +},{"29":29}],59:[function(_dereq_,module,exports){ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; +},{}],60:[function(_dereq_,module,exports){ +var redefine = _dereq_(61); +module.exports = function(target, src){ + for(var key in src)redefine(target, key, src[key]); + return target; +}; +},{"61":61}],61:[function(_dereq_,module,exports){ +// add fake Function#toString +// for correct work wrapped methods / constructors with methods like LoDash isNative +var global = _dereq_(29) + , hide = _dereq_(31) + , SRC = _dereq_(82)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + +_dereq_(16).inspectSource = function(it){ + return $toString.call(it); +}; + +(module.exports = function(O, key, val, safe){ + if(typeof val == 'function'){ + val.hasOwnProperty(SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + val.hasOwnProperty('name') || hide(val, 'name', key); + } + if(O === global){ + O[key] = val; + } else { + if(!safe)delete O[key]; + hide(O, key, val); + } +})(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); +},{"16":16,"29":29,"31":31,"82":82}],62:[function(_dereq_,module,exports){ +module.exports = function(regExp, replace){ + var replacer = replace === Object(replace) ? function(part){ + return replace[part]; + } : replace; + return function(it){ + return String(it).replace(regExp, replacer); + }; +}; +},{}],63:[function(_dereq_,module,exports){ +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y){ + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; +},{}],64:[function(_dereq_,module,exports){ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var getDesc = _dereq_(46).getDesc + , isObject = _dereq_(38) + , anObject = _dereq_(4); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = _dereq_(17)(Function.call, getDesc(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; +},{"17":17,"38":38,"4":4,"46":46}],65:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(29) + , $ = _dereq_(46) + , DESCRIPTORS = _dereq_(19) + , SPECIES = _dereq_(83)('species'); + +module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])$.setDesc(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; +},{"19":19,"29":29,"46":46,"83":83}],66:[function(_dereq_,module,exports){ +var def = _dereq_(46).setDesc + , has = _dereq_(30) + , TAG = _dereq_(83)('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; +},{"30":30,"46":46,"83":83}],67:[function(_dereq_,module,exports){ +var global = _dereq_(29) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; +},{"29":29}],68:[function(_dereq_,module,exports){ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = _dereq_(4) + , aFunction = _dereq_(2) + , SPECIES = _dereq_(83)('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; +},{"2":2,"4":4,"83":83}],69:[function(_dereq_,module,exports){ +module.exports = function(it, Constructor, name){ + if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); + return it; +}; +},{}],70:[function(_dereq_,module,exports){ +var toInteger = _dereq_(77) + , defined = _dereq_(18); +// true -> String#at +// false -> String#codePointAt +module.exports = function(TO_STRING){ + return function(that, pos){ + var s = String(defined(that)) + , i = toInteger(pos) + , l = s.length + , a, b; + if(i < 0 || i >= l)return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; +},{"18":18,"77":77}],71:[function(_dereq_,module,exports){ +// helper for String#{startsWith, endsWith, includes} +var isRegExp = _dereq_(39) + , defined = _dereq_(18); + +module.exports = function(that, searchString, NAME){ + if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; +},{"18":18,"39":39}],72:[function(_dereq_,module,exports){ +// https://github.com/ljharb/proposal-string-pad-left-right +var toLength = _dereq_(79) + , repeat = _dereq_(73) + , defined = _dereq_(18); + +module.exports = function(that, maxLength, fillString, left){ + var S = String(defined(that)) + , stringLength = S.length + , fillStr = fillString === undefined ? ' ' : String(fillString) + , intMaxLength = toLength(maxLength); + if(intMaxLength <= stringLength)return S; + if(fillStr == '')fillStr = ' '; + var fillLen = intMaxLength - stringLength + , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; +},{"18":18,"73":73,"79":79}],73:[function(_dereq_,module,exports){ +'use strict'; +var toInteger = _dereq_(77) + , defined = _dereq_(18); + +module.exports = function repeat(count){ + var str = String(defined(this)) + , res = '' + , n = toInteger(count); + if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); + for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; + return res; +}; +},{"18":18,"77":77}],74:[function(_dereq_,module,exports){ +var $export = _dereq_(22) + , defined = _dereq_(18) + , fails = _dereq_(24) + , spaces = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' + , space = '[' + spaces + ']' + , non = '\u200b\u0085' + , ltrim = RegExp('^' + space + space + '*') + , rtrim = RegExp(space + space + '*$'); + +var exporter = function(KEY, exec){ + var exp = {}; + exp[KEY] = exec(trim); + $export($export.P + $export.F * fails(function(){ + return !!spaces[KEY]() || non[KEY]() != non; + }), 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function(string, TYPE){ + string = String(defined(string)); + if(TYPE & 1)string = string.replace(ltrim, ''); + if(TYPE & 2)string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; +},{"18":18,"22":22,"24":24}],75:[function(_dereq_,module,exports){ +var ctx = _dereq_(17) + , invoke = _dereq_(33) + , html = _dereq_(32) + , cel = _dereq_(20) + , global = _dereq_(29) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listner = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(_dereq_(11)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listner; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listner, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; +},{"11":11,"17":17,"20":20,"29":29,"32":32,"33":33}],76:[function(_dereq_,module,exports){ +var toInteger = _dereq_(77) + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; +},{"77":77}],77:[function(_dereq_,module,exports){ +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; +},{}],78:[function(_dereq_,module,exports){ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = _dereq_(34) + , defined = _dereq_(18); +module.exports = function(it){ + return IObject(defined(it)); +}; +},{"18":18,"34":34}],79:[function(_dereq_,module,exports){ +// 7.1.15 ToLength +var toInteger = _dereq_(77) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; +},{"77":77}],80:[function(_dereq_,module,exports){ +// 7.1.13 ToObject(argument) +var defined = _dereq_(18); +module.exports = function(it){ + return Object(defined(it)); +}; +},{"18":18}],81:[function(_dereq_,module,exports){ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = _dereq_(38); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; +},{"38":38}],82:[function(_dereq_,module,exports){ +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; +},{}],83:[function(_dereq_,module,exports){ +var store = _dereq_(67)('wks') + , uid = _dereq_(82) + , Symbol = _dereq_(29).Symbol; +module.exports = function(name){ + return store[name] || (store[name] = + Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name)); +}; +},{"29":29,"67":67,"82":82}],84:[function(_dereq_,module,exports){ +var classof = _dereq_(10) + , ITERATOR = _dereq_(83)('iterator') + , Iterators = _dereq_(45); +module.exports = _dereq_(16).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; +},{"10":10,"16":16,"45":45,"83":83}],85:[function(_dereq_,module,exports){ +'use strict'; +var $ = _dereq_(46) + , $export = _dereq_(22) + , DESCRIPTORS = _dereq_(19) + , createDesc = _dereq_(59) + , html = _dereq_(32) + , cel = _dereq_(20) + , has = _dereq_(30) + , cof = _dereq_(11) + , invoke = _dereq_(33) + , fails = _dereq_(24) + , anObject = _dereq_(4) + , aFunction = _dereq_(2) + , isObject = _dereq_(38) + , toObject = _dereq_(80) + , toIObject = _dereq_(78) + , toInteger = _dereq_(77) + , toIndex = _dereq_(76) + , toLength = _dereq_(79) + , IObject = _dereq_(34) + , IE_PROTO = _dereq_(82)('__proto__') + , createArrayMethod = _dereq_(8) + , arrayIndexOf = _dereq_(7)(false) + , ObjectProto = Object.prototype + , ArrayProto = Array.prototype + , arraySlice = ArrayProto.slice + , arrayJoin = ArrayProto.join + , defineProperty = $.setDesc + , getOwnDescriptor = $.getDesc + , defineProperties = $.setDescs + , factories = {} + , IE8_DOM_DEFINE; + +if(!DESCRIPTORS){ + IE8_DOM_DEFINE = !fails(function(){ + return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7; + }); + $.setDesc = function(O, P, Attributes){ + if(IE8_DOM_DEFINE)try { + return defineProperty(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)anObject(O)[P] = Attributes.value; + return O; + }; + $.getDesc = function(O, P){ + if(IE8_DOM_DEFINE)try { + return getOwnDescriptor(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); + }; + $.setDescs = defineProperties = function(O, Properties){ + anObject(O); + var keys = $.getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); + return O; + }; +} +$export($export.S + $export.F * !DESCRIPTORS, 'Object', { + // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $.getDesc, + // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) + defineProperty: $.setDesc, + // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) + defineProperties: defineProperties +}); + + // IE 8- don't enum bug keys +var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + + 'toLocaleString,toString,valueOf').split(',') + // Additional keys for getOwnPropertyNames + , keys2 = keys1.concat('length', 'prototype') + , keysLen1 = keys1.length; + +// Create object with `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = cel('iframe') + , i = keysLen1 + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(' + */ + +var runScripts = function runScripts() { + var scripts = []; + var types = ["text/ecmascript-6", "text/6to5", "text/babel", "module"]; + var index = 0; + + /** + * Transform and execute script. Ensures correct load order. + */ + + var exec = function exec() { + var param = scripts[index]; + if (param instanceof Array) { + transform.run.apply(transform, param); + index++; + exec(); + } + }; + + /** + * Load, transform, and execute all scripts. + */ + + var run = function run(script, i) { + var opts = {}; + + if (script.src) { + transform.load(script.src, function (param) { + scripts[i] = param; + exec(); + }, opts, true); + } else { + opts.filename = "embedded"; + scripts[i] = [script.innerHTML, opts]; + } + }; + + // Collect scripts with Babel `types`. + + var _scripts = global.document.getElementsByTagName("script"); + + for (var i = 0; i < _scripts.length; ++i) { + var _script = _scripts[i]; + if (types.indexOf(_script.type) >= 0) scripts.push(_script); + } + + for (i in scripts) { + run(scripts[i], i); + } + + exec(); +}; + +/** + * Register load event to transform and execute scripts. + */ + +if (global.addEventListener) { + global.addEventListener("DOMContentLoaded", runScripts, false); +} else if (global.attachEvent) { + global.attachEvent("onload", runScripts); +} +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"15":15,"49":49,"610":610,"66":66}],15:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +exports.register = register; +exports.polyfill = polyfill; +exports.transformFile = transformFile; +exports.transformFileSync = transformFileSync; +exports.parse = parse; +// istanbul ignore next + +function _interopRequire(obj) { return obj && obj.__esModule ? obj["default"] : obj; } + +// istanbul ignore next + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _lodashLangIsFunction = _dereq_(533); + +var _lodashLangIsFunction2 = _interopRequireDefault(_lodashLangIsFunction); + +var _transformation = _dereq_(66); + +var _transformation2 = _interopRequireDefault(_transformation); + +var _babylon = _dereq_(612); + +var babylon = _interopRequireWildcard(_babylon); + +var _util = _dereq_(182); + +var util = _interopRequireWildcard(_util); + +var _fs = _dereq_(3); + +var _fs2 = _interopRequireDefault(_fs); + +var _types = _dereq_(179); + +var t = _interopRequireWildcard(_types); + +exports.util = util; +exports.acorn = babylon; +exports.transform = _transformation2["default"]; +exports.pipeline = _transformation.pipeline; +exports.canCompile = _util.canCompile; + +var _transformationFile = _dereq_(46); + +exports.File = _interopRequire(_transformationFile); + +var _transformationFileOptionsConfig = _dereq_(48); + +exports.options = _interopRequire(_transformationFileOptionsConfig); + +var _transformationPlugin = _dereq_(82); + +exports.Plugin = _interopRequire(_transformationPlugin); + +var _transformationTransformer = _dereq_(83); + +exports.Transformer = _interopRequire(_transformationTransformer); + +var _transformationPipeline = _dereq_(80); + +exports.Pipeline = _interopRequire(_transformationPipeline); + +var _traversal = _dereq_(148); + +exports.traverse = _interopRequire(_traversal); + +var _toolsBuildExternalHelpers = _dereq_(45); + +exports.buildExternalHelpers = _interopRequire(_toolsBuildExternalHelpers); + +var _package = _dereq_(610); + +exports.version = _package.version; +exports.types = t; + +/** + * Register Babel and polyfill globally. + */ + +function register(opts) { + var callback = _dereq_(17); + if (opts != null) callback(opts); + return callback; +} + +/** + * Register polyfill globally. + */ + +function polyfill() { + _dereq_(44); +} + +/** + * Asynchronously transform `filename` with optional `opts`, calls `callback` when complete. + */ + +function transformFile(filename, opts, callback) { + if (_lodashLangIsFunction2["default"](opts)) { + callback = opts; + opts = {}; + } + + opts.filename = filename; + + _fs2["default"].readFile(filename, function (err, code) { + if (err) return callback(err); + + var result; + + try { + result = _transformation2["default"](code, opts); + } catch (err) { + return callback(err); + } + + callback(null, result); + }); +} + +/** + * Synchronous form of `transformFile`. + */ + +function transformFileSync(filename) { + var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + opts.filename = filename; + return _transformation2["default"](_fs2["default"].readFileSync(filename, "utf8"), opts); +} + +/** + * Parse script with Babel's parser. + */ + +function parse(code) { + var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + opts.allowHashBang = true; + opts.sourceType = "module"; + opts.ecmaVersion = Infinity; + opts.plugins = { + jsx: true, + flow: true + }; + opts.features = {}; + + for (var key in _transformation2["default"].pipeline.transformers) { + opts.features[key] = true; + } + + var ast = babylon.parse(code, opts); + + if (opts.onToken) { + // istanbul ignore next + + var _opts$onToken; + + (_opts$onToken = opts.onToken).push.apply(_opts$onToken, ast.tokens); + } + + if (opts.onComment) { + // istanbul ignore next + + var _opts$onComment; + + (_opts$onComment = opts.onComment).push.apply(_opts$onComment, ast.comments); + } + + return ast.program; +} +},{"148":148,"17":17,"179":179,"182":182,"3":3,"44":44,"45":45,"46":46,"48":48,"533":533,"610":610,"612":612,"66":66,"80":80,"82":82,"83":83}],16:[function(_dereq_,module,exports){ +// required to safely use babel/register within a browserify codebase + +"use strict"; + +exports.__esModule = true; + +_dereq_(44); + +exports["default"] = function () {}; + +module.exports = exports["default"]; +},{"44":44}],17:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequire(obj) { return obj && obj.__esModule ? obj["default"] : obj; } + +_dereq_(44); + +var _node = _dereq_(16); + +exports["default"] = _interopRequire(_node); +module.exports = exports["default"]; +},{"16":16,"44":44}],18:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// istanbul ignore next + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _repeating = _dereq_(586); + +var _repeating2 = _interopRequireDefault(_repeating); + +var _trimRight = _dereq_(608); + +var _trimRight2 = _interopRequireDefault(_trimRight); + +var _lodashLangIsBoolean = _dereq_(531); + +var _lodashLangIsBoolean2 = _interopRequireDefault(_lodashLangIsBoolean); + +var _lodashCollectionIncludes = _dereq_(446); + +var _lodashCollectionIncludes2 = _interopRequireDefault(_lodashCollectionIncludes); + +var _lodashLangIsNumber = _dereq_(535); + +var _lodashLangIsNumber2 = _interopRequireDefault(_lodashLangIsNumber); + +/** + * Buffer for collecting generated output. + */ + +var Buffer = (function () { + function Buffer(position, format) { + _classCallCheck(this, Buffer); + + this.parenPushNewlineState = null; + + this.position = position; + this._indent = format.indent.base; + this.format = format; + this.buf = ""; + } + + /** + * Get the current trimmed buffer. + */ + + Buffer.prototype.get = function get() { + return _trimRight2["default"](this.buf); + }; + + /** + * Get the current indent. + */ + + Buffer.prototype.getIndent = function getIndent() { + if (this.format.compact || this.format.concise) { + return ""; + } else { + return _repeating2["default"](this.format.indent.style, this._indent); + } + }; + + /** + * Get the current indent size. + */ + + Buffer.prototype.indentSize = function indentSize() { + return this.getIndent().length; + }; + + /** + * Increment indent size. + */ + + Buffer.prototype.indent = function indent() { + this._indent++; + }; + + /** + * Decrement indent size. + */ + + Buffer.prototype.dedent = function dedent() { + this._indent--; + }; + + /** + * Add a semicolon to the buffer. + */ + + Buffer.prototype.semicolon = function semicolon() { + this.push(";"); + }; + + /** + * Ensure last character is a semicolon. + */ + + Buffer.prototype.ensureSemicolon = function ensureSemicolon() { + if (!this.isLast(";")) this.semicolon(); + }; + + /** + * Add a right brace to the buffer. + */ + + Buffer.prototype.rightBrace = function rightBrace() { + this.newline(true); + //if (this.format.compact) this._removeLast(";"); + this.push("}"); + }; + + /** + * Add a keyword to the buffer. + */ + + Buffer.prototype.keyword = function keyword(name) { + this.push(name); + this.space(); + }; + + /** + * Add a space to the buffer unless it is compact (override with force). + */ + + Buffer.prototype.space = function space(force) { + if (!force && this.format.compact) return; + + if (force || this.buf && !this.isLast(" ") && !this.isLast("\n")) { + this.push(" "); + } + }; + + /** + * Remove the last character. + */ + + Buffer.prototype.removeLast = function removeLast(cha) { + if (this.format.compact) return; + return this._removeLast(cha); + }; + + Buffer.prototype._removeLast = function _removeLast(cha) { + if (!this._isLast(cha)) return; + this.buf = this.buf.substr(0, this.buf.length - 1); + this.position.unshift(cha); + }; + + /** + * Set some state that will be modified if a newline has been inserted before any + * non-space characters. + * + * This is to prevent breaking semantics for terminatorless separator nodes. eg: + * + * return foo; + * + * returns `foo`. But if we do: + * + * return + * foo; + * + * `undefined` will be returned and not `foo` due to the terminator. + */ + + Buffer.prototype.startTerminatorless = function startTerminatorless() { + return this.parenPushNewlineState = { + printed: false + }; + }; + + /** + * Print an ending parentheses if a starting one has been printed. + */ + + Buffer.prototype.endTerminatorless = function endTerminatorless(state) { + if (state.printed) { + this.dedent(); + this.newline(); + this.push(")"); + } + }; + + /** + * Add a newline (or many newlines), maintaining formatting. + * Strips multiple newlines if removeLast is true. + */ + + Buffer.prototype.newline = function newline(i, removeLast) { + if (this.format.compact || this.format.retainLines) return; + + if (this.format.concise) { + this.space(); + return; + } + + removeLast = removeLast || false; + + if (_lodashLangIsNumber2["default"](i)) { + i = Math.min(2, i); + + if (this.endsWith("{\n") || this.endsWith(":\n")) i--; + if (i <= 0) return; + + while (i > 0) { + this._newline(removeLast); + i--; + } + return; + } + + if (_lodashLangIsBoolean2["default"](i)) { + removeLast = i; + } + + this._newline(removeLast); + }; + + /** + * Adds a newline unless there is already two previous newlines. + */ + + Buffer.prototype._newline = function _newline(removeLast) { + // never allow more than two lines + if (this.endsWith("\n\n")) return; + + // remove the last newline + if (removeLast && this.isLast("\n")) this.removeLast("\n"); + + this.removeLast(" "); + this._removeSpacesAfterLastNewline(); + this._push("\n"); + }; + + /** + * If buffer ends with a newline and some spaces after it, trim those spaces. + */ + + Buffer.prototype._removeSpacesAfterLastNewline = function _removeSpacesAfterLastNewline() { + var lastNewlineIndex = this.buf.lastIndexOf("\n"); + if (lastNewlineIndex === -1) { + return; + } + + var index = this.buf.length - 1; + while (index > lastNewlineIndex) { + if (this.buf[index] !== " ") { + break; + } + + index--; + } + + if (index === lastNewlineIndex) { + this.buf = this.buf.substring(0, index + 1); + } + }; + + /** + * Push a string to the buffer, maintaining indentation and newlines. + */ + + Buffer.prototype.push = function push(str, noIndent) { + if (!this.format.compact && this._indent && !noIndent && str !== "\n") { + // we have an indent level and we aren't pushing a newline + var indent = this.getIndent(); + + // replace all newlines with newlines with the indentation + str = str.replace(/\n/g, "\n" + indent); + + // we've got a newline before us so prepend on the indentation + if (this.isLast("\n")) this._push(indent); + } + + this._push(str); + }; + + /** + * Push a string to the buffer. + */ + + Buffer.prototype._push = function _push(str) { + // see startTerminatorless() instance method + var parenPushNewlineState = this.parenPushNewlineState; + if (parenPushNewlineState) { + for (var i = 0; i < str.length; i++) { + var cha = str[i]; + + // we can ignore spaces since they wont interupt a terminatorless separator + if (cha === " ") continue; + + this.parenPushNewlineState = null; + + if (cha === "\n" || cha === "/") { + // we're going to break this terminator expression so we need to add a parentheses + this._push("("); + this.indent(); + parenPushNewlineState.printed = true; + } + + break; + } + } + + // + this.position.push(str); + this.buf += str; + }; + + /** + * Test if the buffer ends with a string. + */ + + Buffer.prototype.endsWith = function endsWith(str) { + var buf = arguments.length <= 1 || arguments[1] === undefined ? this.buf : arguments[1]; + + if (str.length === 1) { + return buf[buf.length - 1] === str; + } else { + return buf.slice(-str.length) === str; + } + }; + + /** + * Test if a character is last in the buffer. + */ + + Buffer.prototype.isLast = function isLast(cha) { + if (this.format.compact) return false; + return this._isLast(cha); + }; + + Buffer.prototype._isLast = function _isLast(cha) { + var buf = this.buf; + var last = buf[buf.length - 1]; + + if (Array.isArray(cha)) { + return _lodashCollectionIncludes2["default"](cha, last); + } else { + return cha === last; + } + }; + + return Buffer; +})(); + +exports["default"] = Buffer; +module.exports = exports["default"]; +},{"446":446,"531":531,"535":535,"586":586,"608":608}],19:[function(_dereq_,module,exports){ +/** + * Print File.program + */ + +"use strict"; + +exports.__esModule = true; +exports.File = File; +exports.Program = Program; +exports.BlockStatement = BlockStatement; +exports.Noop = Noop; + +function File(node, print) { + print.plain(node.program); +} + +/** + * Print all nodes in a Program.body. + */ + +function Program(node, print) { + print.sequence(node.body); +} + +/** + * Print BlockStatement, collapses empty blocks, prints body. + */ + +function BlockStatement(node, print) { + this.push("{"); + if (node.body.length) { + this.newline(); + print.sequence(node.body, { indent: true }); + if (!this.format.retainLines) this.removeLast("\n"); + this.rightBrace(); + } else { + print.printInnerComments(); + this.push("}"); + } +} + +/** + * What is my purpose? + * Why am I here? + * Why are any of us here? + * Does any of this really matter? + */ + +function Noop() {} +},{}],20:[function(_dereq_,module,exports){ +/** + * Print ClassDeclaration, prints decorators, typeParameters, extends, implements, and body. + */ + +"use strict"; + +exports.__esModule = true; +exports.ClassDeclaration = ClassDeclaration; +exports.ClassBody = ClassBody; +exports.ClassProperty = ClassProperty; +exports.MethodDefinition = MethodDefinition; + +function ClassDeclaration(node, print) { + print.list(node.decorators, { separator: "" }); + this.push("class"); + + if (node.id) { + this.push(" "); + print.plain(node.id); + } + + print.plain(node.typeParameters); + + if (node.superClass) { + this.push(" extends "); + print.plain(node.superClass); + print.plain(node.superTypeParameters); + } + + if (node["implements"]) { + this.push(" implements "); + print.join(node["implements"], { separator: ", " }); + } + + this.space(); + print.plain(node.body); +} + +/** + * Alias ClassDeclaration printer as ClassExpression. + */ + +exports.ClassExpression = ClassDeclaration; + +/** + * Print ClassBody, collapses empty blocks, prints body. + */ + +function ClassBody(node, print) { + this.push("{"); + if (node.body.length === 0) { + print.printInnerComments(); + this.push("}"); + } else { + this.newline(); + + this.indent(); + print.sequence(node.body); + this.dedent(); + + this.rightBrace(); + } +} + +/** + * Print ClassProperty, prints decorators, static, key, typeAnnotation, and value. + * Also: semicolons, deal with it. + */ + +function ClassProperty(node, print) { + print.list(node.decorators, { separator: "" }); + + if (node["static"]) this.push("static "); + print.plain(node.key); + print.plain(node.typeAnnotation); + if (node.value) { + this.space(); + this.push("="); + this.space(); + print.plain(node.value); + } + this.semicolon(); +} + +/** + * Print MethodDefinition, prints decorations, static, and method. + */ + +function MethodDefinition(node, print) { + print.list(node.decorators, { separator: "" }); + + if (node["static"]) { + this.push("static "); + } + + this._method(node, print); +} +},{}],21:[function(_dereq_,module,exports){ +/** + * Prints ComprehensionBlock, prints left and right. + */ + +"use strict"; + +exports.__esModule = true; +exports.ComprehensionBlock = ComprehensionBlock; +exports.ComprehensionExpression = ComprehensionExpression; + +function ComprehensionBlock(node, print) { + this.keyword("for"); + this.push("("); + print.plain(node.left); + this.push(" of "); + print.plain(node.right); + this.push(")"); +} + +/** + * Prints ComprehensionExpression, prints blocks, filter, and body. Handles generators. + */ + +function ComprehensionExpression(node, print) { + this.push(node.generator ? "(" : "["); + + print.join(node.blocks, { separator: " " }); + this.space(); + + if (node.filter) { + this.keyword("if"); + this.push("("); + print.plain(node.filter); + this.push(")"); + this.space(); + } + + print.plain(node.body); + + this.push(node.generator ? ")" : "]"); +} +},{}],22:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +exports.UnaryExpression = UnaryExpression; +exports.DoExpression = DoExpression; +exports.ParenthesizedExpression = ParenthesizedExpression; +exports.UpdateExpression = UpdateExpression; +exports.ConditionalExpression = ConditionalExpression; +exports.NewExpression = NewExpression; +exports.SequenceExpression = SequenceExpression; +exports.ThisExpression = ThisExpression; +exports.Super = Super; +exports.Decorator = Decorator; +exports.CallExpression = CallExpression; +exports.EmptyStatement = EmptyStatement; +exports.ExpressionStatement = ExpressionStatement; +exports.AssignmentPattern = AssignmentPattern; +exports.AssignmentExpression = AssignmentExpression; +exports.BindExpression = BindExpression; +exports.MemberExpression = MemberExpression; +exports.MetaProperty = MetaProperty; +// istanbul ignore next + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _isInteger = _dereq_(434); + +var _isInteger2 = _interopRequireDefault(_isInteger); + +var _lodashLangIsNumber = _dereq_(535); + +var _lodashLangIsNumber2 = _interopRequireDefault(_lodashLangIsNumber); + +var _node = _dereq_(31); + +var _node2 = _interopRequireDefault(_node); + +var _types = _dereq_(179); + +var t = _interopRequireWildcard(_types); + +/** + * RegExp for testing scientific notation in literals. + */ + +var SCIENTIFIC_NOTATION = /e/i; +var ZERO_DECIMAL_INTEGER = /\.0+$/; + +/** + * RegExp for testing if a numeric literal is + * a BinaryIntegerLiteral, OctalIntegerLiteral or HexIntegerLiteral. + */ + +var NON_DECIMAL_NUMERIC_LITERAL = /^0(b|o|x)/i; + +/** + * Prints UnaryExpression, prints operator and argument. + */ + +function UnaryExpression(node, print) { + var needsSpace = /[a-z]$/.test(node.operator); + var arg = node.argument; + + if (t.isUpdateExpression(arg) || t.isUnaryExpression(arg)) { + needsSpace = true; + } + + if (t.isUnaryExpression(arg) && arg.operator === "!") { + needsSpace = false; + } + + this.push(node.operator); + if (needsSpace) this.push(" "); + print.plain(node.argument); +} + +/** + * Prints DoExpression, prints body. + */ + +function DoExpression(node, print) { + this.push("do"); + this.space(); + print.plain(node.body); +} + +/** + * Prints ParenthesizedExpression, prints expression. + */ + +function ParenthesizedExpression(node, print) { + this.push("("); + print.plain(node.expression); + this.push(")"); +} + +/** + * Prints UpdateExpression, prints operator and argument. + */ + +function UpdateExpression(node, print) { + if (node.prefix) { + this.push(node.operator); + print.plain(node.argument); + } else { + print.plain(node.argument); + this.push(node.operator); + } +} + +/** + * Prints ConditionalExpression, prints test, consequent, and alternate. + */ + +function ConditionalExpression(node, print) { + print.plain(node.test); + this.space(); + this.push("?"); + this.space(); + print.plain(node.consequent); + this.space(); + this.push(":"); + this.space(); + print.plain(node.alternate); +} + +/** + * Prints NewExpression, prints callee and arguments. + */ + +function NewExpression(node, print) { + this.push("new "); + print.plain(node.callee); + this.push("("); + print.list(node.arguments); + this.push(")"); +} + +/** + * Prints SequenceExpression.expressions. + */ + +function SequenceExpression(node, print) { + print.list(node.expressions); +} + +/** + * Prints ThisExpression. + */ + +function ThisExpression() { + this.push("this"); +} + +/** + * Prints Super. + */ + +function Super() { + this.push("super"); +} + +/** + * Prints Decorator, prints expression. + */ + +function Decorator(node, print) { + this.push("@"); + print.plain(node.expression); + this.newline(); +} + +/** + * Prints CallExpression, prints callee and arguments. + */ + +function CallExpression(node, print) { + print.plain(node.callee); + + this.push("("); + + var isPrettyCall = node._prettyCall && !this.format.retainLines && !this.format.compact; + + var separator; + if (isPrettyCall) { + separator = ",\n"; + this.newline(); + this.indent(); + } + + print.list(node.arguments, { separator: separator }); + + if (isPrettyCall) { + this.newline(); + this.dedent(); + } + + this.push(")"); +} + +/** + * Builds yield or await expression printer. + * Prints delegate, all, and argument. + */ + +var buildYieldAwait = function buildYieldAwait(keyword) { + return function (node, print) { + this.push(keyword); + + if (node.delegate || node.all) { + this.push("*"); + } + + if (node.argument) { + this.push(" "); + var terminatorState = this.startTerminatorless(); + print.plain(node.argument); + this.endTerminatorless(terminatorState); + } + }; +}; + +/** + * Create YieldExpression and AwaitExpression printers. + */ + +var YieldExpression = buildYieldAwait("yield"); +exports.YieldExpression = YieldExpression; +var AwaitExpression = buildYieldAwait("await"); + +exports.AwaitExpression = AwaitExpression; +/** + * Prints EmptyStatement. + */ + +function EmptyStatement() { + this.semicolon(); +} + +/** + * Prints ExpressionStatement, prints expression. + */ + +function ExpressionStatement(node, print) { + print.plain(node.expression); + this.semicolon(); +} + +/** + * Prints AssignmentPattern, prints left and right. + */ + +function AssignmentPattern(node, print) { + print.plain(node.left); + this.push(" = "); + print.plain(node.right); +} + +/** + * Prints AssignmentExpression, prints left, operator, and right. + */ + +function AssignmentExpression(node, print, parent) { + // Somewhere inside a for statement `init` node but doesn't usually + // needs a paren except for `in` expressions: `for (a in b ? a : b;;)` + var parens = this._inForStatementInit && node.operator === "in" && !_node2["default"].needsParens(node, parent); + + if (parens) { + this.push("("); + } + + // todo: add cases where the spaces can be dropped when in compact mode + print.plain(node.left); + + var spaces = node.operator === "in" || node.operator === "instanceof"; + spaces = true; // todo: https://github.com/babel/babel/issues/1835 + this.space(spaces); + + this.push(node.operator); + + if (!spaces) { + // space is mandatory to avoid outputting regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new Error('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var plType + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + plType = stateChar + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + re += ')' + var pl = patternListStack.pop() + plType = pl.type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case '!': + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length + break + case '?': + case '+': + case '*': + re += plType + break + case '@': break // the default anyway + } + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + var regExp = new RegExp('^' + re + '$', flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + +},{"220":220,"9":9}],556:[function(_dereq_,module,exports){ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options){ + options = options || {}; + if ('string' == typeof val) return parse(val); + return options.long + ? long(val) + : short(val); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = '' + str; + if (str.length > 10000) return; + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + if (!match) return; + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function short(ms) { + if (ms >= d) return Math.round(ms / d) + 'd'; + if (ms >= h) return Math.round(ms / h) + 'h'; + if (ms >= m) return Math.round(ms / m) + 'm'; + if (ms >= s) return Math.round(ms / s) + 's'; + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function long(ms) { + return plural(ms, d, 'day') + || plural(ms, h, 'hour') + || plural(ms, m, 'minute') + || plural(ms, s, 'second') + || ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) return; + if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; + return Math.ceil(ms / n) + ' ' + name + 's'; +} + +},{}],557:[function(_dereq_,module,exports){ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; + +},{}],558:[function(_dereq_,module,exports){ +'use strict'; +var fs = _dereq_(3) + +module.exports = function (pth, cb) { + var fn = typeof fs.access === 'function' ? fs.access : fs.stat; + + fn(pth, function (err) { + cb(null, !err); + }); +}; + +module.exports.sync = function (pth) { + var fn = typeof fs.accessSync === 'function' ? fs.accessSync : fs.statSync; + + try { + fn(pth); + return true; + } catch (err) { + return false; + } +}; + +},{"3":3}],559:[function(_dereq_,module,exports){ +(function (process){ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +}; + +function win32(path) { + // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = !!device && device.charAt(1) !== ':'; + + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; + +}).call(this,_dereq_(10)) +},{"10":10}],560:[function(_dereq_,module,exports){ +"use strict"; + +var originalObject = Object; +var originalDefProp = Object.defineProperty; +var originalCreate = Object.create; + +function defProp(obj, name, value) { + if (originalDefProp) try { + originalDefProp.call(originalObject, obj, name, { value: value }); + } catch (definePropertyIsBrokenInIE8) { + obj[name] = value; + } else { + obj[name] = value; + } +} + +// For functions that will be invoked using .call or .apply, we need to +// define those methods on the function objects themselves, rather than +// inheriting them from Function.prototype, so that a malicious or clumsy +// third party cannot interfere with the functionality of this module by +// redefining Function.prototype.call or .apply. +function makeSafeToCall(fun) { + if (fun) { + defProp(fun, "call", fun.call); + defProp(fun, "apply", fun.apply); + } + return fun; +} + +makeSafeToCall(originalDefProp); +makeSafeToCall(originalCreate); + +var hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty); +var numToStr = makeSafeToCall(Number.prototype.toString); +var strSlice = makeSafeToCall(String.prototype.slice); + +var cloner = function(){}; +function create(prototype) { + if (originalCreate) { + return originalCreate.call(originalObject, prototype); + } + cloner.prototype = prototype || null; + return new cloner; +} + +var rand = Math.random; +var uniqueKeys = create(null); + +function makeUniqueKey() { + // Collisions are highly unlikely, but this module is in the business of + // making guarantees rather than safe bets. + do var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2)); + while (hasOwn.call(uniqueKeys, uniqueKey)); + return uniqueKeys[uniqueKey] = uniqueKey; +} + +function internString(str) { + var obj = {}; + obj[str] = true; + return Object.keys(obj)[0]; +} + +// External users might find this function useful, but it is not necessary +// for the typical use of this module. +defProp(exports, "makeUniqueKey", makeUniqueKey); + +// Object.getOwnPropertyNames is the only way to enumerate non-enumerable +// properties, so if we wrap it to ignore our secret keys, there should be +// no way (except guessing) to access those properties. +var originalGetOPNs = Object.getOwnPropertyNames; +Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + for (var names = originalGetOPNs(object), + src = 0, + dst = 0, + len = names.length; + src < len; + ++src) { + if (!hasOwn.call(uniqueKeys, names[src])) { + if (src > dst) { + names[dst] = names[src]; + } + ++dst; + } + } + names.length = dst; + return names; +}; + +function defaultCreatorFn(object) { + return create(null); +} + +function makeAccessor(secretCreatorFn) { + var brand = makeUniqueKey(); + var passkey = create(null); + + secretCreatorFn = secretCreatorFn || defaultCreatorFn; + + function register(object) { + var secret; // Created lazily. + + function vault(key, forget) { + // Only code that has access to the passkey can retrieve (or forget) + // the secret object. + if (key === passkey) { + return forget + ? secret = null + : secret || (secret = secretCreatorFn(object)); + } + } + + defProp(object, brand, vault); + } + + function accessor(object) { + if (!hasOwn.call(object, brand)) + register(object); + return object[brand](passkey); + } + + accessor.forget = function(object) { + if (hasOwn.call(object, brand)) + object[brand](passkey, true); + }; + + return accessor; +} + +defProp(exports, "makeAccessor", makeAccessor); + +},{}],561:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var types = _dereq_(569); +var n = types.namedTypes; +var isArray = types.builtInTypes.array; +var isObject = types.builtInTypes.object; +var linesModule = _dereq_(563); +var fromString = linesModule.fromString; +var Lines = linesModule.Lines; +var concat = linesModule.concat; +var util = _dereq_(570); +var comparePos = util.comparePos; +var childNodesCacheKey = _dereq_(560).makeUniqueKey(); + +// TODO Move a non-caching implementation of this function into ast-types, +// and implement a caching wrapper function here. +function getSortedChildNodes(node, resultArray) { + if (!node) { + return; + } + + // The .loc checks below are sensitive to some of the problems that + // are fixed by this utility function. Specifically, if it decides to + // set node.loc to null, indicating that the node's .loc information + // is unreliable, then we don't want to add node to the resultArray. + util.fixFaultyLocations(node); + + if (resultArray) { + if (n.Node.check(node) && + n.SourceLocation.check(node.loc)) { + // This reverse insertion sort almost always takes constant + // time because we almost always (maybe always?) append the + // nodes in order anyway. + for (var i = resultArray.length - 1; i >= 0; --i) { + if (comparePos(resultArray[i].loc.end, + node.loc.start) <= 0) { + break; + } + } + resultArray.splice(i + 1, 0, node); + return; + } + } else if (node[childNodesCacheKey]) { + return node[childNodesCacheKey]; + } + + var names; + if (isArray.check(node)) { + names = Object.keys(node); + } else if (isObject.check(node)) { + names = types.getFieldNames(node); + } else { + return; + } + + if (!resultArray) { + Object.defineProperty(node, childNodesCacheKey, { + value: resultArray = [], + enumerable: false + }); + } + + for (var i = 0, nameCount = names.length; i < nameCount; ++i) { + getSortedChildNodes(node[names[i]], resultArray); + } + + return resultArray; +} + +// As efficiently as possible, decorate the comment object with +// .precedingNode, .enclosingNode, and/or .followingNode properties, at +// least one of which is guaranteed to be defined. +function decorateComment(node, comment) { + var childNodes = getSortedChildNodes(node); + + // Time to dust off the old binary search robes and wizard hat. + var left = 0, right = childNodes.length; + while (left < right) { + var middle = (left + right) >> 1; + var child = childNodes[middle]; + + if (comparePos(child.loc.start, comment.loc.start) <= 0 && + comparePos(comment.loc.end, child.loc.end) <= 0) { + // The comment is completely contained by this child node. + decorateComment(comment.enclosingNode = child, comment); + return; // Abandon the binary search at this level. + } + + if (comparePos(child.loc.end, comment.loc.start) <= 0) { + // This child node falls completely before the comment. + // Because we will never consider this node or any nodes + // before it again, this node must be the closest preceding + // node we have encountered so far. + var precedingNode = child; + left = middle + 1; + continue; + } + + if (comparePos(comment.loc.end, child.loc.start) <= 0) { + // This child node falls completely after the comment. + // Because we will never consider this node or any nodes after + // it again, this node must be the closest following node we + // have encountered so far. + var followingNode = child; + right = middle; + continue; + } + + throw new Error("Comment location overlaps with node location"); + } + + if (precedingNode) { + comment.precedingNode = precedingNode; + } + + if (followingNode) { + comment.followingNode = followingNode; + } +} + +exports.attach = function(comments, ast, lines) { + if (!isArray.check(comments)) { + return; + } + + var tiesToBreak = []; + + comments.forEach(function(comment) { + comment.loc.lines = lines; + decorateComment(ast, comment); + + var pn = comment.precedingNode; + var en = comment.enclosingNode; + var fn = comment.followingNode; + + if (pn && fn) { + var tieCount = tiesToBreak.length; + if (tieCount > 0) { + var lastTie = tiesToBreak[tieCount - 1]; + + assert.strictEqual( + lastTie.precedingNode === comment.precedingNode, + lastTie.followingNode === comment.followingNode + ); + + if (lastTie.followingNode !== comment.followingNode) { + breakTies(tiesToBreak, lines); + } + } + + tiesToBreak.push(comment); + + } else if (pn) { + // No contest: we have a trailing comment. + breakTies(tiesToBreak, lines); + addTrailingComment(pn, comment); + + } else if (fn) { + // No contest: we have a leading comment. + breakTies(tiesToBreak, lines); + addLeadingComment(fn, comment); + + } else if (en) { + // The enclosing node has no child nodes at all, so what we + // have here is a dangling comment, e.g. [/* crickets */]. + breakTies(tiesToBreak, lines); + addDanglingComment(en, comment); + + } else { + throw new Error("AST contains no nodes at all?"); + } + }); + + breakTies(tiesToBreak, lines); + + comments.forEach(function(comment) { + // These node references were useful for breaking ties, but we + // don't need them anymore, and they create cycles in the AST that + // may lead to infinite recursion if we don't delete them here. + delete comment.precedingNode; + delete comment.enclosingNode; + delete comment.followingNode; + }); +}; + +function breakTies(tiesToBreak, lines) { + var tieCount = tiesToBreak.length; + if (tieCount === 0) { + return; + } + + var pn = tiesToBreak[0].precedingNode; + var fn = tiesToBreak[0].followingNode; + var gapEndPos = fn.loc.start; + + // Iterate backwards through tiesToBreak, examining the gaps + // between the tied comments. In order to qualify as leading, a + // comment must be separated from fn by an unbroken series of + // whitespace-only gaps (or other comments). + for (var indexOfFirstLeadingComment = tieCount; + indexOfFirstLeadingComment > 0; + --indexOfFirstLeadingComment) { + var comment = tiesToBreak[indexOfFirstLeadingComment - 1]; + assert.strictEqual(comment.precedingNode, pn); + assert.strictEqual(comment.followingNode, fn); + + var gap = lines.sliceString(comment.loc.end, gapEndPos); + if (/\S/.test(gap)) { + // The gap string contained something other than whitespace. + break; + } + + gapEndPos = comment.loc.start; + } + + while (indexOfFirstLeadingComment <= tieCount && + (comment = tiesToBreak[indexOfFirstLeadingComment]) && + // If the comment is a //-style comment and indented more + // deeply than the node itself, reconsider it as trailing. + comment.type === "Line" && + comment.loc.start.column > fn.loc.start.column) { + ++indexOfFirstLeadingComment; + } + + tiesToBreak.forEach(function(comment, i) { + if (i < indexOfFirstLeadingComment) { + addTrailingComment(pn, comment); + } else { + addLeadingComment(fn, comment); + } + }); + + tiesToBreak.length = 0; +} + +function addCommentHelper(node, comment) { + var comments = node.comments || (node.comments = []); + comments.push(comment); +} + +function addLeadingComment(node, comment) { + comment.leading = true; + comment.trailing = false; + addCommentHelper(node, comment); +} + +function addDanglingComment(node, comment) { + comment.leading = false; + comment.trailing = false; + addCommentHelper(node, comment); +} + +function addTrailingComment(node, comment) { + comment.leading = false; + comment.trailing = true; + addCommentHelper(node, comment); +} + +function printLeadingComment(commentPath, print) { + var comment = commentPath.getValue(); + n.Comment.assert(comment); + + var loc = comment.loc; + var lines = loc && loc.lines; + var parts = [print(commentPath)]; + + if (comment.trailing) { + // When we print trailing comments as leading comments, we don't + // want to bring any trailing spaces along. + parts.push("\n"); + + } else if (lines instanceof Lines) { + var trailingSpace = lines.slice( + loc.end, + lines.skipSpaces(loc.end) + ); + + if (trailingSpace.length === 1) { + // If the trailing space contains no newlines, then we want to + // preserve it exactly as we found it. + parts.push(trailingSpace); + } else { + // If the trailing space contains newlines, then replace it + // with just that many newlines, with all other spaces removed. + parts.push(new Array(trailingSpace.length).join("\n")); + } + + } else { + parts.push("\n"); + } + + return concat(parts); +} + +function printTrailingComment(commentPath, print) { + var comment = commentPath.getValue(commentPath); + n.Comment.assert(comment); + + var loc = comment.loc; + var lines = loc && loc.lines; + var parts = []; + + if (lines instanceof Lines) { + var fromPos = lines.skipSpaces(loc.start, true) || lines.firstPos(); + var leadingSpace = lines.slice(fromPos, loc.start); + + if (leadingSpace.length === 1) { + // If the leading space contains no newlines, then we want to + // preserve it exactly as we found it. + parts.push(leadingSpace); + } else { + // If the leading space contains newlines, then replace it + // with just that many newlines, sans all other spaces. + parts.push(new Array(leadingSpace.length).join("\n")); + } + } + + parts.push(print(commentPath)); + + return concat(parts); +} + +exports.printComments = function(path, print) { + var value = path.getValue(); + var innerLines = print(path); + var comments = n.Node.check(value) && + types.getFieldValue(value, "comments"); + + if (!comments || comments.length === 0) { + return innerLines; + } + + var leadingParts = []; + var trailingParts = [innerLines]; + + path.each(function(commentPath) { + var comment = commentPath.getValue(); + var leading = types.getFieldValue(comment, "leading"); + var trailing = types.getFieldValue(comment, "trailing"); + + if (leading || (trailing && comment.type !== "Block")) { + leadingParts.push(printLeadingComment(commentPath, print)); + } else if (trailing) { + assert.strictEqual(comment.type, "Block"); + trailingParts.push(printTrailingComment(commentPath, print)); + } + }, "comments"); + + leadingParts.push.apply(leadingParts, trailingParts); + return concat(leadingParts); +}; + +},{"1":1,"560":560,"563":563,"569":569,"570":570}],562:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var types = _dereq_(569); +var n = types.namedTypes; +var Node = n.Node; +var isArray = types.builtInTypes.array; +var isNumber = types.builtInTypes.number; + +function FastPath(value) { + assert.ok(this instanceof FastPath); + this.stack = [value]; +} + +var FPp = FastPath.prototype; +module.exports = FastPath; + +// Static convenience function for coercing a value to a FastPath. +FastPath.from = function(obj) { + if (obj instanceof FastPath) { + // Return a defensive copy of any existing FastPath instances. + return obj.copy(); + } + + if (obj instanceof types.NodePath) { + // For backwards compatibility, unroll NodePath instances into + // lightweight FastPath [..., name, value] stacks. + var copy = Object.create(FastPath.prototype); + var stack = [obj.value]; + for (var pp; (pp = obj.parentPath); obj = pp) + stack.push(obj.name, pp.value); + copy.stack = stack.reverse(); + return copy; + } + + // Otherwise use obj as the value of the new FastPath instance. + return new FastPath(obj); +}; + +FPp.copy = function copy() { + var copy = Object.create(FastPath.prototype); + copy.stack = this.stack.slice(0); + return copy; +}; + +// The name of the current property is always the penultimate element of +// this.stack, and always a String. +FPp.getName = function getName() { + var s = this.stack; + var len = s.length; + if (len > 1) { + return s[len - 2]; + } + // Since the name is always a string, null is a safe sentinel value to + // return if we do not know the name of the (root) value. + return null; +}; + +// The value of the current property is always the final element of +// this.stack. +FPp.getValue = function getValue() { + var s = this.stack; + return s[s.length - 1]; +}; + +function getNodeHelper(path, count) { + var s = path.stack; + + for (var i = s.length - 1; i >= 0; i -= 2) { + var value = s[i]; + if (n.Node.check(value) && --count < 0) { + return value; + } + } + + return null; +} + +FPp.getNode = function getNode(count) { + return getNodeHelper(this, ~~count); +}; + +FPp.getParentNode = function getParentNode(count) { + return getNodeHelper(this, ~~count + 1); +}; + +// The length of the stack can be either even or odd, depending on whether +// or not we have a name for the root value. The difference between the +// index of the root value and the index of the final value is always +// even, though, which allows us to return the root value in constant time +// (i.e. without iterating backwards through the stack). +FPp.getRootValue = function getRootValue() { + var s = this.stack; + if (s.length % 2 === 0) { + return s[1]; + } + return s[0]; +}; + +// Temporarily push properties named by string arguments given after the +// callback function onto this.stack, then call the callback with a +// reference to this (modified) FastPath object. Note that the stack will +// be restored to its original state after the callback is finished, so it +// is probably a mistake to retain a reference to the path. +FPp.call = function call(callback/*, name1, name2, ... */) { + var s = this.stack; + var origLen = s.length; + var value = s[origLen - 1]; + var argc = arguments.length; + for (var i = 1; i < argc; ++i) { + var name = arguments[i]; + value = value[name]; + s.push(name, value); + } + var result = callback(this); + s.length = origLen; + return result; +}; + +// Similar to FastPath.prototype.call, except that the value obtained by +// accessing this.getValue()[name1][name2]... should be array-like. The +// callback will be called with a reference to this path object for each +// element of the array. +FPp.each = function each(callback/*, name1, name2, ... */) { + var s = this.stack; + var origLen = s.length; + var value = s[origLen - 1]; + var argc = arguments.length; + + for (var i = 1; i < argc; ++i) { + var name = arguments[i]; + value = value[name]; + s.push(name, value); + } + + for (var i = 0; i < value.length; ++i) { + if (i in value) { + s.push(i, value[i]); + // If the callback needs to know the value of i, call + // path.getName(), assuming path is the parameter name. + callback(this); + s.length -= 2; + } + } + + s.length = origLen; +}; + +// Similar to FastPath.prototype.each, except that the results of the +// callback function invocations are stored in an array and returned at +// the end of the iteration. +FPp.map = function map(callback/*, name1, name2, ... */) { + var s = this.stack; + var origLen = s.length; + var value = s[origLen - 1]; + var argc = arguments.length; + + for (var i = 1; i < argc; ++i) { + var name = arguments[i]; + value = value[name]; + s.push(name, value); + } + + var result = new Array(value.length); + + for (var i = 0; i < value.length; ++i) { + if (i in value) { + s.push(i, value[i]); + result[i] = callback(this, i); + s.length -= 2; + } + } + + s.length = origLen; + + return result; +}; + +// Inspired by require("ast-types").NodePath.prototype.needsParens, but +// more efficient because we're iterating backwards through a stack. +FPp.needsParens = function(assumeExpressionContext) { + var parent = this.getParentNode(); + if (!parent) { + return false; + } + + var name = this.getName(); + var node = this.getNode(); + + // If the value of this path is some child of a Node and not a Node + // itself, then it doesn't need parentheses. Only Node objects (in + // fact, only Expression nodes) need parentheses. + if (this.getValue() !== node) { + return false; + } + + // Only expressions need parentheses. + if (!n.Expression.check(node)) { + return false; + } + + // Identifiers never need parentheses. + if (node.type === "Identifier") { + return false; + } + + if (parent.type === "ParenthesizedExpression") { + return false; + } + + switch (node.type) { + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + return parent.type === "MemberExpression" + && name === "object" + && parent.object === node; + + case "BinaryExpression": + case "LogicalExpression": + switch (parent.type) { + case "CallExpression": + return name === "callee" + && parent.callee === node; + + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + return true; + + case "MemberExpression": + return name === "object" + && parent.object === node; + + case "BinaryExpression": + case "LogicalExpression": + var po = parent.operator; + var pp = PRECEDENCE[po]; + var no = node.operator; + var np = PRECEDENCE[no]; + + if (pp > np) { + return true; + } + + if (pp === np && name === "right") { + assert.strictEqual(parent.right, node); + return true; + } + + default: + return false; + } + + case "SequenceExpression": + switch (parent.type) { + case "ForStatement": + // Although parentheses wouldn't hurt around sequence + // expressions in the head of for loops, traditional style + // dictates that e.g. i++, j++ should not be wrapped with + // parentheses. + return false; + + case "ExpressionStatement": + return name !== "expression"; + + default: + // Otherwise err on the side of overparenthesization, adding + // explicit exceptions above if this proves overzealous. + return true; + } + + case "YieldExpression": + switch (parent.type) { + case "BinaryExpression": + case "LogicalExpression": + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + case "CallExpression": + case "MemberExpression": + case "NewExpression": + case "ConditionalExpression": + case "YieldExpression": + return true; + + default: + return false; + } + + case "Literal": + return parent.type === "MemberExpression" + && isNumber.check(node.value) + && name === "object" + && parent.object === node; + + case "AssignmentExpression": + case "ConditionalExpression": + switch (parent.type) { + case "UnaryExpression": + case "SpreadElement": + case "SpreadProperty": + case "BinaryExpression": + case "LogicalExpression": + return true; + + case "CallExpression": + return name === "callee" + && parent.callee === node; + + case "ConditionalExpression": + return name === "test" + && parent.test === node; + + case "MemberExpression": + return name === "object" + && parent.object === node; + + default: + return false; + } + + case "ArrowFunctionExpression": + return isBinary(parent); + + case "ObjectExpression": + if (parent.type === "ArrowFunctionExpression" && + name === "body") { + return true; + } + + default: + if (parent.type === "NewExpression" && + name === "callee" && + parent.callee === node) { + return containsCallExpression(node); + } + } + + if (assumeExpressionContext !== true && + !this.canBeFirstInStatement() && + this.firstInStatement()) + return true; + + return false; +}; + +function isBinary(node) { + return n.BinaryExpression.check(node) + || n.LogicalExpression.check(node); +} + +function isUnaryLike(node) { + return n.UnaryExpression.check(node) + // I considered making SpreadElement and SpreadProperty subtypes + // of UnaryExpression, but they're not really Expression nodes. + || (n.SpreadElement && n.SpreadElement.check(node)) + || (n.SpreadProperty && n.SpreadProperty.check(node)); +} + +var PRECEDENCE = {}; +[["||"], + ["&&"], + ["|"], + ["^"], + ["&"], + ["==", "===", "!=", "!=="], + ["<", ">", "<=", ">=", "in", "instanceof"], + [">>", "<<", ">>>"], + ["+", "-"], + ["*", "/", "%"] +].forEach(function(tier, i) { + tier.forEach(function(op) { + PRECEDENCE[op] = i; + }); +}); + +function containsCallExpression(node) { + if (n.CallExpression.check(node)) { + return true; + } + + if (isArray.check(node)) { + return node.some(containsCallExpression); + } + + if (n.Node.check(node)) { + return types.someField(node, function(name, child) { + return containsCallExpression(child); + }); + } + + return false; +} + +FPp.canBeFirstInStatement = function() { + var node = this.getNode(); + return !n.FunctionExpression.check(node) + && !n.ObjectExpression.check(node); +}; + +FPp.firstInStatement = function() { + var s = this.stack; + var parentName, parent; + var childName, child; + + for (var i = s.length - 1; i >= 0; i -= 2) { + if (n.Node.check(s[i])) { + childName = parentName; + child = parent; + parentName = s[i - 1]; + parent = s[i]; + } + + if (!parent || !child) { + continue; + } + + if (n.BlockStatement.check(parent) && + parentName === "body" && + childName === 0) { + assert.strictEqual(parent.body[0], child); + return true; + } + + if (n.ExpressionStatement.check(parent) && + childName === "expression") { + assert.strictEqual(parent.expression, child); + return true; + } + + if (n.SequenceExpression.check(parent) && + parentName === "expressions" && + childName === 0) { + assert.strictEqual(parent.expressions[0], child); + continue; + } + + if (n.CallExpression.check(parent) && + childName === "callee") { + assert.strictEqual(parent.callee, child); + continue; + } + + if (n.MemberExpression.check(parent) && + childName === "object") { + assert.strictEqual(parent.object, child); + continue; + } + + if (n.ConditionalExpression.check(parent) && + childName === "test") { + assert.strictEqual(parent.test, child); + continue; + } + + if (isBinary(parent) && + childName === "left") { + assert.strictEqual(parent.left, child); + continue; + } + + if (n.UnaryExpression.check(parent) && + !parent.prefix && + childName === "argument") { + assert.strictEqual(parent.argument, child); + continue; + } + + return false; + } + + return true; +}; + +},{"1":1,"569":569}],563:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var sourceMap = _dereq_(601); +var normalizeOptions = _dereq_(565).normalize; +var secretKey = _dereq_(560).makeUniqueKey(); +var types = _dereq_(569); +var isString = types.builtInTypes.string; +var comparePos = _dereq_(570).comparePos; +var Mapping = _dereq_(564); + +// Goals: +// 1. Minimize new string creation. +// 2. Keep (de)identation O(lines) time. +// 3. Permit negative indentations. +// 4. Enforce immutability. +// 5. No newline characters. + +function getSecret(lines) { + return lines[secretKey]; +} + +function Lines(infos, sourceFileName) { + assert.ok(this instanceof Lines); + assert.ok(infos.length > 0); + + if (sourceFileName) { + isString.assert(sourceFileName); + } else { + sourceFileName = null; + } + + Object.defineProperty(this, secretKey, { + value: { + infos: infos, + mappings: [], + name: sourceFileName, + cachedSourceMap: null + } + }); + + if (sourceFileName) { + getSecret(this).mappings.push(new Mapping(this, { + start: this.firstPos(), + end: this.lastPos() + })); + } +} + +// Exposed for instanceof checks. The fromString function should be used +// to create new Lines objects. +exports.Lines = Lines; +var Lp = Lines.prototype; + +// These properties used to be assigned to each new object in the Lines +// constructor, but we can more efficiently stuff them into the secret and +// let these lazy accessors compute their values on-the-fly. +Object.defineProperties(Lp, { + length: { + get: function() { + return getSecret(this).infos.length; + } + }, + + name: { + get: function() { + return getSecret(this).name; + } + } +}); + +function copyLineInfo(info) { + return { + line: info.line, + indent: info.indent, + sliceStart: info.sliceStart, + sliceEnd: info.sliceEnd + }; +} + +var fromStringCache = {}; +var hasOwn = fromStringCache.hasOwnProperty; +var maxCacheKeyLen = 10; + +function countSpaces(spaces, tabWidth) { + var count = 0; + var len = spaces.length; + + for (var i = 0; i < len; ++i) { + switch (spaces.charCodeAt(i)) { + case 9: // '\t' + assert.strictEqual(typeof tabWidth, "number"); + assert.ok(tabWidth > 0); + + var next = Math.ceil(count / tabWidth) * tabWidth; + if (next === count) { + count += tabWidth; + } else { + count = next; + } + + break; + + case 11: // '\v' + case 12: // '\f' + case 13: // '\r' + case 0xfeff: // zero-width non-breaking space + // These characters contribute nothing to indentation. + break; + + case 32: // ' ' + default: // Treat all other whitespace like ' '. + count += 1; + break; + } + } + + return count; +} +exports.countSpaces = countSpaces; + +var leadingSpaceExp = /^\s*/; + +// As specified here: http://www.ecma-international.org/ecma-262/6.0/#sec-line-terminators +var lineTerminatorSeqExp = + /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/; + +/** + * @param {Object} options - Options object that configures printing. + */ +function fromString(string, options) { + if (string instanceof Lines) + return string; + + string += ""; + + var tabWidth = options && options.tabWidth; + var tabless = string.indexOf("\t") < 0; + var cacheable = !options && tabless && (string.length <= maxCacheKeyLen); + + assert.ok(tabWidth || tabless, "No tab width specified but encountered tabs in string\n" + string); + + if (cacheable && hasOwn.call(fromStringCache, string)) + return fromStringCache[string]; + + var lines = new Lines(string.split(lineTerminatorSeqExp).map(function(line) { + var spaces = leadingSpaceExp.exec(line)[0]; + return { + line: line, + indent: countSpaces(spaces, tabWidth), + sliceStart: spaces.length, + sliceEnd: line.length + }; + }), normalizeOptions(options).sourceFileName); + + if (cacheable) + fromStringCache[string] = lines; + + return lines; +} +exports.fromString = fromString; + +function isOnlyWhitespace(string) { + return !/\S/.test(string); +} + +Lp.toString = function(options) { + return this.sliceString(this.firstPos(), this.lastPos(), options); +}; + +Lp.getSourceMap = function(sourceMapName, sourceRoot) { + if (!sourceMapName) { + // Although we could make up a name or generate an anonymous + // source map, instead we assume that any consumer who does not + // provide a name does not actually want a source map. + return null; + } + + var targetLines = this; + + function updateJSON(json) { + json = json || {}; + + isString.assert(sourceMapName); + json.file = sourceMapName; + + if (sourceRoot) { + isString.assert(sourceRoot); + json.sourceRoot = sourceRoot; + } + + return json; + } + + var secret = getSecret(targetLines); + if (secret.cachedSourceMap) { + // Since Lines objects are immutable, we can reuse any source map + // that was previously generated. Nevertheless, we return a new + // JSON object here to protect the cached source map from outside + // modification. + return updateJSON(secret.cachedSourceMap.toJSON()); + } + + var smg = new sourceMap.SourceMapGenerator(updateJSON()); + var sourcesToContents = {}; + + secret.mappings.forEach(function(mapping) { + var sourceCursor = mapping.sourceLines.skipSpaces( + mapping.sourceLoc.start + ) || mapping.sourceLines.lastPos(); + + var targetCursor = targetLines.skipSpaces( + mapping.targetLoc.start + ) || targetLines.lastPos(); + + while (comparePos(sourceCursor, mapping.sourceLoc.end) < 0 && + comparePos(targetCursor, mapping.targetLoc.end) < 0) { + + var sourceChar = mapping.sourceLines.charAt(sourceCursor); + var targetChar = targetLines.charAt(targetCursor); + assert.strictEqual(sourceChar, targetChar); + + var sourceName = mapping.sourceLines.name; + + // Add mappings one character at a time for maximum resolution. + smg.addMapping({ + source: sourceName, + original: { line: sourceCursor.line, + column: sourceCursor.column }, + generated: { line: targetCursor.line, + column: targetCursor.column } + }); + + if (!hasOwn.call(sourcesToContents, sourceName)) { + var sourceContent = mapping.sourceLines.toString(); + smg.setSourceContent(sourceName, sourceContent); + sourcesToContents[sourceName] = sourceContent; + } + + targetLines.nextPos(targetCursor, true); + mapping.sourceLines.nextPos(sourceCursor, true); + } + }); + + secret.cachedSourceMap = smg; + + return smg.toJSON(); +}; + +Lp.bootstrapCharAt = function(pos) { + assert.strictEqual(typeof pos, "object"); + assert.strictEqual(typeof pos.line, "number"); + assert.strictEqual(typeof pos.column, "number"); + + var line = pos.line, + column = pos.column, + strings = this.toString().split(lineTerminatorSeqExp), + string = strings[line - 1]; + + if (typeof string === "undefined") + return ""; + + if (column === string.length && + line < strings.length) + return "\n"; + + if (column >= string.length) + return ""; + + return string.charAt(column); +}; + +Lp.charAt = function(pos) { + assert.strictEqual(typeof pos, "object"); + assert.strictEqual(typeof pos.line, "number"); + assert.strictEqual(typeof pos.column, "number"); + + var line = pos.line, + column = pos.column, + secret = getSecret(this), + infos = secret.infos, + info = infos[line - 1], + c = column; + + if (typeof info === "undefined" || c < 0) + return ""; + + var indent = this.getIndentAt(line); + if (c < indent) + return " "; + + c += info.sliceStart - indent; + + if (c === info.sliceEnd && + line < this.length) + return "\n"; + + if (c >= info.sliceEnd) + return ""; + + return info.line.charAt(c); +}; + +Lp.stripMargin = function(width, skipFirstLine) { + if (width === 0) + return this; + + assert.ok(width > 0, "negative margin: " + width); + + if (skipFirstLine && this.length === 1) + return this; + + var secret = getSecret(this); + + var lines = new Lines(secret.infos.map(function(info, i) { + if (info.line && (i > 0 || !skipFirstLine)) { + info = copyLineInfo(info); + info.indent = Math.max(0, info.indent - width); + } + return info; + })); + + if (secret.mappings.length > 0) { + var newMappings = getSecret(lines).mappings; + assert.strictEqual(newMappings.length, 0); + secret.mappings.forEach(function(mapping) { + newMappings.push(mapping.indent(width, skipFirstLine, true)); + }); + } + + return lines; +}; + +Lp.indent = function(by) { + if (by === 0) + return this; + + var secret = getSecret(this); + + var lines = new Lines(secret.infos.map(function(info) { + if (info.line) { + info = copyLineInfo(info); + info.indent += by; + } + return info + })); + + if (secret.mappings.length > 0) { + var newMappings = getSecret(lines).mappings; + assert.strictEqual(newMappings.length, 0); + secret.mappings.forEach(function(mapping) { + newMappings.push(mapping.indent(by)); + }); + } + + return lines; +}; + +Lp.indentTail = function(by) { + if (by === 0) + return this; + + if (this.length < 2) + return this; + + var secret = getSecret(this); + + var lines = new Lines(secret.infos.map(function(info, i) { + if (i > 0 && info.line) { + info = copyLineInfo(info); + info.indent += by; + } + + return info; + })); + + if (secret.mappings.length > 0) { + var newMappings = getSecret(lines).mappings; + assert.strictEqual(newMappings.length, 0); + secret.mappings.forEach(function(mapping) { + newMappings.push(mapping.indent(by, true)); + }); + } + + return lines; +}; + +Lp.getIndentAt = function(line) { + assert.ok(line >= 1, "no line " + line + " (line numbers start from 1)"); + var secret = getSecret(this), + info = secret.infos[line - 1]; + return Math.max(info.indent, 0); +}; + +Lp.guessTabWidth = function() { + var secret = getSecret(this); + if (hasOwn.call(secret, "cachedTabWidth")) { + return secret.cachedTabWidth; + } + + var counts = []; // Sparse array. + var lastIndent = 0; + + for (var line = 1, last = this.length; line <= last; ++line) { + var info = secret.infos[line - 1]; + var sliced = info.line.slice(info.sliceStart, info.sliceEnd); + + // Whitespace-only lines don't tell us much about the likely tab + // width of this code. + if (isOnlyWhitespace(sliced)) { + continue; + } + + var diff = Math.abs(info.indent - lastIndent); + counts[diff] = ~~counts[diff] + 1; + lastIndent = info.indent; + } + + var maxCount = -1; + var result = 2; + + for (var tabWidth = 1; + tabWidth < counts.length; + tabWidth += 1) { + if (hasOwn.call(counts, tabWidth) && + counts[tabWidth] > maxCount) { + maxCount = counts[tabWidth]; + result = tabWidth; + } + } + + return secret.cachedTabWidth = result; +}; + +Lp.isOnlyWhitespace = function() { + return isOnlyWhitespace(this.toString()); +}; + +Lp.isPrecededOnlyByWhitespace = function(pos) { + var secret = getSecret(this); + var info = secret.infos[pos.line - 1]; + var indent = Math.max(info.indent, 0); + + var diff = pos.column - indent; + if (diff <= 0) { + // If pos.column does not exceed the indentation amount, then + // there must be only whitespace before it. + return true; + } + + var start = info.sliceStart; + var end = Math.min(start + diff, info.sliceEnd); + var prefix = info.line.slice(start, end); + + return isOnlyWhitespace(prefix); +}; + +Lp.getLineLength = function(line) { + var secret = getSecret(this), + info = secret.infos[line - 1]; + return this.getIndentAt(line) + info.sliceEnd - info.sliceStart; +}; + +Lp.nextPos = function(pos, skipSpaces) { + var l = Math.max(pos.line, 0), + c = Math.max(pos.column, 0); + + if (c < this.getLineLength(l)) { + pos.column += 1; + + return skipSpaces + ? !!this.skipSpaces(pos, false, true) + : true; + } + + if (l < this.length) { + pos.line += 1; + pos.column = 0; + + return skipSpaces + ? !!this.skipSpaces(pos, false, true) + : true; + } + + return false; +}; + +Lp.prevPos = function(pos, skipSpaces) { + var l = pos.line, + c = pos.column; + + if (c < 1) { + l -= 1; + + if (l < 1) + return false; + + c = this.getLineLength(l); + + } else { + c = Math.min(c - 1, this.getLineLength(l)); + } + + pos.line = l; + pos.column = c; + + return skipSpaces + ? !!this.skipSpaces(pos, true, true) + : true; +}; + +Lp.firstPos = function() { + // Trivial, but provided for completeness. + return { line: 1, column: 0 }; +}; + +Lp.lastPos = function() { + return { + line: this.length, + column: this.getLineLength(this.length) + }; +}; + +Lp.skipSpaces = function(pos, backward, modifyInPlace) { + if (pos) { + pos = modifyInPlace ? pos : { + line: pos.line, + column: pos.column + }; + } else if (backward) { + pos = this.lastPos(); + } else { + pos = this.firstPos(); + } + + if (backward) { + while (this.prevPos(pos)) { + if (!isOnlyWhitespace(this.charAt(pos)) && + this.nextPos(pos)) { + return pos; + } + } + + return null; + + } else { + while (isOnlyWhitespace(this.charAt(pos))) { + if (!this.nextPos(pos)) { + return null; + } + } + + return pos; + } +}; + +Lp.trimLeft = function() { + var pos = this.skipSpaces(this.firstPos(), false, true); + return pos ? this.slice(pos) : emptyLines; +}; + +Lp.trimRight = function() { + var pos = this.skipSpaces(this.lastPos(), true, true); + return pos ? this.slice(this.firstPos(), pos) : emptyLines; +}; + +Lp.trim = function() { + var start = this.skipSpaces(this.firstPos(), false, true); + if (start === null) + return emptyLines; + + var end = this.skipSpaces(this.lastPos(), true, true); + assert.notStrictEqual(end, null); + + return this.slice(start, end); +}; + +Lp.eachPos = function(callback, startPos, skipSpaces) { + var pos = this.firstPos(); + + if (startPos) { + pos.line = startPos.line, + pos.column = startPos.column + } + + if (skipSpaces && !this.skipSpaces(pos, false, true)) { + return; // Encountered nothing but spaces. + } + + do callback.call(this, pos); + while (this.nextPos(pos, skipSpaces)); +}; + +Lp.bootstrapSlice = function(start, end) { + var strings = this.toString().split( + lineTerminatorSeqExp + ).slice( + start.line - 1, + end.line + ); + + strings.push(strings.pop().slice(0, end.column)); + strings[0] = strings[0].slice(start.column); + + return fromString(strings.join("\n")); +}; + +Lp.slice = function(start, end) { + if (!end) { + if (!start) { + // The client seems to want a copy of this Lines object, but + // Lines objects are immutable, so it's perfectly adequate to + // return the same object. + return this; + } + + // Slice to the end if no end position was provided. + end = this.lastPos(); + } + + var secret = getSecret(this); + var sliced = secret.infos.slice(start.line - 1, end.line); + + if (start.line === end.line) { + sliced[0] = sliceInfo(sliced[0], start.column, end.column); + } else { + assert.ok(start.line < end.line); + sliced[0] = sliceInfo(sliced[0], start.column); + sliced.push(sliceInfo(sliced.pop(), 0, end.column)); + } + + var lines = new Lines(sliced); + + if (secret.mappings.length > 0) { + var newMappings = getSecret(lines).mappings; + assert.strictEqual(newMappings.length, 0); + secret.mappings.forEach(function(mapping) { + var sliced = mapping.slice(this, start, end); + if (sliced) { + newMappings.push(sliced); + } + }, this); + } + + return lines; +}; + +function sliceInfo(info, startCol, endCol) { + var sliceStart = info.sliceStart; + var sliceEnd = info.sliceEnd; + var indent = Math.max(info.indent, 0); + var lineLength = indent + sliceEnd - sliceStart; + + if (typeof endCol === "undefined") { + endCol = lineLength; + } + + startCol = Math.max(startCol, 0); + endCol = Math.min(endCol, lineLength); + endCol = Math.max(endCol, startCol); + + if (endCol < indent) { + indent = endCol; + sliceEnd = sliceStart; + } else { + sliceEnd -= lineLength - endCol; + } + + lineLength = endCol; + lineLength -= startCol; + + if (startCol < indent) { + indent -= startCol; + } else { + startCol -= indent; + indent = 0; + sliceStart += startCol; + } + + assert.ok(indent >= 0); + assert.ok(sliceStart <= sliceEnd); + assert.strictEqual(lineLength, indent + sliceEnd - sliceStart); + + if (info.indent === indent && + info.sliceStart === sliceStart && + info.sliceEnd === sliceEnd) { + return info; + } + + return { + line: info.line, + indent: indent, + sliceStart: sliceStart, + sliceEnd: sliceEnd + }; +} + +Lp.bootstrapSliceString = function(start, end, options) { + return this.slice(start, end).toString(options); +}; + +Lp.sliceString = function(start, end, options) { + if (!end) { + if (!start) { + // The client seems to want a copy of this Lines object, but + // Lines objects are immutable, so it's perfectly adequate to + // return the same object. + return this; + } + + // Slice to the end if no end position was provided. + end = this.lastPos(); + } + + options = normalizeOptions(options); + + var infos = getSecret(this).infos; + var parts = []; + var tabWidth = options.tabWidth; + + for (var line = start.line; line <= end.line; ++line) { + var info = infos[line - 1]; + + if (line === start.line) { + if (line === end.line) { + info = sliceInfo(info, start.column, end.column); + } else { + info = sliceInfo(info, start.column); + } + } else if (line === end.line) { + info = sliceInfo(info, 0, end.column); + } + + var indent = Math.max(info.indent, 0); + + var before = info.line.slice(0, info.sliceStart); + if (options.reuseWhitespace && + isOnlyWhitespace(before) && + countSpaces(before, options.tabWidth) === indent) { + // Reuse original spaces if the indentation is correct. + parts.push(info.line.slice(0, info.sliceEnd)); + continue; + } + + var tabs = 0; + var spaces = indent; + + if (options.useTabs) { + tabs = Math.floor(indent / tabWidth); + spaces -= tabs * tabWidth; + } + + var result = ""; + + if (tabs > 0) { + result += new Array(tabs + 1).join("\t"); + } + + if (spaces > 0) { + result += new Array(spaces + 1).join(" "); + } + + result += info.line.slice(info.sliceStart, info.sliceEnd); + + parts.push(result); + } + + return parts.join(options.lineTerminator); +}; + +Lp.isEmpty = function() { + return this.length < 2 && this.getLineLength(1) < 1; +}; + +Lp.join = function(elements) { + var separator = this; + var separatorSecret = getSecret(separator); + var infos = []; + var mappings = []; + var prevInfo; + + function appendSecret(secret) { + if (secret === null) + return; + + if (prevInfo) { + var info = secret.infos[0]; + var indent = new Array(info.indent + 1).join(" "); + var prevLine = infos.length; + var prevColumn = Math.max(prevInfo.indent, 0) + + prevInfo.sliceEnd - prevInfo.sliceStart; + + prevInfo.line = prevInfo.line.slice( + 0, prevInfo.sliceEnd) + indent + info.line.slice( + info.sliceStart, info.sliceEnd); + + prevInfo.sliceEnd = prevInfo.line.length; + + if (secret.mappings.length > 0) { + secret.mappings.forEach(function(mapping) { + mappings.push(mapping.add(prevLine, prevColumn)); + }); + } + + } else if (secret.mappings.length > 0) { + mappings.push.apply(mappings, secret.mappings); + } + + secret.infos.forEach(function(info, i) { + if (!prevInfo || i > 0) { + prevInfo = copyLineInfo(info); + infos.push(prevInfo); + } + }); + } + + function appendWithSeparator(secret, i) { + if (i > 0) + appendSecret(separatorSecret); + appendSecret(secret); + } + + elements.map(function(elem) { + var lines = fromString(elem); + if (lines.isEmpty()) + return null; + return getSecret(lines); + }).forEach(separator.isEmpty() + ? appendSecret + : appendWithSeparator); + + if (infos.length < 1) + return emptyLines; + + var lines = new Lines(infos); + + getSecret(lines).mappings = mappings; + + return lines; +}; + +exports.concat = function(elements) { + return emptyLines.join(elements); +}; + +Lp.concat = function(other) { + var args = arguments, + list = [this]; + list.push.apply(list, args); + assert.strictEqual(list.length, args.length + 1); + return emptyLines.join(list); +}; + +// The emptyLines object needs to be created all the way down here so that +// Lines.prototype will be fully populated. +var emptyLines = fromString(""); + +},{"1":1,"560":560,"564":564,"565":565,"569":569,"570":570,"601":601}],564:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var types = _dereq_(569); +var isString = types.builtInTypes.string; +var isNumber = types.builtInTypes.number; +var SourceLocation = types.namedTypes.SourceLocation; +var Position = types.namedTypes.Position; +var linesModule = _dereq_(563); +var comparePos = _dereq_(570).comparePos; + +function Mapping(sourceLines, sourceLoc, targetLoc) { + assert.ok(this instanceof Mapping); + assert.ok(sourceLines instanceof linesModule.Lines); + SourceLocation.assert(sourceLoc); + + if (targetLoc) { + // In certain cases it's possible for targetLoc.{start,end}.column + // values to be negative, which technically makes them no longer + // valid SourceLocation nodes, so we need to be more forgiving. + assert.ok( + isNumber.check(targetLoc.start.line) && + isNumber.check(targetLoc.start.column) && + isNumber.check(targetLoc.end.line) && + isNumber.check(targetLoc.end.column) + ); + } else { + // Assume identity mapping if no targetLoc specified. + targetLoc = sourceLoc; + } + + Object.defineProperties(this, { + sourceLines: { value: sourceLines }, + sourceLoc: { value: sourceLoc }, + targetLoc: { value: targetLoc } + }); +} + +var Mp = Mapping.prototype; +module.exports = Mapping; + +Mp.slice = function(lines, start, end) { + assert.ok(lines instanceof linesModule.Lines); + Position.assert(start); + + if (end) { + Position.assert(end); + } else { + end = lines.lastPos(); + } + + var sourceLines = this.sourceLines; + var sourceLoc = this.sourceLoc; + var targetLoc = this.targetLoc; + + function skip(name) { + var sourceFromPos = sourceLoc[name]; + var targetFromPos = targetLoc[name]; + var targetToPos = start; + + if (name === "end") { + targetToPos = end; + } else { + assert.strictEqual(name, "start"); + } + + return skipChars( + sourceLines, sourceFromPos, + lines, targetFromPos, targetToPos + ); + } + + if (comparePos(start, targetLoc.start) <= 0) { + if (comparePos(targetLoc.end, end) <= 0) { + targetLoc = { + start: subtractPos(targetLoc.start, start.line, start.column), + end: subtractPos(targetLoc.end, start.line, start.column) + }; + + // The sourceLoc can stay the same because the contents of the + // targetLoc have not changed. + + } else if (comparePos(end, targetLoc.start) <= 0) { + return null; + + } else { + sourceLoc = { + start: sourceLoc.start, + end: skip("end") + }; + + targetLoc = { + start: subtractPos(targetLoc.start, start.line, start.column), + end: subtractPos(end, start.line, start.column) + }; + } + + } else { + if (comparePos(targetLoc.end, start) <= 0) { + return null; + } + + if (comparePos(targetLoc.end, end) <= 0) { + sourceLoc = { + start: skip("start"), + end: sourceLoc.end + }; + + targetLoc = { + // Same as subtractPos(start, start.line, start.column): + start: { line: 1, column: 0 }, + end: subtractPos(targetLoc.end, start.line, start.column) + }; + + } else { + sourceLoc = { + start: skip("start"), + end: skip("end") + }; + + targetLoc = { + // Same as subtractPos(start, start.line, start.column): + start: { line: 1, column: 0 }, + end: subtractPos(end, start.line, start.column) + }; + } + } + + return new Mapping(this.sourceLines, sourceLoc, targetLoc); +}; + +Mp.add = function(line, column) { + return new Mapping(this.sourceLines, this.sourceLoc, { + start: addPos(this.targetLoc.start, line, column), + end: addPos(this.targetLoc.end, line, column) + }); +}; + +function addPos(toPos, line, column) { + return { + line: toPos.line + line - 1, + column: (toPos.line === 1) + ? toPos.column + column + : toPos.column + }; +} + +Mp.subtract = function(line, column) { + return new Mapping(this.sourceLines, this.sourceLoc, { + start: subtractPos(this.targetLoc.start, line, column), + end: subtractPos(this.targetLoc.end, line, column) + }); +}; + +function subtractPos(fromPos, line, column) { + return { + line: fromPos.line - line + 1, + column: (fromPos.line === line) + ? fromPos.column - column + : fromPos.column + }; +} + +Mp.indent = function(by, skipFirstLine, noNegativeColumns) { + if (by === 0) { + return this; + } + + var targetLoc = this.targetLoc; + var startLine = targetLoc.start.line; + var endLine = targetLoc.end.line; + + if (skipFirstLine && startLine === 1 && endLine === 1) { + return this; + } + + targetLoc = { + start: targetLoc.start, + end: targetLoc.end + }; + + if (!skipFirstLine || startLine > 1) { + var startColumn = targetLoc.start.column + by; + targetLoc.start = { + line: startLine, + column: noNegativeColumns + ? Math.max(0, startColumn) + : startColumn + }; + } + + if (!skipFirstLine || endLine > 1) { + var endColumn = targetLoc.end.column + by; + targetLoc.end = { + line: endLine, + column: noNegativeColumns + ? Math.max(0, endColumn) + : endColumn + }; + } + + return new Mapping(this.sourceLines, this.sourceLoc, targetLoc); +}; + +function skipChars( + sourceLines, sourceFromPos, + targetLines, targetFromPos, targetToPos +) { + assert.ok(sourceLines instanceof linesModule.Lines); + assert.ok(targetLines instanceof linesModule.Lines); + Position.assert(sourceFromPos); + Position.assert(targetFromPos); + Position.assert(targetToPos); + + var targetComparison = comparePos(targetFromPos, targetToPos); + if (targetComparison === 0) { + // Trivial case: no characters to skip. + return sourceFromPos; + } + + if (targetComparison < 0) { + // Skipping forward. + + var sourceCursor = sourceLines.skipSpaces(sourceFromPos); + var targetCursor = targetLines.skipSpaces(targetFromPos); + + var lineDiff = targetToPos.line - targetCursor.line; + sourceCursor.line += lineDiff; + targetCursor.line += lineDiff; + + if (lineDiff > 0) { + // If jumping to later lines, reset columns to the beginnings + // of those lines. + sourceCursor.column = 0; + targetCursor.column = 0; + } else { + assert.strictEqual(lineDiff, 0); + } + + while (comparePos(targetCursor, targetToPos) < 0 && + targetLines.nextPos(targetCursor, true)) { + assert.ok(sourceLines.nextPos(sourceCursor, true)); + assert.strictEqual( + sourceLines.charAt(sourceCursor), + targetLines.charAt(targetCursor) + ); + } + + } else { + // Skipping backward. + + var sourceCursor = sourceLines.skipSpaces(sourceFromPos, true); + var targetCursor = targetLines.skipSpaces(targetFromPos, true); + + var lineDiff = targetToPos.line - targetCursor.line; + sourceCursor.line += lineDiff; + targetCursor.line += lineDiff; + + if (lineDiff < 0) { + // If jumping to earlier lines, reset columns to the ends of + // those lines. + sourceCursor.column = sourceLines.getLineLength(sourceCursor.line); + targetCursor.column = targetLines.getLineLength(targetCursor.line); + } else { + assert.strictEqual(lineDiff, 0); + } + + while (comparePos(targetToPos, targetCursor) < 0 && + targetLines.prevPos(targetCursor, true)) { + assert.ok(sourceLines.prevPos(sourceCursor, true)); + assert.strictEqual( + sourceLines.charAt(sourceCursor), + targetLines.charAt(targetCursor) + ); + } + } + + return sourceCursor; +} + +},{"1":1,"563":563,"569":569,"570":570}],565:[function(_dereq_,module,exports){ +var defaults = { + // If you want to use a different branch of esprima, or any other + // module that supports a .parse function, pass that module object to + // recast.parse as options.esprima. + esprima: _dereq_(3), + + // Number of spaces the pretty-printer should use per tab for + // indentation. If you do not pass this option explicitly, it will be + // (quite reliably!) inferred from the original code. + tabWidth: 4, + + // If you really want the pretty-printer to use tabs instead of + // spaces, make this option true. + useTabs: false, + + // The reprinting code leaves leading whitespace untouched unless it + // has to reindent a line, or you pass false for this option. + reuseWhitespace: true, + + // Override this option to use a different line terminator, e.g. \r\n. + lineTerminator: _dereq_(8).EOL, + + // Some of the pretty-printer code (such as that for printing function + // parameter lists) makes a valiant attempt to prevent really long + // lines. You can adjust the limit by changing this option; however, + // there is no guarantee that line length will fit inside this limit. + wrapColumn: 74, // Aspirational for now. + + // Pass a string as options.sourceFileName to recast.parse to tell the + // reprinter to keep track of reused code so that it can construct a + // source map automatically. + sourceFileName: null, + + // Pass a string as options.sourceMapName to recast.print, and + // (provided you passed options.sourceFileName earlier) the + // PrintResult of recast.print will have a .map property for the + // generated source map. + sourceMapName: null, + + // If provided, this option will be passed along to the source map + // generator as a root directory for relative source file paths. + sourceRoot: null, + + // If you provide a source map that was generated from a previous call + // to recast.print as options.inputSourceMap, the old source map will + // be composed with the new source map. + inputSourceMap: null, + + // If you want esprima to generate .range information (recast only + // uses .loc internally), pass true for this option. + range: false, + + // If you want esprima not to throw exceptions when it encounters + // non-fatal errors, keep this option true. + tolerant: true, + + // If you want to override the quotes used in string literals, specify + // either "single", "double", or "auto" here ("auto" will select the one + // which results in the shorter literal) + // Otherwise, the input marks will be preserved + quote: null, + + // If you want to print trailing commas in object literals, + // array expressions, functions calls and function definitions pass true + // for this option. + trailingComma: false, +}, hasOwn = defaults.hasOwnProperty; + +// Copy options and fill in default values. +exports.normalize = function(options) { + options = options || defaults; + + function get(key) { + return hasOwn.call(options, key) + ? options[key] + : defaults[key]; + } + + return { + tabWidth: +get("tabWidth"), + useTabs: !!get("useTabs"), + reuseWhitespace: !!get("reuseWhitespace"), + lineTerminator: get("lineTerminator"), + wrapColumn: Math.max(get("wrapColumn"), 0), + sourceFileName: get("sourceFileName"), + sourceMapName: get("sourceMapName"), + sourceRoot: get("sourceRoot"), + inputSourceMap: get("inputSourceMap"), + esprima: get("esprima"), + range: get("range"), + tolerant: get("tolerant"), + quote: get("quote"), + trailingComma: get("trailingComma"), + }; +}; + +},{"3":3,"8":8}],566:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var types = _dereq_(569); +var n = types.namedTypes; +var b = types.builders; +var isObject = types.builtInTypes.object; +var isArray = types.builtInTypes.array; +var isFunction = types.builtInTypes.function; +var Patcher = _dereq_(567).Patcher; +var normalizeOptions = _dereq_(565).normalize; +var fromString = _dereq_(563).fromString; +var attachComments = _dereq_(561).attach; +var util = _dereq_(570); + +exports.parse = function parse(source, options) { + options = normalizeOptions(options); + + var lines = fromString(source, options); + + var sourceWithoutTabs = lines.toString({ + tabWidth: options.tabWidth, + reuseWhitespace: false, + useTabs: false + }); + + var comments = []; + var program = options.esprima.parse(sourceWithoutTabs, { + loc: true, + locations: true, + range: options.range, + comment: true, + onComment: comments, + tolerant: options.tolerant, + ecmaVersion: 6, + sourceType: 'module' + }); + + program.loc = program.loc || { + start: lines.firstPos(), + end: lines.lastPos() + }; + + program.loc.lines = lines; + program.loc.indent = 0; + + // Expand the Program node's .loc to include all comments, since + // typically its .loc.start and .loc.end will coincide with those of + // the first and last statements, respectively, excluding any comments + // that fall outside that region. + var trueProgramLoc = util.getTrueLoc(program, lines); + program.loc.start = trueProgramLoc.start; + program.loc.end = trueProgramLoc.end; + + if (program.comments) { + comments = program.comments; + delete program.comments; + } + + // In order to ensure we reprint leading and trailing program + // comments, wrap the original Program node with a File node. + var file = b.file(program); + file.loc = { + lines: lines, + indent: 0, + start: lines.firstPos(), + end: lines.lastPos() + }; + + // Passing file.program here instead of just file means that initial + // comments will be attached to program.body[0] instead of program. + attachComments( + comments, + program.body.length ? file.program : file, + lines + ); + + // Return a copy of the original AST so that any changes made may be + // compared to the original. + return new TreeCopier(lines).copy(file); +}; + +function TreeCopier(lines) { + assert.ok(this instanceof TreeCopier); + this.lines = lines; + this.indent = 0; +} + +var TCp = TreeCopier.prototype; + +TCp.copy = function(node) { + if (isArray.check(node)) { + return node.map(this.copy, this); + } + + if (!isObject.check(node)) { + return node; + } + + util.fixFaultyLocations(node); + + var copy = Object.create(Object.getPrototypeOf(node), { + original: { // Provide a link from the copy to the original. + value: node, + configurable: false, + enumerable: false, + writable: true + } + }); + + var loc = node.loc; + var oldIndent = this.indent; + var newIndent = oldIndent; + + if (loc) { + // When node is a comment, we set node.loc.indent to + // node.loc.start.column so that, when/if we print the comment by + // itself, we can strip that much whitespace from the left margin + // of the comment. This only really matters for multiline Block + // comments, but it doesn't hurt for Line comments. + if (node.type === "Block" || node.type === "Line" || + this.lines.isPrecededOnlyByWhitespace(loc.start)) { + newIndent = this.indent = loc.start.column; + } + + loc.lines = this.lines; + loc.indent = newIndent; + } + + var keys = Object.keys(node); + var keyCount = keys.length; + for (var i = 0; i < keyCount; ++i) { + var key = keys[i]; + if (key === "loc") { + copy[key] = node[key]; + } else { + copy[key] = this.copy(node[key]); + } + } + + this.indent = oldIndent; + + return copy; +}; + +},{"1":1,"561":561,"563":563,"565":565,"567":567,"569":569,"570":570}],567:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var linesModule = _dereq_(563); +var types = _dereq_(569); +var getFieldValue = types.getFieldValue; +var Printable = types.namedTypes.Printable; +var Expression = types.namedTypes.Expression; +var SourceLocation = types.namedTypes.SourceLocation; +var util = _dereq_(570); +var comparePos = util.comparePos; +var FastPath = _dereq_(562); +var isObject = types.builtInTypes.object; +var isArray = types.builtInTypes.array; +var isString = types.builtInTypes.string; +var riskyAdjoiningCharExp = /[0-9a-z_$]/i; + +function Patcher(lines) { + assert.ok(this instanceof Patcher); + assert.ok(lines instanceof linesModule.Lines); + + var self = this, + replacements = []; + + self.replace = function(loc, lines) { + if (isString.check(lines)) + lines = linesModule.fromString(lines); + + replacements.push({ + lines: lines, + start: loc.start, + end: loc.end + }); + }; + + self.get = function(loc) { + // If no location is provided, return the complete Lines object. + loc = loc || { + start: { line: 1, column: 0 }, + end: { line: lines.length, + column: lines.getLineLength(lines.length) } + }; + + var sliceFrom = loc.start, + toConcat = []; + + function pushSlice(from, to) { + assert.ok(comparePos(from, to) <= 0); + toConcat.push(lines.slice(from, to)); + } + + replacements.sort(function(a, b) { + return comparePos(a.start, b.start); + }).forEach(function(rep) { + if (comparePos(sliceFrom, rep.start) > 0) { + // Ignore nested replacement ranges. + } else { + pushSlice(sliceFrom, rep.start); + toConcat.push(rep.lines); + sliceFrom = rep.end; + } + }); + + pushSlice(sliceFrom, loc.end); + + return linesModule.concat(toConcat); + }; +} +exports.Patcher = Patcher; + +var Pp = Patcher.prototype; + +Pp.tryToReprintComments = function(newNode, oldNode, print) { + var patcher = this; + + if (!newNode.comments && + !oldNode.comments) { + // We were (vacuously) able to reprint all the comments! + return true; + } + + var newPath = FastPath.from(newNode); + var oldPath = FastPath.from(oldNode); + + newPath.stack.push("comments", getSurroundingComments(newNode)); + oldPath.stack.push("comments", getSurroundingComments(oldNode)); + + var reprints = []; + var ableToReprintComments = + findArrayReprints(newPath, oldPath, reprints); + + // No need to pop anything from newPath.stack or oldPath.stack, since + // newPath and oldPath are fresh local variables. + + if (ableToReprintComments && reprints.length > 0) { + reprints.forEach(function(reprint) { + var oldComment = reprint.oldPath.getValue(); + assert.ok(oldComment.leading || oldComment.trailing); + patcher.replace( + oldComment.loc, + // Comments can't have .comments, so it doesn't matter + // whether we print with comments or without. + print(reprint.newPath).indentTail(oldComment.loc.indent) + ); + }); + } + + return ableToReprintComments; +}; + +// Get all comments that are either leading or trailing, ignoring any +// comments that occur inside node.loc. Returns an empty array for nodes +// with no leading or trailing comments. +function getSurroundingComments(node) { + var result = []; + if (node.comments && + node.comments.length > 0) { + node.comments.forEach(function(comment) { + if (comment.leading || comment.trailing) { + result.push(comment); + } + }); + } + return result; +} + +Pp.deleteComments = function(node) { + if (!node.comments) { + return; + } + + var patcher = this; + + node.comments.forEach(function(comment) { + if (comment.leading) { + // Delete leading comments along with any trailing whitespace + // they might have. + patcher.replace({ + start: comment.loc.start, + end: node.loc.lines.skipSpaces( + comment.loc.end, false, false) + }, ""); + + } else if (comment.trailing) { + // Delete trailing comments along with any leading whitespace + // they might have. + patcher.replace({ + start: node.loc.lines.skipSpaces( + comment.loc.start, true, false), + end: comment.loc.end + }, ""); + } + }); +}; + +exports.getReprinter = function(path) { + assert.ok(path instanceof FastPath); + + // Make sure that this path refers specifically to a Node, rather than + // some non-Node subproperty of a Node. + var node = path.getValue(); + if (!Printable.check(node)) + return; + + var orig = node.original; + var origLoc = orig && orig.loc; + var lines = origLoc && origLoc.lines; + var reprints = []; + + if (!lines || !findReprints(path, reprints)) + return; + + return function(print) { + var patcher = new Patcher(lines); + + reprints.forEach(function(reprint) { + var newNode = reprint.newPath.getValue(); + var oldNode = reprint.oldPath.getValue(); + + SourceLocation.assert(oldNode.loc, true); + + var needToPrintNewPathWithComments = + !patcher.tryToReprintComments(newNode, oldNode, print) + + if (needToPrintNewPathWithComments) { + // Since we were not able to preserve all leading/trailing + // comments, we delete oldNode's comments, print newPath + // with comments, and then patch the resulting lines where + // oldNode used to be. + patcher.deleteComments(oldNode); + } + + var pos = util.copyPos(oldNode.loc.start); + var needsLeadingSpace = lines.prevPos(pos) && + riskyAdjoiningCharExp.test(lines.charAt(pos)); + + var newLines = print( + reprint.newPath, + needToPrintNewPathWithComments + ).indentTail(oldNode.loc.indent); + + var needsTrailingSpace = + riskyAdjoiningCharExp.test(lines.charAt(oldNode.loc.end)); + + // If we try to replace the argument of a ReturnStatement like + // return"asdf" with e.g. a literal null expression, we run + // the risk of ending up with returnnull, so we need to add an + // extra leading space in situations where that might + // happen. Likewise for "asdf"in obj. See #170. + if (needsLeadingSpace || needsTrailingSpace) { + var newParts = []; + needsLeadingSpace && newParts.push(" "); + newParts.push(newLines); + needsTrailingSpace && newParts.push(" "); + newLines = linesModule.concat(newParts); + } + + patcher.replace(oldNode.loc, newLines); + }); + + // Recall that origLoc is the .loc of an ancestor node that is + // guaranteed to contain all the reprinted nodes and comments. + return patcher.get(origLoc).indentTail(-orig.loc.indent); + }; +}; + +function findReprints(newPath, reprints) { + var newNode = newPath.getValue(); + Printable.assert(newNode); + + var oldNode = newNode.original; + Printable.assert(oldNode); + + assert.deepEqual(reprints, []); + + if (newNode.type !== oldNode.type) { + return false; + } + + var oldPath = new FastPath(oldNode); + var canReprint = findChildReprints(newPath, oldPath, reprints); + + if (!canReprint) { + // Make absolutely sure the calling code does not attempt to reprint + // any nodes. + reprints.length = 0; + } + + return canReprint; +} + +function findAnyReprints(newPath, oldPath, reprints) { + var newNode = newPath.getValue(); + var oldNode = oldPath.getValue(); + + if (newNode === oldNode) + return true; + + if (isArray.check(newNode)) + return findArrayReprints(newPath, oldPath, reprints); + + if (isObject.check(newNode)) + return findObjectReprints(newPath, oldPath, reprints); + + return false; +} + +function findArrayReprints(newPath, oldPath, reprints) { + var newNode = newPath.getValue(); + var oldNode = oldPath.getValue(); + isArray.assert(newNode); + var len = newNode.length; + + if (!(isArray.check(oldNode) && + oldNode.length === len)) + return false; + + for (var i = 0; i < len; ++i) { + newPath.stack.push(i, newNode[i]); + oldPath.stack.push(i, oldNode[i]); + var canReprint = findAnyReprints(newPath, oldPath, reprints); + newPath.stack.length -= 2; + oldPath.stack.length -= 2; + if (!canReprint) { + return false; + } + } + + return true; +} + +function findObjectReprints(newPath, oldPath, reprints) { + var newNode = newPath.getValue(); + isObject.assert(newNode); + + if (newNode.original === null) { + // If newNode.original node was set to null, reprint the node. + return false; + } + + var oldNode = oldPath.getValue(); + if (!isObject.check(oldNode)) + return false; + + if (Printable.check(newNode)) { + if (!Printable.check(oldNode)) { + return false; + } + + // Here we need to decide whether the reprinted code for newNode + // is appropriate for patching into the location of oldNode. + + if (newNode.type === oldNode.type) { + var childReprints = []; + + if (findChildReprints(newPath, oldPath, childReprints)) { + reprints.push.apply(reprints, childReprints); + } else if (oldNode.loc) { + // If we have no .loc information for oldNode, then we + // won't be able to reprint it. + reprints.push({ + oldPath: oldPath.copy(), + newPath: newPath.copy() + }); + } else { + return false; + } + + return true; + } + + if (Expression.check(newNode) && + Expression.check(oldNode) && + // If we have no .loc information for oldNode, then we won't + // be able to reprint it. + oldNode.loc) { + + // If both nodes are subtypes of Expression, then we should be + // able to fill the location occupied by the old node with + // code printed for the new node with no ill consequences. + reprints.push({ + oldPath: oldPath.copy(), + newPath: newPath.copy() + }); + + return true; + } + + // The nodes have different types, and at least one of the types + // is not a subtype of the Expression type, so we cannot safely + // assume the nodes are syntactically interchangeable. + return false; + } + + return findChildReprints(newPath, oldPath, reprints); +} + +// This object is reused in hasOpeningParen and hasClosingParen to avoid +// having to allocate a temporary object. +var reusablePos = { line: 1, column: 0 }; +var nonSpaceExp = /\S/; + +function hasOpeningParen(oldPath) { + var oldNode = oldPath.getValue(); + var loc = oldNode.loc; + var lines = loc && loc.lines; + + if (lines) { + var pos = reusablePos; + pos.line = loc.start.line; + pos.column = loc.start.column; + + while (lines.prevPos(pos)) { + var ch = lines.charAt(pos); + + if (ch === "(") { + // If we found an opening parenthesis but it occurred before + // the start of the original subtree for this reprinting, then + // we must not return true for hasOpeningParen(oldPath). + return comparePos(oldPath.getRootValue().loc.start, pos) <= 0; + } + + if (nonSpaceExp.test(ch)) { + return false; + } + } + } + + return false; +} + +function hasClosingParen(oldPath) { + var oldNode = oldPath.getValue(); + var loc = oldNode.loc; + var lines = loc && loc.lines; + + if (lines) { + var pos = reusablePos; + pos.line = loc.end.line; + pos.column = loc.end.column; + + do { + var ch = lines.charAt(pos); + + if (ch === ")") { + // If we found a closing parenthesis but it occurred after the + // end of the original subtree for this reprinting, then we + // must not return true for hasClosingParen(oldPath). + return comparePos(pos, oldPath.getRootValue().loc.end) <= 0; + } + + if (nonSpaceExp.test(ch)) { + return false; + } + + } while (lines.nextPos(pos)); + } + + return false; +} + +function hasParens(oldPath) { + // This logic can technically be fooled if the node has parentheses + // but there are comments intervening between the parentheses and the + // node. In such cases the node will be harmlessly wrapped in an + // additional layer of parentheses. + return hasOpeningParen(oldPath) && hasClosingParen(oldPath); +} + +function findChildReprints(newPath, oldPath, reprints) { + var newNode = newPath.getValue(); + var oldNode = oldPath.getValue(); + + isObject.assert(newNode); + isObject.assert(oldNode); + + if (newNode.original === null) { + // If newNode.original node was set to null, reprint the node. + return false; + } + + // If this type of node cannot come lexically first in its enclosing + // statement (e.g. a function expression or object literal), and it + // seems to be doing so, then the only way we can ignore this problem + // and save ourselves from falling back to the pretty printer is if an + // opening parenthesis happens to precede the node. For example, + // (function(){ ... }()); does not need to be reprinted, even though + // the FunctionExpression comes lexically first in the enclosing + // ExpressionStatement and fails the hasParens test, because the + // parent CallExpression passes the hasParens test. If we relied on + // the path.needsParens() && !hasParens(oldNode) check below, the + // absence of a closing parenthesis after the FunctionExpression would + // trigger pretty-printing unnecessarily. + if (!newPath.canBeFirstInStatement() && + newPath.firstInStatement() && + !hasOpeningParen(oldPath)) + return false; + + // If this node needs parentheses and will not be wrapped with + // parentheses when reprinted, then return false to skip reprinting + // and let it be printed generically. + if (newPath.needsParens(true) && !hasParens(oldPath)) { + return false; + } + + for (var k in util.getUnionOfKeys(newNode, oldNode)) { + if (k === "loc") + continue; + + newPath.stack.push(k, types.getFieldValue(newNode, k)); + oldPath.stack.push(k, types.getFieldValue(oldNode, k)); + var canReprint = findAnyReprints(newPath, oldPath, reprints); + newPath.stack.length -= 2; + oldPath.stack.length -= 2; + + if (!canReprint) { + return false; + } + } + + return true; +} + +},{"1":1,"562":562,"563":563,"569":569,"570":570}],568:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var sourceMap = _dereq_(601); +var printComments = _dereq_(561).printComments; +var linesModule = _dereq_(563); +var fromString = linesModule.fromString; +var concat = linesModule.concat; +var normalizeOptions = _dereq_(565).normalize; +var getReprinter = _dereq_(567).getReprinter; +var types = _dereq_(569); +var namedTypes = types.namedTypes; +var isString = types.builtInTypes.string; +var isObject = types.builtInTypes.object; +var FastPath = _dereq_(562); +var util = _dereq_(570); + +function PrintResult(code, sourceMap) { + assert.ok(this instanceof PrintResult); + + isString.assert(code); + this.code = code; + + if (sourceMap) { + isObject.assert(sourceMap); + this.map = sourceMap; + } +} + +var PRp = PrintResult.prototype; +var warnedAboutToString = false; + +PRp.toString = function() { + if (!warnedAboutToString) { + console.warn( + "Deprecation warning: recast.print now returns an object with " + + "a .code property. You appear to be treating the object as a " + + "string, which might still work but is strongly discouraged." + ); + + warnedAboutToString = true; + } + + return this.code; +}; + +var emptyPrintResult = new PrintResult(""); + +function Printer(originalOptions) { + assert.ok(this instanceof Printer); + + var explicitTabWidth = originalOptions && originalOptions.tabWidth; + var options = normalizeOptions(originalOptions); + assert.notStrictEqual(options, originalOptions); + + // It's common for client code to pass the same options into both + // recast.parse and recast.print, but the Printer doesn't need (and + // can be confused by) options.sourceFileName, so we null it out. + options.sourceFileName = null; + + function printWithComments(path) { + assert.ok(path instanceof FastPath); + return printComments(path, print); + } + + function print(path, includeComments) { + if (includeComments) + return printWithComments(path); + + assert.ok(path instanceof FastPath); + + if (!explicitTabWidth) { + var oldTabWidth = options.tabWidth; + var loc = path.getNode().loc; + if (loc && loc.lines && loc.lines.guessTabWidth) { + options.tabWidth = loc.lines.guessTabWidth(); + var lines = maybeReprint(path); + options.tabWidth = oldTabWidth; + return lines; + } + } + + return maybeReprint(path); + } + + function maybeReprint(path) { + var reprinter = getReprinter(path); + if (reprinter) + return maybeAddParens(path, reprinter(print)); + return printRootGenerically(path); + } + + // Print the root node generically, but then resume reprinting its + // children non-generically. + function printRootGenerically(path) { + return genericPrint(path, options, printWithComments); + } + + // Print the entire AST generically. + function printGenerically(path) { + return genericPrint(path, options, printGenerically); + } + + this.print = function(ast) { + if (!ast) { + return emptyPrintResult; + } + + var lines = print(FastPath.from(ast), true); + + return new PrintResult( + lines.toString(options), + util.composeSourceMaps( + options.inputSourceMap, + lines.getSourceMap( + options.sourceMapName, + options.sourceRoot + ) + ) + ); + }; + + this.printGenerically = function(ast) { + if (!ast) { + return emptyPrintResult; + } + + var path = FastPath.from(ast); + var oldReuseWhitespace = options.reuseWhitespace; + + // Do not reuse whitespace (or anything else, for that matter) + // when printing generically. + options.reuseWhitespace = false; + + // TODO Allow printing of comments? + var pr = new PrintResult(printGenerically(path).toString(options)); + options.reuseWhitespace = oldReuseWhitespace; + return pr; + }; +} + +exports.Printer = Printer; + +function maybeAddParens(path, lines) { + return path.needsParens() ? concat(["(", lines, ")"]) : lines; +} + +function genericPrint(path, options, printPath) { + assert.ok(path instanceof FastPath); + return maybeAddParens(path, genericPrintNoParens(path, options, printPath)); +} + +function genericPrintNoParens(path, options, print) { + var n = path.getValue(); + + if (!n) { + return fromString(""); + } + + if (typeof n === "string") { + return fromString(n, options); + } + + namedTypes.Printable.assert(n); + + switch (n.type) { + case "File": + return path.call(print, "program"); + + case "Program": + return path.call(function(bodyPath) { + return printStatementSequence(bodyPath, options, print); + }, "body"); + + case "Noop": // Babel extension. + case "EmptyStatement": + return fromString(""); + + case "ExpressionStatement": + return concat([path.call(print, "expression"), ";"]); + + case "ParenthesizedExpression": // Babel extension. + return concat(["(", path.call(print, "expression"), ")"]); + + case "BinaryExpression": + case "LogicalExpression": + case "AssignmentExpression": + return fromString(" ").join([ + path.call(print, "left"), + n.operator, + path.call(print, "right") + ]); + + case "AssignmentPattern": + return concat([ + path.call(print, "left"), + "=", + path.call(print, "right") + ]); + + case "MemberExpression": + var parts = [path.call(print, "object")]; + + var property = path.call(print, "property"); + if (n.computed) { + parts.push("[", property, "]"); + } else { + parts.push(".", property); + } + + return concat(parts); + + case "MetaProperty": + return concat([ + path.call(print, "meta"), + ".", + path.call(print, "property") + ]); + + case "BindExpression": + var parts = []; + + if (n.object) { + parts.push(path.call(print, "object")); + } + + parts.push("::", path.call(print, "callee")); + + return concat(parts); + + case "Path": + return fromString(".").join(n.body); + + case "Identifier": + return concat([ + fromString(n.name, options), + path.call(print, "typeAnnotation") + ]); + + case "SpreadElement": + case "SpreadElementPattern": + case "SpreadProperty": + case "SpreadPropertyPattern": + case "RestElement": + return concat(["...", path.call(print, "argument")]); + + case "FunctionDeclaration": + case "FunctionExpression": + var parts = []; + + if (n.async) + parts.push("async "); + + parts.push("function"); + + if (n.generator) + parts.push("*"); + + if (n.id) { + parts.push( + " ", + path.call(print, "id"), + path.call(print, "typeParameters") + ); + } + + parts.push( + "(", + printFunctionParams(path, options, print), + ")", + path.call(print, "returnType"), + " ", + path.call(print, "body") + ); + + return concat(parts); + + case "ArrowFunctionExpression": + var parts = []; + + if (n.async) + parts.push("async "); + + if ( + n.params.length === 1 && + !n.rest && + n.params[0].type !== 'SpreadElementPattern' && + n.params[0].type !== 'RestElement' + ) { + parts.push(path.call(print, "params", 0)); + } else { + parts.push( + "(", + printFunctionParams(path, options, print), + ")" + ); + } + + parts.push(" => ", path.call(print, "body")); + + return concat(parts); + + case "MethodDefinition": + var parts = []; + + if (n.static) { + parts.push("static "); + } + + parts.push(printMethod(path, options, print)); + + return concat(parts); + + case "YieldExpression": + var parts = ["yield"]; + + if (n.delegate) + parts.push("*"); + + if (n.argument) + parts.push(" ", path.call(print, "argument")); + + return concat(parts); + + case "AwaitExpression": + var parts = ["await"]; + + if (n.all) + parts.push("*"); + + if (n.argument) + parts.push(" ", path.call(print, "argument")); + + return concat(parts); + + case "ModuleDeclaration": + var parts = ["module", path.call(print, "id")]; + + if (n.source) { + assert.ok(!n.body); + parts.push("from", path.call(print, "source")); + } else { + parts.push(path.call(print, "body")); + } + + return fromString(" ").join(parts); + + case "ImportSpecifier": + var parts = []; + + if (n.imported) { + parts.push(path.call(print, "imported")); + if (n.local && + n.local.name !== n.imported.name) { + parts.push(" as ", path.call(print, "local")); + } + } else if (n.id) { + parts.push(path.call(print, "id")); + if (n.name) { + parts.push(" as ", path.call(print, "name")); + } + } + + return concat(parts); + + case "ExportSpecifier": + var parts = []; + + if (n.local) { + parts.push(path.call(print, "local")); + if (n.exported && + n.exported.name !== n.local.name) { + parts.push(" as ", path.call(print, "exported")); + } + } else if (n.id) { + parts.push(path.call(print, "id")); + if (n.name) { + parts.push(" as ", path.call(print, "name")); + } + } + + return concat(parts); + + case "ExportBatchSpecifier": + return fromString("*"); + + case "ImportNamespaceSpecifier": + var parts = ["* as "]; + if (n.local) { + parts.push(path.call(print, "local")); + } else if (n.id) { + parts.push(path.call(print, "id")); + } + return concat(parts); + + case "ImportDefaultSpecifier": + if (n.local) { + return path.call(print, "local"); + } + return path.call(print, "id"); + + case "ExportDeclaration": + var parts = ["export"]; + + if (n["default"]) { + parts.push(" default"); + + } else if (n.specifiers && + n.specifiers.length > 0) { + + if (n.specifiers.length === 1 && + n.specifiers[0].type === "ExportBatchSpecifier") { + parts.push(" *"); + } else { + parts.push( + " { ", + fromString(", ").join(path.map(print, "specifiers")), + " }" + ); + } + + if (n.source) + parts.push(" from ", path.call(print, "source")); + + parts.push(";"); + + return concat(parts); + } + + if (n.declaration) { + var decLines = path.call(print, "declaration"); + parts.push(" ", decLines); + if (lastNonSpaceCharacter(decLines) !== ";") { + parts.push(";"); + } + } + + return concat(parts); + + case "ExportDefaultDeclaration": + return concat([ + "export default ", + path.call(print, "declaration") + ]); + + case "ExportNamedDeclaration": + var parts = ["export "]; + + if (n.declaration) { + parts.push(path.call(print, "declaration")); + } + + if (n.specifiers && + n.specifiers.length > 0) { + parts.push( + n.declaration ? ", {" : "{", + fromString(", ").join(path.map(print, "specifiers")), + "}" + ); + } + + if (n.source) { + parts.push(" from ", path.call(print, "source")); + } + + return concat(parts); + + case "ExportAllDeclaration": + var parts = ["export *"]; + + if (n.exported) { + parts.push(" as ", path.call(print, "exported")); + } + + return concat([ + " from ", + path.call(print, "source") + ]); + + case "ExportNamespaceSpecifier": + return concat(["* as ", path.call(print, "exported")]); + + case "ExportDefaultSpecifier": + return path.call(print, "exported"); + + case "ImportDeclaration": + var parts = ["import "]; + + if (n.importKind && n.importKind !== "value") { + parts.push(n.importKind + " "); + } + + if (n.specifiers && + n.specifiers.length > 0) { + + var foundImportSpecifier = false; + + path.each(function(specifierPath) { + var i = specifierPath.getName(); + if (i > 0) { + parts.push(", "); + } + + var value = specifierPath.getValue(); + + if (namedTypes.ImportDefaultSpecifier.check(value) || + namedTypes.ImportNamespaceSpecifier.check(value)) { + assert.strictEqual(foundImportSpecifier, false); + } else { + namedTypes.ImportSpecifier.assert(value); + if (!foundImportSpecifier) { + foundImportSpecifier = true; + parts.push("{"); + } + } + + parts.push(print(specifierPath)); + }, "specifiers"); + + if (foundImportSpecifier) { + parts.push("}"); + } + + parts.push(" from "); + } + + parts.push(path.call(print, "source"), ";"); + + return concat(parts); + + case "BlockStatement": + var naked = path.call(function(bodyPath) { + return printStatementSequence(bodyPath, options, print); + }, "body"); + + if (naked.isEmpty()) { + return fromString("{}"); + } + + return concat([ + "{\n", + naked.indent(options.tabWidth), + "\n}" + ]); + + case "ReturnStatement": + var parts = ["return"]; + + if (n.argument) { + var argLines = path.call(print, "argument"); + if (argLines.length > 1 && + (namedTypes.XJSElement && + namedTypes.XJSElement.check(n.argument) || + namedTypes.JSXElement && + namedTypes.JSXElement.check(n.argument))) { + parts.push( + " (\n", + argLines.indent(options.tabWidth), + "\n)" + ); + } else { + parts.push(" ", argLines); + } + } + + parts.push(";"); + + return concat(parts); + + case "CallExpression": + return concat([ + path.call(print, "callee"), + printArgumentsList(path, options, print) + ]); + + case "ObjectExpression": + case "ObjectPattern": + case "ObjectTypeAnnotation": + var allowBreak = false; + var isTypeAnnotation = n.type === "ObjectTypeAnnotation"; + var separator = isTypeAnnotation ? ';' : ','; + var fields = []; + + if (isTypeAnnotation) { + fields.push("indexers", "callProperties"); + } + + fields.push("properties"); + + var len = 0; + fields.forEach(function(field) { + len += n[field].length; + }); + + var oneLine = (isTypeAnnotation && len === 1) || len === 0; + var parts = [oneLine ? "{" : "{\n"]; + + var i = 0; + fields.forEach(function(field) { + path.each(function(childPath) { + var lines = print(childPath); + + if (!oneLine) { + lines = lines.indent(options.tabWidth); + } + + var multiLine = !isTypeAnnotation && lines.length > 1; + if (multiLine && allowBreak) { + // Similar to the logic for BlockStatement. + parts.push("\n"); + } + + parts.push(lines); + + if (i < len - 1) { + // Add an extra line break if the previous object property + // had a multi-line value. + parts.push(separator + (multiLine ? "\n\n" : "\n")); + allowBreak = !multiLine; + } else if (len !== 1 && isTypeAnnotation) { + parts.push(separator); + } else if (options.trailingComma) { + parts.push(separator); + } + i++; + }, field); + }); + + parts.push(oneLine ? "}" : "\n}"); + + return concat(parts); + + case "PropertyPattern": + return concat([ + path.call(print, "key"), + ": ", + path.call(print, "pattern") + ]); + + case "Property": // Non-standard AST node type. + if (n.method || n.kind === "get" || n.kind === "set") { + return printMethod(path, options, print); + } + + var parts = []; + + if (n.decorators) { + path.each(function(decoratorPath) { + parts.push(print(decoratorPath), "\n"); + }, "decorators"); + } + + var key = path.call(print, "key"); + if (n.computed) { + parts.push("[", key, "]"); + } else { + parts.push(key); + } + + if (! n.shorthand) { + parts.push(": ", path.call(print, "value")); + } + + return concat(parts); + + case "Decorator": + return concat(["@", path.call(print, "expression")]); + + case "ArrayExpression": + case "ArrayPattern": + var elems = n.elements, + len = elems.length; + + var printed = path.map(print, "elements"); + var joined = fromString(", ").join(printed); + var oneLine = joined.getLineLength(1) <= options.wrapColumn; + var parts = [oneLine ? "[" : "[\n"]; + + path.each(function(elemPath) { + var i = elemPath.getName(); + var elem = elemPath.getValue(); + if (!elem) { + // If the array expression ends with a hole, that hole + // will be ignored by the interpreter, but if it ends with + // two (or more) holes, we need to write out two (or more) + // commas so that the resulting code is interpreted with + // both (all) of the holes. + parts.push(","); + } else { + var lines = printed[i]; + if (oneLine) { + if (i > 0) + parts.push(" "); + } else { + lines = lines.indent(options.tabWidth); + } + parts.push(lines); + if (i < len - 1 || (!oneLine && options.trailingComma)) + parts.push(","); + if (!oneLine) + parts.push("\n"); + } + }, "elements"); + + parts.push("]"); + + return concat(parts); + + case "SequenceExpression": + return fromString(", ").join(path.map(print, "expressions")); + + case "ThisExpression": + return fromString("this"); + + case "Super": + return fromString("super"); + + case "Literal": + if (typeof n.value !== "string") + return fromString(n.value, options); + + return fromString(nodeStr(n.value, options), options); + + case "ModuleSpecifier": + if (n.local) { + throw new Error( + "The ESTree ModuleSpecifier type should be abstract" + ); + } + + // The Esprima ModuleSpecifier type is just a string-valued + // Literal identifying the imported-from module. + return fromString(nodeStr(n.value, options), options); + + case "UnaryExpression": + var parts = [n.operator]; + if (/[a-z]$/.test(n.operator)) + parts.push(" "); + parts.push(path.call(print, "argument")); + return concat(parts); + + case "UpdateExpression": + var parts = [path.call(print, "argument"), n.operator]; + + if (n.prefix) + parts.reverse(); + + return concat(parts); + + case "ConditionalExpression": + return concat([ + "(", path.call(print, "test"), + " ? ", path.call(print, "consequent"), + " : ", path.call(print, "alternate"), ")" + ]); + + case "NewExpression": + var parts = ["new ", path.call(print, "callee")]; + var args = n.arguments; + if (args) { + parts.push(printArgumentsList(path, options, print)); + } + + return concat(parts); + + case "VariableDeclaration": + var parts = [n.kind, " "]; + var maxLen = 0; + var printed = path.map(function(childPath) { + var lines = print(childPath); + maxLen = Math.max(lines.length, maxLen); + return lines; + }, "declarations"); + + if (maxLen === 1) { + parts.push(fromString(", ").join(printed)); + } else if (printed.length > 1 ) { + parts.push( + fromString(",\n").join(printed) + .indentTail(n.kind.length + 1) + ); + } else { + parts.push(printed[0]); + } + + // We generally want to terminate all variable declarations with a + // semicolon, except when they are children of for loops. + var parentNode = path.getParentNode(); + if (!namedTypes.ForStatement.check(parentNode) && + !namedTypes.ForInStatement.check(parentNode) && + !(namedTypes.ForOfStatement && + namedTypes.ForOfStatement.check(parentNode))) { + parts.push(";"); + } + + return concat(parts); + + case "VariableDeclarator": + return n.init ? fromString(" = ").join([ + path.call(print, "id"), + path.call(print, "init") + ]) : path.call(print, "id"); + + case "WithStatement": + return concat([ + "with (", + path.call(print, "object"), + ") ", + path.call(print, "body") + ]); + + case "IfStatement": + var con = adjustClause(path.call(print, "consequent"), options), + parts = ["if (", path.call(print, "test"), ")", con]; + + if (n.alternate) + parts.push( + endsWithBrace(con) ? " else" : "\nelse", + adjustClause(path.call(print, "alternate"), options)); + + return concat(parts); + + case "ForStatement": + // TODO Get the for (;;) case right. + var init = path.call(print, "init"), + sep = init.length > 1 ? ";\n" : "; ", + forParen = "for (", + indented = fromString(sep).join([ + init, + path.call(print, "test"), + path.call(print, "update") + ]).indentTail(forParen.length), + head = concat([forParen, indented, ")"]), + clause = adjustClause(path.call(print, "body"), options), + parts = [head]; + + if (head.length > 1) { + parts.push("\n"); + clause = clause.trimLeft(); + } + + parts.push(clause); + + return concat(parts); + + case "WhileStatement": + return concat([ + "while (", + path.call(print, "test"), + ")", + adjustClause(path.call(print, "body"), options) + ]); + + case "ForInStatement": + // Note: esprima can't actually parse "for each (". + return concat([ + n.each ? "for each (" : "for (", + path.call(print, "left"), + " in ", + path.call(print, "right"), + ")", + adjustClause(path.call(print, "body"), options) + ]); + + case "ForOfStatement": + return concat([ + "for (", + path.call(print, "left"), + " of ", + path.call(print, "right"), + ")", + adjustClause(path.call(print, "body"), options) + ]); + + case "DoWhileStatement": + var doBody = concat([ + "do", + adjustClause(path.call(print, "body"), options) + ]), parts = [doBody]; + + if (endsWithBrace(doBody)) + parts.push(" while"); + else + parts.push("\nwhile"); + + parts.push(" (", path.call(print, "test"), ");"); + + return concat(parts); + + case "DoExpression": + var statements = path.call(function(bodyPath) { + return printStatementSequence(bodyPath, options, print); + }, "body"); + + return concat([ + "do {\n", + statements.indent(options.tabWidth), + "\n}" + ]); + + case "BreakStatement": + var parts = ["break"]; + if (n.label) + parts.push(" ", path.call(print, "label")); + parts.push(";"); + return concat(parts); + + case "ContinueStatement": + var parts = ["continue"]; + if (n.label) + parts.push(" ", path.call(print, "label")); + parts.push(";"); + return concat(parts); + + case "LabeledStatement": + return concat([ + path.call(print, "label"), + ":\n", + path.call(print, "body") + ]); + + case "TryStatement": + var parts = [ + "try ", + path.call(print, "block") + ]; + + if (n.handler) { + parts.push(" ", path.call(print, "handler")); + } else if (n.handlers) { + path.each(function(handlerPath) { + parts.push(" ", print(handlerPath)); + }, "handlers"); + } + + if (n.finalizer) { + parts.push(" finally ", path.call(print, "finalizer")); + } + + return concat(parts); + + case "CatchClause": + var parts = ["catch (", path.call(print, "param")]; + + if (n.guard) + // Note: esprima does not recognize conditional catch clauses. + parts.push(" if ", path.call(print, "guard")); + + parts.push(") ", path.call(print, "body")); + + return concat(parts); + + case "ThrowStatement": + return concat(["throw ", path.call(print, "argument"), ";"]); + + case "SwitchStatement": + return concat([ + "switch (", + path.call(print, "discriminant"), + ") {\n", + fromString("\n").join(path.map(print, "cases")), + "\n}" + ]); + + // Note: ignoring n.lexical because it has no printing consequences. + + case "SwitchCase": + var parts = []; + + if (n.test) + parts.push("case ", path.call(print, "test"), ":"); + else + parts.push("default:"); + + if (n.consequent.length > 0) { + parts.push("\n", path.call(function(consequentPath) { + return printStatementSequence(consequentPath, options, print); + }, "consequent").indent(options.tabWidth)); + } + + return concat(parts); + + case "DebuggerStatement": + return fromString("debugger;"); + + // JSX extensions below. + + case "XJSAttribute": + case "JSXAttribute": + var parts = [path.call(print, "name")]; + if (n.value) + parts.push("=", path.call(print, "value")); + return concat(parts); + + case "XJSIdentifier": + case "JSXIdentifier": + return fromString(n.name, options); + + case "XJSNamespacedName": + case "JSXNamespacedName": + return fromString(":").join([ + path.call(print, "namespace"), + path.call(print, "name") + ]); + + case "XJSMemberExpression": + case "JSXMemberExpression": + return fromString(".").join([ + path.call(print, "object"), + path.call(print, "property") + ]); + + case "XJSSpreadAttribute": + case "JSXSpreadAttribute": + return concat(["{...", path.call(print, "argument"), "}"]); + + case "XJSExpressionContainer": + case "JSXExpressionContainer": + return concat(["{", path.call(print, "expression"), "}"]); + + case "XJSElement": + case "JSXElement": + var openingLines = path.call(print, "openingElement"); + + if (n.openingElement.selfClosing) { + assert.ok(!n.closingElement); + return openingLines; + } + + var childLines = concat( + path.map(function(childPath) { + var child = childPath.getValue(); + + if (namedTypes.Literal.check(child) && + typeof child.value === "string") { + if (/\S/.test(child.value)) { + return child.value.replace(/^\s+|\s+$/g, ""); + } else if (/\n/.test(child.value)) { + return "\n"; + } + } + + return print(childPath); + }, "children") + ).indentTail(options.tabWidth); + + var closingLines = path.call(print, "closingElement"); + + return concat([ + openingLines, + childLines, + closingLines + ]); + + case "XJSOpeningElement": + case "JSXOpeningElement": + var parts = ["<", path.call(print, "name")]; + var attrParts = []; + + path.each(function(attrPath) { + attrParts.push(" ", print(attrPath)); + }, "attributes"); + + var attrLines = concat(attrParts); + + var needLineWrap = ( + attrLines.length > 1 || + attrLines.getLineLength(1) > options.wrapColumn + ); + + if (needLineWrap) { + attrParts.forEach(function(part, i) { + if (part === " ") { + assert.strictEqual(i % 2, 0); + attrParts[i] = "\n"; + } + }); + + attrLines = concat(attrParts).indentTail(options.tabWidth); + } + + parts.push(attrLines, n.selfClosing ? " />" : ">"); + + return concat(parts); + + case "XJSClosingElement": + case "JSXClosingElement": + return concat([""]); + + case "XJSText": + case "JSXText": + return fromString(n.value, options); + + case "XJSEmptyExpression": + case "JSXEmptyExpression": + return fromString(""); + + case "TypeAnnotatedIdentifier": + return concat([ + path.call(print, "annotation"), + " ", + path.call(print, "identifier") + ]); + + case "ClassBody": + if (n.body.length === 0) { + return fromString("{}"); + } + + return concat([ + "{\n", + path.call(function(bodyPath) { + return printStatementSequence(bodyPath, options, print); + }, "body").indent(options.tabWidth), + "\n}" + ]); + + case "ClassPropertyDefinition": + var parts = ["static ", path.call(print, "definition")]; + if (!namedTypes.MethodDefinition.check(n.definition)) + parts.push(";"); + return concat(parts); + + case "ClassProperty": + var parts = []; + if (n.static) + parts.push("static "); + + parts.push(path.call(print, "key")); + if (n.typeAnnotation) + parts.push(path.call(print, "typeAnnotation")); + + if (n.value) + parts.push(" = ", path.call(print, "value")); + + parts.push(";"); + return concat(parts); + + case "ClassDeclaration": + case "ClassExpression": + var parts = ["class"]; + + if (n.id) { + parts.push( + " ", + path.call(print, "id"), + path.call(print, "typeParameters") + ); + } + + if (n.superClass) { + parts.push( + " extends ", + path.call(print, "superClass"), + path.call(print, "superTypeParameters") + ); + } + + if (n["implements"]) { + parts.push( + " implements ", + fromString(", ").join(path.map(print, "implements")) + ); + } + + parts.push(" ", path.call(print, "body")); + + return concat(parts); + + case "TemplateElement": + return fromString(n.value.raw, options); + + case "TemplateLiteral": + var expressions = path.map(print, "expressions"); + var parts = ["`"]; + + path.each(function(childPath) { + var i = childPath.getName(); + parts.push(print(childPath)); + if (i < expressions.length) { + parts.push("${", expressions[i], "}"); + } + }, "quasis"); + + parts.push("`"); + + return concat(parts); + + case "TaggedTemplateExpression": + return concat([ + path.call(print, "tag"), + path.call(print, "quasi") + ]); + + // These types are unprintable because they serve as abstract + // supertypes for other (printable) types. + case "Node": + case "Printable": + case "SourceLocation": + case "Position": + case "Statement": + case "Function": + case "Pattern": + case "Expression": + case "Declaration": + case "Specifier": + case "NamedSpecifier": + case "Comment": // Supertype of Block and Line. + case "MemberTypeAnnotation": // Flow + case "TupleTypeAnnotation": // Flow + case "Type": // Flow + throw new Error("unprintable type: " + JSON.stringify(n.type)); + + case "CommentBlock": // Babel block comment. + case "Block": // Esprima block comment. + return concat(["/*", fromString(n.value, options), "*/"]); + + case "CommentLine": // Babel line comment. + case "Line": // Esprima line comment. + return concat(["//", fromString(n.value, options)]); + + // Type Annotations for Facebook Flow, typically stripped out or + // transformed away before printing. + case "TypeAnnotation": + var parts = []; + + if (n.typeAnnotation) { + if (n.typeAnnotation.type !== "FunctionTypeAnnotation") { + parts.push(": "); + } + parts.push(path.call(print, "typeAnnotation")); + return concat(parts); + } + + return fromString(""); + + case "AnyTypeAnnotation": + return fromString("any", options); + + case "MixedTypeAnnotation": + return fromString("mixed", options); + + case "ArrayTypeAnnotation": + return concat([ + path.call(print, "elementType"), + "[]" + ]); + + case "BooleanTypeAnnotation": + return fromString("boolean", options); + + case "BooleanLiteralTypeAnnotation": + assert.strictEqual(typeof n.value, "boolean"); + return fromString("" + n.value, options); + + case "DeclareClass": + return concat([ + fromString("declare class ", options), + path.call(print, "id"), + " ", + path.call(print, "body"), + ]); + + case "DeclareFunction": + return concat([ + fromString("declare function ", options), + path.call(print, "id"), + ";" + ]); + + case "DeclareModule": + return concat([ + fromString("declare module ", options), + path.call(print, "id"), + " ", + path.call(print, "body"), + ]); + + case "DeclareVariable": + return concat([ + fromString("declare var ", options), + path.call(print, "id"), + ";" + ]); + + case "FunctionTypeAnnotation": + // FunctionTypeAnnotation is ambiguous: + // declare function(a: B): void; OR + // var A: (a: B) => void; + var parts = []; + var parent = path.getParentNode(0); + var isArrowFunctionTypeAnnotation = !( + namedTypes.ObjectTypeCallProperty.check(parent) || + namedTypes.DeclareFunction.check(path.getParentNode(2)) + ); + + var needsColon = + isArrowFunctionTypeAnnotation && + !namedTypes.FunctionTypeParam.check(parent); + + if (needsColon) { + parts.push(": "); + } + + parts.push( + "(", + fromString(", ").join(path.map(print, "params")), + ")" + ); + + // The returnType is not wrapped in a TypeAnnotation, so the colon + // needs to be added separately. + if (n.returnType) { + parts.push( + isArrowFunctionTypeAnnotation ? " => " : ": ", + path.call(print, "returnType") + ); + } + + return concat(parts); + + case "FunctionTypeParam": + return concat([ + path.call(print, "name"), + ": ", + path.call(print, "typeAnnotation"), + ]); + + case "GenericTypeAnnotation": + return concat([ + path.call(print, "id"), + path.call(print, "typeParameters") + ]); + + case "InterfaceDeclaration": + var parts = [ + fromString("interface ", options), + path.call(print, "id"), + path.call(print, "typeParameters"), + " " + ]; + + if (n["extends"]) { + parts.push( + "extends ", + fromString(", ").join(path.map(print, "extends")) + ); + } + + parts.push(" ", path.call(print, "body")); + + return concat(parts); + + case "ClassImplements": + case "InterfaceExtends": + return concat([ + path.call(print, "id"), + path.call(print, "typeParameters") + ]); + + case "IntersectionTypeAnnotation": + return fromString(" & ").join(path.map(print, "types")); + + case "NullableTypeAnnotation": + return concat([ + "?", + path.call(print, "typeAnnotation") + ]); + + case "NumberTypeAnnotation": + return fromString("number", options); + + case "ObjectTypeCallProperty": + return path.call(print, "value"); + + case "ObjectTypeIndexer": + return concat([ + "[", + path.call(print, "id"), + ": ", + path.call(print, "key"), + "]: ", + path.call(print, "value") + ]); + + case "ObjectTypeProperty": + return concat([ + path.call(print, "key"), + ": ", + path.call(print, "value") + ]); + + case "QualifiedTypeIdentifier": + return concat([ + path.call(print, "qualification"), + ".", + path.call(print, "id") + ]); + + case "StringLiteralTypeAnnotation": + return fromString(nodeStr(n.value, options), options); + + case "NumberLiteralTypeAnnotation": + assert.strictEqual(typeof n.value, "number"); + return fromString("" + n.value, options); + + case "StringTypeAnnotation": + return fromString("string", options); + + case "TypeAlias": + return concat([ + "type ", + path.call(print, "id"), + " = ", + path.call(print, "right"), + ";" + ]); + + case "TypeCastExpression": + return concat([ + "(", + path.call(print, "expression"), + path.call(print, "typeAnnotation"), + ")" + ]); + + case "TypeParameterDeclaration": + case "TypeParameterInstantiation": + return concat([ + "<", + fromString(", ").join(path.map(print, "params")), + ">" + ]); + + case "TypeofTypeAnnotation": + return concat([ + fromString("typeof ", options), + path.call(print, "argument") + ]); + + case "UnionTypeAnnotation": + return fromString(" | ").join(path.map(print, "types")); + + case "VoidTypeAnnotation": + return fromString("void", options); + + // Unhandled types below. If encountered, nodes of these types should + // be either left alone or desugared into AST types that are fully + // supported by the pretty-printer. + case "ClassHeritage": // TODO + case "ComprehensionBlock": // TODO + case "ComprehensionExpression": // TODO + case "Glob": // TODO + case "GeneratorExpression": // TODO + case "LetStatement": // TODO + case "LetExpression": // TODO + case "GraphExpression": // TODO + case "GraphIndexExpression": // TODO + + // XML types that nobody cares about or needs to print. + case "XMLDefaultDeclaration": + case "XMLAnyName": + case "XMLQualifiedIdentifier": + case "XMLFunctionQualifiedIdentifier": + case "XMLAttributeSelector": + case "XMLFilterExpression": + case "XML": + case "XMLElement": + case "XMLList": + case "XMLEscape": + case "XMLText": + case "XMLStartTag": + case "XMLEndTag": + case "XMLPointTag": + case "XMLName": + case "XMLAttribute": + case "XMLCdata": + case "XMLComment": + case "XMLProcessingInstruction": + default: + debugger; + throw new Error("unknown type: " + JSON.stringify(n.type)); + } + + return p; +} + +function printStatementSequence(path, options, print) { + var inClassBody = + namedTypes.ClassBody && + namedTypes.ClassBody.check(path.getParentNode()); + + var filtered = []; + var sawComment = false; + var sawStatement = false; + + path.each(function(stmtPath) { + var i = stmtPath.getName(); + var stmt = stmtPath.getValue(); + + // Just in case the AST has been modified to contain falsy + // "statements," it's safer simply to skip them. + if (!stmt) { + return; + } + + // Skip printing EmptyStatement nodes to avoid leaving stray + // semicolons lying around. + if (stmt.type === "EmptyStatement") { + return; + } + + if (namedTypes.Comment.check(stmt)) { + // The pretty printer allows a dangling Comment node to act as + // a Statement when the Comment can't be attached to any other + // non-Comment node in the tree. + sawComment = true; + } else if (!inClassBody) { + namedTypes.Statement.assert(stmt); + sawStatement = true; + } + + // We can't hang onto stmtPath outside of this function, because + // it's just a reference to a mutable FastPath object, so we have + // to go ahead and print it here. + filtered.push({ + node: stmt, + printed: print(stmtPath) + }); + }); + + if (sawComment) { + assert.strictEqual( + sawStatement, false, + "Comments may appear as statements in otherwise empty statement " + + "lists, but may not coexist with non-Comment nodes." + ); + } + + var prevTrailingSpace = null; + var len = filtered.length; + var parts = []; + + filtered.forEach(function(info, i) { + var printed = info.printed; + var stmt = info.node; + var multiLine = printed.length > 1; + var notFirst = i > 0; + var notLast = i < len - 1; + var leadingSpace; + var trailingSpace; + var lines = stmt && stmt.loc && stmt.loc.lines; + var trueLoc = lines && options.reuseWhitespace && + util.getTrueLoc(stmt, lines); + + if (notFirst) { + if (trueLoc) { + var beforeStart = lines.skipSpaces(trueLoc.start, true); + var beforeStartLine = beforeStart ? beforeStart.line : 1; + var leadingGap = trueLoc.start.line - beforeStartLine; + leadingSpace = Array(leadingGap + 1).join("\n"); + } else { + leadingSpace = multiLine ? "\n\n" : "\n"; + } + } else { + leadingSpace = ""; + } + + if (notLast) { + if (trueLoc) { + var afterEnd = lines.skipSpaces(trueLoc.end); + var afterEndLine = afterEnd ? afterEnd.line : lines.length; + var trailingGap = afterEndLine - trueLoc.end.line; + trailingSpace = Array(trailingGap + 1).join("\n"); + } else { + trailingSpace = multiLine ? "\n\n" : "\n"; + } + } else { + trailingSpace = ""; + } + + parts.push( + maxSpace(prevTrailingSpace, leadingSpace), + printed + ); + + if (notLast) { + prevTrailingSpace = trailingSpace; + } else if (trailingSpace) { + parts.push(trailingSpace); + } + }); + + return concat(parts); +} + +function maxSpace(s1, s2) { + if (!s1 && !s2) { + return fromString(""); + } + + if (!s1) { + return fromString(s2); + } + + if (!s2) { + return fromString(s1); + } + + var spaceLines1 = fromString(s1); + var spaceLines2 = fromString(s2); + + if (spaceLines2.length > spaceLines1.length) { + return spaceLines2; + } + + return spaceLines1; +} + +function printMethod(path, options, print) { + var node = path.getNode(); + var kind = node.kind; + var parts = []; + + namedTypes.FunctionExpression.assert(node.value); + + if (node.decorators) { + path.each(function(decoratorPath) { + parts.push(print(decoratorPath), "\n"); + }, "decorators"); + } + + if (node.value.async) { + parts.push("async "); + } + + if (!kind || kind === "init" || kind === "method" || kind === "constructor") { + if (node.value.generator) { + parts.push("*"); + } + } else { + assert.ok(kind === "get" || kind === "set"); + parts.push(kind, " "); + } + + var key = path.call(print, "key"); + if (node.computed) { + key = concat(["[", key, "]"]); + } + + parts.push( + key, + path.call(print, "value", "typeParameters"), + "(", + path.call(function(valuePath) { + return printFunctionParams(valuePath, options, print); + }, "value"), + ")", + path.call(print, "value", "returnType"), + " ", + path.call(print, "value", "body") + ); + + return concat(parts); +} + +function printArgumentsList(path, options, print) { + var printed = path.map(print, "arguments"); + + var joined = fromString(", ").join(printed); + if (joined.getLineLength(1) > options.wrapColumn) { + joined = fromString(",\n").join(printed); + return concat([ + "(\n", + joined.indent(options.tabWidth), + options.trailingComma ? ",\n)" : "\n)" + ]); + } + + return concat(["(", joined, ")"]); +} + +function printFunctionParams(path, options, print) { + var fun = path.getValue(); + namedTypes.Function.assert(fun); + + var printed = path.map(print, "params"); + + if (fun.defaults) { + path.each(function(defExprPath) { + var i = defExprPath.getName(); + var p = printed[i]; + if (p && defExprPath.getValue()) { + printed[i] = concat([p, "=", print(defExprPath)]); + } + }, "defaults"); + } + + if (fun.rest) { + printed.push(concat(["...", path.call(print, "rest")])); + } + + var joined = fromString(", ").join(printed); + if (joined.length > 1 || + joined.getLineLength(1) > options.wrapColumn) { + joined = fromString(",\n").join(printed); + if (options.trailingComma && !fun.rest) { + joined = concat([joined, ",\n"]); + } + return concat(["\n", joined.indent(options.tabWidth)]); + } + + return joined; +} + +function adjustClause(clause, options) { + if (clause.length > 1) + return concat([" ", clause]); + + return concat([ + "\n", + maybeAddSemicolon(clause).indent(options.tabWidth) + ]); +} + +function lastNonSpaceCharacter(lines) { + var pos = lines.lastPos(); + do { + var ch = lines.charAt(pos); + if (/\S/.test(ch)) + return ch; + } while (lines.prevPos(pos)); +} + +function endsWithBrace(lines) { + return lastNonSpaceCharacter(lines) === "}"; +} + +function swapQuotes(str) { + return str.replace(/['"]/g, function(m) { + return m === '"' ? '\'' : '"'; + }); +} + +function nodeStr(str, options) { + isString.assert(str); + switch (options.quote) { + case "auto": + var double = JSON.stringify(str); + var single = swapQuotes(JSON.stringify(swapQuotes(str))); + return double.length > single.length ? single : double; + case "single": + return swapQuotes(JSON.stringify(swapQuotes(str))); + case "double": + default: + return JSON.stringify(str); + } +} + +function maybeAddSemicolon(lines) { + var eoc = lastNonSpaceCharacter(lines); + if (!eoc || "\n};".indexOf(eoc) < 0) + return concat([lines, ";"]); + return lines; +} + +},{"1":1,"561":561,"562":562,"563":563,"565":565,"567":567,"569":569,"570":570,"601":601}],569:[function(_dereq_,module,exports){ +// This module was originally created so that Recast could add its own +// custom types to the AST type system (in particular, the File type), but +// those types are now incorporated into ast-types, so this module doesn't +// have much to do anymore. Still, it might prove useful in the future. +module.exports = _dereq_(202); + +},{"202":202}],570:[function(_dereq_,module,exports){ +var assert = _dereq_(1); +var types = _dereq_(569); +var getFieldValue = types.getFieldValue; +var n = types.namedTypes; +var sourceMap = _dereq_(601); +var SourceMapConsumer = sourceMap.SourceMapConsumer; +var SourceMapGenerator = sourceMap.SourceMapGenerator; +var hasOwn = Object.prototype.hasOwnProperty; + +function getUnionOfKeys() { + var result = {}; + var argc = arguments.length; + for (var i = 0; i < argc; ++i) { + var keys = Object.keys(arguments[i]); + var keyCount = keys.length; + for (var j = 0; j < keyCount; ++j) { + result[keys[j]] = true; + } + } + return result; +} +exports.getUnionOfKeys = getUnionOfKeys; + +function comparePos(pos1, pos2) { + return (pos1.line - pos2.line) || (pos1.column - pos2.column); +} +exports.comparePos = comparePos; + +function copyPos(pos) { + return { + line: pos.line, + column: pos.column + }; +} +exports.copyPos = copyPos; + +exports.composeSourceMaps = function(formerMap, latterMap) { + if (formerMap) { + if (!latterMap) { + return formerMap; + } + } else { + return latterMap || null; + } + + var smcFormer = new SourceMapConsumer(formerMap); + var smcLatter = new SourceMapConsumer(latterMap); + var smg = new SourceMapGenerator({ + file: latterMap.file, + sourceRoot: latterMap.sourceRoot + }); + + var sourcesToContents = {}; + + smcLatter.eachMapping(function(mapping) { + var origPos = smcFormer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + + var sourceName = origPos.source; + if (sourceName === null) { + return; + } + + smg.addMapping({ + source: sourceName, + original: copyPos(origPos), + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + }, + name: mapping.name + }); + + var sourceContent = smcFormer.sourceContentFor(sourceName); + if (sourceContent && !hasOwn.call(sourcesToContents, sourceName)) { + sourcesToContents[sourceName] = sourceContent; + smg.setSourceContent(sourceName, sourceContent); + } + }); + + return smg.toJSON(); +}; + +exports.getTrueLoc = function(node, lines) { + // It's possible that node is newly-created (not parsed by Esprima), + // in which case it probably won't have a .loc property (or an + // .original property for that matter). That's fine; we'll just + // pretty-print it as usual. + if (!node.loc) { + return null; + } + + var start = node.loc.start; + var end = node.loc.end; + + // If the node has any comments, their locations might contribute to + // the true start/end positions of the node. + if (node.comments) { + node.comments.forEach(function(comment) { + if (comment.loc) { + if (comparePos(comment.loc.start, start) < 0) { + start = comment.loc.start; + } + + if (comparePos(end, comment.loc.end) < 0) { + end = comment.loc.end; + } + } + }); + } + + return { + // Finally, trim any leading or trailing whitespace from the true + // location of the node. + start: lines.skipSpaces(start, false, false), + end: lines.skipSpaces(end, true, false) + }; +}; + +exports.fixFaultyLocations = function(node) { + if ((n.MethodDefinition && n.MethodDefinition.check(node)) || + (n.Property.check(node) && (node.method || node.shorthand))) { + // If the node is a MethodDefinition or a .method or .shorthand + // Property, then the location information stored in + // node.value.loc is very likely untrustworthy (just the {body} + // part of a method, or nothing in the case of shorthand + // properties), so we null out that information to prevent + // accidental reuse of bogus source code during reprinting. + node.value.loc = null; + + if (n.FunctionExpression.check(node.value)) { + // FunctionExpression method values should be anonymous, + // because their .id fields are ignored anyway. + node.value.id = null; + } + } + + var loc = node.loc; + if (loc) { + if (loc.start.line < 1) { + loc.start.line = 1; + } + + if (loc.end.line < 1) { + loc.end.line = 1; + } + } +}; + +},{"1":1,"569":569,"601":601}],571:[function(_dereq_,module,exports){ +(function (process){ +var types = _dereq_(569); +var parse = _dereq_(566).parse; +var Printer = _dereq_(568).Printer; + +function print(node, options) { + return new Printer(options).print(node); +} + +function prettyPrint(node, options) { + return new Printer(options).printGenerically(node); +} + +function run(transformer, options) { + return runFile(process.argv[2], transformer, options); +} + +function runFile(path, transformer, options) { + _dereq_(3).readFile(path, "utf-8", function(err, code) { + if (err) { + console.error(err); + return; + } + + runString(code, transformer, options); + }); +} + +function defaultWriteback(output) { + process.stdout.write(output); +} + +function runString(code, transformer, options) { + var writeback = options && options.writeback || defaultWriteback; + transformer(parse(code, options), function(node) { + writeback(print(node, options).code); + }); +} + +Object.defineProperties(exports, { + /** + * Parse a string of code into an augmented syntax tree suitable for + * arbitrary modification and reprinting. + */ + parse: { + enumerable: true, + value: parse + }, + + /** + * Traverse and potentially modify an abstract syntax tree using a + * convenient visitor syntax: + * + * recast.visit(ast, { + * names: [], + * visitIdentifier: function(path) { + * var node = path.value; + * this.visitor.names.push(node.name); + * this.traverse(path); + * } + * }); + */ + visit: { + enumerable: true, + value: types.visit + }, + + /** + * Reprint a modified syntax tree using as much of the original source + * code as possible. + */ + print: { + enumerable: true, + value: print + }, + + /** + * Print without attempting to reuse any original source code. + */ + prettyPrint: { + enumerable: false, + value: prettyPrint + }, + + /** + * Customized version of require("ast-types"). + */ + types: { + enumerable: false, + value: types + }, + + /** + * Convenient command-line interface (see e.g. example/add-braces). + */ + run: { + enumerable: false, + value: run + } +}); + +}).call(this,_dereq_(10)) +},{"10":10,"3":3,"566":566,"568":568,"569":569}],572:[function(_dereq_,module,exports){ +(function (global){ +/*! https://mths.be/regenerate v1.2.0 by @mathias | MIT license */ +;(function(root) { + + // Detect free variables `exports`. + var freeExports = typeof exports == 'object' && exports; + + // Detect free variable `module`. + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + + // Detect free variable `global`, from Node.js or Browserified code, + // and use it as `root`. + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + var ERRORS = { + 'rangeOrder': 'A range\u2019s `stop` value must be greater than or equal ' + + 'to the `start` value.', + 'codePointRange': 'Invalid code point value. Code points range from ' + + 'U+000000 to U+10FFFF.' + }; + + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs + var HIGH_SURROGATE_MIN = 0xD800; + var HIGH_SURROGATE_MAX = 0xDBFF; + var LOW_SURROGATE_MIN = 0xDC00; + var LOW_SURROGATE_MAX = 0xDFFF; + + // In Regenerate output, `\0` will never be preceded by `\` because we sort + // by code point value, so let’s keep this regular expression simple. + var regexNull = /\\x00([^0123456789]|$)/g; + + var object = {}; + var hasOwnProperty = object.hasOwnProperty; + var extend = function(destination, source) { + var key; + for (key in source) { + if (hasOwnProperty.call(source, key)) { + destination[key] = source[key]; + } + } + return destination; + }; + + var forEach = function(array, callback) { + var index = -1; + var length = array.length; + while (++index < length) { + callback(array[index], index); + } + }; + + var toString = object.toString; + var isArray = function(value) { + return toString.call(value) == '[object Array]'; + }; + var isNumber = function(value) { + return typeof value == 'number' || + toString.call(value) == '[object Number]'; + }; + + // This assumes that `number` is a positive integer that `toString()`s nicely + // (which is the case for all code point values). + var zeroes = '0000'; + var pad = function(number, totalCharacters) { + var string = String(number); + return string.length < totalCharacters + ? (zeroes + string).slice(-totalCharacters) + : string; + }; + + var hex = function(number) { + return Number(number).toString(16).toUpperCase(); + }; + + var slice = [].slice; + + /*--------------------------------------------------------------------------*/ + + var dataFromCodePoints = function(codePoints) { + var index = -1; + var length = codePoints.length; + var max = length - 1; + var result = []; + var isStart = true; + var tmp; + var previous = 0; + while (++index < length) { + tmp = codePoints[index]; + if (isStart) { + result.push(tmp); + previous = tmp; + isStart = false; + } else { + if (tmp == previous + 1) { + if (index != max) { + previous = tmp; + continue; + } else { + isStart = true; + result.push(tmp + 1); + } + } else { + // End the previous range and start a new one. + result.push(previous + 1, tmp); + previous = tmp; + } + } + } + if (!isStart) { + result.push(tmp + 1); + } + return result; + }; + + var dataRemove = function(data, codePoint) { + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var length = data.length; + while (index < length) { + start = data[index]; + end = data[index + 1]; + if (codePoint >= start && codePoint < end) { + // Modify this pair. + if (codePoint == start) { + if (end == start + 1) { + // Just remove `start` and `end`. + data.splice(index, 2); + return data; + } else { + // Just replace `start` with a new value. + data[index] = codePoint + 1; + return data; + } + } else if (codePoint == end - 1) { + // Just replace `end` with a new value. + data[index + 1] = codePoint; + return data; + } else { + // Replace `[start, end]` with `[startA, endA, startB, endB]`. + data.splice(index, 2, start, codePoint, codePoint + 1, end); + return data; + } + } + index += 2; + } + return data; + }; + + var dataRemoveRange = function(data, rangeStart, rangeEnd) { + if (rangeEnd < rangeStart) { + throw Error(ERRORS.rangeOrder); + } + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + while (index < data.length) { + start = data[index]; + end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. + + // Exit as soon as no more matching pairs can be found. + if (start > rangeEnd) { + return data; + } + + // Check if this range pair is equal to, or forms a subset of, the range + // to be removed. + // E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`. + // E.g. we have `[40, 51]` and want to remove 0-100 → `[]`. + if (rangeStart <= start && rangeEnd >= end) { + // Remove this pair. + data.splice(index, 2); + continue; + } + + // Check if both `rangeStart` and `rangeEnd` are within the bounds of + // this pair. + // E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`. + if (rangeStart >= start && rangeEnd < end) { + if (rangeStart == start) { + // Replace `[start, end]` with `[startB, endB]`. + data[index] = rangeEnd + 1; + data[index + 1] = end + 1; + return data; + } + // Replace `[start, end]` with `[startA, endA, startB, endB]`. + data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1); + return data; + } + + // Check if only `rangeStart` is within the bounds of this pair. + // E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`. + if (rangeStart >= start && rangeStart <= end) { + // Replace `end` with `rangeStart`. + data[index + 1] = rangeStart; + // Note: we cannot `return` just yet, in case any following pairs still + // contain matching code points. + // E.g. we have `[0, 11, 14, 31]` and want to remove 4-20 + // → `[0, 4, 21, 31]`. + } + + // Check if only `rangeEnd` is within the bounds of this pair. + // E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`. + else if (rangeEnd >= start && rangeEnd <= end) { + // Just replace `start`. + data[index] = rangeEnd + 1; + return data; + } + + index += 2; + } + return data; + }; + + var dataAdd = function(data, codePoint) { + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var lastIndex = null; + var length = data.length; + if (codePoint < 0x0 || codePoint > 0x10FFFF) { + throw RangeError(ERRORS.codePointRange); + } + while (index < length) { + start = data[index]; + end = data[index + 1]; + + // Check if the code point is already in the set. + if (codePoint >= start && codePoint < end) { + return data; + } + + if (codePoint == start - 1) { + // Just replace `start` with a new value. + data[index] = codePoint; + return data; + } + + // At this point, if `start` is `greater` than `codePoint`, insert a new + // `[start, end]` pair before the current pair, or after the current pair + // if there is a known `lastIndex`. + if (start > codePoint) { + data.splice( + lastIndex != null ? lastIndex + 2 : 0, + 0, + codePoint, + codePoint + 1 + ); + return data; + } + + if (codePoint == end) { + // Check if adding this code point causes two separate ranges to become + // a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`. + if (codePoint + 1 == data[index + 2]) { + data.splice(index, 4, start, data[index + 3]); + return data; + } + // Else, just replace `end` with a new value. + data[index + 1] = codePoint + 1; + return data; + } + lastIndex = index; + index += 2; + } + // The loop has finished; add the new pair to the end of the data set. + data.push(codePoint, codePoint + 1); + return data; + }; + + var dataAddData = function(dataA, dataB) { + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var data = dataA.slice(); + var length = dataB.length; + while (index < length) { + start = dataB[index]; + end = dataB[index + 1] - 1; + if (start == end) { + data = dataAdd(data, start); + } else { + data = dataAddRange(data, start, end); + } + index += 2; + } + return data; + }; + + var dataRemoveData = function(dataA, dataB) { + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var data = dataA.slice(); + var length = dataB.length; + while (index < length) { + start = dataB[index]; + end = dataB[index + 1] - 1; + if (start == end) { + data = dataRemove(data, start); + } else { + data = dataRemoveRange(data, start, end); + } + index += 2; + } + return data; + }; + + var dataAddRange = function(data, rangeStart, rangeEnd) { + if (rangeEnd < rangeStart) { + throw Error(ERRORS.rangeOrder); + } + if ( + rangeStart < 0x0 || rangeStart > 0x10FFFF || + rangeEnd < 0x0 || rangeEnd > 0x10FFFF + ) { + throw RangeError(ERRORS.codePointRange); + } + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var added = false; + var length = data.length; + while (index < length) { + start = data[index]; + end = data[index + 1]; + + if (added) { + // The range has already been added to the set; at this point, we just + // need to get rid of the following ranges in case they overlap. + + // Check if this range can be combined with the previous range. + if (start == rangeEnd + 1) { + data.splice(index - 1, 2); + return data; + } + + // Exit as soon as no more possibly overlapping pairs can be found. + if (start > rangeEnd) { + return data; + } + + // E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have + // `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the + // `0,16` range that was previously added. + if (start >= rangeStart && start <= rangeEnd) { + // `start` lies within the range that was previously added. + + if (end > rangeStart && end - 1 <= rangeEnd) { + // `end` lies within the range that was previously added as well, + // so remove this pair. + data.splice(index, 2); + index -= 2; + // Note: we cannot `return` just yet, as there may still be other + // overlapping pairs. + } else { + // `start` lies within the range that was previously added, but + // `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so + // now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`. + // Remove the previously added `end` and the current `start`. + data.splice(index - 1, 2); + index -= 2; + } + + // Note: we cannot return yet. + } + + } + + else if (start == rangeEnd + 1) { + data[index] = rangeStart; + return data; + } + + // Check if a new pair must be inserted *before* the current one. + else if (start > rangeEnd) { + data.splice(index, 0, rangeStart, rangeEnd + 1); + return data; + } + + else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) { + // The new range lies entirely within an existing range pair. No action + // needed. + return data; + } + + else if ( + // E.g. `[0, 11]` and you add 5-15 → `[0, 16]`. + (rangeStart >= start && rangeStart < end) || + // E.g. `[0, 3]` and you add 3-6 → `[0, 7]`. + end == rangeStart + ) { + // Replace `end` with the new value. + data[index + 1] = rangeEnd + 1; + // Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]` + // and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part. + added = true; + // Note: we cannot `return` just yet. + } + + else if (rangeStart <= start && rangeEnd + 1 >= end) { + // The new range is a superset of the old range. + data[index] = rangeStart; + data[index + 1] = rangeEnd + 1; + added = true; + } + + index += 2; + } + // The loop has finished without doing anything; add the new pair to the end + // of the data set. + if (!added) { + data.push(rangeStart, rangeEnd + 1); + } + return data; + }; + + var dataContains = function(data, codePoint) { + var index = 0; + var length = data.length; + // Exit early if `codePoint` is not within `data`’s overall range. + var start = data[index]; + var end = data[length - 1]; + if (length >= 2) { + if (codePoint < start || codePoint > end) { + return false; + } + } + // Iterate over the data per `(start, end)` pair. + while (index < length) { + start = data[index]; + end = data[index + 1]; + if (codePoint >= start && codePoint < end) { + return true; + } + index += 2; + } + return false; + }; + + var dataIntersection = function(data, codePoints) { + var index = 0; + var length = codePoints.length; + var codePoint; + var result = []; + while (index < length) { + codePoint = codePoints[index]; + if (dataContains(data, codePoint)) { + result.push(codePoint); + } + ++index; + } + return dataFromCodePoints(result); + }; + + var dataIsEmpty = function(data) { + return !data.length; + }; + + var dataIsSingleton = function(data) { + // Check if the set only represents a single code point. + return data.length == 2 && data[0] + 1 == data[1]; + }; + + var dataToArray = function(data) { + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var result = []; + var length = data.length; + while (index < length) { + start = data[index]; + end = data[index + 1]; + while (start < end) { + result.push(start); + ++start; + } + index += 2; + } + return result; + }; + + /*--------------------------------------------------------------------------*/ + + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + var floor = Math.floor; + var highSurrogate = function(codePoint) { + return parseInt( + floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, + 10 + ); + }; + + var lowSurrogate = function(codePoint) { + return parseInt( + (codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, + 10 + ); + }; + + var stringFromCharCode = String.fromCharCode; + var codePointToString = function(codePoint) { + var string; + // https://mathiasbynens.be/notes/javascript-escapes#single + // Note: the `\b` escape sequence for U+0008 BACKSPACE in strings has a + // different meaning in regular expressions (word boundary), so it cannot + // be used here. + if (codePoint == 0x09) { + string = '\\t'; + } + // Note: IE < 9 treats `'\v'` as `'v'`, so avoid using it. + // else if (codePoint == 0x0B) { + // string = '\\v'; + // } + else if (codePoint == 0x0A) { + string = '\\n'; + } + else if (codePoint == 0x0C) { + string = '\\f'; + } + else if (codePoint == 0x0D) { + string = '\\r'; + } + else if (codePoint == 0x5C) { + string = '\\\\'; + } + else if ( + codePoint == 0x24 || + (codePoint >= 0x28 && codePoint <= 0x2B) || + codePoint == 0x2D || codePoint == 0x2E || codePoint == 0x3F || + (codePoint >= 0x5B && codePoint <= 0x5E) || + (codePoint >= 0x7B && codePoint <= 0x7D) + ) { + // The code point maps to an unsafe printable ASCII character; + // backslash-escape it. Here’s the list of those symbols: + // + // $()*+-.?[\]^{|} + // + // See #7 for more info. + string = '\\' + stringFromCharCode(codePoint); + } + else if (codePoint >= 0x20 && codePoint <= 0x7E) { + // The code point maps to one of these printable ASCII symbols + // (including the space character): + // + // !"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO + // PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~ + // + // These can safely be used directly. + string = stringFromCharCode(codePoint); + } + else if (codePoint <= 0xFF) { + // https://mathiasbynens.be/notes/javascript-escapes#hexadecimal + string = '\\x' + pad(hex(codePoint), 2); + } + else { // `codePoint <= 0xFFFF` holds true. + // https://mathiasbynens.be/notes/javascript-escapes#unicode + string = '\\u' + pad(hex(codePoint), 4); + } + + // There’s no need to account for astral symbols / surrogate pairs here, + // since `codePointToString` is private and only used for BMP code points. + // But if that’s what you need, just add an `else` block with this code: + // + // string = '\\u' + pad(hex(highSurrogate(codePoint)), 4) + // + '\\u' + pad(hex(lowSurrogate(codePoint)), 4); + + return string; + }; + + var symbolToCodePoint = function(symbol) { + var length = symbol.length; + var first = symbol.charCodeAt(0); + var second; + if ( + first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && + length > 1 // There is a next code unit. + ) { + // `first` is a high surrogate, and there is a next character. Assume + // it’s a low surrogate (else it’s invalid usage of Regenerate anyway). + second = symbol.charCodeAt(1); + // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - HIGH_SURROGATE_MIN) * 0x400 + + second - LOW_SURROGATE_MIN + 0x10000; + } + return first; + }; + + var createBMPCharacterClasses = function(data) { + // Iterate over the data per `(start, end)` pair. + var result = ''; + var index = 0; + var start; + var end; + var length = data.length; + if (dataIsSingleton(data)) { + return codePointToString(data[0]); + } + while (index < length) { + start = data[index]; + end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. + if (start == end) { + result += codePointToString(start); + } else if (start + 1 == end) { + result += codePointToString(start) + codePointToString(end); + } else { + result += codePointToString(start) + '-' + codePointToString(end); + } + index += 2; + } + return '[' + result + ']'; + }; + + var splitAtBMP = function(data) { + // Iterate over the data per `(start, end)` pair. + var loneHighSurrogates = []; + var loneLowSurrogates = []; + var bmp = []; + var astral = []; + var index = 0; + var start; + var end; + var length = data.length; + while (index < length) { + start = data[index]; + end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. + + if (start < HIGH_SURROGATE_MIN) { + + // The range starts and ends before the high surrogate range. + // E.g. (0, 0x10). + if (end < HIGH_SURROGATE_MIN) { + bmp.push(start, end + 1); + } + + // The range starts before the high surrogate range and ends within it. + // E.g. (0, 0xD855). + if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { + bmp.push(start, HIGH_SURROGATE_MIN); + loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1); + } + + // The range starts before the high surrogate range and ends in the low + // surrogate range. E.g. (0, 0xDCFF). + if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { + bmp.push(start, HIGH_SURROGATE_MIN); + loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1); + loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); + } + + // The range starts before the high surrogate range and ends after the + // low surrogate range. E.g. (0, 0x10FFFF). + if (end > LOW_SURROGATE_MAX) { + bmp.push(start, HIGH_SURROGATE_MIN); + loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1); + loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1); + if (end <= 0xFFFF) { + bmp.push(LOW_SURROGATE_MAX + 1, end + 1); + } else { + bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); + astral.push(0xFFFF + 1, end + 1); + } + } + + } else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) { + + // The range starts and ends in the high surrogate range. + // E.g. (0xD855, 0xD866). + if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { + loneHighSurrogates.push(start, end + 1); + } + + // The range starts in the high surrogate range and ends in the low + // surrogate range. E.g. (0xD855, 0xDCFF). + if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { + loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); + loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); + } + + // The range starts in the high surrogate range and ends after the low + // surrogate range. E.g. (0xD855, 0x10FFFF). + if (end > LOW_SURROGATE_MAX) { + loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); + loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1); + if (end <= 0xFFFF) { + bmp.push(LOW_SURROGATE_MAX + 1, end + 1); + } else { + bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); + astral.push(0xFFFF + 1, end + 1); + } + } + + } else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) { + + // The range starts and ends in the low surrogate range. + // E.g. (0xDCFF, 0xDDFF). + if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { + loneLowSurrogates.push(start, end + 1); + } + + // The range starts in the low surrogate range and ends after the low + // surrogate range. E.g. (0xDCFF, 0x10FFFF). + if (end > LOW_SURROGATE_MAX) { + loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1); + if (end <= 0xFFFF) { + bmp.push(LOW_SURROGATE_MAX + 1, end + 1); + } else { + bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); + astral.push(0xFFFF + 1, end + 1); + } + } + + } else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) { + + // The range starts and ends after the low surrogate range. + // E.g. (0xFFAA, 0x10FFFF). + if (end <= 0xFFFF) { + bmp.push(start, end + 1); + } else { + bmp.push(start, 0xFFFF + 1); + astral.push(0xFFFF + 1, end + 1); + } + + } else { + + // The range starts and ends in the astral range. + astral.push(start, end + 1); + + } + + index += 2; + } + return { + 'loneHighSurrogates': loneHighSurrogates, + 'loneLowSurrogates': loneLowSurrogates, + 'bmp': bmp, + 'astral': astral + }; + }; + + var optimizeSurrogateMappings = function(surrogateMappings) { + var result = []; + var tmpLow = []; + var addLow = false; + var mapping; + var nextMapping; + var highSurrogates; + var lowSurrogates; + var nextHighSurrogates; + var nextLowSurrogates; + var index = -1; + var length = surrogateMappings.length; + while (++index < length) { + mapping = surrogateMappings[index]; + nextMapping = surrogateMappings[index + 1]; + if (!nextMapping) { + result.push(mapping); + continue; + } + highSurrogates = mapping[0]; + lowSurrogates = mapping[1]; + nextHighSurrogates = nextMapping[0]; + nextLowSurrogates = nextMapping[1]; + + // Check for identical high surrogate ranges. + tmpLow = lowSurrogates; + while ( + nextHighSurrogates && + highSurrogates[0] == nextHighSurrogates[0] && + highSurrogates[1] == nextHighSurrogates[1] + ) { + // Merge with the next item. + if (dataIsSingleton(nextLowSurrogates)) { + tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]); + } else { + tmpLow = dataAddRange( + tmpLow, + nextLowSurrogates[0], + nextLowSurrogates[1] - 1 + ); + } + ++index; + mapping = surrogateMappings[index]; + highSurrogates = mapping[0]; + lowSurrogates = mapping[1]; + nextMapping = surrogateMappings[index + 1]; + nextHighSurrogates = nextMapping && nextMapping[0]; + nextLowSurrogates = nextMapping && nextMapping[1]; + addLow = true; + } + result.push([ + highSurrogates, + addLow ? tmpLow : lowSurrogates + ]); + addLow = false; + } + return optimizeByLowSurrogates(result); + }; + + var optimizeByLowSurrogates = function(surrogateMappings) { + if (surrogateMappings.length == 1) { + return surrogateMappings; + } + var index = -1; + var innerIndex = -1; + while (++index < surrogateMappings.length) { + var mapping = surrogateMappings[index]; + var lowSurrogates = mapping[1]; + var lowSurrogateStart = lowSurrogates[0]; + var lowSurrogateEnd = lowSurrogates[1]; + innerIndex = index; // Note: the loop starts at the next index. + while (++innerIndex < surrogateMappings.length) { + var otherMapping = surrogateMappings[innerIndex]; + var otherLowSurrogates = otherMapping[1]; + var otherLowSurrogateStart = otherLowSurrogates[0]; + var otherLowSurrogateEnd = otherLowSurrogates[1]; + if ( + lowSurrogateStart == otherLowSurrogateStart && + lowSurrogateEnd == otherLowSurrogateEnd + ) { + // Add the code points in the other item to this one. + if (dataIsSingleton(otherMapping[0])) { + mapping[0] = dataAdd(mapping[0], otherMapping[0][0]); + } else { + mapping[0] = dataAddRange( + mapping[0], + otherMapping[0][0], + otherMapping[0][1] - 1 + ); + } + // Remove the other, now redundant, item. + surrogateMappings.splice(innerIndex, 1); + --innerIndex; + } + } + } + return surrogateMappings; + }; + + var surrogateSet = function(data) { + // Exit early if `data` is an empty set. + if (!data.length) { + return []; + } + + // Iterate over the data per `(start, end)` pair. + var index = 0; + var start; + var end; + var startHigh; + var startLow; + var prevStartHigh = 0; + var prevEndHigh = 0; + var tmpLow = []; + var endHigh; + var endLow; + var surrogateMappings = []; + var length = data.length; + var dataHigh = []; + while (index < length) { + start = data[index]; + end = data[index + 1] - 1; + + startHigh = highSurrogate(start); + startLow = lowSurrogate(start); + endHigh = highSurrogate(end); + endLow = lowSurrogate(end); + + var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN; + var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX; + var complete = false; + + // Append the previous high-surrogate-to-low-surrogate mappings. + // Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`. + if ( + startHigh == endHigh || + startsWithLowestLowSurrogate && endsWithHighestLowSurrogate + ) { + surrogateMappings.push([ + [startHigh, endHigh + 1], + [startLow, endLow + 1] + ]); + complete = true; + } else { + surrogateMappings.push([ + [startHigh, startHigh + 1], + [startLow, LOW_SURROGATE_MAX + 1] + ]); + } + + // Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to + // `(endHigh - 1, LOW_SURROGATE_MAX)`. + if (!complete && startHigh + 1 < endHigh) { + if (endsWithHighestLowSurrogate) { + // Combine step 2 and step 3. + surrogateMappings.push([ + [startHigh + 1, endHigh + 1], + [LOW_SURROGATE_MIN, endLow + 1] + ]); + complete = true; + } else { + surrogateMappings.push([ + [startHigh + 1, endHigh], + [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1] + ]); + } + } + + // Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`. + if (!complete) { + surrogateMappings.push([ + [endHigh, endHigh + 1], + [LOW_SURROGATE_MIN, endLow + 1] + ]); + } + + prevStartHigh = startHigh; + prevEndHigh = endHigh; + + index += 2; + } + + // The format of `surrogateMappings` is as follows: + // + // [ surrogateMapping1, surrogateMapping2 ] + // + // i.e.: + // + // [ + // [ highSurrogates1, lowSurrogates1 ], + // [ highSurrogates2, lowSurrogates2 ] + // ] + return optimizeSurrogateMappings(surrogateMappings); + }; + + var createSurrogateCharacterClasses = function(surrogateMappings) { + var result = []; + forEach(surrogateMappings, function(surrogateMapping) { + var highSurrogates = surrogateMapping[0]; + var lowSurrogates = surrogateMapping[1]; + result.push( + createBMPCharacterClasses(highSurrogates) + + createBMPCharacterClasses(lowSurrogates) + ); + }); + return result.join('|'); + }; + + var createCharacterClassesFromData = function(data, bmpOnly) { + var result = []; + + var parts = splitAtBMP(data); + var loneHighSurrogates = parts.loneHighSurrogates; + var loneLowSurrogates = parts.loneLowSurrogates; + var bmp = parts.bmp; + var astral = parts.astral; + var hasAstral = !dataIsEmpty(parts.astral); + var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates); + var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates); + + var surrogateMappings = surrogateSet(astral); + + if (bmpOnly) { + bmp = dataAddData(bmp, loneHighSurrogates); + hasLoneHighSurrogates = false; + bmp = dataAddData(bmp, loneLowSurrogates); + hasLoneLowSurrogates = false; + } + + if (!dataIsEmpty(bmp)) { + // The data set contains BMP code points that are not high surrogates + // needed for astral code points in the set. + result.push(createBMPCharacterClasses(bmp)); + } + if (surrogateMappings.length) { + // The data set contains astral code points; append character classes + // based on their surrogate pairs. + result.push(createSurrogateCharacterClasses(surrogateMappings)); + } + // https://gist.github.com/mathiasbynens/bbe7f870208abcfec860 + if (hasLoneHighSurrogates) { + result.push( + createBMPCharacterClasses(loneHighSurrogates) + + // Make sure the high surrogates aren’t part of a surrogate pair. + '(?![\\uDC00-\\uDFFF])' + ); + } + if (hasLoneLowSurrogates) { + result.push( + // Make sure the low surrogates aren’t part of a surrogate pair. + '(?:[^\\uD800-\\uDBFF]|^)' + + createBMPCharacterClasses(loneLowSurrogates) + ); + } + return result.join('|'); + }; + + /*--------------------------------------------------------------------------*/ + + // `regenerate` can be used as a constructor (and new methods can be added to + // its prototype) but also as a regular function, the latter of which is the + // documented and most common usage. For that reason, it’s not capitalized. + var regenerate = function(value) { + if (arguments.length > 1) { + value = slice.call(arguments); + } + if (this instanceof regenerate) { + this.data = []; + return value ? this.add(value) : this; + } + return (new regenerate).add(value); + }; + + regenerate.version = '1.2.0'; + + var proto = regenerate.prototype; + extend(proto, { + 'add': function(value) { + var $this = this; + if (value == null) { + return $this; + } + if (value instanceof regenerate) { + // Allow passing other Regenerate instances. + $this.data = dataAddData($this.data, value.data); + return $this; + } + if (arguments.length > 1) { + value = slice.call(arguments); + } + if (isArray(value)) { + forEach(value, function(item) { + $this.add(item); + }); + return $this; + } + $this.data = dataAdd( + $this.data, + isNumber(value) ? value : symbolToCodePoint(value) + ); + return $this; + }, + 'remove': function(value) { + var $this = this; + if (value == null) { + return $this; + } + if (value instanceof regenerate) { + // Allow passing other Regenerate instances. + $this.data = dataRemoveData($this.data, value.data); + return $this; + } + if (arguments.length > 1) { + value = slice.call(arguments); + } + if (isArray(value)) { + forEach(value, function(item) { + $this.remove(item); + }); + return $this; + } + $this.data = dataRemove( + $this.data, + isNumber(value) ? value : symbolToCodePoint(value) + ); + return $this; + }, + 'addRange': function(start, end) { + var $this = this; + $this.data = dataAddRange($this.data, + isNumber(start) ? start : symbolToCodePoint(start), + isNumber(end) ? end : symbolToCodePoint(end) + ); + return $this; + }, + 'removeRange': function(start, end) { + var $this = this; + var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start); + var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end); + $this.data = dataRemoveRange( + $this.data, + startCodePoint, + endCodePoint + ); + return $this; + }, + 'intersection': function(argument) { + var $this = this; + // Allow passing other Regenerate instances. + // TODO: Optimize this by writing and using `dataIntersectionData()`. + var array = argument instanceof regenerate ? + dataToArray(argument.data) : + argument; + $this.data = dataIntersection($this.data, array); + return $this; + }, + 'contains': function(codePoint) { + return dataContains( + this.data, + isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint) + ); + }, + 'clone': function() { + var set = new regenerate; + set.data = this.data.slice(0); + return set; + }, + 'toString': function(options) { + var result = createCharacterClassesFromData( + this.data, + options ? options.bmpOnly : false + ); + // Use `\0` instead of `\x00` where possible. + return result.replace(regexNull, '\\0$1'); + }, + 'toRegExp': function(flags) { + return RegExp(this.toString(), flags || ''); + }, + 'valueOf': function() { // Note: `valueOf` is aliased as `toArray`. + return dataToArray(this.data); + } + }); + + proto.toArray = proto.valueOf; + + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define(function() { + return regenerate; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = regenerate; + } else { // in Narwhal or RingoJS v0.7.0- + freeExports.regenerate = regenerate; + } + } else { // in Rhino or a web browser + root.regenerate = regenerate; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],573:[function(_dereq_,module,exports){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var types = _dereq_(571).types; +var isArray = types.builtInTypes.array; +var b = types.builders; +var n = types.namedTypes; +var leap = _dereq_(575); +var meta = _dereq_(576); +var util = _dereq_(577); +var runtimeProperty = util.runtimeProperty; +var hasOwn = Object.prototype.hasOwnProperty; + +function Emitter(contextId) { + assert.ok(this instanceof Emitter); + n.Identifier.assert(contextId); + + // Used to generate unique temporary names. + this.nextTempId = 0; + + Object.defineProperties(this, { + // In order to make sure the context object does not collide with + // anything in the local scope, we might have to rename it, so we + // refer to it symbolically instead of just assuming that it will be + // called "context". + contextId: { value: contextId }, + + // An append-only list of Statements that grows each time this.emit is + // called. + listing: { value: [] }, + + // A sparse array whose keys correspond to locations in this.listing + // that have been marked as branch/jump targets. + marked: { value: [true] }, + + // The last location will be marked when this.getDispatchLoop is + // called. + finalLoc: { value: loc() }, + + // A list of all leap.TryEntry statements emitted. + tryEntries: { value: [] } + }); + + // The .leapManager property needs to be defined by a separate + // defineProperties call so that .finalLoc will be visible to the + // leap.LeapManager constructor. + Object.defineProperties(this, { + // Each time we evaluate the body of a loop, we tell this.leapManager + // to enter a nested loop context that determines the meaning of break + // and continue statements therein. + leapManager: { value: new leap.LeapManager(this) } + }); +} + +var Ep = Emitter.prototype; +exports.Emitter = Emitter; + +// Offsets into this.listing that could be used as targets for branches or +// jumps are represented as numeric Literal nodes. This representation has +// the amazingly convenient benefit of allowing the exact value of the +// location to be determined at any time, even after generating code that +// refers to the location. +function loc() { + return b.literal(-1); +} + +// Sets the exact value of the given location to the offset of the next +// Statement emitted. +Ep.mark = function(loc) { + n.Literal.assert(loc); + var index = this.listing.length; + if (loc.value === -1) { + loc.value = index; + } else { + // Locations can be marked redundantly, but their values cannot change + // once set the first time. + assert.strictEqual(loc.value, index); + } + this.marked[index] = true; + return loc; +}; + +Ep.emit = function(node) { + if (n.Expression.check(node)) + node = b.expressionStatement(node); + n.Statement.assert(node); + this.listing.push(node); +}; + +// Shorthand for emitting assignment statements. This will come in handy +// for assignments to temporary variables. +Ep.emitAssign = function(lhs, rhs) { + this.emit(this.assign(lhs, rhs)); + return lhs; +}; + +// Shorthand for an assignment statement. +Ep.assign = function(lhs, rhs) { + return b.expressionStatement( + b.assignmentExpression("=", lhs, rhs)); +}; + +// Convenience function for generating expressions like context.next, +// context.sent, and context.rval. +Ep.contextProperty = function(name, computed) { + return b.memberExpression( + this.contextId, + computed ? b.literal(name) : b.identifier(name), + !!computed + ); +}; + +// Shorthand for setting context.rval and jumping to `context.stop()`. +Ep.stop = function(rval) { + if (rval) { + this.setReturnValue(rval); + } + + this.jump(this.finalLoc); +}; + +Ep.setReturnValue = function(valuePath) { + n.Expression.assert(valuePath.value); + + this.emitAssign( + this.contextProperty("rval"), + this.explodeExpression(valuePath) + ); +}; + +Ep.clearPendingException = function(tryLoc, assignee) { + n.Literal.assert(tryLoc); + + var catchCall = b.callExpression( + this.contextProperty("catch", true), + [tryLoc] + ); + + if (assignee) { + this.emitAssign(assignee, catchCall); + } else { + this.emit(catchCall); + } +}; + +// Emits code for an unconditional jump to the given location, even if the +// exact value of the location is not yet known. +Ep.jump = function(toLoc) { + this.emitAssign(this.contextProperty("next"), toLoc); + this.emit(b.breakStatement()); +}; + +// Conditional jump. +Ep.jumpIf = function(test, toLoc) { + n.Expression.assert(test); + n.Literal.assert(toLoc); + + this.emit(b.ifStatement( + test, + b.blockStatement([ + this.assign(this.contextProperty("next"), toLoc), + b.breakStatement() + ]) + )); +}; + +// Conditional jump, with the condition negated. +Ep.jumpIfNot = function(test, toLoc) { + n.Expression.assert(test); + n.Literal.assert(toLoc); + + var negatedTest; + if (n.UnaryExpression.check(test) && + test.operator === "!") { + // Avoid double negation. + negatedTest = test.argument; + } else { + negatedTest = b.unaryExpression("!", test); + } + + this.emit(b.ifStatement( + negatedTest, + b.blockStatement([ + this.assign(this.contextProperty("next"), toLoc), + b.breakStatement() + ]) + )); +}; + +// Returns a unique MemberExpression that can be used to store and +// retrieve temporary values. Since the object of the member expression is +// the context object, which is presumed to coexist peacefully with all +// other local variables, and since we just increment `nextTempId` +// monotonically, uniqueness is assured. +Ep.makeTempVar = function() { + return this.contextProperty("t" + this.nextTempId++); +}; + +Ep.getContextFunction = function(id) { + return b.functionExpression( + id || null/*Anonymous*/, + [this.contextId], + b.blockStatement([this.getDispatchLoop()]), + false, // Not a generator anymore! + false // Nor an expression. + ); +}; + +// Turns this.listing into a loop of the form +// +// while (1) switch (context.next) { +// case 0: +// ... +// case n: +// return context.stop(); +// } +// +// Each marked location in this.listing will correspond to one generated +// case statement. +Ep.getDispatchLoop = function() { + var self = this; + var cases = []; + var current; + + // If we encounter a break, continue, or return statement in a switch + // case, we can skip the rest of the statements until the next case. + var alreadyEnded = false; + + self.listing.forEach(function(stmt, i) { + if (self.marked.hasOwnProperty(i)) { + cases.push(b.switchCase( + b.literal(i), + current = [])); + alreadyEnded = false; + } + + if (!alreadyEnded) { + current.push(stmt); + if (isSwitchCaseEnder(stmt)) + alreadyEnded = true; + } + }); + + // Now that we know how many statements there will be in this.listing, + // we can finally resolve this.finalLoc.value. + this.finalLoc.value = this.listing.length; + + cases.push( + b.switchCase(this.finalLoc, [ + // Intentionally fall through to the "end" case... + ]), + + // So that the runtime can jump to the final location without having + // to know its offset, we provide the "end" case as a synonym. + b.switchCase(b.literal("end"), [ + // This will check/clear both context.thrown and context.rval. + b.returnStatement( + b.callExpression(this.contextProperty("stop"), []) + ) + ]) + ); + + return b.whileStatement( + b.literal(1), + b.switchStatement( + b.assignmentExpression( + "=", + this.contextProperty("prev"), + this.contextProperty("next") + ), + cases + ) + ); +}; + +// See comment above re: alreadyEnded. +function isSwitchCaseEnder(stmt) { + return n.BreakStatement.check(stmt) + || n.ContinueStatement.check(stmt) + || n.ReturnStatement.check(stmt) + || n.ThrowStatement.check(stmt); +} + +Ep.getTryLocsList = function() { + if (this.tryEntries.length === 0) { + // To avoid adding a needless [] to the majority of runtime.wrap + // argument lists, force the caller to handle this case specially. + return null; + } + + var lastLocValue = 0; + + return b.arrayExpression( + this.tryEntries.map(function(tryEntry) { + var thisLocValue = tryEntry.firstLoc.value; + assert.ok(thisLocValue >= lastLocValue, "try entries out of order"); + lastLocValue = thisLocValue; + + var ce = tryEntry.catchEntry; + var fe = tryEntry.finallyEntry; + + var locs = [ + tryEntry.firstLoc, + // The null here makes a hole in the array. + ce ? ce.firstLoc : null + ]; + + if (fe) { + locs[2] = fe.firstLoc; + locs[3] = fe.afterLoc; + } + + return b.arrayExpression(locs); + }) + ); +}; + +// All side effects must be realized in order. + +// If any subexpression harbors a leap, all subexpressions must be +// neutered of side effects. + +// No destructive modification of AST nodes. + +Ep.explode = function(path, ignoreResult) { + assert.ok(path instanceof types.NodePath); + + var node = path.value; + var self = this; + + n.Node.assert(node); + + if (n.Statement.check(node)) + return self.explodeStatement(path); + + if (n.Expression.check(node)) + return self.explodeExpression(path, ignoreResult); + + if (n.Declaration.check(node)) + throw getDeclError(node); + + switch (node.type) { + case "Program": + return path.get("body").map( + self.explodeStatement, + self + ); + + case "VariableDeclarator": + throw getDeclError(node); + + // These node types should be handled by their parent nodes + // (ObjectExpression, SwitchStatement, and TryStatement, respectively). + case "Property": + case "SwitchCase": + case "CatchClause": + throw new Error( + node.type + " nodes should be handled by their parents"); + + default: + throw new Error( + "unknown Node of type " + + JSON.stringify(node.type)); + } +}; + +function getDeclError(node) { + return new Error( + "all declarations should have been transformed into " + + "assignments before the Exploder began its work: " + + JSON.stringify(node)); +} + +Ep.explodeStatement = function(path, labelId) { + assert.ok(path instanceof types.NodePath); + + var stmt = path.value; + var self = this; + + n.Statement.assert(stmt); + + if (labelId) { + n.Identifier.assert(labelId); + } else { + labelId = null; + } + + // Explode BlockStatement nodes even if they do not contain a yield, + // because we don't want or need the curly braces. + if (n.BlockStatement.check(stmt)) { + return path.get("body").each( + self.explodeStatement, + self + ); + } + + if (!meta.containsLeap(stmt)) { + // Technically we should be able to avoid emitting the statement + // altogether if !meta.hasSideEffects(stmt), but that leads to + // confusing generated code (for instance, `while (true) {}` just + // disappears) and is probably a more appropriate job for a dedicated + // dead code elimination pass. + self.emit(stmt); + return; + } + + switch (stmt.type) { + case "ExpressionStatement": + self.explodeExpression(path.get("expression"), true); + break; + + case "LabeledStatement": + var after = loc(); + + // Did you know you can break from any labeled block statement or + // control structure? Well, you can! Note: when a labeled loop is + // encountered, the leap.LabeledEntry created here will immediately + // enclose a leap.LoopEntry on the leap manager's stack, and both + // entries will have the same label. Though this works just fine, it + // may seem a bit redundant. In theory, we could check here to + // determine if stmt knows how to handle its own label; for example, + // stmt happens to be a WhileStatement and so we know it's going to + // establish its own LoopEntry when we explode it (below). Then this + // LabeledEntry would be unnecessary. Alternatively, we might be + // tempted not to pass stmt.label down into self.explodeStatement, + // because we've handled the label here, but that's a mistake because + // labeled loops may contain labeled continue statements, which is not + // something we can handle in this generic case. All in all, I think a + // little redundancy greatly simplifies the logic of this case, since + // it's clear that we handle all possible LabeledStatements correctly + // here, regardless of whether they interact with the leap manager + // themselves. Also remember that labels and break/continue-to-label + // statements are rare, and all of this logic happens at transform + // time, so it has no additional runtime cost. + self.leapManager.withEntry( + new leap.LabeledEntry(after, stmt.label), + function() { + self.explodeStatement(path.get("body"), stmt.label); + } + ); + + self.mark(after); + + break; + + case "WhileStatement": + var before = loc(); + var after = loc(); + + self.mark(before); + self.jumpIfNot(self.explodeExpression(path.get("test")), after); + self.leapManager.withEntry( + new leap.LoopEntry(after, before, labelId), + function() { self.explodeStatement(path.get("body")); } + ); + self.jump(before); + self.mark(after); + + break; + + case "DoWhileStatement": + var first = loc(); + var test = loc(); + var after = loc(); + + self.mark(first); + self.leapManager.withEntry( + new leap.LoopEntry(after, test, labelId), + function() { self.explode(path.get("body")); } + ); + self.mark(test); + self.jumpIf(self.explodeExpression(path.get("test")), first); + self.mark(after); + + break; + + case "ForStatement": + var head = loc(); + var update = loc(); + var after = loc(); + + if (stmt.init) { + // We pass true here to indicate that if stmt.init is an expression + // then we do not care about its result. + self.explode(path.get("init"), true); + } + + self.mark(head); + + if (stmt.test) { + self.jumpIfNot(self.explodeExpression(path.get("test")), after); + } else { + // No test means continue unconditionally. + } + + self.leapManager.withEntry( + new leap.LoopEntry(after, update, labelId), + function() { self.explodeStatement(path.get("body")); } + ); + + self.mark(update); + + if (stmt.update) { + // We pass true here to indicate that if stmt.update is an + // expression then we do not care about its result. + self.explode(path.get("update"), true); + } + + self.jump(head); + + self.mark(after); + + break; + + case "ForInStatement": + var head = loc(); + var after = loc(); + + var keyIterNextFn = self.makeTempVar(); + self.emitAssign( + keyIterNextFn, + b.callExpression( + runtimeProperty("keys"), + [self.explodeExpression(path.get("right"))] + ) + ); + + self.mark(head); + + var keyInfoTmpVar = self.makeTempVar(); + self.jumpIf( + b.memberExpression( + b.assignmentExpression( + "=", + keyInfoTmpVar, + b.callExpression(keyIterNextFn, []) + ), + b.identifier("done"), + false + ), + after + ); + + self.emitAssign( + stmt.left, + b.memberExpression( + keyInfoTmpVar, + b.identifier("value"), + false + ) + ); + + self.leapManager.withEntry( + new leap.LoopEntry(after, head, labelId), + function() { self.explodeStatement(path.get("body")); } + ); + + self.jump(head); + + self.mark(after); + + break; + + case "BreakStatement": + self.emitAbruptCompletion({ + type: "break", + target: self.leapManager.getBreakLoc(stmt.label) + }); + + break; + + case "ContinueStatement": + self.emitAbruptCompletion({ + type: "continue", + target: self.leapManager.getContinueLoc(stmt.label) + }); + + break; + + case "SwitchStatement": + // Always save the discriminant into a temporary variable in case the + // test expressions overwrite values like context.sent. + var disc = self.emitAssign( + self.makeTempVar(), + self.explodeExpression(path.get("discriminant")) + ); + + var after = loc(); + var defaultLoc = loc(); + var condition = defaultLoc; + var caseLocs = []; + + // If there are no cases, .cases might be undefined. + var cases = stmt.cases || []; + + for (var i = cases.length - 1; i >= 0; --i) { + var c = cases[i]; + n.SwitchCase.assert(c); + + if (c.test) { + condition = b.conditionalExpression( + b.binaryExpression("===", disc, c.test), + caseLocs[i] = loc(), + condition + ); + } else { + caseLocs[i] = defaultLoc; + } + } + + self.jump(self.explodeExpression( + new types.NodePath(condition, path, "discriminant") + )); + + self.leapManager.withEntry( + new leap.SwitchEntry(after), + function() { + path.get("cases").each(function(casePath) { + var c = casePath.value; + var i = casePath.name; + + self.mark(caseLocs[i]); + + casePath.get("consequent").each( + self.explodeStatement, + self + ); + }); + } + ); + + self.mark(after); + if (defaultLoc.value === -1) { + self.mark(defaultLoc); + assert.strictEqual(after.value, defaultLoc.value); + } + + break; + + case "IfStatement": + var elseLoc = stmt.alternate && loc(); + var after = loc(); + + self.jumpIfNot( + self.explodeExpression(path.get("test")), + elseLoc || after + ); + + self.explodeStatement(path.get("consequent")); + + if (elseLoc) { + self.jump(after); + self.mark(elseLoc); + self.explodeStatement(path.get("alternate")); + } + + self.mark(after); + + break; + + case "ReturnStatement": + self.emitAbruptCompletion({ + type: "return", + value: self.explodeExpression(path.get("argument")) + }); + + break; + + case "WithStatement": + throw new Error( + node.type + " not supported in generator functions."); + + case "TryStatement": + var after = loc(); + + var handler = stmt.handler; + if (!handler && stmt.handlers) { + handler = stmt.handlers[0] || null; + } + + var catchLoc = handler && loc(); + var catchEntry = catchLoc && new leap.CatchEntry( + catchLoc, + handler.param + ); + + var finallyLoc = stmt.finalizer && loc(); + var finallyEntry = finallyLoc && + new leap.FinallyEntry(finallyLoc, after); + + var tryEntry = new leap.TryEntry( + self.getUnmarkedCurrentLoc(), + catchEntry, + finallyEntry + ); + + self.tryEntries.push(tryEntry); + self.updateContextPrevLoc(tryEntry.firstLoc); + + self.leapManager.withEntry(tryEntry, function() { + self.explodeStatement(path.get("block")); + + if (catchLoc) { + if (finallyLoc) { + // If we have both a catch block and a finally block, then + // because we emit the catch block first, we need to jump over + // it to the finally block. + self.jump(finallyLoc); + + } else { + // If there is no finally block, then we need to jump over the + // catch block to the fall-through location. + self.jump(after); + } + + self.updateContextPrevLoc(self.mark(catchLoc)); + + var bodyPath = path.get("handler", "body"); + var safeParam = self.makeTempVar(); + self.clearPendingException(tryEntry.firstLoc, safeParam); + + var catchScope = bodyPath.scope; + var catchParamName = handler.param.name; + n.CatchClause.assert(catchScope.node); + assert.strictEqual(catchScope.lookup(catchParamName), catchScope); + + types.visit(bodyPath, { + visitIdentifier: function(path) { + if (util.isReference(path, catchParamName) && + path.scope.lookup(catchParamName) === catchScope) { + return safeParam; + } + + this.traverse(path); + }, + + visitFunction: function(path) { + if (path.scope.declares(catchParamName)) { + // Don't descend into nested scopes that shadow the catch + // parameter with their own declarations. This isn't + // logically necessary because of the path.scope.lookup we + // do in visitIdentifier, but it saves time. + return false; + } + + this.traverse(path); + } + }); + + self.leapManager.withEntry(catchEntry, function() { + self.explodeStatement(bodyPath); + }); + } + + if (finallyLoc) { + self.updateContextPrevLoc(self.mark(finallyLoc)); + + self.leapManager.withEntry(finallyEntry, function() { + self.explodeStatement(path.get("finalizer")); + }); + + self.emit(b.returnStatement(b.callExpression( + self.contextProperty("finish"), + [finallyEntry.firstLoc] + ))); + } + }); + + self.mark(after); + + break; + + case "ThrowStatement": + self.emit(b.throwStatement( + self.explodeExpression(path.get("argument")) + )); + + break; + + default: + throw new Error( + "unknown Statement of type " + + JSON.stringify(stmt.type)); + } +}; + +Ep.emitAbruptCompletion = function(record) { + if (!isValidCompletion(record)) { + assert.ok( + false, + "invalid completion record: " + + JSON.stringify(record) + ); + } + + assert.notStrictEqual( + record.type, "normal", + "normal completions are not abrupt" + ); + + var abruptArgs = [b.literal(record.type)]; + + if (record.type === "break" || + record.type === "continue") { + n.Literal.assert(record.target); + abruptArgs[1] = record.target; + } else if (record.type === "return" || + record.type === "throw") { + if (record.value) { + n.Expression.assert(record.value); + abruptArgs[1] = record.value; + } + } + + this.emit( + b.returnStatement( + b.callExpression( + this.contextProperty("abrupt"), + abruptArgs + ) + ) + ); +}; + +function isValidCompletion(record) { + var type = record.type; + + if (type === "normal") { + return !hasOwn.call(record, "target"); + } + + if (type === "break" || + type === "continue") { + return !hasOwn.call(record, "value") + && n.Literal.check(record.target); + } + + if (type === "return" || + type === "throw") { + return hasOwn.call(record, "value") + && !hasOwn.call(record, "target"); + } + + return false; +} + + +// Not all offsets into emitter.listing are potential jump targets. For +// example, execution typically falls into the beginning of a try block +// without jumping directly there. This method returns the current offset +// without marking it, so that a switch case will not necessarily be +// generated for this offset (I say "not necessarily" because the same +// location might end up being marked in the process of emitting other +// statements). There's no logical harm in marking such locations as jump +// targets, but minimizing the number of switch cases keeps the generated +// code shorter. +Ep.getUnmarkedCurrentLoc = function() { + return b.literal(this.listing.length); +}; + +// The context.prev property takes the value of context.next whenever we +// evaluate the switch statement discriminant, which is generally good +// enough for tracking the last location we jumped to, but sometimes +// context.prev needs to be more precise, such as when we fall +// successfully out of a try block and into a finally block without +// jumping. This method exists to update context.prev to the freshest +// available location. If we were implementing a full interpreter, we +// would know the location of the current instruction with complete +// precision at all times, but we don't have that luxury here, as it would +// be costly and verbose to set context.prev before every statement. +Ep.updateContextPrevLoc = function(loc) { + if (loc) { + n.Literal.assert(loc); + + if (loc.value === -1) { + // If an uninitialized location literal was passed in, set its value + // to the current this.listing.length. + loc.value = this.listing.length; + } else { + // Otherwise assert that the location matches the current offset. + assert.strictEqual(loc.value, this.listing.length); + } + + } else { + loc = this.getUnmarkedCurrentLoc(); + } + + // Make sure context.prev is up to date in case we fell into this try + // statement without jumping to it. TODO Consider avoiding this + // assignment when we know control must have jumped here. + this.emitAssign(this.contextProperty("prev"), loc); +}; + +Ep.explodeExpression = function(path, ignoreResult) { + assert.ok(path instanceof types.NodePath); + + var expr = path.value; + if (expr) { + n.Expression.assert(expr); + } else { + return expr; + } + + var self = this; + var result; // Used optionally by several cases below. + + function finish(expr) { + n.Expression.assert(expr); + if (ignoreResult) { + self.emit(expr); + } else { + return expr; + } + } + + // If the expression does not contain a leap, then we either emit the + // expression as a standalone statement or return it whole. + if (!meta.containsLeap(expr)) { + return finish(expr); + } + + // If any child contains a leap (such as a yield or labeled continue or + // break statement), then any sibling subexpressions will almost + // certainly have to be exploded in order to maintain the order of their + // side effects relative to the leaping child(ren). + var hasLeapingChildren = meta.containsLeap.onlyChildren(expr); + + // In order to save the rest of explodeExpression from a combinatorial + // trainwreck of special cases, explodeViaTempVar is responsible for + // deciding when a subexpression needs to be "exploded," which is my + // very technical term for emitting the subexpression as an assignment + // to a temporary variable and the substituting the temporary variable + // for the original subexpression. Think of exploded view diagrams, not + // Michael Bay movies. The point of exploding subexpressions is to + // control the precise order in which the generated code realizes the + // side effects of those subexpressions. + function explodeViaTempVar(tempVar, childPath, ignoreChildResult) { + assert.ok(childPath instanceof types.NodePath); + + assert.ok( + !ignoreChildResult || !tempVar, + "Ignoring the result of a child expression but forcing it to " + + "be assigned to a temporary variable?" + ); + + var result = self.explodeExpression(childPath, ignoreChildResult); + + if (ignoreChildResult) { + // Side effects already emitted above. + + } else if (tempVar || (hasLeapingChildren && + !n.Literal.check(result))) { + // If tempVar was provided, then the result will always be assigned + // to it, even if the result does not otherwise need to be assigned + // to a temporary variable. When no tempVar is provided, we have + // the flexibility to decide whether a temporary variable is really + // necessary. Unfortunately, in general, a temporary variable is + // required whenever any child contains a yield expression, since it + // is difficult to prove (at all, let alone efficiently) whether + // this result would evaluate to the same value before and after the + // yield (see #206). One narrow case where we can prove it doesn't + // matter (and thus we do not need a temporary variable) is when the + // result in question is a Literal value. + result = self.emitAssign( + tempVar || self.makeTempVar(), + result + ); + } + return result; + } + + // If ignoreResult is true, then we must take full responsibility for + // emitting the expression with all its side effects, and we should not + // return a result. + + switch (expr.type) { + case "MemberExpression": + return finish(b.memberExpression( + self.explodeExpression(path.get("object")), + expr.computed + ? explodeViaTempVar(null, path.get("property")) + : expr.property, + expr.computed + )); + + case "CallExpression": + var calleePath = path.get("callee"); + var argsPath = path.get("arguments"); + + var newCallee; + var newArgs = []; + + var hasLeapingArgs = false; + argsPath.each(function(argPath) { + hasLeapingArgs = hasLeapingArgs || + meta.containsLeap(argPath.value); + }); + + if (n.MemberExpression.check(calleePath.value)) { + if (hasLeapingArgs) { + // If the arguments of the CallExpression contained any yield + // expressions, then we need to be sure to evaluate the callee + // before evaluating the arguments, but if the callee was a member + // expression, then we must be careful that the object of the + // member expression still gets bound to `this` for the call. + + var newObject = explodeViaTempVar( + // Assign the exploded callee.object expression to a temporary + // variable so that we can use it twice without reevaluating it. + self.makeTempVar(), + calleePath.get("object") + ); + + var newProperty = calleePath.value.computed + ? explodeViaTempVar(null, calleePath.get("property")) + : calleePath.value.property; + + newArgs.unshift(newObject); + + newCallee = b.memberExpression( + b.memberExpression( + newObject, + newProperty, + calleePath.value.computed + ), + b.identifier("call"), + false + ); + + } else { + newCallee = self.explodeExpression(calleePath); + } + + } else { + newCallee = self.explodeExpression(calleePath); + + if (n.MemberExpression.check(newCallee)) { + // If the callee was not previously a MemberExpression, then the + // CallExpression was "unqualified," meaning its `this` object + // should be the global object. If the exploded expression has + // become a MemberExpression (e.g. a context property, probably a + // temporary variable), then we need to force it to be unqualified + // by using the (0, object.property)(...) trick; otherwise, it + // will receive the object of the MemberExpression as its `this` + // object. + newCallee = b.sequenceExpression([ + b.literal(0), + newCallee + ]); + } + } + + argsPath.each(function(argPath) { + newArgs.push(explodeViaTempVar(null, argPath)); + }); + + return finish(b.callExpression( + newCallee, + newArgs + )); + + case "NewExpression": + return finish(b.newExpression( + explodeViaTempVar(null, path.get("callee")), + path.get("arguments").map(function(argPath) { + return explodeViaTempVar(null, argPath); + }) + )); + + case "ObjectExpression": + return finish(b.objectExpression( + path.get("properties").map(function(propPath) { + return b.property( + propPath.value.kind, + propPath.value.key, + explodeViaTempVar(null, propPath.get("value")) + ); + }) + )); + + case "ArrayExpression": + return finish(b.arrayExpression( + path.get("elements").map(function(elemPath) { + return explodeViaTempVar(null, elemPath); + }) + )); + + case "SequenceExpression": + var lastIndex = expr.expressions.length - 1; + + path.get("expressions").each(function(exprPath) { + if (exprPath.name === lastIndex) { + result = self.explodeExpression(exprPath, ignoreResult); + } else { + self.explodeExpression(exprPath, true); + } + }); + + return result; + + case "LogicalExpression": + var after = loc(); + + if (!ignoreResult) { + result = self.makeTempVar(); + } + + var left = explodeViaTempVar(result, path.get("left")); + + if (expr.operator === "&&") { + self.jumpIfNot(left, after); + } else { + assert.strictEqual(expr.operator, "||"); + self.jumpIf(left, after); + } + + explodeViaTempVar(result, path.get("right"), ignoreResult); + + self.mark(after); + + return result; + + case "ConditionalExpression": + var elseLoc = loc(); + var after = loc(); + var test = self.explodeExpression(path.get("test")); + + self.jumpIfNot(test, elseLoc); + + if (!ignoreResult) { + result = self.makeTempVar(); + } + + explodeViaTempVar(result, path.get("consequent"), ignoreResult); + self.jump(after); + + self.mark(elseLoc); + explodeViaTempVar(result, path.get("alternate"), ignoreResult); + + self.mark(after); + + return result; + + case "UnaryExpression": + return finish(b.unaryExpression( + expr.operator, + // Can't (and don't need to) break up the syntax of the argument. + // Think about delete a[b]. + self.explodeExpression(path.get("argument")), + !!expr.prefix + )); + + case "BinaryExpression": + return finish(b.binaryExpression( + expr.operator, + explodeViaTempVar(null, path.get("left")), + explodeViaTempVar(null, path.get("right")) + )); + + case "AssignmentExpression": + return finish(b.assignmentExpression( + expr.operator, + self.explodeExpression(path.get("left")), + self.explodeExpression(path.get("right")) + )); + + case "UpdateExpression": + return finish(b.updateExpression( + expr.operator, + self.explodeExpression(path.get("argument")), + expr.prefix + )); + + case "YieldExpression": + var after = loc(); + var arg = expr.argument && self.explodeExpression(path.get("argument")); + + if (arg && expr.delegate) { + var result = self.makeTempVar(); + + self.emit(b.returnStatement(b.callExpression( + self.contextProperty("delegateYield"), [ + arg, + b.literal(result.property.name), + after + ] + ))); + + self.mark(after); + + return result; + } + + self.emitAssign(self.contextProperty("next"), after); + self.emit(b.returnStatement(arg || null)); + self.mark(after); + + return self.contextProperty("sent"); + + default: + throw new Error( + "unknown Expression of type " + + JSON.stringify(expr.type)); + } +}; + +},{"1":1,"571":571,"575":575,"576":576,"577":577}],574:[function(_dereq_,module,exports){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var types = _dereq_(571).types; +var n = types.namedTypes; +var b = types.builders; +var hasOwn = Object.prototype.hasOwnProperty; + +// The hoist function takes a FunctionExpression or FunctionDeclaration +// and replaces any Declaration nodes in its body with assignments, then +// returns a VariableDeclaration containing just the names of the removed +// declarations. +exports.hoist = function(funPath) { + assert.ok(funPath instanceof types.NodePath); + n.Function.assert(funPath.value); + + var vars = {}; + + function varDeclToExpr(vdec, includeIdentifiers) { + n.VariableDeclaration.assert(vdec); + var exprs = []; + + vdec.declarations.forEach(function(dec) { + vars[dec.id.name] = dec.id; + + if (dec.init) { + exprs.push(b.assignmentExpression( + "=", dec.id, dec.init + )); + } else if (includeIdentifiers) { + exprs.push(dec.id); + } + }); + + if (exprs.length === 0) + return null; + + if (exprs.length === 1) + return exprs[0]; + + return b.sequenceExpression(exprs); + } + + types.visit(funPath.get("body"), { + visitVariableDeclaration: function(path) { + var expr = varDeclToExpr(path.value, false); + if (expr === null) { + path.replace(); + } else { + // We don't need to traverse this expression any further because + // there can't be any new declarations inside an expression. + return b.expressionStatement(expr); + } + + // Since the original node has been either removed or replaced, + // avoid traversing it any further. + return false; + }, + + visitForStatement: function(path) { + var init = path.value.init; + if (n.VariableDeclaration.check(init)) { + path.get("init").replace(varDeclToExpr(init, false)); + } + this.traverse(path); + }, + + visitForInStatement: function(path) { + var left = path.value.left; + if (n.VariableDeclaration.check(left)) { + path.get("left").replace(varDeclToExpr(left, true)); + } + this.traverse(path); + }, + + visitFunctionDeclaration: function(path) { + var node = path.value; + vars[node.id.name] = node.id; + + var parentNode = path.parent.node; + var assignment = b.expressionStatement( + b.assignmentExpression( + "=", + node.id, + b.functionExpression( + node.id, + node.params, + node.body, + node.generator, + node.expression + ) + ) + ); + + if (n.BlockStatement.check(path.parent.node)) { + // Insert the assignment form before the first statement in the + // enclosing block. + path.parent.get("body").unshift(assignment); + + // Remove the function declaration now that we've inserted the + // equivalent assignment form at the beginning of the block. + path.replace(); + + } else { + // If the parent node is not a block statement, then we can just + // replace the declaration with the equivalent assignment form + // without worrying about hoisting it. + path.replace(assignment); + } + + // Don't hoist variables out of inner functions. + return false; + }, + + visitFunctionExpression: function(path) { + // Don't descend into nested function expressions. + return false; + } + }); + + var paramNames = {}; + funPath.get("params").each(function(paramPath) { + var param = paramPath.value; + if (n.Identifier.check(param)) { + paramNames[param.name] = param; + } else { + // Variables declared by destructuring parameter patterns will be + // harmlessly re-declared. + } + }); + + var declarations = []; + + Object.keys(vars).forEach(function(name) { + if (!hasOwn.call(paramNames, name)) { + declarations.push(b.variableDeclarator(vars[name], null)); + } + }); + + if (declarations.length === 0) { + return null; // Be sure to handle this case! + } + + return b.variableDeclaration("var", declarations); +}; + +},{"1":1,"571":571}],575:[function(_dereq_,module,exports){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var types = _dereq_(571).types; +var n = types.namedTypes; +var b = types.builders; +var inherits = _dereq_(13).inherits; +var hasOwn = Object.prototype.hasOwnProperty; + +function Entry() { + assert.ok(this instanceof Entry); +} + +function FunctionEntry(returnLoc) { + Entry.call(this); + n.Literal.assert(returnLoc); + this.returnLoc = returnLoc; +} + +inherits(FunctionEntry, Entry); +exports.FunctionEntry = FunctionEntry; + +function LoopEntry(breakLoc, continueLoc, label) { + Entry.call(this); + + n.Literal.assert(breakLoc); + n.Literal.assert(continueLoc); + + if (label) { + n.Identifier.assert(label); + } else { + label = null; + } + + this.breakLoc = breakLoc; + this.continueLoc = continueLoc; + this.label = label; +} + +inherits(LoopEntry, Entry); +exports.LoopEntry = LoopEntry; + +function SwitchEntry(breakLoc) { + Entry.call(this); + n.Literal.assert(breakLoc); + this.breakLoc = breakLoc; +} + +inherits(SwitchEntry, Entry); +exports.SwitchEntry = SwitchEntry; + +function TryEntry(firstLoc, catchEntry, finallyEntry) { + Entry.call(this); + + n.Literal.assert(firstLoc); + + if (catchEntry) { + assert.ok(catchEntry instanceof CatchEntry); + } else { + catchEntry = null; + } + + if (finallyEntry) { + assert.ok(finallyEntry instanceof FinallyEntry); + } else { + finallyEntry = null; + } + + // Have to have one or the other (or both). + assert.ok(catchEntry || finallyEntry); + + this.firstLoc = firstLoc; + this.catchEntry = catchEntry; + this.finallyEntry = finallyEntry; +} + +inherits(TryEntry, Entry); +exports.TryEntry = TryEntry; + +function CatchEntry(firstLoc, paramId) { + Entry.call(this); + + n.Literal.assert(firstLoc); + n.Identifier.assert(paramId); + + this.firstLoc = firstLoc; + this.paramId = paramId; +} + +inherits(CatchEntry, Entry); +exports.CatchEntry = CatchEntry; + +function FinallyEntry(firstLoc, afterLoc) { + Entry.call(this); + n.Literal.assert(firstLoc); + n.Literal.assert(afterLoc); + this.firstLoc = firstLoc; + this.afterLoc = afterLoc; +} + +inherits(FinallyEntry, Entry); +exports.FinallyEntry = FinallyEntry; + +function LabeledEntry(breakLoc, label) { + Entry.call(this); + + n.Literal.assert(breakLoc); + n.Identifier.assert(label); + + this.breakLoc = breakLoc; + this.label = label; +} + +inherits(LabeledEntry, Entry); +exports.LabeledEntry = LabeledEntry; + +function LeapManager(emitter) { + assert.ok(this instanceof LeapManager); + + var Emitter = _dereq_(573).Emitter; + assert.ok(emitter instanceof Emitter); + + this.emitter = emitter; + this.entryStack = [new FunctionEntry(emitter.finalLoc)]; +} + +var LMp = LeapManager.prototype; +exports.LeapManager = LeapManager; + +LMp.withEntry = function(entry, callback) { + assert.ok(entry instanceof Entry); + this.entryStack.push(entry); + try { + callback.call(this.emitter); + } finally { + var popped = this.entryStack.pop(); + assert.strictEqual(popped, entry); + } +}; + +LMp._findLeapLocation = function(property, label) { + for (var i = this.entryStack.length - 1; i >= 0; --i) { + var entry = this.entryStack[i]; + var loc = entry[property]; + if (loc) { + if (label) { + if (entry.label && + entry.label.name === label.name) { + return loc; + } + } else if (entry instanceof LabeledEntry) { + // Ignore LabeledEntry entries unless we are actually breaking to + // a label. + } else { + return loc; + } + } + } + + return null; +}; + +LMp.getBreakLoc = function(label) { + return this._findLeapLocation("breakLoc", label); +}; + +LMp.getContinueLoc = function(label) { + return this._findLeapLocation("continueLoc", label); +}; + +},{"1":1,"13":13,"571":571,"573":573}],576:[function(_dereq_,module,exports){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var m = _dereq_(560).makeAccessor(); +var types = _dereq_(571).types; +var isArray = types.builtInTypes.array; +var n = types.namedTypes; +var hasOwn = Object.prototype.hasOwnProperty; + +function makePredicate(propertyName, knownTypes) { + function onlyChildren(node) { + n.Node.assert(node); + + // Assume no side effects until we find out otherwise. + var result = false; + + function check(child) { + if (result) { + // Do nothing. + } else if (isArray.check(child)) { + child.some(check); + } else if (n.Node.check(child)) { + assert.strictEqual(result, false); + result = predicate(child); + } + return result; + } + + types.eachField(node, function(name, child) { + check(child); + }); + + return result; + } + + function predicate(node) { + n.Node.assert(node); + + var meta = m(node); + if (hasOwn.call(meta, propertyName)) + return meta[propertyName]; + + // Certain types are "opaque," which means they have no side + // effects or leaps and we don't care about their subexpressions. + if (hasOwn.call(opaqueTypes, node.type)) + return meta[propertyName] = false; + + if (hasOwn.call(knownTypes, node.type)) + return meta[propertyName] = true; + + return meta[propertyName] = onlyChildren(node); + } + + predicate.onlyChildren = onlyChildren; + + return predicate; +} + +var opaqueTypes = { + FunctionExpression: true +}; + +// These types potentially have side effects regardless of what side +// effects their subexpressions have. +var sideEffectTypes = { + CallExpression: true, // Anything could happen! + ForInStatement: true, // Modifies the key variable. + UnaryExpression: true, // Think delete. + BinaryExpression: true, // Might invoke .toString() or .valueOf(). + AssignmentExpression: true, // Side-effecting by definition. + UpdateExpression: true, // Updates are essentially assignments. + NewExpression: true // Similar to CallExpression. +}; + +// These types are the direct cause of all leaps in control flow. +var leapTypes = { + YieldExpression: true, + BreakStatement: true, + ContinueStatement: true, + ReturnStatement: true, + ThrowStatement: true +}; + +// All leap types are also side effect types. +for (var type in leapTypes) { + if (hasOwn.call(leapTypes, type)) { + sideEffectTypes[type] = leapTypes[type]; + } +} + +exports.hasSideEffects = makePredicate("hasSideEffects", sideEffectTypes); +exports.containsLeap = makePredicate("containsLeap", leapTypes); + +},{"1":1,"560":560,"571":571}],577:[function(_dereq_,module,exports){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var types = _dereq_(571).types; +var n = types.namedTypes; +var b = types.builders; +var hasOwn = Object.prototype.hasOwnProperty; + +exports.defaults = function(obj) { + var len = arguments.length; + var extension; + + for (var i = 1; i < len; ++i) { + if ((extension = arguments[i])) { + for (var key in extension) { + if (hasOwn.call(extension, key) && !hasOwn.call(obj, key)) { + obj[key] = extension[key]; + } + } + } + } + + return obj; +}; + +exports.runtimeProperty = function(name) { + return b.memberExpression( + b.identifier("regeneratorRuntime"), + b.identifier(name), + false + ); +}; + +// Inspired by the isReference function from ast-util: +// https://github.com/eventualbuddha/ast-util/blob/9bf91c5ce8/lib/index.js#L466-L506 +exports.isReference = function(path, name) { + var node = path.value; + + if (!n.Identifier.check(node)) { + return false; + } + + if (name && node.name !== name) { + return false; + } + + var parent = path.parent.value; + + switch (parent.type) { + case "VariableDeclarator": + return path.name === "init"; + + case "MemberExpression": + return path.name === "object" || ( + parent.computed && path.name === "property" + ); + + case "FunctionExpression": + case "FunctionDeclaration": + case "ArrowFunctionExpression": + if (path.name === "id") { + return false; + } + + if (path.parentPath.name === "params" && + parent.params === path.parentPath.value && + parent.params[path.name] === node) { + return false; + } + + return true; + + case "ClassDeclaration": + case "ClassExpression": + return path.name !== "id"; + + case "CatchClause": + return path.name !== "param"; + + case "Property": + case "MethodDefinition": + return path.name !== "key"; + + case "ImportSpecifier": + case "ImportDefaultSpecifier": + case "ImportNamespaceSpecifier": + case "LabeledStatement": + return false; + + default: + return true; + } +}; + +},{"1":1,"571":571}],578:[function(_dereq_,module,exports){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var fs = _dereq_(3); +var recast = _dereq_(571); +var types = recast.types; +var n = types.namedTypes; +var b = types.builders; +var isArray = types.builtInTypes.array; +var isObject = types.builtInTypes.object; +var NodePath = types.NodePath; +var hoist = _dereq_(574).hoist; +var Emitter = _dereq_(573).Emitter; +var util = _dereq_(577); +var runtimeProperty = util.runtimeProperty; +var getMarkInfo = _dereq_(560).makeAccessor(); + +exports.transform = function transform(node, options) { + options = options || {}; + + var path = node instanceof NodePath ? node : new NodePath(node); + visitor.visit(path, options); + node = path.value; + + if (options.includeRuntime === true || + (options.includeRuntime === 'if used' && visitor.wasChangeReported())) { + injectRuntime(n.File.check(node) ? node.program : node); + } + + options.madeChanges = visitor.wasChangeReported(); + + return node; +}; + +function injectRuntime(program) { + n.Program.assert(program); + + // Include the runtime by modifying the AST rather than by concatenating + // strings. This technique will allow for more accurate source mapping. + var runtimePath = _dereq_(579).runtime.path; + var runtime = fs.readFileSync(runtimePath, "utf8"); + var runtimeBody = recast.parse(runtime, { + sourceFileName: runtimePath + }).program.body; + + var body = program.body; + body.unshift.apply(body, runtimeBody); +} + +var visitor = types.PathVisitor.fromMethodsObject({ + reset: function(node, options) { + this.options = options; + }, + + visitFunction: function(path) { + // Calling this.traverse(path) first makes for a post-order traversal. + this.traverse(path); + + var node = path.value; + var shouldTransformAsync = node.async && !this.options.disableAsync; + + if (!node.generator && !shouldTransformAsync) { + return; + } + + this.reportChanged(); + + if (node.expression) { + // Transform expression lambdas into normal functions. + node.expression = false; + node.body = b.blockStatement([ + b.returnStatement(node.body) + ]); + } + + if (shouldTransformAsync) { + awaitVisitor.visit(path.get("body")); + } + + var outerBody = []; + var innerBody = []; + var bodyPath = path.get("body", "body"); + + bodyPath.each(function(childPath) { + var node = childPath.value; + if (node && node._blockHoist != null) { + outerBody.push(node); + } else { + innerBody.push(node); + } + }); + + if (outerBody.length > 0) { + // Only replace the inner body if we actually hoisted any statements + // to the outer body. + bodyPath.replace(innerBody); + } + + var outerFnExpr = getOuterFnExpr(path); + // Note that getOuterFnExpr has the side-effect of ensuring that the + // function has a name (so node.id will always be an Identifier), even + // if a temporary name has to be synthesized. + n.Identifier.assert(node.id); + var innerFnId = b.identifier(node.id.name + "$"); + var contextId = path.scope.declareTemporary("context$"); + var argsId = path.scope.declareTemporary("args$"); + + // Turn all declarations into vars, and replace the original + // declarations with equivalent assignment expressions. + var vars = hoist(path); + + var didRenameArguments = renameArguments(path, argsId); + if (didRenameArguments) { + vars = vars || b.variableDeclaration("var", []); + vars.declarations.push(b.variableDeclarator( + argsId, b.identifier("arguments") + )); + } + + var emitter = new Emitter(contextId); + emitter.explode(path.get("body")); + + if (vars && vars.declarations.length > 0) { + outerBody.push(vars); + } + + var wrapArgs = [ + emitter.getContextFunction(innerFnId), + // Async functions that are not generators don't care about the + // outer function because they don't need it to be marked and don't + // inherit from its .prototype. + node.generator ? outerFnExpr : b.literal(null), + b.thisExpression() + ]; + + var tryLocsList = emitter.getTryLocsList(); + if (tryLocsList) { + wrapArgs.push(tryLocsList); + } + + var wrapCall = b.callExpression( + runtimeProperty(shouldTransformAsync ? "async" : "wrap"), + wrapArgs + ); + + outerBody.push(b.returnStatement(wrapCall)); + node.body = b.blockStatement(outerBody); + + var wasGeneratorFunction = node.generator; + if (wasGeneratorFunction) { + node.generator = false; + } + + if (shouldTransformAsync) { + node.async = false; + } + + if (wasGeneratorFunction && + n.Expression.check(node)) { + return b.callExpression(runtimeProperty("mark"), [node]); + } + }, + + visitForOfStatement: function(path) { + this.traverse(path); + + var node = path.value; + var tempIterId = path.scope.declareTemporary("t$"); + var tempIterDecl = b.variableDeclarator( + tempIterId, + b.callExpression( + runtimeProperty("values"), + [node.right] + ) + ); + + var tempInfoId = path.scope.declareTemporary("t$"); + var tempInfoDecl = b.variableDeclarator(tempInfoId, null); + + var init = node.left; + var loopId; + if (n.VariableDeclaration.check(init)) { + loopId = init.declarations[0].id; + init.declarations.push(tempIterDecl, tempInfoDecl); + } else { + loopId = init; + init = b.variableDeclaration("var", [ + tempIterDecl, + tempInfoDecl + ]); + } + n.Identifier.assert(loopId); + + var loopIdAssignExprStmt = b.expressionStatement( + b.assignmentExpression( + "=", + loopId, + b.memberExpression( + tempInfoId, + b.identifier("value"), + false + ) + ) + ); + + if (n.BlockStatement.check(node.body)) { + node.body.body.unshift(loopIdAssignExprStmt); + } else { + node.body = b.blockStatement([ + loopIdAssignExprStmt, + node.body + ]); + } + + return b.forStatement( + init, + b.unaryExpression( + "!", + b.memberExpression( + b.assignmentExpression( + "=", + tempInfoId, + b.callExpression( + b.memberExpression( + tempIterId, + b.identifier("next"), + false + ), + [] + ) + ), + b.identifier("done"), + false + ) + ), + null, + node.body + ); + } +}); + +// Given a NodePath for a Function, return an Expression node that can be +// used to refer reliably to the function object from inside the function. +// This expression is essentially a replacement for arguments.callee, with +// the key advantage that it works in strict mode. +function getOuterFnExpr(funPath) { + var node = funPath.value; + n.Function.assert(node); + + if (node.generator && // Non-generator functions don't need to be marked. + n.FunctionDeclaration.check(node)) { + var pp = funPath.parent; + + while (pp && !(n.BlockStatement.check(pp.value) || + n.Program.check(pp.value))) { + pp = pp.parent; + } + + if (!pp) { + return node.id; + } + + var markDecl = getRuntimeMarkDecl(pp); + var markedArray = markDecl.declarations[0].id; + var funDeclIdArray = markDecl.declarations[0].init.callee.object; + n.ArrayExpression.assert(funDeclIdArray); + + var index = funDeclIdArray.elements.length; + funDeclIdArray.elements.push(node.id); + + return b.memberExpression( + markedArray, + b.literal(index), + true + ); + } + + return node.id || ( + node.id = funPath.scope.parent.declareTemporary("callee$") + ); +} + +function getRuntimeMarkDecl(blockPath) { + assert.ok(blockPath instanceof NodePath); + var block = blockPath.node; + isArray.assert(block.body); + + var info = getMarkInfo(block); + if (info.decl) { + return info.decl; + } + + info.decl = b.variableDeclaration("var", [ + b.variableDeclarator( + blockPath.scope.declareTemporary("marked"), + b.callExpression( + b.memberExpression( + b.arrayExpression([]), + b.identifier("map"), + false + ), + [runtimeProperty("mark")] + ) + ) + ]); + + for (var i = 0; i < block.body.length; ++i) { + if (!shouldNotHoistAbove(blockPath.get("body", i))) { + break; + } + } + + blockPath.get("body").insertAt(i, info.decl); + + return info.decl; +} + +function shouldNotHoistAbove(stmtPath) { + var value = stmtPath.value; + n.Statement.assert(value); + + // If the first statement is a "use strict" declaration, make sure to + // insert hoisted declarations afterwards. + return n.ExpressionStatement.check(value) && + n.Literal.check(value.expression) && + value.expression.value === "use strict"; +} + +function renameArguments(funcPath, argsId) { + assert.ok(funcPath instanceof types.NodePath); + var func = funcPath.value; + var didRenameArguments = false; + + recast.visit(funcPath, { + visitFunction: function(path) { + if (path.value === func) { + this.traverse(path); + } else { + return false; + } + }, + + visitIdentifier: function(path) { + if (path.value.name === "arguments" && + util.isReference(path)) { + path.replace(argsId); + didRenameArguments = true; + return false; + } + + this.traverse(path); + } + }); + + // If the traversal replaced any arguments references, then we need to + // alias the outer function's arguments binding (be it the implicit + // arguments object or some other parameter or variable) to the variable + // named by argsId. + return didRenameArguments; +} + +var awaitVisitor = types.PathVisitor.fromMethodsObject({ + visitFunction: function(path) { + return false; // Don't descend into nested function scopes. + }, + + visitAwaitExpression: function(path) { + // Convert await and await* expressions to yield expressions. + var argument = path.value.argument; + + // If the parser supports await* syntax using a boolean .all property + // (#171), desugar that syntax to yield Promise.all(argument). + if (path.value.all) { + argument = b.callExpression( + b.memberExpression( + b.identifier("Promise"), + b.identifier("all"), + false + ), + [argument] + ); + } + + // Transforming `await x` to `yield regeneratorRuntime.awrap(x)` + // causes the argument to be wrapped in such a way that the runtime + // can distinguish between awaited and merely yielded values. + return b.yieldExpression( + b.callExpression( + runtimeProperty("awrap"), + [argument] + ), + false + ); + } +}); + +},{"1":1,"3":3,"560":560,"571":571,"573":573,"574":574,"577":577,"579":579}],579:[function(_dereq_,module,exports){ +(function (__dirname){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +var assert = _dereq_(1); +var path = _dereq_(9); +var fs = _dereq_(3); +var through = _dereq_(3); +var transform = _dereq_(578).transform; +var utils = _dereq_(577); +var recast = _dereq_(571); +var types = recast.types; +var genOrAsyncFunExp = /\bfunction\s*\*|\basync\b/; +var blockBindingExp = /\b(let|const)\s+/; + +function exports(file, options) { + var data = []; + return through(write, end); + + function write(buf) { + data.push(buf); + } + + function end() { + this.queue(compile(data.join(""), options).code); + this.queue(null); + } +} + +// To get a writable stream for use as a browserify transform, call +// require("regenerator")(). +module.exports = exports; + +// To include the runtime globally in the current node process, call +// require("regenerator").runtime(). +function runtime() { + _dereq_(580); +} +exports.runtime = runtime; +runtime.path = path.join(__dirname, "runtime.js"); + +function compile(source, options) { + options = normalizeOptions(options); + + if (!genOrAsyncFunExp.test(source)) { + return { + // Shortcut: no generators or async functions to transform. + code: (options.includeRuntime === true ? fs.readFileSync( + path.join(__dirname, "runtime.js"), "utf-8" + ) + "\n" : "") + source + }; + } + + var recastOptions = getRecastOptions(options); + var ast = recast.parse(source, recastOptions); + var nodePath = new types.NodePath(ast); + var programPath = nodePath.get("program"); + + if (shouldVarify(source, options)) { + // Transpile let/const into var declarations. + varifyAst(programPath.node); + } + + transform(programPath, options); + + return recast.print(nodePath, recastOptions); +} + +function normalizeOptions(options) { + options = utils.defaults(options || {}, { + includeRuntime: false, + supportBlockBinding: true + }); + + if (!options.esprima) { + options.esprima = _dereq_(3); + } + + assert.ok( + /harmony/.test(options.esprima.version), + "Bad esprima version: " + options.esprima.version + ); + + return options; +} + +function getRecastOptions(options) { + var recastOptions = { + range: true + }; + + function copy(name) { + if (name in options) { + recastOptions[name] = options[name]; + } + } + + copy("esprima"); + copy("sourceFileName"); + copy("sourceMapName"); + copy("inputSourceMap"); + copy("sourceRoot"); + + return recastOptions; +} + +function shouldVarify(source, options) { + var supportBlockBinding = !!options.supportBlockBinding; + if (supportBlockBinding) { + if (!blockBindingExp.test(source)) { + supportBlockBinding = false; + } + } + + return supportBlockBinding; +} + +function varify(source, options) { + var recastOptions = getRecastOptions(normalizeOptions(options)); + var ast = recast.parse(source, recastOptions); + varifyAst(ast.program); + return recast.print(ast, recastOptions).code; +} + +function varifyAst(ast) { + types.namedTypes.Program.assert(ast); + + var defsResult = _dereq_(418)(ast, { + ast: true, + disallowUnknownReferences: false, + disallowDuplicated: false, + disallowVars: false, + loopClosures: "iife" + }); + + if (defsResult.errors) { + throw new Error(defsResult.errors.join("\n")) + } + + return ast; +} + +// Convenience for just translating let/const to var declarations. +exports.varify = varify; + +// Allow packages that depend on Regenerator to use the same copy of +// ast-types, in case multiple versions are installed by NPM. +exports.types = types; + +// Transforms a string of source code, returning the { code, map? } result +// from recast.print. +exports.compile = compile; + +// To modify an AST directly, call require("regenerator").transform(ast). +exports.transform = transform; + +}).call(this,"/node_modules/regenerator") +},{"1":1,"3":3,"418":418,"571":571,"577":577,"578":578,"580":580,"9":9}],580:[function(_dereq_,module,exports){ +(function (process,global){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; // More compressible than void 0. + var iteratorSymbol = + typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided, then outerFn.prototype instanceof Generator. + var generator = Object.create((outerFn || Generator).prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `value instanceof AwaitArgument` to determine if the yielded value is + // meant to be awaited. Some may consider the name of this method too + // cutesy, but they are curmudgeons. + runtime.awrap = function(arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + // This invoke function is written in a style that assumes some + // calling function (or Promise) will handle exceptions. + function invoke(method, arg) { + var result = generator[method](arg); + var value = result.value; + return value instanceof AwaitArgument + ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) + : Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + return result; + }); + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var invokeNext = invoke.bind(generator, "next"); + var invokeThrow = invoke.bind(generator, "throw"); + var invokeReturn = invoke.bind(generator, "return"); + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return invoke(method, arg); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : new Promise(function (resolve) { + resolve(callInvokeWithMethodAndArg()); + }); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + if (state === GenStateSuspendedYield) { + context.sent = arg; + } else { + context.sent = undefined; + } + + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +}).call(this,_dereq_(10),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"10":10}],581:[function(_dereq_,module,exports){ +// Generated by `/scripts/character-class-escape-sets.js`. Do not edit. +var regenerate = _dereq_(572); + +exports.REGULAR = { + 'd': regenerate() + .addRange(0x30, 0x39), + 'D': regenerate() + .addRange(0x0, 0x2F) + .addRange(0x3A, 0xFFFF), + 's': regenerate(0x20, 0xA0, 0x1680, 0x180E, 0x202F, 0x205F, 0x3000, 0xFEFF) + .addRange(0x9, 0xD) + .addRange(0x2000, 0x200A) + .addRange(0x2028, 0x2029), + 'S': regenerate() + .addRange(0x0, 0x8) + .addRange(0xE, 0x1F) + .addRange(0x21, 0x9F) + .addRange(0xA1, 0x167F) + .addRange(0x1681, 0x180D) + .addRange(0x180F, 0x1FFF) + .addRange(0x200B, 0x2027) + .addRange(0x202A, 0x202E) + .addRange(0x2030, 0x205E) + .addRange(0x2060, 0x2FFF) + .addRange(0x3001, 0xFEFE) + .addRange(0xFF00, 0xFFFF), + 'w': regenerate(0x5F) + .addRange(0x30, 0x39) + .addRange(0x41, 0x5A) + .addRange(0x61, 0x7A), + 'W': regenerate(0x60) + .addRange(0x0, 0x2F) + .addRange(0x3A, 0x40) + .addRange(0x5B, 0x5E) + .addRange(0x7B, 0xFFFF) +}; + +exports.UNICODE = { + 'd': regenerate() + .addRange(0x30, 0x39), + 'D': regenerate() + .addRange(0x0, 0x2F) + .addRange(0x3A, 0x10FFFF), + 's': regenerate(0x20, 0xA0, 0x1680, 0x180E, 0x202F, 0x205F, 0x3000, 0xFEFF) + .addRange(0x9, 0xD) + .addRange(0x2000, 0x200A) + .addRange(0x2028, 0x2029), + 'S': regenerate() + .addRange(0x0, 0x8) + .addRange(0xE, 0x1F) + .addRange(0x21, 0x9F) + .addRange(0xA1, 0x167F) + .addRange(0x1681, 0x180D) + .addRange(0x180F, 0x1FFF) + .addRange(0x200B, 0x2027) + .addRange(0x202A, 0x202E) + .addRange(0x2030, 0x205E) + .addRange(0x2060, 0x2FFF) + .addRange(0x3001, 0xFEFE) + .addRange(0xFF00, 0x10FFFF), + 'w': regenerate(0x5F) + .addRange(0x30, 0x39) + .addRange(0x41, 0x5A) + .addRange(0x61, 0x7A), + 'W': regenerate(0x60) + .addRange(0x0, 0x2F) + .addRange(0x3A, 0x40) + .addRange(0x5B, 0x5E) + .addRange(0x7B, 0x10FFFF) +}; + +exports.UNICODE_IGNORE_CASE = { + 'd': regenerate() + .addRange(0x30, 0x39), + 'D': regenerate() + .addRange(0x0, 0x2F) + .addRange(0x3A, 0x10FFFF), + 's': regenerate(0x20, 0xA0, 0x1680, 0x180E, 0x202F, 0x205F, 0x3000, 0xFEFF) + .addRange(0x9, 0xD) + .addRange(0x2000, 0x200A) + .addRange(0x2028, 0x2029), + 'S': regenerate() + .addRange(0x0, 0x8) + .addRange(0xE, 0x1F) + .addRange(0x21, 0x9F) + .addRange(0xA1, 0x167F) + .addRange(0x1681, 0x180D) + .addRange(0x180F, 0x1FFF) + .addRange(0x200B, 0x2027) + .addRange(0x202A, 0x202E) + .addRange(0x2030, 0x205E) + .addRange(0x2060, 0x2FFF) + .addRange(0x3001, 0xFEFE) + .addRange(0xFF00, 0x10FFFF), + 'w': regenerate(0x5F, 0x17F, 0x212A) + .addRange(0x30, 0x39) + .addRange(0x41, 0x5A) + .addRange(0x61, 0x7A), + 'W': regenerate(0x4B, 0x53, 0x60) + .addRange(0x0, 0x2F) + .addRange(0x3A, 0x40) + .addRange(0x5B, 0x5E) + .addRange(0x7B, 0x10FFFF) +}; + +},{"572":572}],582:[function(_dereq_,module,exports){ +module.exports={ + "75": 8490, + "83": 383, + "107": 8490, + "115": 383, + "181": 924, + "197": 8491, + "383": 83, + "452": 453, + "453": 452, + "455": 456, + "456": 455, + "458": 459, + "459": 458, + "497": 498, + "498": 497, + "837": 8126, + "914": 976, + "917": 1013, + "920": 1012, + "921": 8126, + "922": 1008, + "924": 181, + "928": 982, + "929": 1009, + "931": 962, + "934": 981, + "937": 8486, + "962": 931, + "976": 914, + "977": 1012, + "981": 934, + "982": 928, + "1008": 922, + "1009": 929, + "1012": [ + 920, + 977 + ], + "1013": 917, + "7776": 7835, + "7835": 7776, + "8126": [ + 837, + 921 + ], + "8486": 937, + "8490": 75, + "8491": 197, + "66560": 66600, + "66561": 66601, + "66562": 66602, + "66563": 66603, + "66564": 66604, + "66565": 66605, + "66566": 66606, + "66567": 66607, + "66568": 66608, + "66569": 66609, + "66570": 66610, + "66571": 66611, + "66572": 66612, + "66573": 66613, + "66574": 66614, + "66575": 66615, + "66576": 66616, + "66577": 66617, + "66578": 66618, + "66579": 66619, + "66580": 66620, + "66581": 66621, + "66582": 66622, + "66583": 66623, + "66584": 66624, + "66585": 66625, + "66586": 66626, + "66587": 66627, + "66588": 66628, + "66589": 66629, + "66590": 66630, + "66591": 66631, + "66592": 66632, + "66593": 66633, + "66594": 66634, + "66595": 66635, + "66596": 66636, + "66597": 66637, + "66598": 66638, + "66599": 66639, + "66600": 66560, + "66601": 66561, + "66602": 66562, + "66603": 66563, + "66604": 66564, + "66605": 66565, + "66606": 66566, + "66607": 66567, + "66608": 66568, + "66609": 66569, + "66610": 66570, + "66611": 66571, + "66612": 66572, + "66613": 66573, + "66614": 66574, + "66615": 66575, + "66616": 66576, + "66617": 66577, + "66618": 66578, + "66619": 66579, + "66620": 66580, + "66621": 66581, + "66622": 66582, + "66623": 66583, + "66624": 66584, + "66625": 66585, + "66626": 66586, + "66627": 66587, + "66628": 66588, + "66629": 66589, + "66630": 66590, + "66631": 66591, + "66632": 66592, + "66633": 66593, + "66634": 66594, + "66635": 66595, + "66636": 66596, + "66637": 66597, + "66638": 66598, + "66639": 66599, + "68736": 68800, + "68737": 68801, + "68738": 68802, + "68739": 68803, + "68740": 68804, + "68741": 68805, + "68742": 68806, + "68743": 68807, + "68744": 68808, + "68745": 68809, + "68746": 68810, + "68747": 68811, + "68748": 68812, + "68749": 68813, + "68750": 68814, + "68751": 68815, + "68752": 68816, + "68753": 68817, + "68754": 68818, + "68755": 68819, + "68756": 68820, + "68757": 68821, + "68758": 68822, + "68759": 68823, + "68760": 68824, + "68761": 68825, + "68762": 68826, + "68763": 68827, + "68764": 68828, + "68765": 68829, + "68766": 68830, + "68767": 68831, + "68768": 68832, + "68769": 68833, + "68770": 68834, + "68771": 68835, + "68772": 68836, + "68773": 68837, + "68774": 68838, + "68775": 68839, + "68776": 68840, + "68777": 68841, + "68778": 68842, + "68779": 68843, + "68780": 68844, + "68781": 68845, + "68782": 68846, + "68783": 68847, + "68784": 68848, + "68785": 68849, + "68786": 68850, + "68800": 68736, + "68801": 68737, + "68802": 68738, + "68803": 68739, + "68804": 68740, + "68805": 68741, + "68806": 68742, + "68807": 68743, + "68808": 68744, + "68809": 68745, + "68810": 68746, + "68811": 68747, + "68812": 68748, + "68813": 68749, + "68814": 68750, + "68815": 68751, + "68816": 68752, + "68817": 68753, + "68818": 68754, + "68819": 68755, + "68820": 68756, + "68821": 68757, + "68822": 68758, + "68823": 68759, + "68824": 68760, + "68825": 68761, + "68826": 68762, + "68827": 68763, + "68828": 68764, + "68829": 68765, + "68830": 68766, + "68831": 68767, + "68832": 68768, + "68833": 68769, + "68834": 68770, + "68835": 68771, + "68836": 68772, + "68837": 68773, + "68838": 68774, + "68839": 68775, + "68840": 68776, + "68841": 68777, + "68842": 68778, + "68843": 68779, + "68844": 68780, + "68845": 68781, + "68846": 68782, + "68847": 68783, + "68848": 68784, + "68849": 68785, + "68850": 68786, + "71840": 71872, + "71841": 71873, + "71842": 71874, + "71843": 71875, + "71844": 71876, + "71845": 71877, + "71846": 71878, + "71847": 71879, + "71848": 71880, + "71849": 71881, + "71850": 71882, + "71851": 71883, + "71852": 71884, + "71853": 71885, + "71854": 71886, + "71855": 71887, + "71856": 71888, + "71857": 71889, + "71858": 71890, + "71859": 71891, + "71860": 71892, + "71861": 71893, + "71862": 71894, + "71863": 71895, + "71864": 71896, + "71865": 71897, + "71866": 71898, + "71867": 71899, + "71868": 71900, + "71869": 71901, + "71870": 71902, + "71871": 71903, + "71872": 71840, + "71873": 71841, + "71874": 71842, + "71875": 71843, + "71876": 71844, + "71877": 71845, + "71878": 71846, + "71879": 71847, + "71880": 71848, + "71881": 71849, + "71882": 71850, + "71883": 71851, + "71884": 71852, + "71885": 71853, + "71886": 71854, + "71887": 71855, + "71888": 71856, + "71889": 71857, + "71890": 71858, + "71891": 71859, + "71892": 71860, + "71893": 71861, + "71894": 71862, + "71895": 71863, + "71896": 71864, + "71897": 71865, + "71898": 71866, + "71899": 71867, + "71900": 71868, + "71901": 71869, + "71902": 71870, + "71903": 71871 +} + +},{}],583:[function(_dereq_,module,exports){ +var generate = _dereq_(584).generate; +var parse = _dereq_(585).parse; +var regenerate = _dereq_(572); +var iuMappings = _dereq_(582); +var ESCAPE_SETS = _dereq_(581); + +function getCharacterClassEscapeSet(character) { + if (unicode) { + if (ignoreCase) { + return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]; + } + return ESCAPE_SETS.UNICODE[character]; + } + return ESCAPE_SETS.REGULAR[character]; +} + +var object = {}; +var hasOwnProperty = object.hasOwnProperty; +function has(object, property) { + return hasOwnProperty.call(object, property); +} + +// Prepare a Regenerate set containing all code points, used for negative +// character classes (if any). +var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF); +// Without the `u` flag, the range stops at 0xFFFF. +// https://mths.be/es6#sec-pattern-semantics +var BMP_SET = regenerate().addRange(0x0, 0xFFFF); + +// Prepare a Regenerate set containing all code points that are supposed to be +// matched by `/./u`. https://mths.be/es6#sec-atom +var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points + .remove( + // minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators): + 0x000A, // Line Feed + 0x000D, // Carriage Return + 0x2028, // Line Separator + 0x2029 // Paragraph Separator + ); +// Prepare a Regenerate set containing all code points that are supposed to be +// matched by `/./` (only BMP code points). +var DOT_SET = DOT_SET_UNICODE.clone() + .intersection(BMP_SET); + +// Add a range of code points + any case-folded code points in that range to a +// set. +regenerate.prototype.iuAddRange = function(min, max) { + var $this = this; + do { + var folded = caseFold(min); + if (folded) { + $this.add(folded); + } + } while (++min <= max); + return $this; +}; + +function assign(target, source) { + for (var key in source) { + // Note: `hasOwnProperty` is not needed here. + target[key] = source[key]; + } +} + +function update(item, pattern) { + // TODO: Test if memoizing `pattern` here is worth the effort. + if (!pattern) { + return; + } + var tree = parse(pattern, ''); + switch (tree.type) { + case 'characterClass': + case 'group': + case 'value': + // No wrapping needed. + break; + default: + // Wrap the pattern in a non-capturing group. + tree = wrap(tree, pattern); + } + assign(item, tree); +} + +function wrap(tree, pattern) { + // Wrap the pattern in a non-capturing group. + return { + 'type': 'group', + 'behavior': 'ignore', + 'body': [tree], + 'raw': '(?:' + pattern + ')' + }; +} + +function caseFold(codePoint) { + return has(iuMappings, codePoint) ? iuMappings[codePoint] : false; +} + +var ignoreCase = false; +var unicode = false; +function processCharacterClass(characterClassItem) { + var set = regenerate(); + var body = characterClassItem.body.forEach(function(item) { + switch (item.type) { + case 'value': + set.add(item.codePoint); + if (ignoreCase && unicode) { + var folded = caseFold(item.codePoint); + if (folded) { + set.add(folded); + } + } + break; + case 'characterClassRange': + var min = item.min.codePoint; + var max = item.max.codePoint; + set.addRange(min, max); + if (ignoreCase && unicode) { + set.iuAddRange(min, max); + } + break; + case 'characterClassEscape': + set.add(getCharacterClassEscapeSet(item.value)); + break; + // The `default` clause is only here as a safeguard; it should never be + // reached. Code coverage tools should ignore it. + /* istanbul ignore next */ + default: + throw Error('Unknown term type: ' + item.type); + } + }); + if (characterClassItem.negative) { + set = (unicode ? UNICODE_SET : BMP_SET).clone().remove(set); + } + update(characterClassItem, set.toString()); + return characterClassItem; +} + +function processTerm(item) { + switch (item.type) { + case 'dot': + update( + item, + (unicode ? DOT_SET_UNICODE : DOT_SET).toString() + ); + break; + case 'characterClass': + item = processCharacterClass(item); + break; + case 'characterClassEscape': + update( + item, + getCharacterClassEscapeSet(item.value).toString() + ); + break; + case 'alternative': + case 'disjunction': + case 'group': + case 'quantifier': + item.body = item.body.map(processTerm); + break; + case 'value': + var codePoint = item.codePoint; + var set = regenerate(codePoint); + if (ignoreCase && unicode) { + var folded = caseFold(codePoint); + if (folded) { + set.add(folded); + } + } + update(item, set.toString()); + break; + case 'anchor': + case 'empty': + case 'group': + case 'reference': + // Nothing to do here. + break; + // The `default` clause is only here as a safeguard; it should never be + // reached. Code coverage tools should ignore it. + /* istanbul ignore next */ + default: + throw Error('Unknown term type: ' + item.type); + } + return item; +}; + +module.exports = function(pattern, flags) { + var tree = parse(pattern, flags); + ignoreCase = flags ? flags.indexOf('i') > -1 : false; + unicode = flags ? flags.indexOf('u') > -1 : false; + assign(tree, processTerm(tree)); + return generate(tree); +}; + +},{"572":572,"581":581,"582":582,"584":584,"585":585}],584:[function(_dereq_,module,exports){ +(function (global){ +/*! + * RegJSGen + * Copyright 2014 Benjamin Tan + * Available under MIT license + */ +;(function() { + 'use strict'; + + /** Used to determine if values are of the language type `Object` */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Used as a reference to the global object */ + var root = (objectTypes[typeof window] && window) || this; + + /** Backup possible global object */ + var oldRoot = root; + + /** Detect free variable `exports` */ + var freeExports = objectTypes[typeof exports] && exports; + + /** Detect free variable `module` */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ + var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + /*! Based on https://mths.be/fromcodepoint v0.2.0 by @mathias */ + + var stringFromCharCode = String.fromCharCode; + var floor = Math.floor; + function fromCodePoint() { + var MAX_SIZE = 0x4000; + var codeUnits = []; + var highSurrogate; + var lowSurrogate; + var index = -1; + var length = arguments.length; + if (!length) { + return ''; + } + var result = ''; + while (++index < length) { + var codePoint = Number(arguments[index]); + if ( + !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` + codePoint < 0 || // not a valid Unicode code point + codePoint > 0x10FFFF || // not a valid Unicode code point + floor(codePoint) != codePoint // not an integer + ) { + throw RangeError('Invalid code point: ' + codePoint); + } + if (codePoint <= 0xFFFF) { + // BMP code point + codeUnits.push(codePoint); + } else { + // Astral code point; split in surrogate halves + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + codePoint -= 0x10000; + highSurrogate = (codePoint >> 10) + 0xD800; + lowSurrogate = (codePoint % 0x400) + 0xDC00; + codeUnits.push(highSurrogate, lowSurrogate); + } + if (index + 1 == length || codeUnits.length > MAX_SIZE) { + result += stringFromCharCode.apply(null, codeUnits); + codeUnits.length = 0; + } + } + return result; + } + + function assertType(type, expected) { + if (expected.indexOf('|') == -1) { + if (type == expected) { + return; + } + + throw Error('Invalid node type: ' + type); + } + + expected = assertType.hasOwnProperty(expected) + ? assertType[expected] + : (assertType[expected] = RegExp('^(?:' + expected + ')$')); + + if (expected.test(type)) { + return; + } + + throw Error('Invalid node type: ' + type); + } + + /*--------------------------------------------------------------------------*/ + + function generate(node) { + var type = node.type; + + if (generate.hasOwnProperty(type) && typeof generate[type] == 'function') { + return generate[type](node); + } + + throw Error('Invalid node type: ' + type); + } + + /*--------------------------------------------------------------------------*/ + + function generateAlternative(node) { + assertType(node.type, 'alternative'); + + var terms = node.body, + length = terms ? terms.length : 0; + + if (length == 1) { + return generateTerm(terms[0]); + } else { + var i = -1, + result = ''; + + while (++i < length) { + result += generateTerm(terms[i]); + } + + return result; + } + } + + function generateAnchor(node) { + assertType(node.type, 'anchor'); + + switch (node.kind) { + case 'start': + return '^'; + case 'end': + return '$'; + case 'boundary': + return '\\b'; + case 'not-boundary': + return '\\B'; + default: + throw Error('Invalid assertion'); + } + } + + function generateAtom(node) { + assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value'); + + return generate(node); + } + + function generateCharacterClass(node) { + assertType(node.type, 'characterClass'); + + var classRanges = node.body, + length = classRanges ? classRanges.length : 0; + + var i = -1, + result = '['; + + if (node.negative) { + result += '^'; + } + + while (++i < length) { + result += generateClassAtom(classRanges[i]); + } + + result += ']'; + + return result; + } + + function generateCharacterClassEscape(node) { + assertType(node.type, 'characterClassEscape'); + + return '\\' + node.value; + } + + function generateCharacterClassRange(node) { + assertType(node.type, 'characterClassRange'); + + var min = node.min, + max = node.max; + + if (min.type == 'characterClassRange' || max.type == 'characterClassRange') { + throw Error('Invalid character class range'); + } + + return generateClassAtom(min) + '-' + generateClassAtom(max); + } + + function generateClassAtom(node) { + assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value'); + + return generate(node); + } + + function generateDisjunction(node) { + assertType(node.type, 'disjunction'); + + var body = node.body, + length = body ? body.length : 0; + + if (length == 0) { + throw Error('No body'); + } else if (length == 1) { + return generate(body[0]); + } else { + var i = -1, + result = ''; + + while (++i < length) { + if (i != 0) { + result += '|'; + } + result += generate(body[i]); + } + + return result; + } + } + + function generateDot(node) { + assertType(node.type, 'dot'); + + return '.'; + } + + function generateGroup(node) { + assertType(node.type, 'group'); + + var result = '('; + + switch (node.behavior) { + case 'normal': + break; + case 'ignore': + result += '?:'; + break; + case 'lookahead': + result += '?='; + break; + case 'negativeLookahead': + result += '?!'; + break; + default: + throw Error('Invalid behaviour: ' + node.behaviour); + } + + var body = node.body, + length = body ? body.length : 0; + + if (length == 1) { + result += generate(body[0]); + } else { + var i = -1; + + while (++i < length) { + result += generate(body[i]); + } + } + + result += ')'; + + return result; + } + + function generateQuantifier(node) { + assertType(node.type, 'quantifier'); + + var quantifier = '', + min = node.min, + max = node.max; + + switch (max) { + case undefined: + case null: + switch (min) { + case 0: + quantifier = '*' + break; + case 1: + quantifier = '+'; + break; + default: + quantifier = '{' + min + ',}'; + break; + } + break; + default: + if (min == max) { + quantifier = '{' + min + '}'; + } + else if (min == 0 && max == 1) { + quantifier = '?'; + } else { + quantifier = '{' + min + ',' + max + '}'; + } + break; + } + + if (!node.greedy) { + quantifier += '?'; + } + + return generateAtom(node.body[0]) + quantifier; + } + + function generateReference(node) { + assertType(node.type, 'reference'); + + return '\\' + node.matchIndex; + } + + function generateTerm(node) { + assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value'); + + return generate(node); + } + + function generateValue(node) { + assertType(node.type, 'value'); + + var kind = node.kind, + codePoint = node.codePoint; + + switch (kind) { + case 'controlLetter': + return '\\c' + fromCodePoint(codePoint + 64); + case 'hexadecimalEscape': + return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2); + case 'identifier': + return '\\' + fromCodePoint(codePoint); + case 'null': + return '\\' + codePoint; + case 'octal': + return '\\' + codePoint.toString(8); + case 'singleEscape': + switch (codePoint) { + case 0x0008: + return '\\b'; + case 0x009: + return '\\t'; + case 0x00A: + return '\\n'; + case 0x00B: + return '\\v'; + case 0x00C: + return '\\f'; + case 0x00D: + return '\\r'; + default: + throw Error('Invalid codepoint: ' + codePoint); + } + case 'symbol': + return fromCodePoint(codePoint); + case 'unicodeEscape': + return '\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4); + case 'unicodeCodePointEscape': + return '\\u{' + codePoint.toString(16).toUpperCase() + '}'; + default: + throw Error('Unsupported node kind: ' + kind); + } + } + + /*--------------------------------------------------------------------------*/ + + generate.alternative = generateAlternative; + generate.anchor = generateAnchor; + generate.characterClass = generateCharacterClass; + generate.characterClassEscape = generateCharacterClassEscape; + generate.characterClassRange = generateCharacterClassRange; + generate.disjunction = generateDisjunction; + generate.dot = generateDot; + generate.group = generateGroup; + generate.quantifier = generateQuantifier; + generate.reference = generateReference; + generate.value = generateValue; + + /*--------------------------------------------------------------------------*/ + + // export regjsgen + // some AMD build optimizers, like r.js, check for condition patterns like the following: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // define as an anonymous module so, through path mapping, it can be aliased + define(function() { + return { + 'generate': generate + }; + }); + } + // check for `exports` after `define` in case a build optimizer adds an `exports` object + else if (freeExports && freeModule) { + // in Narwhal, Node.js, Rhino -require, or RingoJS + freeExports.generate = generate; + } + // in a browser or Rhino + else { + root.regjsgen = { + 'generate': generate + }; + } +}.call(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],585:[function(_dereq_,module,exports){ +// regjsparser +// +// ================================================================== +// +// See ECMA-262 Standard: 15.10.1 +// +// NOTE: The ECMA-262 standard uses the term "Assertion" for /^/. Here the +// term "Anchor" is used. +// +// Pattern :: +// Disjunction +// +// Disjunction :: +// Alternative +// Alternative | Disjunction +// +// Alternative :: +// [empty] +// Alternative Term +// +// Term :: +// Anchor +// Atom +// Atom Quantifier +// +// Anchor :: +// ^ +// $ +// \ b +// \ B +// ( ? = Disjunction ) +// ( ? ! Disjunction ) +// +// Quantifier :: +// QuantifierPrefix +// QuantifierPrefix ? +// +// QuantifierPrefix :: +// * +// + +// ? +// { DecimalDigits } +// { DecimalDigits , } +// { DecimalDigits , DecimalDigits } +// +// Atom :: +// PatternCharacter +// . +// \ AtomEscape +// CharacterClass +// ( Disjunction ) +// ( ? : Disjunction ) +// +// PatternCharacter :: +// SourceCharacter but not any of: ^ $ \ . * + ? ( ) [ ] { } | +// +// AtomEscape :: +// DecimalEscape +// CharacterEscape +// CharacterClassEscape +// +// CharacterEscape[U] :: +// ControlEscape +// c ControlLetter +// HexEscapeSequence +// RegExpUnicodeEscapeSequence[?U] (ES6) +// IdentityEscape[?U] +// +// ControlEscape :: +// one of f n r t v +// ControlLetter :: +// one of +// a b c d e f g h i j k l m n o p q r s t u v w x y z +// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z +// +// IdentityEscape :: +// SourceCharacter but not IdentifierPart +// +// +// +// DecimalEscape :: +// DecimalIntegerLiteral [lookahead ∉ DecimalDigit] +// +// CharacterClassEscape :: +// one of d D s S w W +// +// CharacterClass :: +// [ [lookahead ∉ {^}] ClassRanges ] +// [ ^ ClassRanges ] +// +// ClassRanges :: +// [empty] +// NonemptyClassRanges +// +// NonemptyClassRanges :: +// ClassAtom +// ClassAtom NonemptyClassRangesNoDash +// ClassAtom - ClassAtom ClassRanges +// +// NonemptyClassRangesNoDash :: +// ClassAtom +// ClassAtomNoDash NonemptyClassRangesNoDash +// ClassAtomNoDash - ClassAtom ClassRanges +// +// ClassAtom :: +// - +// ClassAtomNoDash +// +// ClassAtomNoDash :: +// SourceCharacter but not one of \ or ] or - +// \ ClassEscape +// +// ClassEscape :: +// DecimalEscape +// b +// CharacterEscape +// CharacterClassEscape + +(function() { + + function parse(str, flags) { + function addRaw(node) { + node.raw = str.substring(node.range[0], node.range[1]); + return node; + } + + function updateRawStart(node, start) { + node.range[0] = start; + return addRaw(node); + } + + function createAnchor(kind, rawLength) { + return addRaw({ + type: 'anchor', + kind: kind, + range: [ + pos - rawLength, + pos + ] + }); + } + + function createValue(kind, codePoint, from, to) { + return addRaw({ + type: 'value', + kind: kind, + codePoint: codePoint, + range: [from, to] + }); + } + + function createEscaped(kind, codePoint, value, fromOffset) { + fromOffset = fromOffset || 0; + return createValue(kind, codePoint, pos - (value.length + fromOffset), pos); + } + + function createCharacter(matches) { + var _char = matches[0]; + var first = _char.charCodeAt(0); + if (hasUnicodeFlag) { + var second; + if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) { + second = lookahead().charCodeAt(0); + if (second >= 0xDC00 && second <= 0xDFFF) { + // Unicode surrogate pair + pos++; + return createValue( + 'symbol', + (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, + pos - 2, pos); + } + } + } + return createValue('symbol', first, pos - 1, pos); + } + + function createDisjunction(alternatives, from, to) { + return addRaw({ + type: 'disjunction', + body: alternatives, + range: [ + from, + to + ] + }); + } + + function createDot() { + return addRaw({ + type: 'dot', + range: [ + pos - 1, + pos + ] + }); + } + + function createCharacterClassEscape(value) { + return addRaw({ + type: 'characterClassEscape', + value: value, + range: [ + pos - 2, + pos + ] + }); + } + + function createReference(matchIndex) { + return addRaw({ + type: 'reference', + matchIndex: parseInt(matchIndex, 10), + range: [ + pos - 1 - matchIndex.length, + pos + ] + }); + } + + function createGroup(behavior, disjunction, from, to) { + return addRaw({ + type: 'group', + behavior: behavior, + body: disjunction, + range: [ + from, + to + ] + }); + } + + function createQuantifier(min, max, from, to) { + if (to == null) { + from = pos - 1; + to = pos; + } + + return addRaw({ + type: 'quantifier', + min: min, + max: max, + greedy: true, + body: null, // set later on + range: [ + from, + to + ] + }); + } + + function createAlternative(terms, from, to) { + return addRaw({ + type: 'alternative', + body: terms, + range: [ + from, + to + ] + }); + } + + function createCharacterClass(classRanges, negative, from, to) { + return addRaw({ + type: 'characterClass', + body: classRanges, + negative: negative, + range: [ + from, + to + ] + }); + } + + function createClassRange(min, max, from, to) { + // See 15.10.2.15: + if (min.codePoint > max.codePoint) { + bail('invalid range in character class', min.raw + '-' + max.raw, from, to); + } + + return addRaw({ + type: 'characterClassRange', + min: min, + max: max, + range: [ + from, + to + ] + }); + } + + function flattenBody(body) { + if (body.type === 'alternative') { + return body.body; + } else { + return [body]; + } + } + + function isEmpty(obj) { + return obj.type === 'empty'; + } + + function incr(amount) { + amount = (amount || 1); + var res = str.substring(pos, pos + amount); + pos += (amount || 1); + return res; + } + + function skip(value) { + if (!match(value)) { + bail('character', value); + } + } + + function match(value) { + if (str.indexOf(value, pos) === pos) { + return incr(value.length); + } + } + + function lookahead() { + return str[pos]; + } + + function current(value) { + return str.indexOf(value, pos) === pos; + } + + function next(value) { + return str[pos + 1] === value; + } + + function matchReg(regExp) { + var subStr = str.substring(pos); + var res = subStr.match(regExp); + if (res) { + res.range = []; + res.range[0] = pos; + incr(res[0].length); + res.range[1] = pos; + } + return res; + } + + function parseDisjunction() { + // Disjunction :: + // Alternative + // Alternative | Disjunction + var res = [], from = pos; + res.push(parseAlternative()); + + while (match('|')) { + res.push(parseAlternative()); + } + + if (res.length === 1) { + return res[0]; + } + + return createDisjunction(res, from, pos); + } + + function parseAlternative() { + var res = [], from = pos; + var term; + + // Alternative :: + // [empty] + // Alternative Term + while (term = parseTerm()) { + res.push(term); + } + + if (res.length === 1) { + return res[0]; + } + + return createAlternative(res, from, pos); + } + + function parseTerm() { + // Term :: + // Anchor + // Atom + // Atom Quantifier + + if (pos >= str.length || current('|') || current(')')) { + return null; /* Means: The term is empty */ + } + + var anchor = parseAnchor(); + + if (anchor) { + return anchor; + } + + var atom = parseAtom(); + if (!atom) { + bail('Expected atom'); + } + var quantifier = parseQuantifier() || false; + if (quantifier) { + quantifier.body = flattenBody(atom); + // The quantifier contains the atom. Therefore, the beginning of the + // quantifier range is given by the beginning of the atom. + updateRawStart(quantifier, atom.range[0]); + return quantifier; + } + return atom; + } + + function parseGroup(matchA, typeA, matchB, typeB) { + var type = null, from = pos; + + if (match(matchA)) { + type = typeA; + } else if (match(matchB)) { + type = typeB; + } else { + return false; + } + + var body = parseDisjunction(); + if (!body) { + bail('Expected disjunction'); + } + skip(')'); + var group = createGroup(type, flattenBody(body), from, pos); + + if (type == 'normal') { + // Keep track of the number of closed groups. This is required for + // parseDecimalEscape(). In case the string is parsed a second time the + // value already holds the total count and no incrementation is required. + if (firstIteration) { + closedCaptureCounter++; + } + } + return group; + } + + function parseAnchor() { + // Anchor :: + // ^ + // $ + // \ b + // \ B + // ( ? = Disjunction ) + // ( ? ! Disjunction ) + var res, from = pos; + + if (match('^')) { + return createAnchor('start', 1 /* rawLength */); + } else if (match('$')) { + return createAnchor('end', 1 /* rawLength */); + } else if (match('\\b')) { + return createAnchor('boundary', 2 /* rawLength */); + } else if (match('\\B')) { + return createAnchor('not-boundary', 2 /* rawLength */); + } else { + return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead'); + } + } + + function parseQuantifier() { + // Quantifier :: + // QuantifierPrefix + // QuantifierPrefix ? + // + // QuantifierPrefix :: + // * + // + + // ? + // { DecimalDigits } + // { DecimalDigits , } + // { DecimalDigits , DecimalDigits } + + var res, from = pos; + var quantifier; + var min, max; + + if (match('*')) { + quantifier = createQuantifier(0); + } + else if (match('+')) { + quantifier = createQuantifier(1); + } + else if (match('?')) { + quantifier = createQuantifier(0, 1); + } + else if (res = matchReg(/^\{([0-9]+)\}/)) { + min = parseInt(res[1], 10); + quantifier = createQuantifier(min, min, res.range[0], res.range[1]); + } + else if (res = matchReg(/^\{([0-9]+),\}/)) { + min = parseInt(res[1], 10); + quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]); + } + else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) { + min = parseInt(res[1], 10); + max = parseInt(res[2], 10); + if (min > max) { + bail('numbers out of order in {} quantifier', '', from, pos); + } + quantifier = createQuantifier(min, max, res.range[0], res.range[1]); + } + + if (quantifier) { + if (match('?')) { + quantifier.greedy = false; + quantifier.range[1] += 1; + } + } + + return quantifier; + } + + function parseAtom() { + // Atom :: + // PatternCharacter + // . + // \ AtomEscape + // CharacterClass + // ( Disjunction ) + // ( ? : Disjunction ) + + var res; + + // jviereck: allow ']', '}' here as well to be compatible with browser's + // implementations: ']'.match(/]/); + // if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) { + if (res = matchReg(/^[^^$\\.*+?(){[|]/)) { + // PatternCharacter + return createCharacter(res); + } + else if (match('.')) { + // . + return createDot(); + } + else if (match('\\')) { + // \ AtomEscape + res = parseAtomEscape(); + if (!res) { + bail('atomEscape'); + } + return res; + } + else if (res = parseCharacterClass()) { + return res; + } + else { + // ( Disjunction ) + // ( ? : Disjunction ) + return parseGroup('(?:', 'ignore', '(', 'normal'); + } + } + + function parseUnicodeSurrogatePairEscape(firstEscape) { + if (hasUnicodeFlag) { + var first, second; + if (firstEscape.kind == 'unicodeEscape' && + (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF && + current('\\') && next('u') ) { + var prevPos = pos; + pos++; + var secondEscape = parseClassEscape(); + if (secondEscape.kind == 'unicodeEscape' && + (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) { + // Unicode surrogate pair + firstEscape.range[1] = secondEscape.range[1]; + firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + firstEscape.type = 'value'; + firstEscape.kind = 'unicodeCodePointEscape'; + addRaw(firstEscape); + } + else { + pos = prevPos; + } + } + } + return firstEscape; + } + + function parseClassEscape() { + return parseAtomEscape(true); + } + + function parseAtomEscape(insideCharacterClass) { + // AtomEscape :: + // DecimalEscape + // CharacterEscape + // CharacterClassEscape + + var res, from = pos; + + res = parseDecimalEscape(); + if (res) { + return res; + } + + // For ClassEscape + if (insideCharacterClass) { + if (match('b')) { + // 15.10.2.19 + // The production ClassEscape :: b evaluates by returning the + // CharSet containing the one character (Unicode value 0008). + return createEscaped('singleEscape', 0x0008, '\\b'); + } else if (match('B')) { + bail('\\B not possible inside of CharacterClass', '', from); + } + } + + res = parseCharacterEscape(); + + return res; + } + + + function parseDecimalEscape() { + // DecimalEscape :: + // DecimalIntegerLiteral [lookahead ∉ DecimalDigit] + // CharacterClassEscape :: one of d D s S w W + + var res, match; + + if (res = matchReg(/^(?!0)\d+/)) { + match = res[0]; + var refIdx = parseInt(res[0], 10); + if (refIdx <= closedCaptureCounter) { + // If the number is smaller than the normal-groups found so + // far, then it is a reference... + return createReference(res[0]); + } else { + // ... otherwise it needs to be interpreted as a octal (if the + // number is in an octal format). If it is NOT octal format, + // then the slash is ignored and the number is matched later + // as normal characters. + + // Recall the negative decision to decide if the input must be parsed + // a second time with the total normal-groups. + backrefDenied.push(refIdx); + + // Reset the position again, as maybe only parts of the previous + // matched numbers are actual octal numbers. E.g. in '019' only + // the '01' should be matched. + incr(-res[0].length); + if (res = matchReg(/^[0-7]{1,3}/)) { + return createEscaped('octal', parseInt(res[0], 8), res[0], 1); + } else { + // If we end up here, we have a case like /\91/. Then the + // first slash is to be ignored and the 9 & 1 to be treated + // like ordinary characters. Create a character for the + // first number only here - other number-characters + // (if available) will be matched later. + res = createCharacter(matchReg(/^[89]/)); + return updateRawStart(res, res.range[0] - 1); + } + } + } + // Only allow octal numbers in the following. All matched numbers start + // with a zero (if the do not, the previous if-branch is executed). + // If the number is not octal format and starts with zero (e.g. `091`) + // then only the zeros `0` is treated here and the `91` are ordinary + // characters. + // Example: + // /\091/.exec('\091')[0].length === 3 + else if (res = matchReg(/^[0-7]{1,3}/)) { + match = res[0]; + if (/^0{1,3}$/.test(match)) { + // If they are all zeros, then only take the first one. + return createEscaped('null', 0x0000, '0', match.length + 1); + } else { + return createEscaped('octal', parseInt(match, 8), match, 1); + } + } else if (res = matchReg(/^[dDsSwW]/)) { + return createCharacterClassEscape(res[0]); + } + return false; + } + + function parseCharacterEscape() { + // CharacterEscape :: + // ControlEscape + // c ControlLetter + // HexEscapeSequence + // UnicodeEscapeSequence + // IdentityEscape + + var res; + if (res = matchReg(/^[fnrtv]/)) { + // ControlEscape + var codePoint = 0; + switch (res[0]) { + case 't': codePoint = 0x009; break; + case 'n': codePoint = 0x00A; break; + case 'v': codePoint = 0x00B; break; + case 'f': codePoint = 0x00C; break; + case 'r': codePoint = 0x00D; break; + } + return createEscaped('singleEscape', codePoint, '\\' + res[0]); + } else if (res = matchReg(/^c([a-zA-Z])/)) { + // c ControlLetter + return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2); + } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) { + // HexEscapeSequence + return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2); + } else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) { + // UnicodeEscapeSequence + return parseUnicodeSurrogatePairEscape( + createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2) + ); + } else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) { + // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape) + return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4); + } else { + // IdentityEscape + return parseIdentityEscape(); + } + } + + // Taken from the Esprima parser. + function isIdentifierPart(ch) { + // Generated by `tools/generate-identifier-regex.js`. + var NonAsciiIdentifierPart = new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'); + + return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) + (ch >= 65 && ch <= 90) || // A..Z + (ch >= 97 && ch <= 122) || // a..z + (ch >= 48 && ch <= 57) || // 0..9 + (ch === 92) || // \ (backslash) + ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch))); + } + + function parseIdentityEscape() { + // IdentityEscape :: + // SourceCharacter but not IdentifierPart + // + // + + var ZWJ = '\u200C'; + var ZWNJ = '\u200D'; + + var tmp; + + if (!isIdentifierPart(lookahead())) { + tmp = incr(); + return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1); + } + + if (match(ZWJ)) { + // + return createEscaped('identifier', 0x200C, ZWJ); + } else if (match(ZWNJ)) { + // + return createEscaped('identifier', 0x200D, ZWNJ); + } + + return null; + } + + function parseCharacterClass() { + // CharacterClass :: + // [ [lookahead ∉ {^}] ClassRanges ] + // [ ^ ClassRanges ] + + var res, from = pos; + if (res = matchReg(/^\[\^/)) { + res = parseClassRanges(); + skip(']'); + return createCharacterClass(res, true, from, pos); + } else if (match('[')) { + res = parseClassRanges(); + skip(']'); + return createCharacterClass(res, false, from, pos); + } + + return null; + } + + function parseClassRanges() { + // ClassRanges :: + // [empty] + // NonemptyClassRanges + + var res; + if (current(']')) { + // Empty array means nothing insinde of the ClassRange. + return []; + } else { + res = parseNonemptyClassRanges(); + if (!res) { + bail('nonEmptyClassRanges'); + } + return res; + } + } + + function parseHelperClassRanges(atom) { + var from, to, res; + if (current('-') && !next(']')) { + // ClassAtom - ClassAtom ClassRanges + skip('-'); + + res = parseClassAtom(); + if (!res) { + bail('classAtom'); + } + to = pos; + var classRanges = parseClassRanges(); + if (!classRanges) { + bail('classRanges'); + } + from = atom.range[0]; + if (classRanges.type === 'empty') { + return [createClassRange(atom, res, from, to)]; + } + return [createClassRange(atom, res, from, to)].concat(classRanges); + } + + res = parseNonemptyClassRangesNoDash(); + if (!res) { + bail('nonEmptyClassRangesNoDash'); + } + + return [atom].concat(res); + } + + function parseNonemptyClassRanges() { + // NonemptyClassRanges :: + // ClassAtom + // ClassAtom NonemptyClassRangesNoDash + // ClassAtom - ClassAtom ClassRanges + + var atom = parseClassAtom(); + if (!atom) { + bail('classAtom'); + } + + if (current(']')) { + // ClassAtom + return [atom]; + } + + // ClassAtom NonemptyClassRangesNoDash + // ClassAtom - ClassAtom ClassRanges + return parseHelperClassRanges(atom); + } + + function parseNonemptyClassRangesNoDash() { + // NonemptyClassRangesNoDash :: + // ClassAtom + // ClassAtomNoDash NonemptyClassRangesNoDash + // ClassAtomNoDash - ClassAtom ClassRanges + + var res = parseClassAtom(); + if (!res) { + bail('classAtom'); + } + if (current(']')) { + // ClassAtom + return res; + } + + // ClassAtomNoDash NonemptyClassRangesNoDash + // ClassAtomNoDash - ClassAtom ClassRanges + return parseHelperClassRanges(res); + } + + function parseClassAtom() { + // ClassAtom :: + // - + // ClassAtomNoDash + if (match('-')) { + return createCharacter('-'); + } else { + return parseClassAtomNoDash(); + } + } + + function parseClassAtomNoDash() { + // ClassAtomNoDash :: + // SourceCharacter but not one of \ or ] or - + // \ ClassEscape + + var res; + if (res = matchReg(/^[^\\\]-]/)) { + return createCharacter(res[0]); + } else if (match('\\')) { + res = parseClassEscape(); + if (!res) { + bail('classEscape'); + } + + return parseUnicodeSurrogatePairEscape(res); + } + } + + function bail(message, details, from, to) { + from = from == null ? pos : from; + to = to == null ? from : to; + + var contextStart = Math.max(0, from - 10); + var contextEnd = Math.min(to + 10, str.length); + + // Output a bit of context and a line pointing to where our error is. + // + // We are assuming that there are no actual newlines in the content as this is a regular expression. + var context = ' ' + str.substring(contextStart, contextEnd); + var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^'; + + throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer); + } + + var backrefDenied = []; + var closedCaptureCounter = 0; + var firstIteration = true; + var hasUnicodeFlag = (flags || "").indexOf("u") !== -1; + var pos = 0; + + // Convert the input to a string and treat the empty string special. + str = String(str); + if (str === '') { + str = '(?:)'; + } + + var result = parseDisjunction(); + + if (result.range[1] !== str.length) { + bail('Could not parse entire input - got stuck', '', result.range[1]); + } + + // The spec requires to interpret the `\2` in `/\2()()/` as backreference. + // As the parser collects the number of capture groups as the string is + // parsed it is impossible to make these decisions at the point when the + // `\2` is handled. In case the local decision turns out to be wrong after + // the parsing has finished, the input string is parsed a second time with + // the total number of capture groups set. + // + // SEE: https://github.com/jviereck/regjsparser/issues/70 + for (var i = 0; i < backrefDenied.length; i++) { + if (backrefDenied[i] <= closedCaptureCounter) { + // Parse the input a second time. + pos = 0; + firstIteration = false; + return parseDisjunction(); + } + } + + return result; + } + + var regjsparser = { + parse: parse + }; + + if (typeof module !== 'undefined' && module.exports) { + module.exports = regjsparser; + } else { + window.regjsparser = regjsparser; + } + +}()); + +},{}],586:[function(_dereq_,module,exports){ +'use strict'; +var isFinite = _dereq_(433); + +module.exports = function (str, n) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string as the first argument'); + } + + if (n < 0 || !isFinite(n)) { + throw new TypeError('Expected a finite positive number'); + } + + var ret = ''; + + do { + if (n & 1) { + ret += str; + } + + str += str; + } while (n = n >> 1); + + return ret; +}; + +},{"433":433}],587:[function(_dereq_,module,exports){ +'use strict'; +module.exports = /^#!.*/; + +},{}],588:[function(_dereq_,module,exports){ +// simple-fmt.js +// MIT licensed, see LICENSE file +// Copyright (c) 2013 Olov Lassus + +var fmt = (function() { + "use strict"; + + function fmt(str, var_args) { + var args = Array.prototype.slice.call(arguments, 1); + return str.replace(/\{(\d+)\}/g, function(s, match) { + return (match in args ? args[match] : s); + }); + } + + function obj(str, obj) { + return str.replace(/\{([_$a-zA-Z0-9][_$a-zA-Z0-9]*)\}/g, function(s, match) { + return (match in obj ? obj[match] : s); + }); + } + + function repeat(str, n) { + return (new Array(n + 1)).join(str); + } + + fmt.fmt = fmt; + fmt.obj = obj; + fmt.repeat = repeat; + return fmt; +})(); + +if (typeof module !== "undefined" && typeof module.exports !== "undefined") { + module.exports = fmt; +} + +},{}],589:[function(_dereq_,module,exports){ +// simple-is.js +// MIT licensed, see LICENSE file +// Copyright (c) 2013 Olov Lassus + +var is = (function() { + "use strict"; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var toString = Object.prototype.toString; + var _undefined = void 0; + + return { + nan: function(v) { + return v !== v; + }, + boolean: function(v) { + return typeof v === "boolean"; + }, + number: function(v) { + return typeof v === "number"; + }, + string: function(v) { + return typeof v === "string"; + }, + fn: function(v) { + return typeof v === "function"; + }, + object: function(v) { + return v !== null && typeof v === "object"; + }, + primitive: function(v) { + var t = typeof v; + return v === null || v === _undefined || + t === "boolean" || t === "number" || t === "string"; + }, + array: Array.isArray || function(v) { + return toString.call(v) === "[object Array]"; + }, + finitenumber: function(v) { + return typeof v === "number" && isFinite(v); + }, + someof: function(v, values) { + return values.indexOf(v) >= 0; + }, + noneof: function(v, values) { + return values.indexOf(v) === -1; + }, + own: function(obj, prop) { + return hasOwnProperty.call(obj, prop); + }, + }; +})(); + +if (typeof module !== "undefined" && typeof module.exports !== "undefined") { + module.exports = is; +} + +},{}],590:[function(_dereq_,module,exports){ +'use strict'; +module.exports = function (str) { + var isExtendedLengthPath = /^\\\\\?\\/.test(str); + var hasNonAscii = /[^\x00-\x80]+/.test(str); + + if (isExtendedLengthPath || hasNonAscii) { + return str; + } + + return str.replace(/\\/g, '/'); +}; + +},{}],591:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + var util = _dereq_(600); + + /** + * A data structure which is a combination of an array and a set. Adding a new + * member is O(1), testing for membership is O(1), and finding the index of an + * element is O(1). Removing elements from the set is not supported. Only + * strings are supported for membership. + */ + function ArraySet() { + this._array = []; + this._set = {}; + } + + /** + * Static method for creating ArraySet instances from an existing array. + */ + ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { + var set = new ArraySet(); + for (var i = 0, len = aArray.length; i < len; i++) { + set.add(aArray[i], aAllowDuplicates); + } + return set; + }; + + /** + * Return how many unique items are in this ArraySet. If duplicates have been + * added, than those do not count towards the size. + * + * @returns Number + */ + ArraySet.prototype.size = function ArraySet_size() { + return Object.getOwnPropertyNames(this._set).length; + }; + + /** + * Add the given string to this set. + * + * @param String aStr + */ + ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { + var sStr = util.toSetString(aStr); + var isDuplicate = this._set.hasOwnProperty(sStr); + var idx = this._array.length; + if (!isDuplicate || aAllowDuplicates) { + this._array.push(aStr); + } + if (!isDuplicate) { + this._set[sStr] = idx; + } + }; + + /** + * Is the given string a member of this set? + * + * @param String aStr + */ + ArraySet.prototype.has = function ArraySet_has(aStr) { + var sStr = util.toSetString(aStr); + return this._set.hasOwnProperty(sStr); + }; + + /** + * What is the index of the given string in the array? + * + * @param String aStr + */ + ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { + var sStr = util.toSetString(aStr); + if (this._set.hasOwnProperty(sStr)) { + return this._set[sStr]; + } + throw new Error('"' + aStr + '" is not in the set.'); + }; + + /** + * What is the element at the given index? + * + * @param Number aIdx + */ + ArraySet.prototype.at = function ArraySet_at(aIdx) { + if (aIdx >= 0 && aIdx < this._array.length) { + return this._array[aIdx]; + } + throw new Error('No element indexed by ' + aIdx); + }; + + /** + * Returns the array representation of this set (which has the proper indices + * indicated by indexOf). Note that this is a copy of the internal array used + * for storing the members so that no one can mess with internal state. + */ + ArraySet.prototype.toArray = function ArraySet_toArray() { + return this._array.slice(); + }; + + exports.ArraySet = ArraySet; +} + +},{"600":600}],592:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + * + * Based on the Base 64 VLQ implementation in Closure Compiler: + * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java + * + * Copyright 2011 The Closure Compiler Authors. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +{ + var base64 = _dereq_(593); + + // A single base 64 digit can contain 6 bits of data. For the base 64 variable + // length quantities we use in the source map spec, the first bit is the sign, + // the next four bits are the actual value, and the 6th bit is the + // continuation bit. The continuation bit tells us whether there are more + // digits in this value following this digit. + // + // Continuation + // | Sign + // | | + // V V + // 101011 + + var VLQ_BASE_SHIFT = 5; + + // binary: 100000 + var VLQ_BASE = 1 << VLQ_BASE_SHIFT; + + // binary: 011111 + var VLQ_BASE_MASK = VLQ_BASE - 1; + + // binary: 100000 + var VLQ_CONTINUATION_BIT = VLQ_BASE; + + /** + * Converts from a two-complement value to a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) + * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) + */ + function toVLQSigned(aValue) { + return aValue < 0 + ? ((-aValue) << 1) + 1 + : (aValue << 1) + 0; + } + + /** + * Converts to a two-complement value from a value where the sign bit is + * placed in the least significant bit. For example, as decimals: + * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 + * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 + */ + function fromVLQSigned(aValue) { + var isNegative = (aValue & 1) === 1; + var shifted = aValue >> 1; + return isNegative + ? -shifted + : shifted; + } + + /** + * Returns the base 64 VLQ encoded value. + */ + exports.encode = function base64VLQ_encode(aValue) { + var encoded = ""; + var digit; + + var vlq = toVLQSigned(aValue); + + do { + digit = vlq & VLQ_BASE_MASK; + vlq >>>= VLQ_BASE_SHIFT; + if (vlq > 0) { + // There are still more digits in this value, so we must make sure the + // continuation bit is marked. + digit |= VLQ_CONTINUATION_BIT; + } + encoded += base64.encode(digit); + } while (vlq > 0); + + return encoded; + }; + + /** + * Decodes the next base 64 VLQ value from the given string and returns the + * value and the rest of the string via the out parameter. + */ + exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { + var strLen = aStr.length; + var result = 0; + var shift = 0; + var continuation, digit; + + do { + if (aIndex >= strLen) { + throw new Error("Expected more digits in base 64 VLQ value."); + } + + digit = base64.decode(aStr.charCodeAt(aIndex++)); + if (digit === -1) { + throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); + } + + continuation = !!(digit & VLQ_CONTINUATION_BIT); + digit &= VLQ_BASE_MASK; + result = result + (digit << shift); + shift += VLQ_BASE_SHIFT; + } while (continuation); + + aOutParam.value = fromVLQSigned(result); + aOutParam.rest = aIndex; + }; +} + +},{"593":593}],593:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); + + /** + * Encode an integer in the range of 0 to 63 to a single base 64 digit. + */ + exports.encode = function (number) { + if (0 <= number && number < intToCharMap.length) { + return intToCharMap[number]; + } + throw new TypeError("Must be between 0 and 63: " + number); + }; + + /** + * Decode a single base 64 character code digit to an integer. Returns -1 on + * failure. + */ + exports.decode = function (charCode) { + var bigA = 65; // 'A' + var bigZ = 90; // 'Z' + + var littleA = 97; // 'a' + var littleZ = 122; // 'z' + + var zero = 48; // '0' + var nine = 57; // '9' + + var plus = 43; // '+' + var slash = 47; // '/' + + var littleOffset = 26; + var numberOffset = 52; + + // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ + if (bigA <= charCode && charCode <= bigZ) { + return (charCode - bigA); + } + + // 26 - 51: abcdefghijklmnopqrstuvwxyz + if (littleA <= charCode && charCode <= littleZ) { + return (charCode - littleA + littleOffset); + } + + // 52 - 61: 0123456789 + if (zero <= charCode && charCode <= nine) { + return (charCode - zero + numberOffset); + } + + // 62: + + if (charCode == plus) { + return 62; + } + + // 63: / + if (charCode == slash) { + return 63; + } + + // Invalid base64 digit. + return -1; + }; +} + +},{}],594:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + exports.GREATEST_LOWER_BOUND = 1; + exports.LEAST_UPPER_BOUND = 2; + + /** + * Recursive implementation of binary search. + * + * @param aLow Indices here and lower do not contain the needle. + * @param aHigh Indices here and higher do not contain the needle. + * @param aNeedle The element being searched for. + * @param aHaystack The non-empty array being searched. + * @param aCompare Function which takes two elements and returns -1, 0, or 1. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + */ + function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { + // This function terminates when one of the following is true: + // + // 1. We find the exact element we are looking for. + // + // 2. We did not find the exact element, but we can return the index of + // the next-closest element. + // + // 3. We did not find the exact element, and there is no next-closest + // element than the one we are searching for, so we return -1. + var mid = Math.floor((aHigh - aLow) / 2) + aLow; + var cmp = aCompare(aNeedle, aHaystack[mid], true); + if (cmp === 0) { + // Found the element we are looking for. + return mid; + } + else if (cmp > 0) { + // Our needle is greater than aHaystack[mid]. + if (aHigh - mid > 1) { + // The element is in the upper half. + return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); + } + + // The exact needle element was not found in this haystack. Determine if + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return aHigh < aHaystack.length ? aHigh : -1; + } else { + return mid; + } + } + else { + // Our needle is less than aHaystack[mid]. + if (mid - aLow > 1) { + // The element is in the lower half. + return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); + } + + // we are in termination case (3) or (2) and return the appropriate thing. + if (aBias == exports.LEAST_UPPER_BOUND) { + return mid; + } else { + return aLow < 0 ? -1 : aLow; + } + } + } + + /** + * This is an implementation of binary search which will always try and return + * the index of the closest element if there is no exact hit. This is because + * mappings between original and generated line/col pairs are single points, + * and there is an implicit region between each of them, so a miss just means + * that you aren't on the very start of a region. + * + * @param aNeedle The element you are looking for. + * @param aHaystack The array that is being searched. + * @param aCompare A function which takes the needle and an element in the + * array and returns -1, 0, or 1 depending on whether the needle is less + * than, equal to, or greater than the element, respectively. + * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or + * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. + */ + exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { + if (aHaystack.length === 0) { + return -1; + } + + var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, + aCompare, aBias || exports.GREATEST_LOWER_BOUND); + if (index < 0) { + return -1; + } + + // We have found either the exact element, or the next-closest element than + // the one we are searching for. However, there may be more than one such + // element. Make sure we always return the smallest of these. + while (index - 1 >= 0) { + if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { + break; + } + --index; + } + + return index; + }; +} + +},{}],595:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2014 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + var util = _dereq_(600); + + /** + * Determine whether mappingB is after mappingA with respect to generated + * position. + */ + function generatedPositionAfter(mappingA, mappingB) { + // Optimized for most common case + var lineA = mappingA.generatedLine; + var lineB = mappingB.generatedLine; + var columnA = mappingA.generatedColumn; + var columnB = mappingB.generatedColumn; + return lineB > lineA || lineB == lineA && columnB >= columnA || + util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + } + + /** + * A data structure to provide a sorted view of accumulated mappings in a + * performance conscious manner. It trades a neglibable overhead in general + * case for a large speedup in case of mappings being added in order. + */ + function MappingList() { + this._array = []; + this._sorted = true; + // Serves as infimum + this._last = {generatedLine: -1, generatedColumn: 0}; + } + + /** + * Iterate through internal items. This method takes the same arguments that + * `Array.prototype.forEach` takes. + * + * NOTE: The order of the mappings is NOT guaranteed. + */ + MappingList.prototype.unsortedForEach = + function MappingList_forEach(aCallback, aThisArg) { + this._array.forEach(aCallback, aThisArg); + }; + + /** + * Add the given source mapping. + * + * @param Object aMapping + */ + MappingList.prototype.add = function MappingList_add(aMapping) { + if (generatedPositionAfter(this._last, aMapping)) { + this._last = aMapping; + this._array.push(aMapping); + } else { + this._sorted = false; + this._array.push(aMapping); + } + }; + + /** + * Returns the flat, sorted array of mappings. The mappings are sorted by + * generated position. + * + * WARNING: This method returns internal data without copying, for + * performance. The return value must NOT be mutated, and should be treated as + * an immutable borrow. If you want to take ownership, you must make your own + * copy. + */ + MappingList.prototype.toArray = function MappingList_toArray() { + if (!this._sorted) { + this._array.sort(util.compareByGeneratedPositionsInflated); + this._sorted = true; + } + return this._array; + }; + + exports.MappingList = MappingList; +} + +},{"600":600}],596:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + // It turns out that some (most?) JavaScript engines don't self-host + // `Array.prototype.sort`. This makes sense because C++ will likely remain + // faster than JS when doing raw CPU-intensive sorting. However, when using a + // custom comparator function, calling back and forth between the VM's C++ and + // JIT'd JS is rather slow *and* loses JIT type information, resulting in + // worse generated code for the comparator function than would be optimal. In + // fact, when sorting with a comparator, these costs outweigh the benefits of + // sorting in C++. By using our own JS-implemented Quick Sort (below), we get + // a ~3500ms mean speed-up in `bench/bench.html`. + + /** + * Swap the elements indexed by `x` and `y` in the array `ary`. + * + * @param {Array} ary + * The array. + * @param {Number} x + * The index of the first item. + * @param {Number} y + * The index of the second item. + */ + function swap(ary, x, y) { + var temp = ary[x]; + ary[x] = ary[y]; + ary[y] = temp; + } + + /** + * Returns a random integer within the range `low .. high` inclusive. + * + * @param {Number} low + * The lower bound on the range. + * @param {Number} high + * The upper bound on the range. + */ + function randomIntInRange(low, high) { + return Math.round(low + (Math.random() * (high - low))); + } + + /** + * The Quick Sort algorithm. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + * @param {Number} p + * Start index of the array + * @param {Number} r + * End index of the array + */ + function doQuickSort(ary, comparator, p, r) { + // If our lower bound is less than our upper bound, we (1) partition the + // array into two pieces and (2) recurse on each half. If it is not, this is + // the empty array and our base case. + + if (p < r) { + // (1) Partitioning. + // + // The partitioning chooses a pivot between `p` and `r` and moves all + // elements that are less than or equal to the pivot to the before it, and + // all the elements that are greater than it after it. The effect is that + // once partition is done, the pivot is in the exact place it will be when + // the array is put in sorted order, and it will not need to be moved + // again. This runs in O(n) time. + + // Always choose a random pivot so that an input array which is reverse + // sorted does not cause O(n^2) running time. + var pivotIndex = randomIntInRange(p, r); + var i = p - 1; + + swap(ary, pivotIndex, r); + var pivot = ary[r]; + + // Immediately after `j` is incremented in this loop, the following hold + // true: + // + // * Every element in `ary[p .. i]` is less than or equal to the pivot. + // + // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. + for (var j = p; j < r; j++) { + if (comparator(ary[j], pivot) <= 0) { + i += 1; + swap(ary, i, j); + } + } + + swap(ary, i + 1, j); + var q = i + 1; + + // (2) Recurse on each half. + + doQuickSort(ary, comparator, p, q - 1); + doQuickSort(ary, comparator, q + 1, r); + } + } + + /** + * Sort the given array in-place with the given comparator function. + * + * @param {Array} ary + * An array to sort. + * @param {function} comparator + * Function to use to compare two items. + */ + exports.quickSort = function (ary, comparator) { + doQuickSort(ary, comparator, 0, ary.length - 1); + }; +} + +},{}],597:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + var util = _dereq_(600); + var binarySearch = _dereq_(594); + var ArraySet = _dereq_(591).ArraySet; + var base64VLQ = _dereq_(592); + var quickSort = _dereq_(596).quickSort; + + function SourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + return sourceMap.sections != null + ? new IndexedSourceMapConsumer(sourceMap) + : new BasicSourceMapConsumer(sourceMap); + } + + SourceMapConsumer.fromSourceMap = function(aSourceMap) { + return BasicSourceMapConsumer.fromSourceMap(aSourceMap); + } + + /** + * The version of the source mapping spec that we are consuming. + */ + SourceMapConsumer.prototype._version = 3; + + // `__generatedMappings` and `__originalMappings` are arrays that hold the + // parsed mapping coordinates from the source map's "mappings" attribute. They + // are lazily instantiated, accessed via the `_generatedMappings` and + // `_originalMappings` getters respectively, and we only parse the mappings + // and create these arrays once queried for a source location. We jump through + // these hoops because there can be many thousands of mappings, and parsing + // them is expensive, so we only want to do it if we must. + // + // Each object in the arrays is of the form: + // + // { + // generatedLine: The line number in the generated code, + // generatedColumn: The column number in the generated code, + // source: The path to the original source file that generated this + // chunk of code, + // originalLine: The line number in the original source that + // corresponds to this chunk of generated code, + // originalColumn: The column number in the original source that + // corresponds to this chunk of generated code, + // name: The name of the original symbol which generated this chunk of + // code. + // } + // + // All properties except for `generatedLine` and `generatedColumn` can be + // `null`. + // + // `_generatedMappings` is ordered by the generated positions. + // + // `_originalMappings` is ordered by the original positions. + + SourceMapConsumer.prototype.__generatedMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { + get: function () { + if (!this.__generatedMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__generatedMappings; + } + }); + + SourceMapConsumer.prototype.__originalMappings = null; + Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { + get: function () { + if (!this.__originalMappings) { + this._parseMappings(this._mappings, this.sourceRoot); + } + + return this.__originalMappings; + } + }); + + SourceMapConsumer.prototype._charIsMappingSeparator = + function SourceMapConsumer_charIsMappingSeparator(aStr, index) { + var c = aStr.charAt(index); + return c === ";" || c === ","; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + SourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + throw new Error("Subclasses must implement _parseMappings"); + }; + + SourceMapConsumer.GENERATED_ORDER = 1; + SourceMapConsumer.ORIGINAL_ORDER = 2; + + SourceMapConsumer.GREATEST_LOWER_BOUND = 1; + SourceMapConsumer.LEAST_UPPER_BOUND = 2; + + /** + * Iterate over each mapping between an original source/line/column and a + * generated line/column in this source map. + * + * @param Function aCallback + * The function that is called with each mapping. + * @param Object aContext + * Optional. If specified, this object will be the value of `this` every + * time that `aCallback` is called. + * @param aOrder + * Either `SourceMapConsumer.GENERATED_ORDER` or + * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to + * iterate over the mappings sorted by the generated file's line/column + * order or the original's source/line/column order, respectively. Defaults to + * `SourceMapConsumer.GENERATED_ORDER`. + */ + SourceMapConsumer.prototype.eachMapping = + function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { + var context = aContext || null; + var order = aOrder || SourceMapConsumer.GENERATED_ORDER; + + var mappings; + switch (order) { + case SourceMapConsumer.GENERATED_ORDER: + mappings = this._generatedMappings; + break; + case SourceMapConsumer.ORIGINAL_ORDER: + mappings = this._originalMappings; + break; + default: + throw new Error("Unknown order of iteration."); + } + + var sourceRoot = this.sourceRoot; + mappings.map(function (mapping) { + var source = mapping.source === null ? null : this._sources.at(mapping.source); + if (source != null && sourceRoot != null) { + source = util.join(sourceRoot, source); + } + return { + source: source, + generatedLine: mapping.generatedLine, + generatedColumn: mapping.generatedColumn, + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: mapping.name === null ? null : this._names.at(mapping.name) + }; + }, this).forEach(aCallback, context); + }; + + /** + * Returns all generated line and column information for the original source, + * line, and column provided. If no column is provided, returns all mappings + * corresponding to a either the line we are searching for or the next + * closest line that has any mappings. Otherwise, returns all mappings + * corresponding to the given line and either the column we are searching for + * or the next closest column that has any offsets. + * + * The only argument is an object with the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: Optional. the column number in the original source. + * + * and an array of objects is returned, each with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + SourceMapConsumer.prototype.allGeneratedPositionsFor = + function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { + var line = util.getArg(aArgs, 'line'); + + // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping + // returns the index of the closest mapping less than the needle. By + // setting needle.originalColumn to 0, we thus find the last mapping for + // the given line, provided such a mapping exists. + var needle = { + source: util.getArg(aArgs, 'source'), + originalLine: line, + originalColumn: util.getArg(aArgs, 'column', 0) + }; + + if (this.sourceRoot != null) { + needle.source = util.relative(this.sourceRoot, needle.source); + } + if (!this._sources.has(needle.source)) { + return []; + } + needle.source = this._sources.indexOf(needle.source); + + var mappings = []; + + var index = this._findMapping(needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + binarySearch.LEAST_UPPER_BOUND); + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (aArgs.column === undefined) { + var originalLine = mapping.originalLine; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we found. Since + // mappings are sorted, this is guaranteed to find all mappings for + // the line we found. + while (mapping && mapping.originalLine === originalLine) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } else { + var originalColumn = mapping.originalColumn; + + // Iterate until either we run out of mappings, or we run into + // a mapping for a different line than the one we were searching for. + // Since mappings are sorted, this is guaranteed to find all mappings for + // the line we are searching for. + while (mapping && + mapping.originalLine === line && + mapping.originalColumn == originalColumn) { + mappings.push({ + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }); + + mapping = this._originalMappings[++index]; + } + } + } + + return mappings; + }; + + exports.SourceMapConsumer = SourceMapConsumer; + + /** + * A BasicSourceMapConsumer instance represents a parsed source map which we can + * query for information about the original file positions by giving it a file + * position in the generated source. + * + * The only parameter is the raw source map (either as a JSON string, or + * already parsed to an object). According to the spec, source maps have the + * following attributes: + * + * - version: Which version of the source map spec this map is following. + * - sources: An array of URLs to the original source files. + * - names: An array of identifiers which can be referrenced by individual mappings. + * - sourceRoot: Optional. The URL root from which all sources are relative. + * - sourcesContent: Optional. An array of contents of the original source files. + * - mappings: A string of base64 VLQs which contain the actual mappings. + * - file: Optional. The generated file this source map is associated with. + * + * Here is an example source map, taken from the source map spec[0]: + * + * { + * version : 3, + * file: "out.js", + * sourceRoot : "", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AA,AB;;ABCDE;" + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# + */ + function BasicSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sources = util.getArg(sourceMap, 'sources'); + // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which + // requires the array) to play nice here. + var names = util.getArg(sourceMap, 'names', []); + var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); + var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); + var mappings = util.getArg(sourceMap, 'mappings'); + var file = util.getArg(sourceMap, 'file', null); + + // Once again, Sass deviates from the spec and supplies the version as a + // string rather than a number, so we use loose equality checking here. + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + sources = sources + // Some source maps produce relative source paths like "./foo.js" instead of + // "foo.js". Normalize these first so that future comparisons will succeed. + // See bugzil.la/1090768. + .map(util.normalize) + // Always ensure that absolute sources are internally stored relative to + // the source root, if the source root is absolute. Not doing this would + // be particularly problematic when the source root is a prefix of the + // source (valid, but why??). See github issue #199 and bugzil.la/1188982. + .map(function (source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) + ? util.relative(sourceRoot, source) + : source; + }); + + // Pass `true` below to allow duplicate names and sources. While source maps + // are intended to be compressed and deduplicated, the TypeScript compiler + // sometimes generates source maps with duplicates in them. See Github issue + // #72 and bugzil.la/889492. + this._names = ArraySet.fromArray(names, true); + this._sources = ArraySet.fromArray(sources, true); + + this.sourceRoot = sourceRoot; + this.sourcesContent = sourcesContent; + this._mappings = mappings; + this.file = file; + } + + BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; + + /** + * Create a BasicSourceMapConsumer from a SourceMapGenerator. + * + * @param SourceMapGenerator aSourceMap + * The source map that will be consumed. + * @returns BasicSourceMapConsumer + */ + BasicSourceMapConsumer.fromSourceMap = + function SourceMapConsumer_fromSourceMap(aSourceMap) { + var smc = Object.create(BasicSourceMapConsumer.prototype); + + var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); + var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); + smc.sourceRoot = aSourceMap._sourceRoot; + smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), + smc.sourceRoot); + smc.file = aSourceMap._file; + + // Because we are modifying the entries (by converting string sources and + // names to indices into the sources and names ArraySets), we have to make + // a copy of the entry or else bad things happen. Shared mutable state + // strikes again! See github issue #191. + + var generatedMappings = aSourceMap._mappings.toArray().slice(); + var destGeneratedMappings = smc.__generatedMappings = []; + var destOriginalMappings = smc.__originalMappings = []; + + for (var i = 0, length = generatedMappings.length; i < length; i++) { + var srcMapping = generatedMappings[i]; + var destMapping = new Mapping; + destMapping.generatedLine = srcMapping.generatedLine; + destMapping.generatedColumn = srcMapping.generatedColumn; + + if (srcMapping.source) { + destMapping.source = sources.indexOf(srcMapping.source); + destMapping.originalLine = srcMapping.originalLine; + destMapping.originalColumn = srcMapping.originalColumn; + + if (srcMapping.name) { + destMapping.name = names.indexOf(srcMapping.name); + } + + destOriginalMappings.push(destMapping); + } + + destGeneratedMappings.push(destMapping); + } + + quickSort(smc.__originalMappings, util.compareByOriginalPositions); + + return smc; + }; + + /** + * The version of the source mapping spec that we are consuming. + */ + BasicSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { + get: function () { + return this._sources.toArray().map(function (s) { + return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; + }, this); + } + }); + + /** + * Provide the JIT with a nice shape / hidden class. + */ + function Mapping() { + this.generatedLine = 0; + this.generatedColumn = 0; + this.source = null; + this.originalLine = null; + this.originalColumn = null; + this.name = null; + } + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + BasicSourceMapConsumer.prototype._parseMappings = + function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { + var generatedLine = 1; + var previousGeneratedColumn = 0; + var previousOriginalLine = 0; + var previousOriginalColumn = 0; + var previousSource = 0; + var previousName = 0; + var length = aStr.length; + var index = 0; + var cachedSegments = {}; + var temp = {}; + var originalMappings = []; + var generatedMappings = []; + var mapping, str, segment, end, value; + + while (index < length) { + if (aStr.charAt(index) === ';') { + generatedLine++; + index++; + previousGeneratedColumn = 0; + } + else if (aStr.charAt(index) === ',') { + index++; + } + else { + mapping = new Mapping(); + mapping.generatedLine = generatedLine; + + // Because each offset is encoded relative to the previous one, + // many segments often have the same encoding. We can exploit this + // fact by caching the parsed variable length fields of each segment, + // allowing us to avoid a second parse if we encounter the same + // segment again. + for (end = index; end < length; end++) { + if (this._charIsMappingSeparator(aStr, end)) { + break; + } + } + str = aStr.slice(index, end); + + segment = cachedSegments[str]; + if (segment) { + index += str.length; + } else { + segment = []; + while (index < end) { + base64VLQ.decode(aStr, index, temp); + value = temp.value; + index = temp.rest; + segment.push(value); + } + + if (segment.length === 2) { + throw new Error('Found a source, but no line and column'); + } + + if (segment.length === 3) { + throw new Error('Found a source and line, but no column'); + } + + cachedSegments[str] = segment; + } + + // Generated column. + mapping.generatedColumn = previousGeneratedColumn + segment[0]; + previousGeneratedColumn = mapping.generatedColumn; + + if (segment.length > 1) { + // Original source. + mapping.source = previousSource + segment[1]; + previousSource += segment[1]; + + // Original line. + mapping.originalLine = previousOriginalLine + segment[2]; + previousOriginalLine = mapping.originalLine; + // Lines are stored 0-based + mapping.originalLine += 1; + + // Original column. + mapping.originalColumn = previousOriginalColumn + segment[3]; + previousOriginalColumn = mapping.originalColumn; + + if (segment.length > 4) { + // Original name. + mapping.name = previousName + segment[4]; + previousName += segment[4]; + } + } + + generatedMappings.push(mapping); + if (typeof mapping.originalLine === 'number') { + originalMappings.push(mapping); + } + } + } + + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); + this.__generatedMappings = generatedMappings; + + quickSort(originalMappings, util.compareByOriginalPositions); + this.__originalMappings = originalMappings; + }; + + /** + * Find the mapping that best matches the hypothetical "needle" mapping that + * we are searching for in the given "haystack" of mappings. + */ + BasicSourceMapConsumer.prototype._findMapping = + function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, + aColumnName, aComparator, aBias) { + // To return the position we are searching for, we must first find the + // mapping for the given position and then return the opposite position it + // points to. Because the mappings are sorted, we can use binary search to + // find the best mapping. + + if (aNeedle[aLineName] <= 0) { + throw new TypeError('Line must be greater than or equal to 1, got ' + + aNeedle[aLineName]); + } + if (aNeedle[aColumnName] < 0) { + throw new TypeError('Column must be greater than or equal to 0, got ' + + aNeedle[aColumnName]); + } + + return binarySearch.search(aNeedle, aMappings, aComparator, aBias); + }; + + /** + * Compute the last column for each generated mapping. The last column is + * inclusive. + */ + BasicSourceMapConsumer.prototype.computeColumnSpans = + function SourceMapConsumer_computeColumnSpans() { + for (var index = 0; index < this._generatedMappings.length; ++index) { + var mapping = this._generatedMappings[index]; + + // Mappings do not contain a field for the last generated columnt. We + // can come up with an optimistic estimate, however, by assuming that + // mappings are contiguous (i.e. given two consecutive mappings, the + // first mapping ends where the second one starts). + if (index + 1 < this._generatedMappings.length) { + var nextMapping = this._generatedMappings[index + 1]; + + if (mapping.generatedLine === nextMapping.generatedLine) { + mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; + continue; + } + } + + // The last mapping for each line spans the entire line. + mapping.lastGeneratedColumn = Infinity; + } + }; + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ + BasicSourceMapConsumer.prototype.originalPositionFor = + function SourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._generatedMappings, + "generatedLine", + "generatedColumn", + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._generatedMappings[index]; + + if (mapping.generatedLine === needle.generatedLine) { + var source = util.getArg(mapping, 'source', null); + if (source !== null) { + source = this._sources.at(source); + if (this.sourceRoot != null) { + source = util.join(this.sourceRoot, source); + } + } + var name = util.getArg(mapping, 'name', null); + if (name !== null) { + name = this._names.at(name); + } + return { + source: source, + line: util.getArg(mapping, 'originalLine', null), + column: util.getArg(mapping, 'originalColumn', null), + name: name + }; + } + } + + return { + source: null, + line: null, + column: null, + name: null + }; + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + BasicSourceMapConsumer.prototype.hasContentsOfAllSources = + function BasicSourceMapConsumer_hasContentsOfAllSources() { + if (!this.sourcesContent) { + return false; + } + return this.sourcesContent.length >= this._sources.size() && + !this.sourcesContent.some(function (sc) { return sc == null; }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + BasicSourceMapConsumer.prototype.sourceContentFor = + function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + if (!this.sourcesContent) { + return null; + } + + if (this.sourceRoot != null) { + aSource = util.relative(this.sourceRoot, aSource); + } + + if (this._sources.has(aSource)) { + return this.sourcesContent[this._sources.indexOf(aSource)]; + } + + var url; + if (this.sourceRoot != null + && (url = util.urlParse(this.sourceRoot))) { + // XXX: file:// URIs and absolute paths lead to unexpected behavior for + // many users. We can help them out when they expect file:// URIs to + // behave like it would if they were running a local HTTP server. See + // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. + var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); + if (url.scheme == "file" + && this._sources.has(fileUriAbsPath)) { + return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] + } + + if ((!url.path || url.path == "/") + && this._sources.has("/" + aSource)) { + return this.sourcesContent[this._sources.indexOf("/" + aSource)]; + } + } + + // This function is used recursively from + // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we + // don't want to throw if we can't find the source - we just want to + // return null, so we provide a flag to exit gracefully. + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or + * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the + * closest element that is smaller than or greater than the one we are + * searching for, respectively, if the exact element cannot be found. + * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + BasicSourceMapConsumer.prototype.generatedPositionFor = + function SourceMapConsumer_generatedPositionFor(aArgs) { + var source = util.getArg(aArgs, 'source'); + if (this.sourceRoot != null) { + source = util.relative(this.sourceRoot, source); + } + if (!this._sources.has(source)) { + return { + line: null, + column: null, + lastColumn: null + }; + } + source = this._sources.indexOf(source); + + var needle = { + source: source, + originalLine: util.getArg(aArgs, 'line'), + originalColumn: util.getArg(aArgs, 'column') + }; + + var index = this._findMapping( + needle, + this._originalMappings, + "originalLine", + "originalColumn", + util.compareByOriginalPositions, + util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) + ); + + if (index >= 0) { + var mapping = this._originalMappings[index]; + + if (mapping.source === needle.source) { + return { + line: util.getArg(mapping, 'generatedLine', null), + column: util.getArg(mapping, 'generatedColumn', null), + lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) + }; + } + } + + return { + line: null, + column: null, + lastColumn: null + }; + }; + + exports.BasicSourceMapConsumer = BasicSourceMapConsumer; + + /** + * An IndexedSourceMapConsumer instance represents a parsed source map which + * we can query for information. It differs from BasicSourceMapConsumer in + * that it takes "indexed" source maps (i.e. ones with a "sections" field) as + * input. + * + * The only parameter is a raw source map (either as a JSON string, or already + * parsed to an object). According to the spec for indexed source maps, they + * have the following attributes: + * + * - version: Which version of the source map spec this map is following. + * - file: Optional. The generated file this source map is associated with. + * - sections: A list of section definitions. + * + * Each value under the "sections" field has two fields: + * - offset: The offset into the original specified at which this section + * begins to apply, defined as an object with a "line" and "column" + * field. + * - map: A source map definition. This source map could also be indexed, + * but doesn't have to be. + * + * Instead of the "map" field, it's also possible to have a "url" field + * specifying a URL to retrieve a source map from, but that's currently + * unsupported. + * + * Here's an example source map, taken from the source map spec[0], but + * modified to omit a section which uses the "url" field. + * + * { + * version : 3, + * file: "app.js", + * sections: [{ + * offset: {line:100, column:10}, + * map: { + * version : 3, + * file: "section.js", + * sources: ["foo.js", "bar.js"], + * names: ["src", "maps", "are", "fun"], + * mappings: "AAAA,E;;ABCDE;" + * } + * }], + * } + * + * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt + */ + function IndexedSourceMapConsumer(aSourceMap) { + var sourceMap = aSourceMap; + if (typeof aSourceMap === 'string') { + sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); + } + + var version = util.getArg(sourceMap, 'version'); + var sections = util.getArg(sourceMap, 'sections'); + + if (version != this._version) { + throw new Error('Unsupported version: ' + version); + } + + this._sources = new ArraySet(); + this._names = new ArraySet(); + + var lastOffset = { + line: -1, + column: 0 + }; + this._sections = sections.map(function (s) { + if (s.url) { + // The url field will require support for asynchronicity. + // See https://github.com/mozilla/source-map/issues/16 + throw new Error('Support for url field in sections not implemented.'); + } + var offset = util.getArg(s, 'offset'); + var offsetLine = util.getArg(offset, 'line'); + var offsetColumn = util.getArg(offset, 'column'); + + if (offsetLine < lastOffset.line || + (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { + throw new Error('Section offsets must be ordered and non-overlapping.'); + } + lastOffset = offset; + + return { + generatedOffset: { + // The offset fields are 0-based, but we use 1-based indices when + // encoding/decoding from VLQ. + generatedLine: offsetLine + 1, + generatedColumn: offsetColumn + 1 + }, + consumer: new SourceMapConsumer(util.getArg(s, 'map')) + } + }); + } + + IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); + IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; + + /** + * The version of the source mapping spec that we are consuming. + */ + IndexedSourceMapConsumer.prototype._version = 3; + + /** + * The list of original sources. + */ + Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { + get: function () { + var sources = []; + for (var i = 0; i < this._sections.length; i++) { + for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { + sources.push(this._sections[i].consumer.sources[j]); + } + } + return sources; + } + }); + + /** + * Returns the original source, line, and column information for the generated + * source's line and column positions provided. The only argument is an object + * with the following properties: + * + * - line: The line number in the generated source. + * - column: The column number in the generated source. + * + * and an object is returned with the following properties: + * + * - source: The original source file, or null. + * - line: The line number in the original source, or null. + * - column: The column number in the original source, or null. + * - name: The original identifier, or null. + */ + IndexedSourceMapConsumer.prototype.originalPositionFor = + function IndexedSourceMapConsumer_originalPositionFor(aArgs) { + var needle = { + generatedLine: util.getArg(aArgs, 'line'), + generatedColumn: util.getArg(aArgs, 'column') + }; + + // Find the section containing the generated position we're trying to map + // to an original position. + var sectionIndex = binarySearch.search(needle, this._sections, + function(needle, section) { + var cmp = needle.generatedLine - section.generatedOffset.generatedLine; + if (cmp) { + return cmp; + } + + return (needle.generatedColumn - + section.generatedOffset.generatedColumn); + }); + var section = this._sections[sectionIndex]; + + if (!section) { + return { + source: null, + line: null, + column: null, + name: null + }; + } + + return section.consumer.originalPositionFor({ + line: needle.generatedLine - + (section.generatedOffset.generatedLine - 1), + column: needle.generatedColumn - + (section.generatedOffset.generatedLine === needle.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + bias: aArgs.bias + }); + }; + + /** + * Return true if we have the source content for every source in the source + * map, false otherwise. + */ + IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = + function IndexedSourceMapConsumer_hasContentsOfAllSources() { + return this._sections.every(function (s) { + return s.consumer.hasContentsOfAllSources(); + }); + }; + + /** + * Returns the original source content. The only argument is the url of the + * original source file. Returns null if no original source content is + * available. + */ + IndexedSourceMapConsumer.prototype.sourceContentFor = + function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + var content = section.consumer.sourceContentFor(aSource, true); + if (content) { + return content; + } + } + if (nullOnMissing) { + return null; + } + else { + throw new Error('"' + aSource + '" is not in the SourceMap.'); + } + }; + + /** + * Returns the generated line and column information for the original source, + * line, and column positions provided. The only argument is an object with + * the following properties: + * + * - source: The filename of the original source. + * - line: The line number in the original source. + * - column: The column number in the original source. + * + * and an object is returned with the following properties: + * + * - line: The line number in the generated source, or null. + * - column: The column number in the generated source, or null. + */ + IndexedSourceMapConsumer.prototype.generatedPositionFor = + function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + + // Only consider this section if the requested source is in the list of + // sources of the consumer. + if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { + continue; + } + var generatedPosition = section.consumer.generatedPositionFor(aArgs); + if (generatedPosition) { + var ret = { + line: generatedPosition.line + + (section.generatedOffset.generatedLine - 1), + column: generatedPosition.column + + (section.generatedOffset.generatedLine === generatedPosition.line + ? section.generatedOffset.generatedColumn - 1 + : 0) + }; + return ret; + } + } + + return { + line: null, + column: null + }; + }; + + /** + * Parse the mappings in a string in to a data structure which we can easily + * query (the ordered arrays in the `this.__generatedMappings` and + * `this.__originalMappings` properties). + */ + IndexedSourceMapConsumer.prototype._parseMappings = + function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { + this.__generatedMappings = []; + this.__originalMappings = []; + for (var i = 0; i < this._sections.length; i++) { + var section = this._sections[i]; + var sectionMappings = section.consumer._generatedMappings; + for (var j = 0; j < sectionMappings.length; j++) { + var mapping = sectionMappings[j]; + + var source = section.consumer._sources.at(mapping.source); + if (section.consumer.sourceRoot !== null) { + source = util.join(section.consumer.sourceRoot, source); + } + this._sources.add(source); + source = this._sources.indexOf(source); + + var name = section.consumer._names.at(mapping.name); + this._names.add(name); + name = this._names.indexOf(name); + + // The mappings coming from the consumer for the section have + // generated positions relative to the start of the section, so we + // need to offset them to be relative to the start of the concatenated + // generated file. + var adjustedMapping = { + source: source, + generatedLine: mapping.generatedLine + + (section.generatedOffset.generatedLine - 1), + generatedColumn: mapping.generatedColumn + + (section.generatedOffset.generatedLine === mapping.generatedLine + ? section.generatedOffset.generatedColumn - 1 + : 0), + originalLine: mapping.originalLine, + originalColumn: mapping.originalColumn, + name: name + }; + + this.__generatedMappings.push(adjustedMapping); + if (typeof adjustedMapping.originalLine === 'number') { + this.__originalMappings.push(adjustedMapping); + } + } + } + + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); + }; + + exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; +} + +},{"591":591,"592":592,"594":594,"596":596,"600":600}],598:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + var base64VLQ = _dereq_(592); + var util = _dereq_(600); + var ArraySet = _dereq_(591).ArraySet; + var MappingList = _dereq_(595).MappingList; + + /** + * An instance of the SourceMapGenerator represents a source map which is + * being built incrementally. You may pass an object with the following + * properties: + * + * - file: The filename of the generated source. + * - sourceRoot: A root for all relative URLs in this source map. + */ + function SourceMapGenerator(aArgs) { + if (!aArgs) { + aArgs = {}; + } + this._file = util.getArg(aArgs, 'file', null); + this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); + this._skipValidation = util.getArg(aArgs, 'skipValidation', false); + this._sources = new ArraySet(); + this._names = new ArraySet(); + this._mappings = new MappingList(); + this._sourcesContents = null; + } + + SourceMapGenerator.prototype._version = 3; + + /** + * Creates a new SourceMapGenerator based on a SourceMapConsumer + * + * @param aSourceMapConsumer The SourceMap. + */ + SourceMapGenerator.fromSourceMap = + function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { + var sourceRoot = aSourceMapConsumer.sourceRoot; + var generator = new SourceMapGenerator({ + file: aSourceMapConsumer.file, + sourceRoot: sourceRoot + }); + aSourceMapConsumer.eachMapping(function (mapping) { + var newMapping = { + generated: { + line: mapping.generatedLine, + column: mapping.generatedColumn + } + }; + + if (mapping.source != null) { + newMapping.source = mapping.source; + if (sourceRoot != null) { + newMapping.source = util.relative(sourceRoot, newMapping.source); + } + + newMapping.original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; + + if (mapping.name != null) { + newMapping.name = mapping.name; + } + } + + generator.addMapping(newMapping); + }); + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + generator.setSourceContent(sourceFile, content); + } + }); + return generator; + }; + + /** + * Add a single mapping from original source line and column to the generated + * source's line and column for this source map being created. The mapping + * object should have the following properties: + * + * - generated: An object with the generated line and column positions. + * - original: An object with the original line and column positions. + * - source: The original source file (relative to the sourceRoot). + * - name: An optional original token name for this mapping. + */ + SourceMapGenerator.prototype.addMapping = + function SourceMapGenerator_addMapping(aArgs) { + var generated = util.getArg(aArgs, 'generated'); + var original = util.getArg(aArgs, 'original', null); + var source = util.getArg(aArgs, 'source', null); + var name = util.getArg(aArgs, 'name', null); + + if (!this._skipValidation) { + this._validateMapping(generated, original, source, name); + } + + if (source != null && !this._sources.has(source)) { + this._sources.add(source); + } + + if (name != null && !this._names.has(name)) { + this._names.add(name); + } + + this._mappings.add({ + generatedLine: generated.line, + generatedColumn: generated.column, + originalLine: original != null && original.line, + originalColumn: original != null && original.column, + source: source, + name: name + }); + }; + + /** + * Set the source content for a source file. + */ + SourceMapGenerator.prototype.setSourceContent = + function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { + var source = aSourceFile; + if (this._sourceRoot != null) { + source = util.relative(this._sourceRoot, source); + } + + if (aSourceContent != null) { + // Add the source content to the _sourcesContents map. + // Create a new _sourcesContents map if the property is null. + if (!this._sourcesContents) { + this._sourcesContents = {}; + } + this._sourcesContents[util.toSetString(source)] = aSourceContent; + } else if (this._sourcesContents) { + // Remove the source file from the _sourcesContents map. + // If the _sourcesContents map is empty, set the property to null. + delete this._sourcesContents[util.toSetString(source)]; + if (Object.keys(this._sourcesContents).length === 0) { + this._sourcesContents = null; + } + } + }; + + /** + * Applies the mappings of a sub-source-map for a specific source file to the + * source map being generated. Each mapping to the supplied source file is + * rewritten using the supplied source map. Note: The resolution for the + * resulting mappings is the minimium of this map and the supplied map. + * + * @param aSourceMapConsumer The source map to be applied. + * @param aSourceFile Optional. The filename of the source file. + * If omitted, SourceMapConsumer's file property will be used. + * @param aSourceMapPath Optional. The dirname of the path to the source map + * to be applied. If relative, it is relative to the SourceMapConsumer. + * This parameter is needed when the two source maps aren't in the same + * directory, and the source map to be applied contains relative source + * paths. If so, those relative source paths need to be rewritten + * relative to the SourceMapGenerator. + */ + SourceMapGenerator.prototype.applySourceMap = + function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { + var sourceFile = aSourceFile; + // If aSourceFile is omitted, we will use the file property of the SourceMap + if (aSourceFile == null) { + if (aSourceMapConsumer.file == null) { + throw new Error( + 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + + 'or the source map\'s "file" property. Both were omitted.' + ); + } + sourceFile = aSourceMapConsumer.file; + } + var sourceRoot = this._sourceRoot; + // Make "sourceFile" relative if an absolute Url is passed. + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + // Applying the SourceMap can add and remove items from the sources and + // the names array. + var newSources = new ArraySet(); + var newNames = new ArraySet(); + + // Find mappings for the "sourceFile" + this._mappings.unsortedForEach(function (mapping) { + if (mapping.source === sourceFile && mapping.originalLine != null) { + // Check if it can be mapped by the source map, then update the mapping. + var original = aSourceMapConsumer.originalPositionFor({ + line: mapping.originalLine, + column: mapping.originalColumn + }); + if (original.source != null) { + // Copy mapping + mapping.source = original.source; + if (aSourceMapPath != null) { + mapping.source = util.join(aSourceMapPath, mapping.source) + } + if (sourceRoot != null) { + mapping.source = util.relative(sourceRoot, mapping.source); + } + mapping.originalLine = original.line; + mapping.originalColumn = original.column; + if (original.name != null) { + mapping.name = original.name; + } + } + } + + var source = mapping.source; + if (source != null && !newSources.has(source)) { + newSources.add(source); + } + + var name = mapping.name; + if (name != null && !newNames.has(name)) { + newNames.add(name); + } + + }, this); + this._sources = newSources; + this._names = newNames; + + // Copy sourcesContents of applied map. + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aSourceMapPath != null) { + sourceFile = util.join(aSourceMapPath, sourceFile); + } + if (sourceRoot != null) { + sourceFile = util.relative(sourceRoot, sourceFile); + } + this.setSourceContent(sourceFile, content); + } + }, this); + }; + + /** + * A mapping can have one of the three levels of data: + * + * 1. Just the generated position. + * 2. The Generated position, original position, and original source. + * 3. Generated and original position, original source, as well as a name + * token. + * + * To maintain consistency, we validate that any new mapping being added falls + * in to one of these categories. + */ + SourceMapGenerator.prototype._validateMapping = + function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, + aName) { + if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aGenerated.line > 0 && aGenerated.column >= 0 + && !aOriginal && !aSource && !aName) { + // Case 1. + return; + } + else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated + && aOriginal && 'line' in aOriginal && 'column' in aOriginal + && aGenerated.line > 0 && aGenerated.column >= 0 + && aOriginal.line > 0 && aOriginal.column >= 0 + && aSource) { + // Cases 2 and 3. + return; + } + else { + throw new Error('Invalid mapping: ' + JSON.stringify({ + generated: aGenerated, + source: aSource, + original: aOriginal, + name: aName + })); + } + }; + + /** + * Serialize the accumulated mappings in to the stream of base 64 VLQs + * specified by the source map format. + */ + SourceMapGenerator.prototype._serializeMappings = + function SourceMapGenerator_serializeMappings() { + var previousGeneratedColumn = 0; + var previousGeneratedLine = 1; + var previousOriginalColumn = 0; + var previousOriginalLine = 0; + var previousName = 0; + var previousSource = 0; + var result = ''; + var mapping; + var nameIdx; + var sourceIdx; + + var mappings = this._mappings.toArray(); + for (var i = 0, len = mappings.length; i < len; i++) { + mapping = mappings[i]; + + if (mapping.generatedLine !== previousGeneratedLine) { + previousGeneratedColumn = 0; + while (mapping.generatedLine !== previousGeneratedLine) { + result += ';'; + previousGeneratedLine++; + } + } + else { + if (i > 0) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + continue; + } + result += ','; + } + } + + result += base64VLQ.encode(mapping.generatedColumn + - previousGeneratedColumn); + previousGeneratedColumn = mapping.generatedColumn; + + if (mapping.source != null) { + sourceIdx = this._sources.indexOf(mapping.source); + result += base64VLQ.encode(sourceIdx - previousSource); + previousSource = sourceIdx; + + // lines are stored 0-based in SourceMap spec version 3 + result += base64VLQ.encode(mapping.originalLine - 1 + - previousOriginalLine); + previousOriginalLine = mapping.originalLine - 1; + + result += base64VLQ.encode(mapping.originalColumn + - previousOriginalColumn); + previousOriginalColumn = mapping.originalColumn; + + if (mapping.name != null) { + nameIdx = this._names.indexOf(mapping.name); + result += base64VLQ.encode(nameIdx - previousName); + previousName = nameIdx; + } + } + } + + return result; + }; + + SourceMapGenerator.prototype._generateSourcesContent = + function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { + return aSources.map(function (source) { + if (!this._sourcesContents) { + return null; + } + if (aSourceRoot != null) { + source = util.relative(aSourceRoot, source); + } + var key = util.toSetString(source); + return Object.prototype.hasOwnProperty.call(this._sourcesContents, + key) + ? this._sourcesContents[key] + : null; + }, this); + }; + + /** + * Externalize the source map. + */ + SourceMapGenerator.prototype.toJSON = + function SourceMapGenerator_toJSON() { + var map = { + version: this._version, + sources: this._sources.toArray(), + names: this._names.toArray(), + mappings: this._serializeMappings() + }; + if (this._file != null) { + map.file = this._file; + } + if (this._sourceRoot != null) { + map.sourceRoot = this._sourceRoot; + } + if (this._sourcesContents) { + map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); + } + + return map; + }; + + /** + * Render the source map being generated to a string. + */ + SourceMapGenerator.prototype.toString = + function SourceMapGenerator_toString() { + return JSON.stringify(this.toJSON()); + }; + + exports.SourceMapGenerator = SourceMapGenerator; +} + +},{"591":591,"592":592,"595":595,"600":600}],599:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + var SourceMapGenerator = _dereq_(598).SourceMapGenerator; + var util = _dereq_(600); + + // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other + // operating systems these days (capturing the result). + var REGEX_NEWLINE = /(\r?\n)/; + + // Newline character code for charCodeAt() comparisons + var NEWLINE_CODE = 10; + + // Private symbol for identifying `SourceNode`s when multiple versions of + // the source-map library are loaded. This MUST NOT CHANGE across + // versions! + var isSourceNode = "$$$isSourceNode$$$"; + + /** + * SourceNodes provide a way to abstract over interpolating/concatenating + * snippets of generated JavaScript source code while maintaining the line and + * column information associated with the original source code. + * + * @param aLine The original line number. + * @param aColumn The original column number. + * @param aSource The original source's filename. + * @param aChunks Optional. An array of strings which are snippets of + * generated JS, or other SourceNodes. + * @param aName The original identifier. + */ + function SourceNode(aLine, aColumn, aSource, aChunks, aName) { + this.children = []; + this.sourceContents = {}; + this.line = aLine == null ? null : aLine; + this.column = aColumn == null ? null : aColumn; + this.source = aSource == null ? null : aSource; + this.name = aName == null ? null : aName; + this[isSourceNode] = true; + if (aChunks != null) this.add(aChunks); + } + + /** + * Creates a SourceNode from generated code and a SourceMapConsumer. + * + * @param aGeneratedCode The generated code + * @param aSourceMapConsumer The SourceMap for the generated code + * @param aRelativePath Optional. The path that relative sources in the + * SourceMapConsumer should be relative to. + */ + SourceNode.fromStringWithSourceMap = + function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { + // The SourceNode we want to fill with the generated code + // and the SourceMap + var node = new SourceNode(); + + // All even indices of this array are one line of the generated code, + // while all odd indices are the newlines between two adjacent lines + // (since `REGEX_NEWLINE` captures its match). + // Processed fragments are removed from this array, by calling `shiftNextLine`. + var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); + var shiftNextLine = function() { + var lineContents = remainingLines.shift(); + // The last line of a file might not have a newline. + var newLine = remainingLines.shift() || ""; + return lineContents + newLine; + }; + + // We need to remember the position of "remainingLines" + var lastGeneratedLine = 1, lastGeneratedColumn = 0; + + // The generate SourceNodes we need a code range. + // To extract it current and last mapping is used. + // Here we store the last mapping. + var lastMapping = null; + + aSourceMapConsumer.eachMapping(function (mapping) { + if (lastMapping !== null) { + // We add the code from "lastMapping" to "mapping": + // First check if there is a new line in between. + if (lastGeneratedLine < mapping.generatedLine) { + // Associate first line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + lastGeneratedLine++; + lastGeneratedColumn = 0; + // The remaining code is added without mapping + } else { + // There is no new line in between. + // Associate the code between "lastGeneratedColumn" and + // "mapping.generatedColumn" with "lastMapping" + var nextLine = remainingLines[0]; + var code = nextLine.substr(0, mapping.generatedColumn - + lastGeneratedColumn); + remainingLines[0] = nextLine.substr(mapping.generatedColumn - + lastGeneratedColumn); + lastGeneratedColumn = mapping.generatedColumn; + addMappingWithCode(lastMapping, code); + // No more remaining code, continue + lastMapping = mapping; + return; + } + } + // We add the generated code until the first mapping + // to the SourceNode without any mapping. + // Each line is added as separate string. + while (lastGeneratedLine < mapping.generatedLine) { + node.add(shiftNextLine()); + lastGeneratedLine++; + } + if (lastGeneratedColumn < mapping.generatedColumn) { + var nextLine = remainingLines[0]; + node.add(nextLine.substr(0, mapping.generatedColumn)); + remainingLines[0] = nextLine.substr(mapping.generatedColumn); + lastGeneratedColumn = mapping.generatedColumn; + } + lastMapping = mapping; + }, this); + // We have processed all mappings. + if (remainingLines.length > 0) { + if (lastMapping) { + // Associate the remaining code in the current line with "lastMapping" + addMappingWithCode(lastMapping, shiftNextLine()); + } + // and add the remaining lines without any mapping + node.add(remainingLines.join("")); + } + + // Copy sourcesContent into SourceNode + aSourceMapConsumer.sources.forEach(function (sourceFile) { + var content = aSourceMapConsumer.sourceContentFor(sourceFile); + if (content != null) { + if (aRelativePath != null) { + sourceFile = util.join(aRelativePath, sourceFile); + } + node.setSourceContent(sourceFile, content); + } + }); + + return node; + + function addMappingWithCode(mapping, code) { + if (mapping === null || mapping.source === undefined) { + node.add(code); + } else { + var source = aRelativePath + ? util.join(aRelativePath, mapping.source) + : mapping.source; + node.add(new SourceNode(mapping.originalLine, + mapping.originalColumn, + source, + code, + mapping.name)); + } + } + }; + + /** + * Add a chunk of generated JS to this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.add = function SourceNode_add(aChunk) { + if (Array.isArray(aChunk)) { + aChunk.forEach(function (chunk) { + this.add(chunk); + }, this); + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + if (aChunk) { + this.children.push(aChunk); + } + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Add a chunk of generated JS to the beginning of this source node. + * + * @param aChunk A string snippet of generated JS code, another instance of + * SourceNode, or an array where each member is one of those things. + */ + SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { + if (Array.isArray(aChunk)) { + for (var i = aChunk.length-1; i >= 0; i--) { + this.prepend(aChunk[i]); + } + } + else if (aChunk[isSourceNode] || typeof aChunk === "string") { + this.children.unshift(aChunk); + } + else { + throw new TypeError( + "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk + ); + } + return this; + }; + + /** + * Walk over the tree of JS snippets in this node and its children. The + * walking function is called once for each snippet of JS and is passed that + * snippet and the its original associated source's line/column location. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walk = function SourceNode_walk(aFn) { + var chunk; + for (var i = 0, len = this.children.length; i < len; i++) { + chunk = this.children[i]; + if (chunk[isSourceNode]) { + chunk.walk(aFn); + } + else { + if (chunk !== '') { + aFn(chunk, { source: this.source, + line: this.line, + column: this.column, + name: this.name }); + } + } + } + }; + + /** + * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between + * each of `this.children`. + * + * @param aSep The separator. + */ + SourceNode.prototype.join = function SourceNode_join(aSep) { + var newChildren; + var i; + var len = this.children.length; + if (len > 0) { + newChildren = []; + for (i = 0; i < len-1; i++) { + newChildren.push(this.children[i]); + newChildren.push(aSep); + } + newChildren.push(this.children[i]); + this.children = newChildren; + } + return this; + }; + + /** + * Call String.prototype.replace on the very right-most source snippet. Useful + * for trimming whitespace from the end of a source node, etc. + * + * @param aPattern The pattern to replace. + * @param aReplacement The thing to replace the pattern with. + */ + SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { + var lastChild = this.children[this.children.length - 1]; + if (lastChild[isSourceNode]) { + lastChild.replaceRight(aPattern, aReplacement); + } + else if (typeof lastChild === 'string') { + this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); + } + else { + this.children.push(''.replace(aPattern, aReplacement)); + } + return this; + }; + + /** + * Set the source content for a source file. This will be added to the SourceMapGenerator + * in the sourcesContent field. + * + * @param aSourceFile The filename of the source file + * @param aSourceContent The content of the source file + */ + SourceNode.prototype.setSourceContent = + function SourceNode_setSourceContent(aSourceFile, aSourceContent) { + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; + }; + + /** + * Walk over the tree of SourceNodes. The walking function is called for each + * source file content and is passed the filename and source content. + * + * @param aFn The traversal function. + */ + SourceNode.prototype.walkSourceContents = + function SourceNode_walkSourceContents(aFn) { + for (var i = 0, len = this.children.length; i < len; i++) { + if (this.children[i][isSourceNode]) { + this.children[i].walkSourceContents(aFn); + } + } + + var sources = Object.keys(this.sourceContents); + for (var i = 0, len = sources.length; i < len; i++) { + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); + } + }; + + /** + * Return the string representation of this source node. Walks over the tree + * and concatenates all the various snippets together to one string. + */ + SourceNode.prototype.toString = function SourceNode_toString() { + var str = ""; + this.walk(function (chunk) { + str += chunk; + }); + return str; + }; + + /** + * Returns the string representation of this source node along with a source + * map. + */ + SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { + var generated = { + code: "", + line: 1, + column: 0 + }; + var map = new SourceMapGenerator(aArgs); + var sourceMappingActive = false; + var lastOriginalSource = null; + var lastOriginalLine = null; + var lastOriginalColumn = null; + var lastOriginalName = null; + this.walk(function (chunk, original) { + generated.code += chunk; + if (original.source !== null + && original.line !== null + && original.column !== null) { + if(lastOriginalSource !== original.source + || lastOriginalLine !== original.line + || lastOriginalColumn !== original.column + || lastOriginalName !== original.name) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + lastOriginalSource = original.source; + lastOriginalLine = original.line; + lastOriginalColumn = original.column; + lastOriginalName = original.name; + sourceMappingActive = true; + } else if (sourceMappingActive) { + map.addMapping({ + generated: { + line: generated.line, + column: generated.column + } + }); + lastOriginalSource = null; + sourceMappingActive = false; + } + for (var idx = 0, length = chunk.length; idx < length; idx++) { + if (chunk.charCodeAt(idx) === NEWLINE_CODE) { + generated.line++; + generated.column = 0; + // Mappings end at eol + if (idx + 1 === length) { + lastOriginalSource = null; + sourceMappingActive = false; + } else if (sourceMappingActive) { + map.addMapping({ + source: original.source, + original: { + line: original.line, + column: original.column + }, + generated: { + line: generated.line, + column: generated.column + }, + name: original.name + }); + } + } else { + generated.column++; + } + } + }); + this.walkSourceContents(function (sourceFile, sourceContent) { + map.setSourceContent(sourceFile, sourceContent); + }); + + return { code: generated.code, map: map }; + }; + + exports.SourceNode = SourceNode; +} + +},{"598":598,"600":600}],600:[function(_dereq_,module,exports){ +/* -*- Mode: js; js-indent-level: 2; -*- */ +/* + * Copyright 2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE or: + * http://opensource.org/licenses/BSD-3-Clause + */ +{ + /** + * This is a helper function for getting values from parameter/options + * objects. + * + * @param args The object we are extracting values from + * @param name The name of the property we are getting. + * @param defaultValue An optional value to return if the property is missing + * from the object. If this is not specified and the property is missing, an + * error will be thrown. + */ + function getArg(aArgs, aName, aDefaultValue) { + if (aName in aArgs) { + return aArgs[aName]; + } else if (arguments.length === 3) { + return aDefaultValue; + } else { + throw new Error('"' + aName + '" is a required argument.'); + } + } + exports.getArg = getArg; + + var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; + var dataUrlRegexp = /^data:.+\,.+$/; + + function urlParse(aUrl) { + var match = aUrl.match(urlRegexp); + if (!match) { + return null; + } + return { + scheme: match[1], + auth: match[2], + host: match[3], + port: match[4], + path: match[5] + }; + } + exports.urlParse = urlParse; + + function urlGenerate(aParsedUrl) { + var url = ''; + if (aParsedUrl.scheme) { + url += aParsedUrl.scheme + ':'; + } + url += '//'; + if (aParsedUrl.auth) { + url += aParsedUrl.auth + '@'; + } + if (aParsedUrl.host) { + url += aParsedUrl.host; + } + if (aParsedUrl.port) { + url += ":" + aParsedUrl.port + } + if (aParsedUrl.path) { + url += aParsedUrl.path; + } + return url; + } + exports.urlGenerate = urlGenerate; + + /** + * Normalizes a path, or the path portion of a URL: + * + * - Replaces consequtive slashes with one slash. + * - Removes unnecessary '.' parts. + * - Removes unnecessary '/..' parts. + * + * Based on code in the Node.js 'path' core module. + * + * @param aPath The path or url to normalize. + */ + function normalize(aPath) { + var path = aPath; + var url = urlParse(aPath); + if (url) { + if (!url.path) { + return aPath; + } + path = url.path; + } + var isAbsolute = exports.isAbsolute(path); + + var parts = path.split(/\/+/); + for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { + part = parts[i]; + if (part === '.') { + parts.splice(i, 1); + } else if (part === '..') { + up++; + } else if (up > 0) { + if (part === '') { + // The first part is blank if the path is absolute. Trying to go + // above the root is a no-op. Therefore we can remove all '..' parts + // directly after the root. + parts.splice(i + 1, up); + up = 0; + } else { + parts.splice(i, 2); + up--; + } + } + } + path = parts.join('/'); + + if (path === '') { + path = isAbsolute ? '/' : '.'; + } + + if (url) { + url.path = path; + return urlGenerate(url); + } + return path; + } + exports.normalize = normalize; + + /** + * Joins two paths/URLs. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be joined with the root. + * + * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a + * scheme-relative URL: Then the scheme of aRoot, if any, is prepended + * first. + * - Otherwise aPath is a path. If aRoot is a URL, then its path portion + * is updated with the result and aRoot is returned. Otherwise the result + * is returned. + * - If aPath is absolute, the result is aPath. + * - Otherwise the two paths are joined with a slash. + * - Joining for example 'http://' and 'www.example.com' is also supported. + */ + function join(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + if (aPath === "") { + aPath = "."; + } + var aPathUrl = urlParse(aPath); + var aRootUrl = urlParse(aRoot); + if (aRootUrl) { + aRoot = aRootUrl.path || '/'; + } + + // `join(foo, '//www.example.org')` + if (aPathUrl && !aPathUrl.scheme) { + if (aRootUrl) { + aPathUrl.scheme = aRootUrl.scheme; + } + return urlGenerate(aPathUrl); + } + + if (aPathUrl || aPath.match(dataUrlRegexp)) { + return aPath; + } + + // `join('http://', 'www.example.com')` + if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { + aRootUrl.host = aPath; + return urlGenerate(aRootUrl); + } + + var joined = aPath.charAt(0) === '/' + ? aPath + : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); + + if (aRootUrl) { + aRootUrl.path = joined; + return urlGenerate(aRootUrl); + } + return joined; + } + exports.join = join; + + exports.isAbsolute = function (aPath) { + return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); + }; + + /** + * Make a path relative to a URL or another path. + * + * @param aRoot The root path or URL. + * @param aPath The path or URL to be made relative to aRoot. + */ + function relative(aRoot, aPath) { + if (aRoot === "") { + aRoot = "."; + } + + aRoot = aRoot.replace(/\/$/, ''); + + // It is possible for the path to be above the root. In this case, simply + // checking whether the root is a prefix of the path won't work. Instead, we + // need to remove components from the root one by one, until either we find + // a prefix that fits, or we run out of components to remove. + var level = 0; + while (aPath.indexOf(aRoot + '/') !== 0) { + var index = aRoot.lastIndexOf("/"); + if (index < 0) { + return aPath; + } + + // If the only part of the root that is left is the scheme (i.e. http://, + // file:///, etc.), one or more slashes (/), or simply nothing at all, we + // have exhausted all components, so the path is not relative to the root. + aRoot = aRoot.slice(0, index); + if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { + return aPath; + } + + ++level; + } + + // Make sure we add a "../" for each component we removed from the root. + return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); + } + exports.relative = relative; + + /** + * Because behavior goes wacky when you set `__proto__` on objects, we + * have to prefix all the strings in our set with an arbitrary character. + * + * See https://github.com/mozilla/source-map/pull/31 and + * https://github.com/mozilla/source-map/issues/30 + * + * @param String aStr + */ + function toSetString(aStr) { + return '$' + aStr; + } + exports.toSetString = toSetString; + + function fromSetString(aStr) { + return aStr.substr(1); + } + exports.fromSetString = fromSetString; + + /** + * Comparator between two mappings where the original positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same original source/line/column, but different generated + * line and column the same. Useful when searching for a mapping with a + * stubbed out mapping. + */ + function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { + var cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0 || onlyCompareOriginal) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; + } + exports.compareByOriginalPositions = compareByOriginalPositions; + + /** + * Comparator between two mappings with deflated source and name indices where + * the generated positions are compared. + * + * Optionally pass in `true` as `onlyCompareGenerated` to consider two + * mappings with the same generated line and column, but different + * source/name/original line and column the same. Useful when searching for a + * mapping with a stubbed out mapping. + */ + function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0 || onlyCompareGenerated) { + return cmp; + } + + cmp = mappingA.source - mappingB.source; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return mappingA.name - mappingB.name; + } + exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; + + function strcmp(aStr1, aStr2) { + if (aStr1 === aStr2) { + return 0; + } + + if (aStr1 > aStr2) { + return 1; + } + + return -1; + } + + /** + * Comparator between two mappings with inflated source and name strings where + * the generated positions are compared. + */ + function compareByGeneratedPositionsInflated(mappingA, mappingB) { + var cmp = mappingA.generatedLine - mappingB.generatedLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.generatedColumn - mappingB.generatedColumn; + if (cmp !== 0) { + return cmp; + } + + cmp = strcmp(mappingA.source, mappingB.source); + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalLine - mappingB.originalLine; + if (cmp !== 0) { + return cmp; + } + + cmp = mappingA.originalColumn - mappingB.originalColumn; + if (cmp !== 0) { + return cmp; + } + + return strcmp(mappingA.name, mappingB.name); + } + exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; +} + +},{}],601:[function(_dereq_,module,exports){ +/* + * Copyright 2009-2011 Mozilla Foundation and contributors + * Licensed under the New BSD license. See LICENSE.txt or: + * http://opensource.org/licenses/BSD-3-Clause + */ +exports.SourceMapGenerator = _dereq_(598).SourceMapGenerator; +exports.SourceMapConsumer = _dereq_(597).SourceMapConsumer; +exports.SourceNode = _dereq_(599).SourceNode; + +},{"597":597,"598":598,"599":599}],602:[function(_dereq_,module,exports){ +//! stable.js 0.1.5, https://github.com/Two-Screen/stable +//! © 2014 Angry Bytes and contributors. MIT licensed. + +(function() { + +// A stable array sort, because `Array#sort()` is not guaranteed stable. +// This is an implementation of merge sort, without recursion. + +var stable = function(arr, comp) { + return exec(arr.slice(), comp); +}; + +stable.inplace = function(arr, comp) { + var result = exec(arr, comp); + + // This simply copies back if the result isn't in the original array, + // which happens on an odd number of passes. + if (result !== arr) { + pass(result, null, arr.length, arr); + } + + return arr; +}; + +// Execute the sort using the input array and a second buffer as work space. +// Returns one of those two, containing the final result. +function exec(arr, comp) { + if (typeof(comp) !== 'function') { + comp = function(a, b) { + return String(a).localeCompare(b); + }; + } + + // Short-circuit when there's nothing to sort. + var len = arr.length; + if (len <= 1) { + return arr; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + for (var chk = 1; chk < len; chk *= 2) { + pass(arr, comp, chk, buffer); + + var tmp = arr; + arr = buffer; + buffer = tmp; + } + + return arr; +} + +// Run a single pass with the given chunk size. +var pass = function(arr, comp, chk, result) { + var len = arr.length; + var i = 0; + // Step size / double chunk size. + var dbl = chk * 2; + // Bounds of the left and right chunks. + var l, r, e; + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) { + r = l + chk; + e = r + chk; + if (r > len) r = len; + if (e > len) e = len; + + // Iterate both chunks in parallel. + li = l; + ri = r; + while (true) { + // Compare the chunks. + if (li < r && ri < e) { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) { + result[i++] = arr[li++]; + } + else { + result[i++] = arr[ri++]; + } + } + // Nothing to compare, just flush what's left. + else if (li < r) { + result[i++] = arr[li++]; + } + else if (ri < e) { + result[i++] = arr[ri++]; + } + // Both iterators are at the chunk ends. + else { + break; + } + } + } +}; + +// Export using CommonJS or to the window. +if (typeof(module) !== 'undefined') { + module.exports = stable; +} +else { + window.stable = stable; +} + +})(); + +},{}],603:[function(_dereq_,module,exports){ +// stringmap.js +// MIT licensed, see LICENSE file +// Copyright (c) 2013 Olov Lassus + +var StringMap = (function() { + "use strict"; + + // to save us a few characters + var hasOwnProperty = Object.prototype.hasOwnProperty; + + var create = (function() { + function hasOwnEnumerableProps(obj) { + for (var prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + return true; + } + } + return false; + } + // FF <= 3.6: + // o = {}; o.hasOwnProperty("__proto__" or "__count__" or "__parent__") => true + // o = {"__proto__": null}; Object.prototype.hasOwnProperty.call(o, "__proto__" or "__count__" or "__parent__") => false + function hasOwnPollutedProps(obj) { + return hasOwnProperty.call(obj, "__count__") || hasOwnProperty.call(obj, "__parent__"); + } + + var useObjectCreate = false; + if (typeof Object.create === "function") { + if (!hasOwnEnumerableProps(Object.create(null))) { + useObjectCreate = true; + } + } + if (useObjectCreate === false) { + if (hasOwnEnumerableProps({})) { + throw new Error("StringMap environment error 0, please file a bug at https://github.com/olov/stringmap/issues"); + } + } + // no throw yet means we can create objects without own enumerable props (safe-guard against VMs and shims) + + var o = (useObjectCreate ? Object.create(null) : {}); + var useProtoClear = false; + if (hasOwnPollutedProps(o)) { + o.__proto__ = null; + if (hasOwnEnumerableProps(o) || hasOwnPollutedProps(o)) { + throw new Error("StringMap environment error 1, please file a bug at https://github.com/olov/stringmap/issues"); + } + useProtoClear = true; + } + // no throw yet means we can create objects without own polluted props (safe-guard against VMs and shims) + + return function() { + var o = (useObjectCreate ? Object.create(null) : {}); + if (useProtoClear) { + o.__proto__ = null; + } + return o; + }; + })(); + + // stringmap ctor + function stringmap(optional_object) { + // use with or without new + if (!(this instanceof stringmap)) { + return new stringmap(optional_object); + } + this.obj = create(); + this.hasProto = false; // false (no __proto__ key) or true (has __proto__ key) + this.proto = undefined; // value for __proto__ key when hasProto is true, undefined otherwise + + if (optional_object) { + this.setMany(optional_object); + } + }; + + // primitive methods that deals with data representation + stringmap.prototype.has = function(key) { + // The type-check of key in has, get, set and delete is important because otherwise an object + // {toString: function() { return "__proto__"; }} can avoid the key === "__proto__" test. + // The alternative to type-checking would be to force string conversion, i.e. key = String(key); + if (typeof key !== "string") { + throw new Error("StringMap expected string key"); + } + return (key === "__proto__" ? + this.hasProto : + hasOwnProperty.call(this.obj, key)); + }; + + stringmap.prototype.get = function(key) { + if (typeof key !== "string") { + throw new Error("StringMap expected string key"); + } + return (key === "__proto__" ? + this.proto : + (hasOwnProperty.call(this.obj, key) ? this.obj[key] : undefined)); + }; + + stringmap.prototype.set = function(key, value) { + if (typeof key !== "string") { + throw new Error("StringMap expected string key"); + } + if (key === "__proto__") { + this.hasProto = true; + this.proto = value; + } else { + this.obj[key] = value; + } + }; + + stringmap.prototype.remove = function(key) { + if (typeof key !== "string") { + throw new Error("StringMap expected string key"); + } + var didExist = this.has(key); + if (key === "__proto__") { + this.hasProto = false; + this.proto = undefined; + } else { + delete this.obj[key]; + } + return didExist; + }; + + // alias remove to delete but beware: + // sm.delete("key"); // OK in ES5 and later + // sm['delete']("key"); // OK in all ES versions + // sm.remove("key"); // OK in all ES versions + stringmap.prototype['delete'] = stringmap.prototype.remove; + + stringmap.prototype.isEmpty = function() { + for (var key in this.obj) { + if (hasOwnProperty.call(this.obj, key)) { + return false; + } + } + return !this.hasProto; + }; + + stringmap.prototype.size = function() { + var len = 0; + for (var key in this.obj) { + if (hasOwnProperty.call(this.obj, key)) { + ++len; + } + } + return (this.hasProto ? len + 1 : len); + }; + + stringmap.prototype.keys = function() { + var keys = []; + for (var key in this.obj) { + if (hasOwnProperty.call(this.obj, key)) { + keys.push(key); + } + } + if (this.hasProto) { + keys.push("__proto__"); + } + return keys; + }; + + stringmap.prototype.values = function() { + var values = []; + for (var key in this.obj) { + if (hasOwnProperty.call(this.obj, key)) { + values.push(this.obj[key]); + } + } + if (this.hasProto) { + values.push(this.proto); + } + return values; + }; + + stringmap.prototype.items = function() { + var items = []; + for (var key in this.obj) { + if (hasOwnProperty.call(this.obj, key)) { + items.push([key, this.obj[key]]); + } + } + if (this.hasProto) { + items.push(["__proto__", this.proto]); + } + return items; + }; + + + // methods that rely on the above primitives + stringmap.prototype.setMany = function(object) { + if (object === null || (typeof object !== "object" && typeof object !== "function")) { + throw new Error("StringMap expected Object"); + } + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + this.set(key, object[key]); + } + } + return this; + }; + + stringmap.prototype.merge = function(other) { + var keys = other.keys(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + this.set(key, other.get(key)); + } + return this; + }; + + stringmap.prototype.map = function(fn) { + var keys = this.keys(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + keys[i] = fn(this.get(key), key); // re-use keys array for results + } + return keys; + }; + + stringmap.prototype.forEach = function(fn) { + var keys = this.keys(); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + fn(this.get(key), key); + } + }; + + stringmap.prototype.clone = function() { + var other = stringmap(); + return other.merge(this); + }; + + stringmap.prototype.toString = function() { + var self = this; + return "{" + this.keys().map(function(key) { + return JSON.stringify(key) + ":" + JSON.stringify(self.get(key)); + }).join(",") + "}"; + }; + + return stringmap; +})(); + +if (typeof module !== "undefined" && typeof module.exports !== "undefined") { + module.exports = StringMap; +} + +},{}],604:[function(_dereq_,module,exports){ +// stringset.js +// MIT licensed, see LICENSE file +// Copyright (c) 2013 Olov Lassus + +var StringSet = (function() { + "use strict"; + + // to save us a few characters + var hasOwnProperty = Object.prototype.hasOwnProperty; + + var create = (function() { + function hasOwnEnumerableProps(obj) { + for (var prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + return true; + } + } + return false; + } + + // FF <= 3.6: + // o = {}; o.hasOwnProperty("__proto__" or "__count__" or "__parent__") => true + // o = {"__proto__": null}; Object.prototype.hasOwnProperty.call(o, "__proto__" or "__count__" or "__parent__") => false + function hasOwnPollutedProps(obj) { + return hasOwnProperty.call(obj, "__count__") || hasOwnProperty.call(obj, "__parent__"); + } + + var useObjectCreate = false; + if (typeof Object.create === "function") { + if (!hasOwnEnumerableProps(Object.create(null))) { + useObjectCreate = true; + } + } + if (useObjectCreate === false) { + if (hasOwnEnumerableProps({})) { + throw new Error("StringSet environment error 0, please file a bug at https://github.com/olov/stringset/issues"); + } + } + // no throw yet means we can create objects without own enumerable props (safe-guard against VMs and shims) + + var o = (useObjectCreate ? Object.create(null) : {}); + var useProtoClear = false; + if (hasOwnPollutedProps(o)) { + o.__proto__ = null; + if (hasOwnEnumerableProps(o) || hasOwnPollutedProps(o)) { + throw new Error("StringSet environment error 1, please file a bug at https://github.com/olov/stringset/issues"); + } + useProtoClear = true; + } + // no throw yet means we can create objects without own polluted props (safe-guard against VMs and shims) + + return function() { + var o = (useObjectCreate ? Object.create(null) : {}); + if (useProtoClear) { + o.__proto__ = null; + } + return o; + }; + })(); + + // stringset ctor + function stringset(optional_array) { + // use with or without new + if (!(this instanceof stringset)) { + return new stringset(optional_array); + } + this.obj = create(); + this.hasProto = false; // false (no __proto__ item) or true (has __proto__ item) + + if (optional_array) { + this.addMany(optional_array); + } + }; + + // primitive methods that deals with data representation + stringset.prototype.has = function(item) { + // The type-check of item in has, get, set and delete is important because otherwise an object + // {toString: function() { return "__proto__"; }} can avoid the item === "__proto__" test. + // The alternative to type-checking would be to force string conversion, i.e. item = String(item); + if (typeof item !== "string") { + throw new Error("StringSet expected string item"); + } + return (item === "__proto__" ? + this.hasProto : + hasOwnProperty.call(this.obj, item)); + }; + + stringset.prototype.add = function(item) { + if (typeof item !== "string") { + throw new Error("StringSet expected string item"); + } + if (item === "__proto__") { + this.hasProto = true; + } else { + this.obj[item] = true; + } + }; + + stringset.prototype.remove = function(item) { + if (typeof item !== "string") { + throw new Error("StringSet expected string item"); + } + var didExist = this.has(item); + if (item === "__proto__") { + this.hasProto = false; + } else { + delete this.obj[item]; + } + return didExist; + }; + + // alias remove to delete but beware: + // ss.delete("key"); // OK in ES5 and later + // ss['delete']("key"); // OK in all ES versions + // ss.remove("key"); // OK in all ES versions + stringset.prototype['delete'] = stringset.prototype.remove; + + stringset.prototype.isEmpty = function() { + for (var item in this.obj) { + if (hasOwnProperty.call(this.obj, item)) { + return false; + } + } + return !this.hasProto; + }; + + stringset.prototype.size = function() { + var len = 0; + for (var item in this.obj) { + if (hasOwnProperty.call(this.obj, item)) { + ++len; + } + } + return (this.hasProto ? len + 1 : len); + }; + + stringset.prototype.items = function() { + var items = []; + for (var item in this.obj) { + if (hasOwnProperty.call(this.obj, item)) { + items.push(item); + } + } + if (this.hasProto) { + items.push("__proto__"); + } + return items; + }; + + + // methods that rely on the above primitives + stringset.prototype.addMany = function(items) { + if (!Array.isArray(items)) { + throw new Error("StringSet expected array"); + } + for (var i = 0; i < items.length; i++) { + this.add(items[i]); + } + return this; + }; + + stringset.prototype.merge = function(other) { + this.addMany(other.items()); + return this; + }; + + stringset.prototype.clone = function() { + var other = stringset(); + return other.merge(this); + }; + + stringset.prototype.toString = function() { + return "{" + this.items().map(JSON.stringify).join(",") + "}"; + }; + + return stringset; +})(); + +if (typeof module !== "undefined" && typeof module.exports !== "undefined") { + module.exports = StringSet; +} + +},{}],605:[function(_dereq_,module,exports){ +'use strict'; +var ansiRegex = _dereq_(184)(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; + +},{"184":184}],606:[function(_dereq_,module,exports){ +(function (process){ +'use strict'; +var argv = process.argv; + +var terminator = argv.indexOf('--'); +var hasFlag = function (flag) { + flag = '--' + flag; + var pos = argv.indexOf(flag); + return pos !== -1 && (terminator !== -1 ? pos < terminator : true); +}; + +module.exports = (function () { + if ('FORCE_COLOR' in process.env) { + return true; + } + + if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + return false; + } + + if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); + +}).call(this,_dereq_(10)) +},{"10":10}],607:[function(_dereq_,module,exports){ +'use strict'; +module.exports = function toFastProperties(obj) { + function f() {} + f.prototype = obj; + new f(); + return; + eval(obj); +}; + +},{}],608:[function(_dereq_,module,exports){ +'use strict'; +module.exports = function (str) { + var tail = str.length; + + while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { + tail--; + } + + return str.slice(0, tail); +}; + +},{}],609:[function(_dereq_,module,exports){ +(function (process){ +var Module = _dereq_(3); + +var resolve = module.exports = function (loc, _require) { + try { + return (_require || _dereq_).resolve(loc); + } catch (err) { + return null; + } +}; + +var relativeMod; + +resolve.relative = function (loc) { + // we're in the browser, probably + if (typeof Module === "object") return null; + + if (!relativeMod) { + relativeMod = new Module; + relativeMod.paths = Module._nodeModulePaths(process.cwd()); + } + + try { + return Module._resolveFilename(loc, relativeMod); + } catch (err) { + return null; + } +}; + +}).call(this,_dereq_(10)) +},{"10":10,"3":3}],610:[function(_dereq_,module,exports){ +module.exports={ + "name": "babel-core", + "version": "5.8.38", + "description": "A compiler for writing next generation JavaScript", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "repository": "babel/babel", + "browser": { + "./lib/api/register/node.js": "./lib/api/register/browser.js" + }, + "keywords": [ + "6to5", + "babel", + "classes", + "const", + "es6", + "harmony", + "let", + "modules", + "transpile", + "transpiler", + "var" + ], + "scripts": { + "bench": "make bench", + "test": "make test" + }, + "dependencies": { + "babel-plugin-constant-folding": "^1.0.1", + "babel-plugin-dead-code-elimination": "^1.0.2", + "babel-plugin-eval": "^1.0.1", + "babel-plugin-inline-environment-variables": "^1.0.1", + "babel-plugin-jscript": "^1.0.4", + "babel-plugin-member-expression-literals": "^1.0.1", + "babel-plugin-property-literals": "^1.0.1", + "babel-plugin-proto-to-assign": "^1.0.3", + "babel-plugin-react-constant-elements": "^1.0.3", + "babel-plugin-react-display-name": "^1.0.3", + "babel-plugin-remove-console": "^1.0.1", + "babel-plugin-remove-debugger": "^1.0.1", + "babel-plugin-runtime": "^1.0.7", + "babel-plugin-undeclared-variables-check": "^1.0.2", + "babel-plugin-undefined-to-void": "^1.1.6", + "babylon": "^5.8.38", + "bluebird": "^2.9.33", + "chalk": "^1.0.0", + "convert-source-map": "^1.1.0", + "core-js": "^1.0.0", + "debug": "^2.1.1", + "detect-indent": "^3.0.0", + "esutils": "^2.0.0", + "fs-readdir-recursive": "^0.1.0", + "globals": "^6.4.0", + "home-or-tmp": "^1.0.0", + "is-integer": "^1.0.4", + "js-tokens": "1.0.1", + "json5": "^0.4.0", + "lodash": "^3.10.0", + "minimatch": "^2.0.3", + "output-file-sync": "^1.1.0", + "path-exists": "^1.0.0", + "path-is-absolute": "^1.0.0", + "private": "^0.1.6", + "regenerator": "0.8.40", + "regexpu": "^1.3.0", + "repeating": "^1.1.2", + "resolve": "^1.1.6", + "shebang-regex": "^1.0.0", + "slash": "^1.0.0", + "source-map": "^0.5.0", + "source-map-support": "^0.2.10", + "to-fast-properties": "^1.0.0", + "trim-right": "^1.0.0", + "try-resolve": "^1.0.0" + } +} +},{}],611:[function(_dereq_,module,exports){ +module.exports={"abstract-expression-call":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceGet"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"}]},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}]},"abstract-expression-delete":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceDelete"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}]},"abstract-expression-get":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceGet"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}]},"abstract-expression-set":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceSet"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"},{"type":"Identifier","name":"VALUE"}]}}]},"array-comprehension-container":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"ArrayExpression","elements":[]}}],"kind":"var"},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"KEY"}}]},"parenthesizedExpression":true},"arguments":[]}}]},"array-from":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"from"},"computed":false},"arguments":[{"type":"Identifier","name":"VALUE"}]}}]},"array-push":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"KEY"},"property":{"type":"Identifier","name":"push"},"computed":false},"arguments":[{"type":"Identifier","name":"STATEMENT"}]}}]},"call":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"OBJECT"},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"CONTEXT"}]}}]},"class-decorator":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"CLASS_REF"},"right":{"type":"LogicalExpression","left":{"type":"CallExpression","callee":{"type":"Identifier","name":"DECORATOR"},"arguments":[{"type":"Identifier","name":"CLASS_REF"}]},"operator":"||","right":{"type":"Identifier","name":"CLASS_REF"}}}}]},"class-derived-default-constructor":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Super"},"arguments":[{"type":"SpreadElement","argument":{"type":"Identifier","name":"arguments"}}]}}]},"parenthesizedExpression":true}}]},"default-parameter-assign":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"VARIABLE_NAME"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"VARIABLE_NAME"},"right":{"type":"Identifier","name":"DEFAULT_VALUE"}}},"alternate":null}]},"default-parameter":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"length"},"computed":false},"operator":"<=","right":{"type":"Identifier","name":"ARGUMENT_KEY"}},"operator":"||","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"ARGUMENT_KEY"},"computed":true},"operator":"===","right":{"type":"Identifier","name":"undefined"}}},"consequent":{"type":"Identifier","name":"DEFAULT_VALUE"},"alternate":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"ARGUMENT_KEY"},"computed":true}}}],"kind":"let"}]},"exports-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"KEY"},"computed":false},"right":{"type":"Identifier","name":"VALUE"}}}]},"exports-default-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"module"},"property":{"type":"Identifier","name":"exports"},"computed":false},"right":{"type":"Identifier","name":"VALUE"}}}]},"exports-from-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"exports"},{"type":"Identifier","name":"ID"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"get"},"value":{"type":"FunctionExpression","id":{"type":"Identifier","name":"get"},"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"INIT"}}]}},"kind":"init"}]}]}}]},"exports-module-declaration-loose":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"__esModule"},"computed":false},"right":{"type":"Literal","value":true}}}]},"exports-module-declaration":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"exports"},{"type":"Literal","value":"__esModule"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"Literal","value":true},"kind":"init"}]}]}}]},"for-of-array":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"KEY"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARR"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"KEY"}},"body":{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"BODY"}}}]},"for-of-loose":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"LOOP_OBJECT"},"init":{"type":"Identifier","name":"OBJECT"}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"IS_ARRAY"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"LOOP_OBJECT"}]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"INDEX"},"init":{"type":"Literal","value":0}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"LOOP_OBJECT"},"init":{"type":"ConditionalExpression","test":{"type":"Identifier","name":"IS_ARRAY"},"consequent":{"type":"Identifier","name":"LOOP_OBJECT"},"alternate":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}}}],"kind":"var"},"test":null,"update":null,"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ID"},"init":null}],"kind":"var"},{"type":"IfStatement","test":{"type":"Identifier","name":"IS_ARRAY"},"consequent":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"INDEX"},"operator":">=","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"Identifier","name":"length"},"computed":false}},"consequent":{"type":"BreakStatement","label":null},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ID"},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"INDEX"}},"computed":true}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"INDEX"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]}}},{"type":"IfStatement","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"INDEX"},"property":{"type":"Identifier","name":"done"},"computed":false},"consequent":{"type":"BreakStatement","label":null},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ID"},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"INDEX"},"property":{"type":"Identifier","name":"value"},"computed":false}}}]}}]}}]},"for-of":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_COMPLETION"},"init":{"type":"Literal","value":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_HAD_ERROR_KEY"},"init":{"type":"Literal","value":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_ERROR_KEY"},"init":{"type":"Identifier","name":"undefined"}}],"kind":"var"},{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_KEY"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"OBJECT"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"STEP_KEY"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_COMPLETION"},"right":{"type":"MemberExpression","object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"STEP_KEY"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]},"parenthesizedExpression":true},"property":{"type":"Identifier","name":"done"},"computed":false},"parenthesizedExpression":true}},"update":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_COMPLETION"},"right":{"type":"Literal","value":true}},"body":{"type":"BlockStatement","body":[]}}]},"handler":{"type":"CatchClause","param":{"type":"Identifier","name":"err"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_HAD_ERROR_KEY"},"right":{"type":"Literal","value":true}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_ERROR_KEY"},"right":{"type":"Identifier","name":"err"}}}]}},"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"Identifier","name":"ITERATOR_COMPLETION"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Literal","value":"return"},"computed":true}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Literal","value":"return"},"computed":true},"arguments":[]}}]},"alternate":null}]},"handler":null,"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"ITERATOR_HAD_ERROR_KEY"},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"Identifier","name":"ITERATOR_ERROR_KEY"}}]},"alternate":null}]}}]}}]},"helper-async-to-generator":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"fn"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"gen"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"fn"},"property":{"type":"Identifier","name":"apply"},"computed":false},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"arguments"}]}}],"kind":"var"},{"type":"ReturnStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"Promise"},"arguments":[{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"resolve"},{"type":"Identifier","name":"reject"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"callNext"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"step"},"property":{"type":"Identifier","name":"bind"},"computed":false},"arguments":[{"type":"Literal","value":null,"rawValue":null},{"type":"Literal","value":"next"}]}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"callThrow"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"step"},"property":{"type":"Identifier","name":"bind"},"computed":false},"arguments":[{"type":"Literal","value":null,"rawValue":null},{"type":"Literal","value":"throw"}]}}],"kind":"var"},{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"step"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"key"},{"type":"Identifier","name":"arg"}],"body":{"type":"BlockStatement","body":[{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"info"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"gen"},"property":{"type":"Identifier","name":"key"},"computed":true},"arguments":[{"type":"Identifier","name":"arg"}]}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"value"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"info"},"property":{"type":"Identifier","name":"value"},"computed":false}}],"kind":"var"}]},"handler":{"type":"CatchClause","param":{"type":"Identifier","name":"error"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"reject"},"arguments":[{"type":"Identifier","name":"error"}]}},{"type":"ReturnStatement","argument":null}]}},"guardedHandlers":[],"finalizer":null},{"type":"IfStatement","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"info"},"property":{"type":"Identifier","name":"done"},"computed":false},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"resolve"},"arguments":[{"type":"Identifier","name":"value"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Promise"},"property":{"type":"Identifier","name":"resolve"},"computed":false},"arguments":[{"type":"Identifier","name":"value"}]},"property":{"type":"Identifier","name":"then"},"computed":false},"arguments":[{"type":"Identifier","name":"callNext"},{"type":"Identifier","name":"callThrow"}]}}]}}]}},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"callNext"},"arguments":[]}}]}}]}}]}}}]},"parenthesizedExpression":true}}]},"helper-bind":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Function"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"bind"},"computed":false}}]},"helper-class-call-check":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"instance"},{"type":"Identifier","name":"Constructor"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"BinaryExpression","left":{"type":"Identifier","name":"instance"},"operator":"instanceof","right":{"type":"Identifier","name":"Constructor"},"parenthesizedExpression":true}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Cannot call a class as a function"}]}}]},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-create-class":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"defineProperties"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"props"}],"body":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"right":{"type":"LogicalExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"operator":"||","right":{"type":"Literal","value":false}}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"configurable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"descriptor"}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"writable"},"computed":false},"right":{"type":"Literal","value":true}}},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false},{"type":"Identifier","name":"descriptor"}]}}]}}]}},{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"protoProps"},{"type":"Identifier","name":"staticProps"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"protoProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"Constructor"},"property":{"type":"Identifier","name":"prototype"},"computed":false},{"type":"Identifier","name":"protoProps"}]}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"staticProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"staticProps"}]}},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"Constructor"}}]}}}]},"parenthesizedExpression":true},"arguments":[]}}]},"helper-create-decorated-class":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"defineProperties"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"descriptors"},{"type":"Identifier","name":"initializers"}],"body":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorators"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor","leadingComments":null},"property":{"type":"Identifier","name":"key"},"computed":false,"leadingComments":null},"leadingComments":null}},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"right":{"type":"LogicalExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"operator":"||","right":{"type":"Literal","value":false}}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"configurable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"descriptor"}},"operator":"||","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"writable"},"computed":false},"right":{"type":"Literal","value":true}}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"decorators"},"consequent":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"f"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"f"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"f"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorator"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"f"},"computed":true}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}},"operator":"===","right":{"type":"Literal","value":"function"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"descriptor"},"right":{"type":"LogicalExpression","left":{"type":"CallExpression","callee":{"type":"Identifier","name":"decorator"},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]},"operator":"||","right":{"type":"Identifier","name":"descriptor"}}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"The decorator for method "},"operator":"+","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}},"operator":"+","right":{"type":"Literal","value":" is of the invalid type "}},"operator":"+","right":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}}}]}}]}}]}},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"operator":"!==","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"initializers"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"Identifier","name":"descriptor"}}},{"type":"ContinueStatement","label":null}]},"alternate":null}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]}}]}}]}},{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"protoProps"},{"type":"Identifier","name":"staticProps"},{"type":"Identifier","name":"protoInitializers"},{"type":"Identifier","name":"staticInitializers"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"protoProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"Constructor"},"property":{"type":"Identifier","name":"prototype"},"computed":false},{"type":"Identifier","name":"protoProps"},{"type":"Identifier","name":"protoInitializers"}]}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"staticProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"staticProps"},{"type":"Identifier","name":"staticInitializers"}]}},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"Constructor"}}]}}}]},"parenthesizedExpression":true},"arguments":[]}}]},"helper-create-decorated-object":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"descriptors"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"target"},"init":{"type":"ObjectExpression","properties":[]}}],"kind":"var"},{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorators"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor","leadingComments":null},"property":{"type":"Identifier","name":"key"},"computed":false,"leadingComments":null},"leadingComments":null}},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"configurable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"descriptor"}},"operator":"||","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"writable"},"computed":false},"right":{"type":"Literal","value":true}}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"decorators"},"consequent":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"f"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"f"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"f"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorator"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"f"},"computed":true}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}},"operator":"===","right":{"type":"Literal","value":"function"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"descriptor"},"right":{"type":"LogicalExpression","left":{"type":"CallExpression","callee":{"type":"Identifier","name":"decorator"},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]},"operator":"||","right":{"type":"Identifier","name":"descriptor"}}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"The decorator for method "},"operator":"+","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}},"operator":"+","right":{"type":"Literal","value":" is of the invalid type "}},"operator":"+","right":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}}}]}}]}}]}}]},"alternate":null},{"type":"IfStatement","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"value"},"computed":false},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"target"}]}}}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"target"}}]},"parenthesizedExpression":true}}]},"helper-default-props":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"defaultProps"},{"type":"Identifier","name":"props"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"defaultProps"},"consequent":{"type":"BlockStatement","body":[{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"propName"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"defaultProps"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"propName"},"computed":true}},"operator":"===","right":{"type":"Literal","value":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"propName"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"defaultProps"},"property":{"type":"Identifier","name":"propName"},"computed":true}}}]},"alternate":null}]}}]},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"props"}}]},"parenthesizedExpression":true}}]},"helper-defaults":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"defaults"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"keys"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyNames"},"computed":false},"arguments":[{"type":"Identifier","name":"defaults"}]}}],"kind":"var"},{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"keys"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"keys"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"value"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyDescriptor"},"computed":false},"arguments":[{"type":"Identifier","name":"defaults"},{"type":"Identifier","name":"key"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"LogicalExpression","left":{"type":"Identifier","name":"value"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"value"},"property":{"type":"Identifier","name":"configurable"},"computed":false}},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"key"},"computed":true},"operator":"===","right":{"type":"Identifier","name":"undefined"}}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"value"}]}}]},"alternate":null}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"parenthesizedExpression":true}}]},"helper-define-decorated-property-descriptor":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptors"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"key"},"computed":true}}],"kind":"var"},{"type":"IfStatement","test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"Identifier","name":"_descriptor"}},"consequent":{"type":"ReturnStatement","argument":null,"leadingComments":null,"trailingComments":null},"alternate":null},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor","leadingComments":null},"init":{"type":"ObjectExpression","properties":[]},"leadingComments":null}],"kind":"var"},{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_key"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"_descriptor"},"body":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"_key"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"_descriptor"},"property":{"type":"Identifier","name":"_key"},"computed":true}},"trailingComments":null}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor","leadingComments":null},"property":{"type":"Identifier","name":"value"},"computed":false,"leadingComments":null},"right":{"type":"ConditionalExpression","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"consequent":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"target"}]},"alternate":{"type":"Identifier","name":"undefined"}},"leadingComments":null}},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]}}]},"parenthesizedExpression":true}}]},"helper-define-property":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"value"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"key","leadingComments":null},"operator":"in","right":{"type":"Identifier","name":"obj"},"leadingComments":null},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"Identifier","name":"value"},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"configurable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"writable"},"value":{"type":"Literal","value":true},"kind":"init"}]}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"Identifier","name":"value"}}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"parenthesizedExpression":true}}]},"helper-extends":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"LogicalExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"assign"},"computed":false},"operator":"||","right":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"}],"body":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":1}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"arguments"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"source"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"arguments"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"source"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"source"},{"type":"Identifier","name":"key"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"target"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"source"},"property":{"type":"Identifier","name":"key"},"computed":true}}}]},"alternate":null}]}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"target"}}]}}}}]},"helper-get":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":{"type":"Identifier","name":"get"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"receiver"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"object"},"operator":"===","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"object"},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"Function"},"property":{"type":"Identifier","name":"prototype"},"computed":false}}},"alternate":null},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"desc"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyDescriptor"},"computed":false},"arguments":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"desc"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"parent"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getPrototypeOf"},"computed":false},"arguments":[{"type":"Identifier","name":"object"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"parent"},"operator":"===","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"undefined"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"Identifier","name":"get"},"arguments":[{"type":"Identifier","name":"parent"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"receiver"}]}}]}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"desc"}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"value"},"computed":false}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"getter"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"get"},"computed":false}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"getter"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"undefined"}}]},"alternate":null},{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"getter"},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"receiver"}]}}]}}}]},"parenthesizedExpression":true}}]},"helper-has-own":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false}}]},"helper-inherits":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"subClass"},{"type":"Identifier","name":"superClass"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"superClass"}},"operator":"!==","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"Identifier","name":"superClass"},"operator":"!==","right":{"type":"Literal","value":null,"rawValue":null}}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"BinaryExpression","left":{"type":"Literal","value":"Super expression must either be null or a function, not "},"operator":"+","right":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"superClass"}}}]}}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"subClass"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"create"},"computed":false},"arguments":[{"type":"LogicalExpression","left":{"type":"Identifier","name":"superClass"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"superClass"},"property":{"type":"Identifier","name":"prototype"},"computed":false}},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"constructor"},"value":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"Identifier","name":"subClass"},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":false},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"writable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"configurable"},"value":{"type":"Literal","value":true},"kind":"init"}]},"kind":"init"}]}]}}},{"type":"IfStatement","test":{"type":"Identifier","name":"superClass"},"consequent":{"type":"ExpressionStatement","expression":{"type":"ConditionalExpression","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"setPrototypeOf"},"computed":false},"consequent":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"setPrototypeOf"},"computed":false},"arguments":[{"type":"Identifier","name":"subClass"},{"type":"Identifier","name":"superClass"}]},"alternate":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"subClass"},"property":{"type":"Identifier","name":"__proto__"},"computed":false},"right":{"type":"Identifier","name":"superClass"}}}},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-instanceof":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"left"},{"type":"Identifier","name":"right"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Identifier","name":"right"},"operator":"!=","right":{"type":"Literal","value":null,"rawValue":null}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"right"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"hasInstance"},"computed":false},"computed":true}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"right"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"hasInstance"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"left"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"BinaryExpression","left":{"type":"Identifier","name":"left"},"operator":"instanceof","right":{"type":"Identifier","name":"right"}}}]}}]},"parenthesizedExpression":true}}]},"helper-interop-export-wildcard":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"defaults"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"newObj"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"defaults"},"arguments":[{"type":"ObjectExpression","properties":[]},{"type":"Identifier","name":"obj"}]}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"newObj"},"property":{"type":"Literal","value":"default"},"computed":true}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"newObj"}}]},"parenthesizedExpression":true}}]},"helper-interop-require-default":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"__esModule"},"computed":false}},"consequent":{"type":"Identifier","name":"obj"},"alternate":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Literal","value":"default"},"value":{"type":"Identifier","name":"obj"},"kind":"init"}]}}}]},"parenthesizedExpression":true}}]},"helper-interop-require-wildcard":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"__esModule"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"newObj"},"init":{"type":"ObjectExpression","properties":[]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"obj"},"operator":"!=","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"BlockStatement","body":[{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"obj"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"}]},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"newObj"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"key"},"computed":true}}},"alternate":null}]}}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"newObj"},"property":{"type":"Literal","value":"default"},"computed":true},"right":{"type":"Identifier","name":"obj"}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"newObj"}}]}}]},"parenthesizedExpression":true}}]},"helper-interop-require":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"__esModule"},"computed":false}},"consequent":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Literal","value":"default"},"computed":true},"alternate":{"type":"Identifier","name":"obj"}}}]},"parenthesizedExpression":true}}]},"helper-new-arrow-check":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"innerThis"},{"type":"Identifier","name":"boundThis"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"innerThis"},"operator":"!==","right":{"type":"Identifier","name":"boundThis"}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Cannot instantiate an arrow function"}]}}]},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-object-destructuring-empty":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"obj"},"operator":"==","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Cannot destructure undefined"}]}},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-object-without-properties":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"keys"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"target"},"init":{"type":"ObjectExpression","properties":[]}}],"kind":"var"},{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"obj"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"keys"},"property":{"type":"Identifier","name":"indexOf"},"computed":false},"arguments":[{"type":"Identifier","name":"i"}]},"operator":">=","right":{"type":"Literal","value":0}},"consequent":{"type":"ContinueStatement","label":null},"alternate":null},{"type":"IfStatement","test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"i"}]}},"consequent":{"type":"ContinueStatement","label":null},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"target"},"property":{"type":"Identifier","name":"i"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"i"},"computed":true}}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"target"}}]},"parenthesizedExpression":true}}]},"helper-self-global":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"ConditionalExpression","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"global"}},"operator":"===","right":{"type":"Literal","value":"undefined"}},"consequent":{"type":"Identifier","name":"self"},"alternate":{"type":"Identifier","name":"global"}}}]},"helper-set":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":{"type":"Identifier","name":"set"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"value"},{"type":"Identifier","name":"receiver"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"desc"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyDescriptor"},"computed":false},"arguments":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"desc"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"parent"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getPrototypeOf"},"computed":false},"arguments":[{"type":"Identifier","name":"object"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"parent"},"operator":"!==","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"set"},"arguments":[{"type":"Identifier","name":"parent"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"value"},{"type":"Identifier","name":"receiver"}]}}]},"alternate":null}]},"alternate":{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"desc"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"writable"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"value"},"computed":false},"right":{"type":"Identifier","name":"value"}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"setter"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"set"},"computed":false}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"setter"},"operator":"!==","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"setter"},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"receiver"},{"type":"Identifier","name":"value"}]}}]},"alternate":null}]}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"value"}}]},"parenthesizedExpression":true}}]},"helper-slice":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"slice"},"computed":false}}]},"helper-sliced-to-array-loose":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"arr"}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"operator":"in","right":{"type":"CallExpression","callee":{"type":"Identifier","name":"Object"},"arguments":[{"type":"Identifier","name":"arr"}]}},"consequent":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_arr"},"init":{"type":"ArrayExpression","elements":[]}}],"kind":"var"},{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_iterator"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_step"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_step"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_iterator"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]},"parenthesizedExpression":true},"property":{"type":"Identifier","name":"done"},"computed":false}},"update":null,"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"push"},"computed":false},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"_step"},"property":{"type":"Identifier","name":"value"},"computed":false}]}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"i"},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"length"},"computed":false},"operator":"===","right":{"type":"Identifier","name":"i"}}},"consequent":{"type":"BreakStatement","label":null},"alternate":null}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"_arr"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Invalid attempt to destructure non-iterable instance"}]}}]}}}]},"parenthesizedExpression":true}}]},"helper-sliced-to-array":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"sliceIterator","leadingComments":null},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_arr","leadingComments":null},"init":{"type":"ArrayExpression","elements":[]},"leadingComments":null}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_n"},"init":{"type":"Literal","value":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_d"},"init":{"type":"Literal","value":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_e"},"init":{"type":"Identifier","name":"undefined"}}],"kind":"var"},{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_i"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_s"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_n"},"right":{"type":"MemberExpression","object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_s"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_i"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]},"parenthesizedExpression":true},"property":{"type":"Identifier","name":"done"},"computed":false},"parenthesizedExpression":true}},"update":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_n"},"right":{"type":"Literal","value":true}},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"push"},"computed":false},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"_s"},"property":{"type":"Identifier","name":"value"},"computed":false}]}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"i"},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"length"},"computed":false},"operator":"===","right":{"type":"Identifier","name":"i"}}},"consequent":{"type":"BreakStatement","label":null},"alternate":null}]}}]},"handler":{"type":"CatchClause","param":{"type":"Identifier","name":"err"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_d"},"right":{"type":"Literal","value":true}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_e"},"right":{"type":"Identifier","name":"err"}}}]}},"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"Identifier","name":"_n"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"_i"},"property":{"type":"Literal","value":"return"},"computed":true}},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_i"},"property":{"type":"Literal","value":"return"},"computed":true},"arguments":[]}},"alternate":null}]},"handler":null,"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"_d"},"consequent":{"type":"ThrowStatement","argument":{"type":"Identifier","name":"_e"}},"alternate":null}]}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"_arr"}}]}},{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"arr"}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"operator":"in","right":{"type":"CallExpression","callee":{"type":"Identifier","name":"Object"},"arguments":[{"type":"Identifier","name":"arr"}]}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"Identifier","name":"sliceIterator"},"arguments":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Invalid attempt to destructure non-iterable instance"}]}}]}}}]}}}]},"parenthesizedExpression":true},"arguments":[]}}]},"helper-tagged-template-literal-loose":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"strings"},{"type":"Identifier","name":"raw"}],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"strings"},"property":{"type":"Identifier","name":"raw"},"computed":false},"right":{"type":"Identifier","name":"raw"}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"strings"}}]},"parenthesizedExpression":true}}]},"helper-tagged-template-literal":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"strings"},{"type":"Identifier","name":"raw"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"freeze"},"computed":false},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperties"},"computed":false},"arguments":[{"type":"Identifier","name":"strings"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"raw"},"value":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"freeze"},"computed":false},"arguments":[{"type":"Identifier","name":"raw"}]},"kind":"init"}]},"kind":"init"}]}]}]}}]},"parenthesizedExpression":true}}]},"helper-temporal-assert-defined":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"val"},{"type":"Identifier","name":"name"},{"type":"Identifier","name":"undef"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"val"},"operator":"===","right":{"type":"Identifier","name":"undef"}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"ReferenceError"},"arguments":[{"type":"BinaryExpression","left":{"type":"Identifier","name":"name"},"operator":"+","right":{"type":"Literal","value":" is not defined - temporal dead zone"}}]}}]},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Literal","value":true}}]},"parenthesizedExpression":true}}]},"helper-temporal-undefined":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"ObjectExpression","properties":[],"parenthesizedExpression":true}}]},"helper-to-array":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"Identifier","name":"arr"},"alternate":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"from"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]}}}]},"parenthesizedExpression":true}}]},"helper-to-consumable-array":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"arr2"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"Array"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"Identifier","name":"length"},"computed":false}]}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr2"},"property":{"type":"Identifier","name":"i"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"Identifier","name":"i"},"computed":true}}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"arr2"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"from"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]}}]}}]},"parenthesizedExpression":true}}]},"helper-typeof-react-element":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"LogicalExpression","left":{"type":"LogicalExpression","left":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"Symbol"}},"operator":"===","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Literal","value":"for"},"computed":true}},"operator":"&&","right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Literal","value":"for"},"computed":true},"arguments":[{"type":"Literal","value":"react.element"}]}},"operator":"||","right":{"type":"Literal","value":60103}}}]},"helper-typeof":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"constructor"},"computed":false},"operator":"===","right":{"type":"Identifier","name":"Symbol"}}},"consequent":{"type":"Literal","value":"symbol"},"alternate":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"obj"}}}}]},"parenthesizedExpression":true}}]},"let-scoping-return":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"RETURN"}},"operator":"===","right":{"type":"Literal","value":"object"}},"consequent":{"type":"ReturnStatement","argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"RETURN"},"property":{"type":"Identifier","name":"v"},"computed":false}},"alternate":null}]},"named-function":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"GET_OUTER_ID"},"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION_ID"}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION"}}]},"parenthesizedExpression":true},"arguments":[]}}]},"property-method-assignment-wrapper-generator":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"FUNCTION_KEY"}],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"FUNCTION_ID"},"generator":true,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"YieldExpression","delegate":true,"argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"apply"},"computed":false},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"arguments"}]}}}]}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_ID"},"property":{"type":"Identifier","name":"toString"},"computed":false},"right":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"toString"},"computed":false},"arguments":[]}}]}}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION_ID"}}]},"parenthesizedExpression":true},"arguments":[{"type":"Identifier","name":"FUNCTION"}]}}]},"property-method-assignment-wrapper":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"FUNCTION_KEY"}],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"FUNCTION_ID"},"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"apply"},"computed":false},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"arguments"}]}}]}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_ID"},"property":{"type":"Identifier","name":"toString"},"computed":false},"right":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"toString"},"computed":false},"arguments":[]}}]}}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION_ID"}}]},"parenthesizedExpression":true},"arguments":[{"type":"Identifier","name":"FUNCTION"}]}}]},"prototype-identifier":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"},"computed":false}}]},"require-assign-key":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"MemberExpression","object":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]},"property":{"type":"Identifier","name":"KEY"},"computed":false}}],"kind":"var"}]},"require":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]}}]},"rest":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"LEN"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"length"},"computed":false}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ARRAY"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"Array"},"arguments":[{"type":"Identifier","name":"ARRAY_LEN"}]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"Identifier","name":"START"}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"KEY"},"operator":"<","right":{"type":"Identifier","name":"LEN"}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"KEY"}},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"ARRAY_KEY"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"KEY"},"computed":true}}}]}}]},"self-contained-helpers-head":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Literal","value":"default"},"computed":true},"right":{"type":"Identifier","name":"HELPER"}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"__esModule"},"computed":false},"right":{"type":"Literal","value":true}}}]},"system":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"System"},"property":{"type":"Identifier","name":"register"},"computed":false},"arguments":[{"type":"Identifier","name":"MODULE_NAME"},{"type":"Identifier","name":"MODULE_DEPENDENCIES"},{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"EXPORT_IDENTIFIER"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"setters"},"value":{"type":"Identifier","name":"SETTERS"},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"execute"},"value":{"type":"Identifier","name":"EXECUTE"},"kind":"init"}]}}]}}]}}]},"tail-call-body":{"type":"Program","body":[{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"AGAIN_ID"},"init":{"type":"Literal","value":true}}],"kind":"var"},{"type":"LabeledStatement","body":{"type":"WhileStatement","test":{"type":"Identifier","name":"AGAIN_ID"},"body":{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"BLOCK"}}},"label":{"type":"Identifier","name":"FUNCTION_ID"}}]}]},"test-exports":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"exports"}},"operator":"!==","right":{"type":"Literal","value":"undefined"}}}]},"test-module":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"module"}},"operator":"!==","right":{"type":"Literal","value":"undefined"}}}]},"umd-commonjs-strict":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"root"},{"type":"Identifier","name":"factory"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"define"}},"operator":"===","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"define"},"property":{"type":"Identifier","name":"amd"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"define"},"arguments":[{"type":"Identifier","name":"AMD_ARGUMENTS"},{"type":"Identifier","name":"factory"}]}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"exports"}},"operator":"===","right":{"type":"Literal","value":"object"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"Identifier","name":"COMMON_ARGUMENTS"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"Identifier","name":"BROWSER_ARGUMENTS"}]}}]}}}]},"parenthesizedExpression":true},"arguments":[{"type":"Identifier","name":"UMD_ROOT"},{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"FACTORY_PARAMETERS"}],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"FACTORY_BODY"}}]}}]}}]},"umd-runner-body":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"global"},{"type":"Identifier","name":"factory"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"define"}},"operator":"===","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"define"},"property":{"type":"Identifier","name":"amd"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"define"},"arguments":[{"type":"Identifier","name":"AMD_ARGUMENTS"},{"type":"Identifier","name":"factory"}]}}]},"alternate":{"type":"IfStatement","test":{"type":"Identifier","name":"COMMON_TEST"},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"Identifier","name":"COMMON_ARGUMENTS"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"mod"},"init":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"exports"},"value":{"type":"ObjectExpression","properties":[]},"kind":"init"}]}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"mod"},"property":{"type":"Identifier","name":"exports"},"computed":false},{"type":"Identifier","name":"BROWSER_ARGUMENTS"}]}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"global"},"property":{"type":"Identifier","name":"GLOBAL_ARG"},"computed":false},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"mod"},"property":{"type":"Identifier","name":"exports"},"computed":false}}}]}}}]},"parenthesizedExpression":true}}]}} +},{}],612:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +exports.parse = parse; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _parser = _dereq_(616); + +var _parser2 = _interopRequireDefault(_parser); + +_dereq_(621); + +_dereq_(620); + +_dereq_(618); + +_dereq_(615); + +_dereq_(619); + +_dereq_(617); + +_dereq_(614); + +var _tokenizerTypes = _dereq_(628); + +_dereq_(626); + +_dereq_(625); + +var _pluginsFlow = _dereq_(622); + +var _pluginsFlow2 = _interopRequireDefault(_pluginsFlow); + +var _pluginsJsx = _dereq_(623); + +var _pluginsJsx2 = _interopRequireDefault(_pluginsJsx); + +_parser.plugins.flow = _pluginsFlow2["default"]; +_parser.plugins.jsx = _pluginsJsx2["default"]; + +function parse(input, options) { + return new _parser2["default"](options, input).parse(); +} + +exports.tokTypes = _tokenizerTypes.types; +},{"614":614,"615":615,"616":616,"617":617,"618":618,"619":619,"620":620,"621":621,"622":622,"623":623,"625":625,"626":626,"628":628}],613:[function(_dereq_,module,exports){ +// A second optional argument can be given to further configure +// the parser process. These options are recognized: + +"use strict"; + +exports.__esModule = true; +exports.getOptions = getOptions; +var defaultOptions = { + // Source type ("script" or "module") for different semantics + sourceType: "script", + // By default, reserved words are not enforced. Disable + // `allowReserved` to enforce them. When this option has the + // value "never", reserved words and keywords can also not be + // used as property names. + allowReserved: true, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + plugins: {}, + // Babel-specific options + features: {}, + strictMode: null +}; + +exports.defaultOptions = defaultOptions; +// Interpret and default an options object + +function getOptions(opts) { + var options = {}; + for (var key in defaultOptions) { + options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; + } + return options; +} +},{}],614:[function(_dereq_,module,exports){ +/** + * Based on the comment attachment algorithm used in espree and estraverse. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +"use strict"; + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +function last(stack) { + return stack[stack.length - 1]; +} + +var pp = _index2["default"].prototype; + +pp.addComment = function (comment) { + this.state.trailingComments.push(comment); + this.state.leadingComments.push(comment); +}; + +pp.processComment = function (node) { + if (node.type === "Program" && node.body.length > 0) return; + + var stack = this.state.commentStack; + + var lastChild, trailingComments, i; + + if (this.state.trailingComments.length > 0) { + // If the first comment in trailingComments comes after the + // current node, then we're good - all comments in the array will + // come after the node and so it's safe to add them as official + // trailingComments. + if (this.state.trailingComments[0].start >= node.end) { + trailingComments = this.state.trailingComments; + this.state.trailingComments = []; + } else { + // Otherwise, if the first comment doesn't come after the + // current node, that means we have a mix of leading and trailing + // comments in the array and that leadingComments contains the + // same items as trailingComments. Reset trailingComments to + // zero items and we'll handle this by evaluating leadingComments + // later. + this.state.trailingComments.length = 0; + } + } else { + var lastInStack = last(stack); + if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { + trailingComments = lastInStack.trailingComments; + lastInStack.trailingComments = null; + } + } + + // Eating the stack. + while (stack.length > 0 && last(stack).start >= node.start) { + lastChild = stack.pop(); + } + + if (lastChild) { + if (lastChild.leadingComments) { + if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) { + node.leadingComments = lastChild.leadingComments; + lastChild.leadingComments = null; + } else { + // A leading comment for an anonymous class had been stolen by its first MethodDefinition, + // so this takes back the leading comment. + // See also: https://github.com/eslint/espree/issues/158 + for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { + if (lastChild.leadingComments[i].end <= node.start) { + node.leadingComments = lastChild.leadingComments.splice(0, i + 1); + break; + } + } + } + } + } else if (this.state.leadingComments.length > 0) { + if (last(this.state.leadingComments).end <= node.start) { + node.leadingComments = this.state.leadingComments; + this.state.leadingComments = []; + } else { + // https://github.com/eslint/espree/issues/2 + // + // In special cases, such as return (without a value) and + // debugger, all comments will end up as leadingComments and + // will otherwise be eliminated. This step runs when the + // commentStack is empty and there are comments left + // in leadingComments. + // + // This loop figures out the stopping point between the actual + // leading and trailing comments by finding the location of the + // first comment that comes after the given node. + for (i = 0; i < this.state.leadingComments.length; i++) { + if (this.state.leadingComments[i].end > node.start) { + break; + } + } + + // Split the array based on the location of the first comment + // that comes after the node. Keep in mind that this could + // result in an empty array, and if so, the array must be + // deleted. + node.leadingComments = this.state.leadingComments.slice(0, i); + if (node.leadingComments.length === 0) { + node.leadingComments = null; + } + + // Similarly, trailing comments are attached later. The variable + // must be reset to null if there are no trailing comments. + trailingComments = this.state.leadingComments.slice(i); + if (trailingComments.length === 0) { + trailingComments = null; + } + } + } + + if (trailingComments) { + if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { + node.innerComments = trailingComments; + } else { + node.trailingComments = trailingComments; + } + } + + stack.push(node); +}; +},{"616":616}],615:[function(_dereq_,module,exports){ +// A recursive descent parser operates by defining functions for all +// syntactic elements, and recursively calling those, each function +// advancing the input stream and returning an AST node. Precedence +// of constructs (for example, the fact that `!x[1]` means `!(x[1])` +// instead of `(!x)[1]` is handled by the fact that the parser +// function that parses unary prefix operators is called first, and +// in turn calls the function that parses `[]` subscripts — that +// way, it'll receive the node for `x[1]` already parsed, and wraps +// *that* in the unary operator node. +// +// Acorn uses an [operator precedence parser][opp] to handle binary +// operator precedence, because it is much more compact than using +// the technique outlined above, which uses different, nesting +// functions to specify precedence, for all of the ten binary +// precedence levels that JavaScript defines. +// +// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + +"use strict"; + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _tokenizerTypes = _dereq_(628); + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +var _utilIdentifier = _dereq_(629); + +var pp = _index2["default"].prototype; + +// Check if property name clashes with already added. +// Object/class getters and setters are not allowed to clash — +// either with each other or with an init property — and in +// strict mode, init properties are also not allowed to be repeated. + +pp.checkPropClash = function (prop, propHash) { + if (prop.computed || prop.method || prop.shorthand) return; + + var key = prop.key, + name = undefined; + switch (key.type) { + case "Identifier": + name = key.name;break; + case "Literal": + name = String(key.value);break; + default: + return; + } + + var kind = prop.kind; + if (name === "__proto__" && kind === "init") { + if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + propHash.proto = true; + } +}; + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function (s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. + +// Parse a full expression. The optional arguments are used to +// forbid the `in` operator (in for loops initalization expressions) +// and provide reference for storing '=' operator inside shorthand +// property assignment in contexts where both object expression +// and object pattern might appear (so it's possible to raise +// delayed syntax error at correct position). + +pp.parseExpression = function (noIn, refShorthandDefaultPos) { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); + if (this.match(_tokenizerTypes.types.comma)) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(_tokenizerTypes.types.comma)) { + node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); + } + this.toReferencedList(node.expressions); + return this.finishNode(node, "SequenceExpression"); + } + return expr; +}; + +// Parse an assignment expression. This includes applications of +// operators like `+=`. + +pp.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse) { + if (this.match(_tokenizerTypes.types._yield) && this.state.inGenerator) { + return this.parseYield(); + } + + var failOnShorthandAssign = undefined; + if (!refShorthandDefaultPos) { + refShorthandDefaultPos = { start: 0 }; + failOnShorthandAssign = true; + } else { + failOnShorthandAssign = false; + } + var startPos = this.state.start, + startLoc = this.state.startLoc; + if (this.match(_tokenizerTypes.types.parenL) || this.match(_tokenizerTypes.types.name)) { + this.state.potentialArrowAt = this.state.start; + } + var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); + if (this.state.type.isAssign) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; + node.left = this.match(_tokenizerTypes.types.eq) ? this.toAssignable(left) : left; + refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly + this.checkLVal(left); + if (left.parenthesizedExpression) { + var errorMsg = undefined; + if (left.type === "ObjectPattern") { + errorMsg = "`({a}) = 0` use `({a} = 0)`"; + } else if (left.type === "ArrayPattern") { + errorMsg = "`([a]) = 0` use `([a] = 0)`"; + } + if (errorMsg) { + this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg); + } + } + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression"); + } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); + } + return left; +}; + +// Parse a ternary conditional (`?:`) operator. + +pp.parseMaybeConditional = function (noIn, refShorthandDefaultPos) { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var expr = this.parseExprOps(noIn, refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; + if (this.eat(_tokenizerTypes.types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(_tokenizerTypes.types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; +}; + +// Start the precedence parser. + +pp.parseExprOps = function (noIn, refShorthandDefaultPos) { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var expr = this.parseMaybeUnary(refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + return expr; + } else { + return this.parseExprOp(expr, startPos, startLoc, -1, noIn); + } +}; + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. + +pp.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.state.type.binop; + if (prec != null && (!noIn || !this.match(_tokenizerTypes.types._in))) { + if (prec > minPrec) { + var node = this.startNodeAt(leftStartPos, leftStartLoc); + node.left = left; + node.operator = this.state.value; + var op = this.state.type; + this.next(); + var startPos = this.state.start, + startLoc = this.state.startLoc; + node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn); + this.finishNode(node, op === _tokenizerTypes.types.logicalOR || op === _tokenizerTypes.types.logicalAND ? "LogicalExpression" : "BinaryExpression"); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + } + } + return left; +}; + +// Parse unary operators, both prefix and postfix. + +pp.parseMaybeUnary = function (refShorthandDefaultPos) { + if (this.state.type.prefix) { + var node = this.startNode(), + update = this.match(_tokenizerTypes.types.incDec); + node.operator = this.state.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); + if (update) { + this.checkLVal(node.argument); + } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { + this.raise(node.start, "Deleting local variable in strict mode"); + } + return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } + + var startPos = this.state.start, + startLoc = this.state.startLoc; + var expr = this.parseExprSubscripts(refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; + while (this.state.type.postfix && !this.canInsertSemicolon()) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.state.value; + node.prefix = false; + node.argument = expr; + this.checkLVal(expr); + this.next(); + expr = this.finishNode(node, "UpdateExpression"); + } + return expr; +}; + +// Parse call, dot, and `[]`-subscript expressions. + +pp.parseExprSubscripts = function (refShorthandDefaultPos) { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var expr = this.parseExprAtom(refShorthandDefaultPos); + if (refShorthandDefaultPos && refShorthandDefaultPos.start) { + return expr; + } else { + return this.parseSubscripts(expr, startPos, startLoc); + } +}; + +pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { + for (;;) { + if (!noCalls && this.eat(_tokenizerTypes.types.doubleColon)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.callee = this.parseNoCallExpr(); + return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); + } else if (this.eat(_tokenizerTypes.types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = this.parseIdent(true); + node.computed = false; + base = this.finishNode(node, "MemberExpression"); + } else if (this.eat(_tokenizerTypes.types.bracketL)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = this.parseExpression(); + node.computed = true; + this.expect(_tokenizerTypes.types.bracketR); + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.match(_tokenizerTypes.types.parenL)) { + var possibleAsync = base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); + this.next(); + + var node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = this.parseExprList(_tokenizerTypes.types.parenR, this.options.features["es7.trailingFunctionCommas"]); + base = this.finishNode(node, "CallExpression"); + + if (possibleAsync && (this.match(_tokenizerTypes.types.colon) || this.match(_tokenizerTypes.types.arrow))) { + base = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); + } else { + this.toReferencedList(node.arguments); + } + } else if (this.match(_tokenizerTypes.types.backQuote)) { + var node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate(); + base = this.finishNode(node, "TaggedTemplateExpression"); + } else { + return base; + } + } +}; + +pp.parseAsyncArrowFromCallExpression = function (node, call) { + if (!this.options.features["es7.asyncFunctions"]) this.unexpected(); + this.expect(_tokenizerTypes.types.arrow); + return this.parseArrowExpression(node, call.arguments, true); +}; + +// Parse a no-call expression (like argument of `new` or `::` operators). + +pp.parseNoCallExpr = function () { + var startPos = this.state.start, + startLoc = this.state.startLoc; + return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); +}; + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. + +pp.parseExprAtom = function (refShorthandDefaultPos) { + var node = undefined, + canBeArrow = this.state.potentialArrowAt === this.state.start; + switch (this.state.type) { + case _tokenizerTypes.types._super: + if (!this.state.inFunction) this.raise(this.state.start, "'super' outside of function or class"); + case _tokenizerTypes.types._this: + var type = this.match(_tokenizerTypes.types._this) ? "ThisExpression" : "Super"; + node = this.startNode(); + this.next(); + return this.finishNode(node, type); + + case _tokenizerTypes.types._yield: + if (this.state.inGenerator) this.unexpected(); + + case _tokenizerTypes.types._do: + if (this.options.features["es7.doExpressions"]) { + var _node = this.startNode(); + this.next(); + var oldInFunction = this.state.inFunction; + var oldLabels = this.state.labels; + this.state.labels = []; + this.state.inFunction = false; + _node.body = this.parseBlock(); + this.state.inFunction = oldInFunction; + this.state.labels = oldLabels; + return this.finishNode(_node, "DoExpression"); + } + + case _tokenizerTypes.types.name: + node = this.startNode(); + var id = this.parseIdent(true); + + if (this.options.features["es7.asyncFunctions"]) { + if (id.name === "await") { + if (this.inAsync) return this.parseAwait(node); + } else if (id.name === "async" && this.match(_tokenizerTypes.types._function) && !this.canInsertSemicolon()) { + this.next(); + return this.parseFunction(node, false, false, true); + } else if (canBeArrow && id.name === "async" && this.match(_tokenizerTypes.types.name)) { + var params = [this.parseIdent()]; + this.expect(_tokenizerTypes.types.arrow); + // var foo = bar => {}; + return this.parseArrowExpression(node, params, true); + } + } + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokenizerTypes.types.arrow)) { + return this.parseArrowExpression(node, [id]); + } + + return id; + + case _tokenizerTypes.types.regexp: + var value = this.state.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + + case _tokenizerTypes.types.num:case _tokenizerTypes.types.string: + return this.parseLiteral(this.state.value); + + case _tokenizerTypes.types._null:case _tokenizerTypes.types._true:case _tokenizerTypes.types._false: + node = this.startNode(); + node.rawValue = node.value = this.match(_tokenizerTypes.types._null) ? null : this.match(_tokenizerTypes.types._true); + node.raw = this.state.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + + case _tokenizerTypes.types.parenL: + return this.parseParenAndDistinguishExpression(null, null, canBeArrow); + + case _tokenizerTypes.types.bracketL: + node = this.startNode(); + this.next(); + // check whether this is array comprehension or regular array + if (this.options.features["es7.comprehensions"] && this.match(_tokenizerTypes.types._for)) { + return this.parseComprehension(node, false); + } + node.elements = this.parseExprList(_tokenizerTypes.types.bracketR, true, true, refShorthandDefaultPos); + this.toReferencedList(node.elements); + return this.finishNode(node, "ArrayExpression"); + + case _tokenizerTypes.types.braceL: + return this.parseObj(false, refShorthandDefaultPos); + + case _tokenizerTypes.types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, false); + + case _tokenizerTypes.types.at: + this.parseDecorators(); + + case _tokenizerTypes.types._class: + node = this.startNode(); + this.takeDecorators(node); + return this.parseClass(node, false); + + case _tokenizerTypes.types._new: + return this.parseNew(); + + case _tokenizerTypes.types.backQuote: + return this.parseTemplate(); + + case _tokenizerTypes.types.doubleColon: + node = this.startNode(); + this.next(); + node.object = null; + var callee = node.callee = this.parseNoCallExpr(); + if (callee.type === "MemberExpression") { + return this.finishNode(node, "BindExpression"); + } else { + this.raise(callee.start, "Binding should be performed on object property."); + } + + default: + this.unexpected(); + } +}; + +pp.parseLiteral = function (value) { + var node = this.startNode(); + node.rawValue = node.value = value; + node.raw = this.input.slice(this.state.start, this.state.end); + this.next(); + return this.finishNode(node, "Literal"); +}; + +pp.parseParenExpression = function () { + this.expect(_tokenizerTypes.types.parenL); + var val = this.parseExpression(); + this.expect(_tokenizerTypes.types.parenR); + return val; +}; + +pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow, isAsync) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + var val = undefined; + this.next(); + + if (this.options.features["es7.comprehensions"] && this.match(_tokenizerTypes.types._for)) { + return this.parseComprehension(this.startNodeAt(startPos, startLoc), true); + } + + var innerStartPos = this.state.start, + innerStartLoc = this.state.startLoc; + var exprList = [], + first = true; + var refShorthandDefaultPos = { start: 0 }, + spreadStart = undefined, + innerParenStart = undefined, + optionalCommaStart = undefined; + while (!this.match(_tokenizerTypes.types.parenR)) { + if (first) { + first = false; + } else { + this.expect(_tokenizerTypes.types.comma); + if (this.match(_tokenizerTypes.types.parenR) && this.options.features["es7.trailingFunctionCommas"]) { + optionalCommaStart = this.state.start; + break; + } + } + + if (this.match(_tokenizerTypes.types.ellipsis)) { + var spreadNodeStartPos = this.state.start, + spreadNodeStartLoc = this.state.startLoc; + spreadStart = this.state.start; + exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartLoc, spreadNodeStartPos)); + break; + } else { + if (this.match(_tokenizerTypes.types.parenL) && !innerParenStart) { + innerParenStart = this.state.start; + } + exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem)); + } + } + var innerEndPos = this.state.start; + var innerEndLoc = this.state.startLoc; + this.expect(_tokenizerTypes.types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokenizerTypes.types.arrow)) { + if (innerParenStart) this.unexpected(innerParenStart); + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, isAsync); + } + + if (!exprList.length) { + if (isAsync) { + return; + } else { + this.unexpected(this.state.lastTokStart); + } + } + if (optionalCommaStart) this.unexpected(optionalCommaStart); + if (spreadStart) this.unexpected(spreadStart); + if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.toReferencedList(val.expressions); + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + + val.parenthesizedExpression = true; + return val; +}; + +pp.parseParenItem = function (node) { + return node; +}; + +// New's precedence is slightly tricky. It must allow its argument +// to be a `[]` or dot subscript expression, but not a call — at +// least, not without wrapping it in parentheses. Thus, it uses the + +pp.parseNew = function () { + var node = this.startNode(); + var meta = this.parseIdent(true); + + if (this.eat(_tokenizerTypes.types.dot)) { + node.meta = meta; + node.property = this.parseIdent(true); + + if (node.property.name !== "target") { + this.raise(node.property.start, "The only valid meta property for new is new.target"); + } + + return this.finishNode(node, "MetaProperty"); + } + + node.callee = this.parseNoCallExpr(); + + if (this.eat(_tokenizerTypes.types.parenL)) { + node.arguments = this.parseExprList(_tokenizerTypes.types.parenR, this.options.features["es7.trailingFunctionCommas"]); + this.toReferencedList(node.arguments); + } else { + node.arguments = []; + } + + return this.finishNode(node, "NewExpression"); +}; + +// Parse template expression. + +pp.parseTemplateElement = function () { + var elem = this.startNode(); + elem.value = { + raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), + cooked: this.state.value + }; + this.next(); + elem.tail = this.match(_tokenizerTypes.types.backQuote); + return this.finishNode(elem, "TemplateElement"); +}; + +pp.parseTemplate = function () { + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement(); + node.quasis = [curElt]; + while (!curElt.tail) { + this.expect(_tokenizerTypes.types.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(_tokenizerTypes.types.braceR); + node.quasis.push(curElt = this.parseTemplateElement()); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); +}; + +// Parse an object literal or binding pattern. + +pp.parseObj = function (isPattern, refShorthandDefaultPos) { + var node = this.startNode(), + first = true, + propHash = Object.create(null); + node.properties = []; + var decorators = []; + this.next(); + while (!this.eat(_tokenizerTypes.types.braceR)) { + if (first) { + first = false; + } else { + this.expect(_tokenizerTypes.types.comma); + if (this.eat(_tokenizerTypes.types.braceR)) break; + } + + while (this.match(_tokenizerTypes.types.at)) { + decorators.push(this.parseDecorator()); + } + + var prop = this.startNode(), + isGenerator = false, + isAsync = false, + startPos = undefined, + startLoc = undefined; + if (decorators.length) { + prop.decorators = decorators; + decorators = []; + } + if (this.options.features["es7.objectRestSpread"] && this.match(_tokenizerTypes.types.ellipsis)) { + prop = this.parseSpread(); + prop.type = "SpreadProperty"; + node.properties.push(prop); + continue; + } + prop.method = false; + prop.shorthand = false; + if (isPattern || refShorthandDefaultPos) { + startPos = this.state.start; + startLoc = this.state.startLoc; + } + if (!isPattern) { + isGenerator = this.eat(_tokenizerTypes.types.star); + } + if (!isPattern && this.options.features["es7.asyncFunctions"] && this.isContextual("async")) { + if (isGenerator) this.unexpected(); + var asyncId = this.parseIdent(); + if (this.match(_tokenizerTypes.types.colon) || this.match(_tokenizerTypes.types.parenL) || this.match(_tokenizerTypes.types.braceR)) { + prop.key = asyncId; + } else { + isAsync = true; + this.parsePropertyName(prop); + } + } else { + this.parsePropertyName(prop); + } + this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); + this.checkPropClash(prop, propHash); + node.properties.push(this.finishNode(prop, "Property")); + } + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no property"); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); +}; + +pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { + if (this.eat(_tokenizerTypes.types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); + prop.kind = "init"; + } else if (this.match(_tokenizerTypes.types.parenL)) { + if (isPattern) this.unexpected(); + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && !this.match(_tokenizerTypes.types.comma) && !this.match(_tokenizerTypes.types.braceR)) { + if (isGenerator || isAsync || isPattern) this.unexpected(); + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") this.raise(start, "getter should have no params");else this.raise(start, "setter should have exactly one param"); + } + } else if (!prop.computed && prop.key.type === "Identifier") { + prop.kind = "init"; + if (isPattern) { + if (this.isKeyword(prop.key.name) || this.strict && (_utilIdentifier.reservedWords.strictBind(prop.key.name) || _utilIdentifier.reservedWords.strict(prop.key.name)) || !this.options.allowReserved && this.isReservedWord(prop.key.name)) this.raise(prop.key.start, "Binding " + prop.key.name); + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); + } else if (this.match(_tokenizerTypes.types.eq) && refShorthandDefaultPos) { + if (!refShorthandDefaultPos.start) refShorthandDefaultPos.start = this.state.start; + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); + } else { + prop.value = prop.key.__clone(); + } + prop.shorthand = true; + } else { + this.unexpected(); + } +}; + +pp.parsePropertyName = function (prop) { + if (this.eat(_tokenizerTypes.types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(_tokenizerTypes.types.bracketR); + return prop.key; + } else { + prop.computed = false; + return prop.key = this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdent(true); + } +}; + +// Initialize empty function node. + +pp.initFunction = function (node, isAsync) { + node.id = null; + node.generator = false; + node.expression = false; + if (this.options.features["es7.asyncFunctions"]) { + node.async = !!isAsync; + } +}; + +// Parse object or class method. + +pp.parseMethod = function (isGenerator, isAsync) { + var node = this.startNode(); + this.initFunction(node, isAsync); + this.expect(_tokenizerTypes.types.parenL); + node.params = this.parseBindingList(_tokenizerTypes.types.parenR, false, this.options.features["es7.trailingFunctionCommas"]); + node.generator = isGenerator; + this.parseFunctionBody(node); + return this.finishNode(node, "FunctionExpression"); +}; + +// Parse arrow function expression with given parameters. + +pp.parseArrowExpression = function (node, params, isAsync) { + this.initFunction(node, isAsync); + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true); + return this.finishNode(node, "ArrowFunctionExpression"); +}; + +// Parse function body and check parameters. + +pp.parseFunctionBody = function (node, allowExpression) { + var isExpression = allowExpression && !this.match(_tokenizerTypes.types.braceL); + + var oldInAsync = this.inAsync; + this.inAsync = node.async; + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + } else { + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldInFunc = this.state.inFunction, + oldInGen = this.state.inGenerator, + oldLabels = this.state.labels; + this.state.inFunction = true;this.state.inGenerator = node.generator;this.state.labels = []; + node.body = this.parseBlock(true); + node.expression = false; + this.state.inFunction = oldInFunc;this.state.inGenerator = oldInGen;this.state.labels = oldLabels; + } + this.inAsync = oldInAsync; + + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (this.strict || !isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) { + var nameHash = Object.create(null), + oldStrict = this.strict; + this.strict = true; + if (node.id) { + this.checkLVal(node.id, true); + } + var _arr = node.params; + for (var _i = 0; _i < _arr.length; _i++) { + var param = _arr[_i]; + this.checkLVal(param, true, nameHash); + } + this.strict = oldStrict; + } +}; + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +pp.parseExprList = function (close, allowTrailingComma, allowEmpty, refShorthandDefaultPos) { + var elts = [], + first = true; + while (!this.eat(close)) { + if (first) { + first = false; + } else { + this.expect(_tokenizerTypes.types.comma); + if (allowTrailingComma && this.eat(close)) break; + } + + elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); + } + return elts; +}; + +pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos) { + var elt = undefined; + if (allowEmpty && this.match(_tokenizerTypes.types.comma)) { + elt = null; + } else if (this.match(_tokenizerTypes.types.ellipsis)) { + elt = this.parseSpread(refShorthandDefaultPos); + } else { + elt = this.parseMaybeAssign(false, refShorthandDefaultPos); + } + return elt; +}; + +// Parse the next token as an identifier. If `liberal` is true (used +// when parsing properties), it will also convert keywords into +// identifiers. + +pp.parseIdent = function (liberal) { + var node = this.startNode(); + if (this.match(_tokenizerTypes.types.name)) { + if (!liberal && (!this.options.allowReserved && this.isReservedWord(this.state.value) || this.strict && _utilIdentifier.reservedWords.strict(this.state.value))) this.raise(this.state.start, "The keyword '" + this.state.value + "' is reserved"); + node.name = this.state.value; + } else if (liberal && this.state.type.keyword) { + node.name = this.state.type.keyword; + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "Identifier"); +}; + +// Parses await expression inside async function. + +pp.parseAwait = function (node) { + if (this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon()) { + this.unexpected(); + } + node.all = this.eat(_tokenizerTypes.types.star); + node.argument = this.parseMaybeUnary(); + return this.finishNode(node, "AwaitExpression"); +}; + +// Parses yield expression inside generator. + +pp.parseYield = function () { + var node = this.startNode(); + this.next(); + if (this.match(_tokenizerTypes.types.semi) || this.canInsertSemicolon() || !this.match(_tokenizerTypes.types.star) && !this.state.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(_tokenizerTypes.types.star); + node.argument = this.parseMaybeAssign(); + } + return this.finishNode(node, "YieldExpression"); +}; + +// Parses array and generator comprehensions. + +pp.parseComprehension = function (node, isGenerator) { + node.blocks = []; + while (this.match(_tokenizerTypes.types._for)) { + var block = this.startNode(); + this.next(); + this.expect(_tokenizerTypes.types.parenL); + block.left = this.parseBindingAtom(); + this.checkLVal(block.left, true); + this.expectContextual("of"); + block.right = this.parseExpression(); + this.expect(_tokenizerTypes.types.parenR); + node.blocks.push(this.finishNode(block, "ComprehensionBlock")); + } + node.filter = this.eat(_tokenizerTypes.types._if) ? this.parseParenExpression() : null; + node.body = this.parseExpression(); + this.expect(isGenerator ? _tokenizerTypes.types.parenR : _tokenizerTypes.types.bracketR); + node.generator = isGenerator; + return this.finishNode(node, "ComprehensionExpression"); +}; +},{"616":616,"628":628,"629":629}],616:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// istanbul ignore next + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// istanbul ignore next + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var _utilIdentifier = _dereq_(629); + +var _options = _dereq_(613); + +var _tokenizer = _dereq_(626); + +var _tokenizer2 = _interopRequireDefault(_tokenizer); + +// Registered plugins + +var plugins = {}; + +exports.plugins = plugins; + +var Parser = (function (_Tokenizer) { + _inherits(Parser, _Tokenizer); + + function Parser(options, input) { + _classCallCheck(this, Parser); + + _Tokenizer.call(this, input); + + this.options = _options.getOptions(options); + this.isKeyword = _utilIdentifier.isKeyword; + this.isReservedWord = _utilIdentifier.reservedWords[6]; + this.input = input; + this.loadPlugins(this.options.plugins); + + // Figure out if it's a module code. + this.inModule = this.options.sourceType === "module"; + this.strict = this.options.strictMode === false ? false : this.inModule; + + // If enabled, skip leading hashbang line. + if (this.state.pos === 0 && this.input[0] === "#" && this.input[1] === "!") { + this.skipLineComment(2); + } + } + + Parser.prototype.extend = function extend(name, f) { + this[name] = f(this[name]); + }; + + Parser.prototype.loadPlugins = function loadPlugins(plugins) { + for (var _name in plugins) { + var plugin = exports.plugins[_name]; + if (!plugin) throw new Error("Plugin '" + _name + "' not found"); + plugin(this, plugins[_name]); + } + }; + + Parser.prototype.parse = function parse() { + var file = this.startNode(); + var program = this.startNode(); + this.nextToken(); + return this.parseTopLevel(file, program); + }; + + return Parser; +})(_tokenizer2["default"]); + +exports["default"] = Parser; +},{"613":613,"626":626,"629":629}],617:[function(_dereq_,module,exports){ +"use strict"; + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _utilLocation = _dereq_(630); + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +var pp = _index2["default"].prototype; + +// This function is used to raise exceptions on parse errors. It +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +pp.raise = function (pos, message) { + var loc = _utilLocation.getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; + err.loc = loc; + throw err; +}; +},{"616":616,"630":630}],618:[function(_dereq_,module,exports){ +"use strict"; + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _tokenizerTypes = _dereq_(628); + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +var _utilIdentifier = _dereq_(629); + +var pp = _index2["default"].prototype; + +// Convert existing expression atom to assignable pattern +// if possible. + +pp.toAssignable = function (node, isBinding) { + if (node) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + break; + + case "ObjectExpression": + node.type = "ObjectPattern"; + var _arr = node.properties; + for (var _i = 0; _i < _arr.length; _i++) { + var prop = _arr[_i]; + if (prop.type === "SpreadProperty") continue; + if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + this.toAssignable(prop.value, isBinding); + } + break; + + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, isBinding); + break; + + case "AssignmentExpression": + if (node.operator === "=") { + node.type = "AssignmentPattern"; + delete node.operator; + } else { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + } + break; + + case "MemberExpression": + if (!isBinding) break; + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } + return node; +}; + +// Convert list of expression atoms to binding list. + +pp.toAssignableList = function (exprList, isBinding) { + var end = exprList.length; + if (end) { + var last = exprList[end - 1]; + if (last && last.type === "RestElement") { + --end; + } else if (last && last.type === "SpreadElement") { + last.type = "RestElement"; + var arg = last.argument; + this.toAssignable(arg, isBinding); + if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") { + this.unexpected(arg.start); + } + --end; + } + } + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) this.toAssignable(elt, isBinding); + } + return exprList; +}; + +// Convert list of expression atoms to a list of + +pp.toReferencedList = function (exprList) { + return exprList; +}; + +// Parses spread element. + +pp.parseSpread = function (refShorthandDefaultPos) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(refShorthandDefaultPos); + return this.finishNode(node, "SpreadElement"); +}; + +pp.parseRest = function () { + var node = this.startNode(); + this.next(); + node.argument = this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types.bracketL) ? this.parseBindingAtom() : this.unexpected(); + return this.finishNode(node, "RestElement"); +}; + +// Parses lvalue (assignable) atom. + +pp.parseBindingAtom = function () { + switch (this.state.type) { + case _tokenizerTypes.types.name: + return this.parseIdent(); + + case _tokenizerTypes.types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(_tokenizerTypes.types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + + case _tokenizerTypes.types.braceL: + return this.parseObj(true); + + default: + this.unexpected(); + } +}; + +pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) { + var elts = [], + first = true; + while (!this.eat(close)) { + if (first) first = false;else this.expect(_tokenizerTypes.types.comma); + if (allowEmpty && this.match(_tokenizerTypes.types.comma)) { + elts.push(null); + } else if (allowTrailingComma && this.eat(close)) { + break; + } else if (this.match(_tokenizerTypes.types.ellipsis)) { + elts.push(this.parseAssignableListItemTypes(this.parseRest())); + this.expect(close); + break; + } else { + var left = this.parseMaybeDefault(); + this.parseAssignableListItemTypes(left); + elts.push(this.parseMaybeDefault(null, null, left)); + } + } + return elts; +}; + +pp.parseAssignableListItemTypes = function (param) { + return param; +}; + +// Parses assignment pattern around given atom if possible. + +pp.parseMaybeDefault = function (startPos, startLoc, left) { + startLoc = startLoc || this.state.startLoc; + startPos = startPos || this.state.start; + left = left || this.parseBindingAtom(); + if (!this.eat(_tokenizerTypes.types.eq)) return left; + + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); +}; + +// Verify that a node is an lval — something that can be assigned +// to. + +pp.checkLVal = function (expr, isBinding, checkClashes) { + switch (expr.type) { + case "Identifier": + if (this.strict && (_utilIdentifier.reservedWords.strictBind(expr.name) || _utilIdentifier.reservedWords.strict(expr.name))) this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + if (checkClashes) { + if (checkClashes[expr.name]) { + this.raise(expr.start, "Argument name clash in strict mode"); + } else { + checkClashes[expr.name] = true; + } + } + break; + + case "MemberExpression": + if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); + break; + + case "ObjectPattern": + var _arr2 = expr.properties; + + for (var _i2 = 0; _i2 < _arr2.length; _i2++) { + var prop = _arr2[_i2]; + if (prop.type === "Property") prop = prop.value; + this.checkLVal(prop, isBinding, checkClashes); + } + break; + + case "ArrayPattern": + var _arr3 = expr.elements; + + for (var _i3 = 0; _i3 < _arr3.length; _i3++) { + var elem = _arr3[_i3]; + if (elem) this.checkLVal(elem, isBinding, checkClashes); + } + break; + + case "AssignmentPattern": + this.checkLVal(expr.left, isBinding, checkClashes); + break; + + case "SpreadProperty": + case "RestElement": + this.checkLVal(expr.argument, isBinding, checkClashes); + break; + + default: + this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue"); + } +}; +},{"616":616,"628":628,"629":629}],619:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// istanbul ignore next + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +var _utilLocation = _dereq_(630); + +// Start an AST node, attaching a start offset. + +var pp = _index2["default"].prototype; + +var Node = (function () { + function Node(parser, pos, loc) { + _classCallCheck(this, Node); + + this.type = ""; + this.start = pos; + this.end = 0; + this.loc = new _utilLocation.SourceLocation(loc); + } + + Node.prototype.__clone = function __clone() { + var node2 = new Node(); + for (var key in this) node2[key] = this[key]; + return node2; + }; + + return Node; +})(); + +exports.Node = Node; + +pp.startNode = function () { + return new Node(this, this.state.start, this.state.startLoc); +}; + +pp.startNodeAt = function (pos, loc) { + return new Node(this, pos, loc); +}; + +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + node.loc.end = loc; + this.processComment(node); + return node; +} + +// Finish an AST node, adding `type` and `end` properties. + +pp.finishNode = function (node, type) { + return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); +}; + +// Finish node at given position + +pp.finishNodeAt = function (node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc); +}; +},{"616":616,"630":630}],620:[function(_dereq_,module,exports){ +"use strict"; + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _tokenizerTypes = _dereq_(628); + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +var _utilWhitespace = _dereq_(631); + +var pp = _index2["default"].prototype; + +// ### Statement parsing + +// Parse a program. Initializes the parser, reads any number of +// statements, and wraps them in a Program node. Optionally takes a +// `program` argument. If present, the statements will be appended +// to its body instead of creating a new node. + +pp.parseTopLevel = function (file, program) { + program.sourceType = this.options.sourceType; + program.body = []; + + var first = true; + while (!this.match(_tokenizerTypes.types.eof)) { + var stmt = this.parseStatement(true, true); + program.body.push(stmt); + if (first) { + if (this.isUseStrict(stmt)) this.setStrict(true); + first = false; + } + } + this.next(); + + file.program = this.finishNode(program, "Program"); + file.comments = this.state.comments; + file.tokens = this.state.tokens; + + return this.finishNode(file, "File"); +}; + +var loopLabel = { kind: "loop" }, + switchLabel = { kind: "switch" }; + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + +pp.parseStatement = function (declaration, topLevel) { + if (this.match(_tokenizerTypes.types.at)) { + this.parseDecorators(true); + } + + var starttype = this.state.type, + node = this.startNode(); + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case _tokenizerTypes.types._break:case _tokenizerTypes.types._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case _tokenizerTypes.types._debugger: + return this.parseDebuggerStatement(node); + case _tokenizerTypes.types._do: + return this.parseDoStatement(node); + case _tokenizerTypes.types._for: + return this.parseForStatement(node); + case _tokenizerTypes.types._function: + if (!declaration) this.unexpected(); + return this.parseFunctionStatement(node); + + case _tokenizerTypes.types._class: + if (!declaration) this.unexpected(); + this.takeDecorators(node); + return this.parseClass(node, true); + + case _tokenizerTypes.types._if: + return this.parseIfStatement(node); + case _tokenizerTypes.types._return: + return this.parseReturnStatement(node); + case _tokenizerTypes.types._switch: + return this.parseSwitchStatement(node); + case _tokenizerTypes.types._throw: + return this.parseThrowStatement(node); + case _tokenizerTypes.types._try: + return this.parseTryStatement(node); + case _tokenizerTypes.types._let:case _tokenizerTypes.types._const: + if (!declaration) this.unexpected(); // NOTE: falls through to _var + case _tokenizerTypes.types._var: + return this.parseVarStatement(node, starttype); + case _tokenizerTypes.types._while: + return this.parseWhileStatement(node); + case _tokenizerTypes.types._with: + return this.parseWithStatement(node); + case _tokenizerTypes.types.braceL: + return this.parseBlock(); + case _tokenizerTypes.types.semi: + return this.parseEmptyStatement(node); + case _tokenizerTypes.types._export: + case _tokenizerTypes.types._import: + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); + + if (!this.inModule) this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + return starttype === _tokenizerTypes.types._import ? this.parseImport(node) : this.parseExport(node); + + case _tokenizerTypes.types.name: + if (this.options.features["es7.asyncFunctions"] && this.state.value === "async") { + // peek ahead and see if next token is a function + var state = this.state.clone(); + this.next(); + if (this.match(_tokenizerTypes.types._function) && !this.canInsertSemicolon()) { + this.expect(_tokenizerTypes.types._function); + return this.parseFunction(node, true, false, true); + } else { + this.state = state; + } + } + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + var maybeName = this.state.value, + expr = this.parseExpression(); + + if (starttype === _tokenizerTypes.types.name && expr.type === "Identifier" && this.eat(_tokenizerTypes.types.colon)) { + return this.parseLabeledStatement(node, maybeName, expr); + } else { + return this.parseExpressionStatement(node, expr); + } + } +}; + +pp.takeDecorators = function (node) { + if (this.state.decorators.length) { + node.decorators = this.state.decorators; + this.state.decorators = []; + } +}; + +pp.parseDecorators = function (allowExport) { + while (this.match(_tokenizerTypes.types.at)) { + this.state.decorators.push(this.parseDecorator()); + } + + if (allowExport && this.match(_tokenizerTypes.types._export)) { + return; + } + + if (!this.match(_tokenizerTypes.types._class)) { + this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); + } +}; + +pp.parseDecorator = function () { + if (!this.options.features["es7.decorators"]) { + this.unexpected(); + } + var node = this.startNode(); + this.next(); + node.expression = this.parseMaybeAssign(); + return this.finishNode(node, "Decorator"); +}; + +pp.parseBreakContinueStatement = function (node, keyword) { + var isBreak = keyword === "break"; + this.next(); + + if (this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon()) { + node.label = null; + } else if (!this.match(_tokenizerTypes.types.name)) { + this.unexpected(); + } else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + for (var i = 0; i < this.state.labels.length; ++i) { + var lab = this.state.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) break; + if (node.label && isBreak) break; + } + } + if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); +}; + +pp.parseDebuggerStatement = function (node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); +}; + +pp.parseDoStatement = function (node) { + this.next(); + this.state.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.state.labels.pop(); + this.expect(_tokenizerTypes.types._while); + node.test = this.parseParenExpression(); + this.eat(_tokenizerTypes.types.semi); + return this.finishNode(node, "DoWhileStatement"); +}; + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. + +pp.parseForStatement = function (node) { + this.next(); + this.state.labels.push(loopLabel); + this.expect(_tokenizerTypes.types.parenL); + + if (this.match(_tokenizerTypes.types.semi)) { + return this.parseFor(node, null); + } + + if (this.match(_tokenizerTypes.types._var) || this.match(_tokenizerTypes.types._let) || this.match(_tokenizerTypes.types._const)) { + var _init = this.startNode(), + varKind = this.state.type; + this.next(); + this.parseVar(_init, true, varKind); + this.finishNode(_init, "VariableDeclaration"); + if ((this.match(_tokenizerTypes.types._in) || this.isContextual("of")) && _init.declarations.length === 1 && !(varKind !== _tokenizerTypes.types._var && _init.declarations[0].init)) return this.parseForIn(node, _init); + return this.parseFor(node, _init); + } + + var refShorthandDefaultPos = { start: 0 }; + var init = this.parseExpression(true, refShorthandDefaultPos); + if (this.match(_tokenizerTypes.types._in) || this.isContextual("of")) { + this.toAssignable(init); + this.checkLVal(init); + return this.parseForIn(node, init); + } else if (refShorthandDefaultPos.start) { + this.unexpected(refShorthandDefaultPos.start); + } + return this.parseFor(node, init); +}; + +pp.parseFunctionStatement = function (node) { + this.next(); + return this.parseFunction(node, true); +}; + +pp.parseIfStatement = function (node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement(false); + node.alternate = this.eat(_tokenizerTypes.types._else) ? this.parseStatement(false) : null; + return this.finishNode(node, "IfStatement"); +}; + +pp.parseReturnStatement = function (node) { + if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { + this.raise(this.state.start, "'return' outside of function"); + } + + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon()) { + node.argument = null; + } else { + node.argument = this.parseExpression(); + this.semicolon(); + } + + return this.finishNode(node, "ReturnStatement"); +}; + +pp.parseSwitchStatement = function (node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(_tokenizerTypes.types.braceL); + this.state.labels.push(switchLabel); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + for (var cur, sawDefault; !this.match(_tokenizerTypes.types.braceR);) { + if (this.match(_tokenizerTypes.types._case) || this.match(_tokenizerTypes.types._default)) { + var isCase = this.match(_tokenizerTypes.types._case); + if (cur) this.finishNode(cur, "SwitchCase"); + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses"); + sawDefault = true; + cur.test = null; + } + this.expect(_tokenizerTypes.types.colon); + } else { + if (!cur) this.unexpected(); + cur.consequent.push(this.parseStatement(true)); + } + } + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); // Closing brace + this.state.labels.pop(); + return this.finishNode(node, "SwitchStatement"); +}; + +pp.parseThrowStatement = function (node) { + this.next(); + if (_utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.state.lastTokEnd, "Illegal newline after throw"); + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); +}; + +// Reused empty array added for node fields that are always empty. + +var empty = []; + +pp.parseTryStatement = function (node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.match(_tokenizerTypes.types._catch)) { + var clause = this.startNode(); + this.next(); + this.expect(_tokenizerTypes.types.parenL); + clause.param = this.parseBindingAtom(); + this.checkLVal(clause.param, true); + this.expect(_tokenizerTypes.types.parenR); + clause.body = this.parseBlock(); + node.handler = this.finishNode(clause, "CatchClause"); + } + + node.guardedHandlers = empty; + node.finalizer = this.eat(_tokenizerTypes.types._finally) ? this.parseBlock() : null; + + if (!node.handler && !node.finalizer) { + this.raise(node.start, "Missing catch or finally clause"); + } + + return this.finishNode(node, "TryStatement"); +}; + +pp.parseVarStatement = function (node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); +}; + +pp.parseWhileStatement = function (node) { + this.next(); + node.test = this.parseParenExpression(); + this.state.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.state.labels.pop(); + return this.finishNode(node, "WhileStatement"); +}; + +pp.parseWithStatement = function (node) { + if (this.strict) this.raise(this.state.start, "'with' in strict mode"); + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement(false); + return this.finishNode(node, "WithStatement"); +}; + +pp.parseEmptyStatement = function (node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); +}; + +pp.parseLabeledStatement = function (node, maybeName, expr) { + var _arr = this.state.labels; + + for (var _i = 0; _i < _arr.length; _i++) { + var label = _arr[_i]; + if (label.name === maybeName) { + this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } + } + + var kind = this.state.type.isLoop ? "loop" : this.match(_tokenizerTypes.types._switch) ? "switch" : null; + for (var i = this.state.labels.length - 1; i >= 0; i--) { + var label = this.state.labels[i]; + if (label.statementStart === node.start) { + label.statementStart = this.state.start; + label.kind = kind; + } else { + break; + } + } + + this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); + node.body = this.parseStatement(true); + this.state.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); +}; + +pp.parseExpressionStatement = function (node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); +}; + +// Parse a semicolon-enclosed block of statements, handling `"use +// strict"` declarations when `allowStrict` is true (used for +// function bodies). + +pp.parseBlock = function (allowStrict) { + var node = this.startNode(), + first = true, + oldStrict = undefined; + node.body = []; + this.expect(_tokenizerTypes.types.braceL); + while (!this.eat(_tokenizerTypes.types.braceR)) { + var stmt = this.parseStatement(true); + node.body.push(stmt); + if (first && allowStrict && this.isUseStrict(stmt)) { + oldStrict = this.strict; + this.setStrict(this.strict = true); + } + first = false; + } + if (oldStrict === false) this.setStrict(false); + return this.finishNode(node, "BlockStatement"); +}; + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +pp.parseFor = function (node, init) { + node.init = init; + this.expect(_tokenizerTypes.types.semi); + node.test = this.match(_tokenizerTypes.types.semi) ? null : this.parseExpression(); + this.expect(_tokenizerTypes.types.semi); + node.update = this.match(_tokenizerTypes.types.parenR) ? null : this.parseExpression(); + this.expect(_tokenizerTypes.types.parenR); + node.body = this.parseStatement(false); + this.state.labels.pop(); + return this.finishNode(node, "ForStatement"); +}; + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +pp.parseForIn = function (node, init) { + var type = this.match(_tokenizerTypes.types._in) ? "ForInStatement" : "ForOfStatement"; + this.next(); + node.left = init; + node.right = this.parseExpression(); + this.expect(_tokenizerTypes.types.parenR); + node.body = this.parseStatement(false); + this.state.labels.pop(); + return this.finishNode(node, type); +}; + +// Parse a list of variable declarations. + +pp.parseVar = function (node, isFor, kind) { + node.declarations = []; + node.kind = kind.keyword; + for (;;) { + var decl = this.startNode(); + this.parseVarHead(decl); + if (this.eat(_tokenizerTypes.types.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === _tokenizerTypes.types._const && !(this.match(_tokenizerTypes.types._in) || this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(_tokenizerTypes.types._in) || this.isContextual("of")))) { + this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(_tokenizerTypes.types.comma)) break; + } + return node; +}; + +pp.parseVarHead = function (decl) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, true); +}; + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + +pp.parseFunction = function (node, isStatement, allowExpressionBody, isAsync) { + this.initFunction(node, isAsync); + node.generator = this.eat(_tokenizerTypes.types.star); + + if (isStatement || this.match(_tokenizerTypes.types.name)) { + node.id = this.parseIdent(); + } + + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); +}; + +pp.parseFunctionParams = function (node) { + this.expect(_tokenizerTypes.types.parenL); + node.params = this.parseBindingList(_tokenizerTypes.types.parenR, false, this.options.features["es7.trailingFunctionCommas"]); +}; + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + +pp.parseClass = function (node, isStatement) { + this.next(); + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(_tokenizerTypes.types.braceL); + var decorators = []; + while (!this.eat(_tokenizerTypes.types.braceR)) { + if (this.eat(_tokenizerTypes.types.semi)) continue; + if (this.match(_tokenizerTypes.types.at)) { + decorators.push(this.parseDecorator()); + continue; + } + var method = this.startNode(); + if (decorators.length) { + method.decorators = decorators; + decorators = []; + } + var isMaybeStatic = this.match(_tokenizerTypes.types.name) && this.state.value === "static"; + var isGenerator = this.eat(_tokenizerTypes.types.star), + isAsync = false; + this.parsePropertyName(method); + method["static"] = isMaybeStatic && !this.match(_tokenizerTypes.types.parenL); + if (method["static"]) { + if (isGenerator) this.unexpected(); + isGenerator = this.eat(_tokenizerTypes.types.star); + this.parsePropertyName(method); + } + if (!isGenerator && method.key.type === "Identifier" && !method.computed && this.isClassProperty()) { + classBody.body.push(this.parseClassProperty(method)); + continue; + } + if (this.options.features["es7.asyncFunctions"] && !this.match(_tokenizerTypes.types.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async") { + isAsync = true; + this.parsePropertyName(method); + } + var isGetSet = false; + method.kind = "method"; + if (!method.computed) { + var key = method.key; + + if (!isAsync && !isGenerator && key.type === "Identifier" && !this.match(_tokenizerTypes.types.parenL) && (key.name === "get" || key.name === "set")) { + isGetSet = true; + method.kind = key.name; + key = this.parsePropertyName(method); + } + if (!method["static"] && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) { + if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); + if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); + if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); + if (isAsync) this.raise(key.start, "Constructor can't be an async function"); + method.kind = "constructor"; + hadConstructor = true; + } + } + if (method.kind === "constructor" && method.decorators) { + this.raise(method.start, "You can't attach decorators to a class constructor"); + } + this.parseClassMethod(classBody, method, isGenerator, isAsync); + if (isGetSet) { + var paramCount = method.kind === "get" ? 0 : 1; + if (method.value.params.length !== paramCount) { + var start = method.value.start; + if (method.kind === "get") { + this.raise(start, "getter should have no params"); + } else { + this.raise(start, "setter should have exactly one param"); + } + } + } + } + + if (decorators.length) { + this.raise(this.state.start, "You have trailing decorators with no method"); + } + + node.body = this.finishNode(classBody, "ClassBody"); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); +}; + +pp.isClassProperty = function () { + return this.match(_tokenizerTypes.types.eq) || this.match(_tokenizerTypes.types.semi) || this.canInsertSemicolon(); +}; + +pp.parseClassProperty = function (node) { + if (this.match(_tokenizerTypes.types.eq)) { + if (!this.options.features["es7.classProperties"]) this.unexpected(); + this.next(); + node.value = this.parseMaybeAssign(); + } else { + node.value = null; + } + this.semicolon(); + return this.finishNode(node, "ClassProperty"); +}; + +pp.parseClassMethod = function (classBody, method, isGenerator, isAsync) { + method.value = this.parseMethod(isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "MethodDefinition")); +}; + +pp.parseClassId = function (node, isStatement) { + node.id = this.match(_tokenizerTypes.types.name) ? this.parseIdent() : isStatement ? this.unexpected() : null; +}; + +pp.parseClassSuper = function (node) { + node.superClass = this.eat(_tokenizerTypes.types._extends) ? this.parseExprSubscripts() : null; +}; + +// Parses module export declaration. + +pp.parseExport = function (node) { + this.next(); + // export * from '...' + if (this.match(_tokenizerTypes.types.star)) { + var specifier = this.startNode(); + this.next(); + if (this.options.features["es7.exportExtensions"] && this.eatContextual("as")) { + specifier.exported = this.parseIdent(); + node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; + this.parseExportSpecifiersMaybe(node); + this.parseExportFrom(node, true); + } else { + this.parseExportFrom(node, true); + return this.finishNode(node, "ExportAllDeclaration"); + } + } else if (this.options.features["es7.exportExtensions"] && this.isExportDefaultSpecifier()) { + var specifier = this.startNode(); + specifier.exported = this.parseIdent(true); + node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; + if (this.match(_tokenizerTypes.types.comma) && this.lookahead().type === _tokenizerTypes.types.star) { + this.expect(_tokenizerTypes.types.comma); + var _specifier = this.startNode(); + this.expect(_tokenizerTypes.types.star); + this.expectContextual("as"); + _specifier.exported = this.parseIdent(); + node.specifiers.push(this.finishNode(_specifier, "ExportNamespaceSpecifier")); + } else { + this.parseExportSpecifiersMaybe(node); + } + this.parseExportFrom(node, true); + } else if (this.eat(_tokenizerTypes.types._default)) { + // export default ... + var possibleDeclaration = this.match(_tokenizerTypes.types._function) || this.match(_tokenizerTypes.types._class); + var expr = this.parseMaybeAssign(); + var needsSemi = true; + if (possibleDeclaration) { + needsSemi = false; + if (expr.id) { + expr.type = expr.type === "FunctionExpression" ? "FunctionDeclaration" : "ClassDeclaration"; + } + } + node.declaration = expr; + if (needsSemi) this.semicolon(); + this.checkExport(node); + return this.finishNode(node, "ExportDefaultDeclaration"); + } else if (this.state.type.keyword || this.shouldParseExportDeclaration()) { + node.specifiers = []; + node.source = null; + node.declaration = this.parseExportDeclaration(node); + } else { + // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(); + this.parseExportFrom(node); + } + this.checkExport(node); + return this.finishNode(node, "ExportNamedDeclaration"); +}; + +pp.parseExportDeclaration = function () { + return this.parseStatement(true); +}; + +pp.isExportDefaultSpecifier = function () { + if (this.match(_tokenizerTypes.types.name)) { + return this.state.value !== "type" && this.state.value !== "async" && this.state.value !== "interface"; + } + + if (!this.match(_tokenizerTypes.types._default)) { + return false; + } + + var lookahead = this.lookahead(); + return lookahead.type === _tokenizerTypes.types.comma || lookahead.type === _tokenizerTypes.types.name && lookahead.value === "from"; +}; + +pp.parseExportSpecifiersMaybe = function (node) { + if (this.eat(_tokenizerTypes.types.comma)) { + node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); + } +}; + +pp.parseExportFrom = function (node, expect) { + if (this.eatContextual("from")) { + node.source = this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.unexpected(); + this.checkExport(node); + } else { + if (expect) { + this.unexpected(); + } else { + node.source = null; + } + } + + this.semicolon(); +}; + +pp.shouldParseExportDeclaration = function () { + return this.options.features["es7.asyncFunctions"] && this.isContextual("async"); +}; + +pp.checkExport = function (node) { + if (this.state.decorators.length) { + var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); + if (!node.declaration || !isClass) { + this.raise(node.start, "You can only use decorators on an export when exporting a class"); + } + this.takeDecorators(node.declaration); + } +}; + +// Parses a comma-separated list of module exports. + +pp.parseExportSpecifiers = function () { + var nodes = [], + first = true; + // export { x, y as z } [from '...'] + this.expect(_tokenizerTypes.types.braceL); + + while (!this.eat(_tokenizerTypes.types.braceR)) { + if (first) { + first = false; + } else { + this.expect(_tokenizerTypes.types.comma); + if (this.eat(_tokenizerTypes.types.braceR)) break; + } + + var node = this.startNode(); + node.local = this.parseIdent(this.match(_tokenizerTypes.types._default)); + node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local.__clone(); + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + + return nodes; +}; + +// Parses import declaration. + +pp.parseImport = function (node) { + this.next(); + + // import '...' + if (this.match(_tokenizerTypes.types.string)) { + node.specifiers = []; + node.source = this.parseExprAtom(); + } else { + node.specifiers = []; + this.parseImportSpecifiers(node); + this.expectContextual("from"); + node.source = this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); +}; + +// Parses a comma-separated list of module imports. + +pp.parseImportSpecifiers = function (node) { + var first = true; + if (this.match(_tokenizerTypes.types.name)) { + // import defaultObj, { x, y as z } from '...' + var startPos = this.state.start, + startLoc = this.state.startLoc; + node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdent(), startPos, startLoc)); + if (!this.eat(_tokenizerTypes.types.comma)) return; + } + + if (this.match(_tokenizerTypes.types.star)) { + var specifier = this.startNode(); + this.next(); + this.expectContextual("as"); + specifier.local = this.parseIdent(); + this.checkLVal(specifier.local, true); + node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); + return; + } + + this.expect(_tokenizerTypes.types.braceL); + while (!this.eat(_tokenizerTypes.types.braceR)) { + if (first) { + first = false; + } else { + this.expect(_tokenizerTypes.types.comma); + if (this.eat(_tokenizerTypes.types.braceR)) break; + } + + var specifier = this.startNode(); + specifier.imported = this.parseIdent(true); + specifier.local = this.eatContextual("as") ? this.parseIdent() : specifier.imported.__clone(); + this.checkLVal(specifier.local, true); + node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); + } +}; + +pp.parseImportSpecifierDefault = function (id, startPos, startLoc) { + var node = this.startNodeAt(startPos, startLoc); + node.local = id; + this.checkLVal(node.local, true); + return this.finishNode(node, "ImportDefaultSpecifier"); +}; +},{"616":616,"628":628,"631":631}],621:[function(_dereq_,module,exports){ +"use strict"; + +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _tokenizerTypes = _dereq_(628); + +var _index = _dereq_(616); + +var _index2 = _interopRequireDefault(_index); + +var _utilWhitespace = _dereq_(631); + +var pp = _index2["default"].prototype; + +// ## Parser utilities + +// Test whether a statement node is the string literal `"use strict"`. + +pp.isUseStrict = function (stmt) { + return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.raw.slice(1, -1) === "use strict"; +}; + +// TODO + +pp.isRelational = function (op) { + return this.match(_tokenizerTypes.types.relational) && this.state.value === op; +}; + +// TODO + +pp.expectRelational = function (op) { + if (this.isRelational(op)) { + this.next(); + } else { + this.unexpected(); + } +}; + +// Tests whether parsed token is a contextual keyword. + +pp.isContextual = function (name) { + return this.match(_tokenizerTypes.types.name) && this.state.value === name; +}; + +// Consumes contextual keyword if possible. + +pp.eatContextual = function (name) { + return this.state.value === name && this.eat(_tokenizerTypes.types.name); +}; + +// Asserts that following token is given contextual keyword. + +pp.expectContextual = function (name) { + if (!this.eatContextual(name)) this.unexpected(); +}; + +// Test whether a semicolon can be inserted at the current position. + +pp.canInsertSemicolon = function () { + return this.match(_tokenizerTypes.types.eof) || this.match(_tokenizerTypes.types.braceR) || _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); +}; + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. + +pp.semicolon = function () { + if (!this.eat(_tokenizerTypes.types.semi) && !this.canInsertSemicolon()) this.unexpected(); +}; + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error. + +pp.expect = function (type) { + return this.eat(type) || this.unexpected(); +}; + +// Raise an unexpected token error. + +pp.unexpected = function (pos) { + this.raise(pos != null ? pos : this.state.start, "Unexpected token"); +}; +},{"616":616,"628":628,"631":631}],622:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _tokenizerTypes = _dereq_(628); + +var _parser = _dereq_(616); + +var _parser2 = _interopRequireDefault(_parser); + +var pp = _parser2["default"].prototype; + +pp.flowParseTypeInitialiser = function (tok) { + var oldInType = this.state.inType; + this.state.inType = true; + this.expect(tok || _tokenizerTypes.types.colon); + var type = this.flowParseType(); + this.state.inType = oldInType; + return type; +}; + +pp.flowParseDeclareClass = function (node) { + this.next(); + this.flowParseInterfaceish(node, true); + return this.finishNode(node, "DeclareClass"); +}; + +pp.flowParseDeclareFunction = function (node) { + this.next(); + + var id = node.id = this.parseIdent(); + + var typeNode = this.startNode(); + var typeContainer = this.startNode(); + + if (this.isRelational("<")) { + typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + typeNode.typeParameters = null; + } + + this.expect(_tokenizerTypes.types.parenL); + var tmp = this.flowParseFunctionTypeParams(); + typeNode.params = tmp.params; + typeNode.rest = tmp.rest; + this.expect(_tokenizerTypes.types.parenR); + typeNode.returnType = this.flowParseTypeInitialiser(); + + typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); + id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); + + this.finishNode(id, id.type); + + this.semicolon(); + + return this.finishNode(node, "DeclareFunction"); +}; + +pp.flowParseDeclare = function (node) { + if (this.match(_tokenizerTypes.types._class)) { + return this.flowParseDeclareClass(node); + } else if (this.match(_tokenizerTypes.types._function)) { + return this.flowParseDeclareFunction(node); + } else if (this.match(_tokenizerTypes.types._var)) { + return this.flowParseDeclareVariable(node); + } else if (this.isContextual("module")) { + return this.flowParseDeclareModule(node); + } else if (this.isContextual("type")) { + return this.flowParseDeclareTypeAlias(node); + } else if (this.isContextual("interface")) { + return this.flowParseDeclareInterface(node); + } else { + this.unexpected(); + } +}; + +pp.flowParseDeclareVariable = function (node) { + this.next(); + node.id = this.flowParseTypeAnnotatableIdentifier(); + this.semicolon(); + return this.finishNode(node, "DeclareVariable"); +}; + +pp.flowParseDeclareModule = function (node) { + this.next(); + + if (this.match(_tokenizerTypes.types.string)) { + node.id = this.parseExprAtom(); + } else { + node.id = this.parseIdent(); + } + + var bodyNode = node.body = this.startNode(); + var body = bodyNode.body = []; + this.expect(_tokenizerTypes.types.braceL); + while (!this.match(_tokenizerTypes.types.braceR)) { + var node2 = this.startNode(); + + // todo: declare check + this.next(); + + body.push(this.flowParseDeclare(node2)); + } + this.expect(_tokenizerTypes.types.braceR); + + this.finishNode(bodyNode, "BlockStatement"); + return this.finishNode(node, "DeclareModule"); +}; + +pp.flowParseDeclareTypeAlias = function (node) { + this.next(); + this.flowParseTypeAlias(node); + return this.finishNode(node, "DeclareTypeAlias"); +}; + +pp.flowParseDeclareInterface = function (node) { + this.next(); + this.flowParseInterfaceish(node); + return this.finishNode(node, "DeclareInterface"); +}; + +// Interfaces + +pp.flowParseInterfaceish = function (node, allowStatic) { + node.id = this.parseIdent(); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node["extends"] = []; + node.mixins = []; + + if (this.eat(_tokenizerTypes.types._extends)) { + do { + node["extends"].push(this.flowParseInterfaceExtends()); + } while (this.eat(_tokenizerTypes.types.comma)); + } + + if (this.isContextual("mixins")) { + this.next(); + do { + node.mixins.push(this.flowParseInterfaceExtends()); + } while (this.eat(_tokenizerTypes.types.comma)); + } + + node.body = this.flowParseObjectType(allowStatic); +}; + +pp.flowParseInterfaceExtends = function () { + var node = this.startNode(); + + node.id = this.parseIdent(); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + node.typeParameters = null; + } + + return this.finishNode(node, "InterfaceExtends"); +}; + +pp.flowParseInterface = function (node) { + this.flowParseInterfaceish(node, false); + return this.finishNode(node, "InterfaceDeclaration"); +}; + +// Type aliases + +pp.flowParseTypeAlias = function (node) { + node.id = this.parseIdent(); + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } else { + node.typeParameters = null; + } + + node.right = this.flowParseTypeInitialiser(_tokenizerTypes.types.eq); + this.semicolon(); + + return this.finishNode(node, "TypeAlias"); +}; + +// Type annotations + +pp.flowParseTypeParameterDeclaration = function () { + var node = this.startNode(); + node.params = []; + + this.expectRelational("<"); + while (!this.isRelational(">")) { + node.params.push(this.flowParseTypeAnnotatableIdentifier()); + if (!this.isRelational(">")) { + this.expect(_tokenizerTypes.types.comma); + } + } + this.expectRelational(">"); + + return this.finishNode(node, "TypeParameterDeclaration"); +}; + +pp.flowParseTypeParameterInstantiation = function () { + var node = this.startNode(), + oldInType = this.state.inType; + node.params = []; + + this.state.inType = true; + + this.expectRelational("<"); + while (!this.isRelational(">")) { + node.params.push(this.flowParseType()); + if (!this.isRelational(">")) { + this.expect(_tokenizerTypes.types.comma); + } + } + this.expectRelational(">"); + + this.state.inType = oldInType; + + return this.finishNode(node, "TypeParameterInstantiation"); +}; + +pp.flowParseObjectPropertyKey = function () { + return this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdent(true); +}; + +pp.flowParseObjectTypeIndexer = function (node, isStatic) { + node["static"] = isStatic; + + this.expect(_tokenizerTypes.types.bracketL); + node.id = this.flowParseObjectPropertyKey(); + node.key = this.flowParseTypeInitialiser(); + this.expect(_tokenizerTypes.types.bracketR); + node.value = this.flowParseTypeInitialiser(); + + this.flowObjectTypeSemicolon(); + return this.finishNode(node, "ObjectTypeIndexer"); +}; + +pp.flowParseObjectTypeMethodish = function (node) { + node.params = []; + node.rest = null; + node.typeParameters = null; + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + + this.expect(_tokenizerTypes.types.parenL); + while (this.match(_tokenizerTypes.types.name)) { + node.params.push(this.flowParseFunctionTypeParam()); + if (!this.match(_tokenizerTypes.types.parenR)) { + this.expect(_tokenizerTypes.types.comma); + } + } + + if (this.eat(_tokenizerTypes.types.ellipsis)) { + node.rest = this.flowParseFunctionTypeParam(); + } + this.expect(_tokenizerTypes.types.parenR); + node.returnType = this.flowParseTypeInitialiser(); + + return this.finishNode(node, "FunctionTypeAnnotation"); +}; + +pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { + var node = this.startNodeAt(startPos, startLoc); + node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc)); + node["static"] = isStatic; + node.key = key; + node.optional = false; + this.flowObjectTypeSemicolon(); + return this.finishNode(node, "ObjectTypeProperty"); +}; + +pp.flowParseObjectTypeCallProperty = function (node, isStatic) { + var valueNode = this.startNode(); + node["static"] = isStatic; + node.value = this.flowParseObjectTypeMethodish(valueNode); + this.flowObjectTypeSemicolon(); + return this.finishNode(node, "ObjectTypeCallProperty"); +}; + +pp.flowParseObjectType = function (allowStatic) { + var nodeStart = this.startNode(); + var node; + var propertyKey; + var isStatic; + + nodeStart.callProperties = []; + nodeStart.properties = []; + nodeStart.indexers = []; + + this.expect(_tokenizerTypes.types.braceL); + + while (!this.match(_tokenizerTypes.types.braceR)) { + var optional = false; + var startPos = this.state.start, + startLoc = this.state.startLoc; + node = this.startNode(); + if (allowStatic && this.isContextual("static")) { + this.next(); + isStatic = true; + } + + if (this.match(_tokenizerTypes.types.bracketL)) { + nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic)); + } else if (this.match(_tokenizerTypes.types.parenL) || this.isRelational("<")) { + nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, allowStatic)); + } else { + if (isStatic && this.match(_tokenizerTypes.types.colon)) { + propertyKey = this.parseIdent(); + } else { + propertyKey = this.flowParseObjectPropertyKey(); + } + if (this.isRelational("<") || this.match(_tokenizerTypes.types.parenL)) { + // This is a method property + nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); + } else { + if (this.eat(_tokenizerTypes.types.question)) { + optional = true; + } + node.key = propertyKey; + node.value = this.flowParseTypeInitialiser(); + node.optional = optional; + node["static"] = isStatic; + this.flowObjectTypeSemicolon(); + nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); + } + } + } + + this.expect(_tokenizerTypes.types.braceR); + + return this.finishNode(nodeStart, "ObjectTypeAnnotation"); +}; + +pp.flowObjectTypeSemicolon = function () { + if (!this.eat(_tokenizerTypes.types.semi) && !this.eat(_tokenizerTypes.types.comma) && !this.match(_tokenizerTypes.types.braceR)) { + this.unexpected(); + } +}; + +pp.flowParseGenericType = function (startPos, startLoc, id) { + var node = this.startNodeAt(startPos, startLoc); + + node.typeParameters = null; + node.id = id; + + while (this.eat(_tokenizerTypes.types.dot)) { + var node2 = this.startNodeAt(startPos, startLoc); + node2.qualification = node.id; + node2.id = this.parseIdent(); + node.id = this.finishNode(node2, "QualifiedTypeIdentifier"); + } + + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterInstantiation(); + } + + return this.finishNode(node, "GenericTypeAnnotation"); +}; + +pp.flowParseTypeofType = function () { + var node = this.startNode(); + this.expect(_tokenizerTypes.types._typeof); + node.argument = this.flowParsePrimaryType(); + return this.finishNode(node, "TypeofTypeAnnotation"); +}; + +pp.flowParseTupleType = function () { + var node = this.startNode(); + node.types = []; + this.expect(_tokenizerTypes.types.bracketL); + // We allow trailing commas + while (this.state.pos < this.input.length && !this.match(_tokenizerTypes.types.bracketR)) { + node.types.push(this.flowParseType()); + if (this.match(_tokenizerTypes.types.bracketR)) break; + this.expect(_tokenizerTypes.types.comma); + } + this.expect(_tokenizerTypes.types.bracketR); + return this.finishNode(node, "TupleTypeAnnotation"); +}; + +pp.flowParseFunctionTypeParam = function () { + var optional = false; + var node = this.startNode(); + node.name = this.parseIdent(); + if (this.eat(_tokenizerTypes.types.question)) { + optional = true; + } + node.optional = optional; + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "FunctionTypeParam"); +}; + +pp.flowParseFunctionTypeParams = function () { + var ret = { params: [], rest: null }; + while (this.match(_tokenizerTypes.types.name)) { + ret.params.push(this.flowParseFunctionTypeParam()); + if (!this.match(_tokenizerTypes.types.parenR)) { + this.expect(_tokenizerTypes.types.comma); + } + } + if (this.eat(_tokenizerTypes.types.ellipsis)) { + ret.rest = this.flowParseFunctionTypeParam(); + } + return ret; +}; + +pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) { + switch (id.name) { + case "any": + return this.finishNode(node, "AnyTypeAnnotation"); + + case "void": + return this.finishNode(node, "VoidTypeAnnotation"); + + case "bool": + case "boolean": + return this.finishNode(node, "BooleanTypeAnnotation"); + + case "mixed": + return this.finishNode(node, "MixedTypeAnnotation"); + + case "number": + return this.finishNode(node, "NumberTypeAnnotation"); + + case "string": + return this.finishNode(node, "StringTypeAnnotation"); + + default: + return this.flowParseGenericType(startPos, startLoc, id); + } +}; + +// The parsing of types roughly parallels the parsing of expressions, and +// primary types are kind of like primary expressions...they're the +// primitives with which other types are constructed. +pp.flowParsePrimaryType = function () { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var node = this.startNode(); + var tmp; + var type; + var isGroupedType = false; + + switch (this.state.type) { + case _tokenizerTypes.types.name: + return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdent()); + + case _tokenizerTypes.types.braceL: + return this.flowParseObjectType(); + + case _tokenizerTypes.types.bracketL: + return this.flowParseTupleType(); + + case _tokenizerTypes.types.relational: + if (this.state.value === "<") { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + this.expect(_tokenizerTypes.types.parenL); + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + this.expect(_tokenizerTypes.types.parenR); + + this.expect(_tokenizerTypes.types.arrow); + + node.returnType = this.flowParseType(); + + return this.finishNode(node, "FunctionTypeAnnotation"); + } + + case _tokenizerTypes.types.parenL: + this.next(); + + // Check to see if this is actually a grouped type + if (!this.match(_tokenizerTypes.types.parenR) && !this.match(_tokenizerTypes.types.ellipsis)) { + if (this.match(_tokenizerTypes.types.name)) { + var token = this.lookahead().type; + isGroupedType = token !== _tokenizerTypes.types.question && token !== _tokenizerTypes.types.colon; + } else { + isGroupedType = true; + } + } + + if (isGroupedType) { + type = this.flowParseType(); + this.expect(_tokenizerTypes.types.parenR); + + // If we see a => next then someone was probably confused about + // function types, so we can provide a better error message + if (this.eat(_tokenizerTypes.types.arrow)) { + this.raise(node, "Unexpected token =>. It looks like " + "you are trying to write a function type, but you ended up " + "writing a grouped type followed by an =>, which is a syntax " + "error. Remember, function type parameters are named so function " + "types look like (name1: type1, name2: type2) => returnType. You " + "probably wrote (type1) => returnType"); + } + + return type; + } + + tmp = this.flowParseFunctionTypeParams(); + node.params = tmp.params; + node.rest = tmp.rest; + + this.expect(_tokenizerTypes.types.parenR); + + this.expect(_tokenizerTypes.types.arrow); + + node.returnType = this.flowParseType(); + node.typeParameters = null; + + return this.finishNode(node, "FunctionTypeAnnotation"); + + case _tokenizerTypes.types.string: + node.rawValue = node.value = this.state.value; + node.raw = this.input.slice(this.state.start, this.state.end); + this.next(); + return this.finishNode(node, "StringLiteralTypeAnnotation"); + + case _tokenizerTypes.types._true:case _tokenizerTypes.types._false: + node.value = this.match(_tokenizerTypes.types._true); + this.next(); + return this.finishNode(node, "BooleanLiteralTypeAnnotation"); + + case _tokenizerTypes.types.num: + node.rawValue = node.value = this.state.value; + node.raw = this.input.slice(this.state.start, this.state.end); + this.next(); + return this.finishNode(node, "NumberLiteralTypeAnnotation"); + + case _tokenizerTypes.types._null: + node.value = this.match(_tokenizerTypes.types._null); + this.next(); + return this.finishNode(node, "NullLiteralTypeAnnotation"); + + case _tokenizerTypes.types._this: + node.value = this.match(_tokenizerTypes.types._this); + this.next(); + return this.finishNode(node, "ThisTypeAnnotation"); + + default: + if (this.state.type.keyword === "typeof") { + return this.flowParseTypeofType(); + } + } + + this.unexpected(); +}; + +pp.flowParsePostfixType = function () { + var node = this.startNode(); + var type = node.elementType = this.flowParsePrimaryType(); + if (this.match(_tokenizerTypes.types.bracketL)) { + this.expect(_tokenizerTypes.types.bracketL); + this.expect(_tokenizerTypes.types.bracketR); + return this.finishNode(node, "ArrayTypeAnnotation"); + } else { + return type; + } +}; + +pp.flowParsePrefixType = function () { + var node = this.startNode(); + if (this.eat(_tokenizerTypes.types.question)) { + node.typeAnnotation = this.flowParsePrefixType(); + return this.finishNode(node, "NullableTypeAnnotation"); + } else { + return this.flowParsePostfixType(); + } +}; + +pp.flowParseIntersectionType = function () { + var node = this.startNode(); + var type = this.flowParsePrefixType(); + node.types = [type]; + while (this.eat(_tokenizerTypes.types.bitwiseAND)) { + node.types.push(this.flowParsePrefixType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); +}; + +pp.flowParseUnionType = function () { + var node = this.startNode(); + var type = this.flowParseIntersectionType(); + node.types = [type]; + while (this.eat(_tokenizerTypes.types.bitwiseOR)) { + node.types.push(this.flowParseIntersectionType()); + } + return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); +}; + +pp.flowParseType = function () { + var oldInType = this.state.inType; + this.state.inType = true; + var type = this.flowParseUnionType(); + this.state.inType = oldInType; + return type; +}; + +pp.flowParseTypeAnnotation = function () { + var node = this.startNode(); + node.typeAnnotation = this.flowParseTypeInitialiser(); + return this.finishNode(node, "TypeAnnotation"); +}; + +pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOptionalParam) { + var ident = this.parseIdent(); + var isOptionalParam = false; + + if (canBeOptionalParam && this.eat(_tokenizerTypes.types.question)) { + this.expect(_tokenizerTypes.types.question); + isOptionalParam = true; + } + + if (requireTypeAnnotation || this.match(_tokenizerTypes.types.colon)) { + ident.typeAnnotation = this.flowParseTypeAnnotation(); + this.finishNode(ident, ident.type); + } + + if (isOptionalParam) { + ident.optional = true; + this.finishNode(ident, ident.type); + } + + return ident; +}; + +exports["default"] = function (instance) { + // function name(): string {} + instance.extend("parseFunctionBody", function (inner) { + return function (node, allowExpression) { + if (this.match(_tokenizerTypes.types.colon) && !allowExpression) { + // if allowExpression is true then we're parsing an arrow function and if + // there's a return type then it's been handled elsewhere + node.returnType = this.flowParseTypeAnnotation(); + } + + return inner.call(this, node, allowExpression); + }; + }); + + instance.extend("parseStatement", function (inner) { + return function (declaration, topLevel) { + // strict mode handling of `interface` since it's a reserved word + if (this.strict && this.match(_tokenizerTypes.types.name) && this.state.value === "interface") { + var node = this.startNode(); + this.next(); + return this.flowParseInterface(node); + } else { + return inner.call(this, declaration, topLevel); + } + }; + }); + + instance.extend("parseExpressionStatement", function (inner) { + return function (node, expr) { + if (expr.type === "Identifier") { + if (expr.name === "declare") { + if (this.match(_tokenizerTypes.types._class) || this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types._function) || this.match(_tokenizerTypes.types._var)) { + return this.flowParseDeclare(node); + } + } else if (this.match(_tokenizerTypes.types.name)) { + if (expr.name === "interface") { + return this.flowParseInterface(node); + } else if (expr.name === "type") { + return this.flowParseTypeAlias(node); + } + } + } + + return inner.call(this, node, expr); + }; + }); + + instance.extend("shouldParseExportDeclaration", function (inner) { + return function () { + return this.isContextual("type") || this.isContextual("interface") || inner.call(this); + }; + }); + + instance.extend("parseParenItem", function () { + return function (node, startLoc, startPos, forceArrow) { + if (this.match(_tokenizerTypes.types.colon)) { + var typeCastNode = this.startNodeAt(startLoc, startPos); + typeCastNode.expression = node; + typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); + + if (forceArrow && !this.match(_tokenizerTypes.types.arrow)) { + this.unexpected(); + } + + if (this.eat(_tokenizerTypes.types.arrow)) { + // ((lol): number => {}); + var func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]); + func.returnType = typeCastNode.typeAnnotation; + return func; + } else { + return this.finishNode(typeCastNode, "TypeCastExpression"); + } + } else { + return node; + } + }; + }); + + instance.extend("parseExport", function (inner) { + return function (node) { + node = inner.call(this, node); + if (node.type === "ExportNamedDeclaration") { + node.exportKind = node.exportKind || "value"; + } + return node; + }; + }); + + instance.extend("parseExportDeclaration", function (inner) { + return function (node) { + if (this.isContextual("type")) { + node.exportKind = "type"; + + var declarationNode = this.startNode(); + this.next(); + + if (this.match(_tokenizerTypes.types.braceL)) { + // export type { foo, bar }; + node.specifiers = this.parseExportSpecifiers(); + this.parseExportFrom(node); + return null; + } else { + // export type Foo = Bar; + return this.flowParseTypeAlias(declarationNode); + } + } else if (this.isContextual("interface")) { + node.exportKind = "type"; + var _declarationNode = this.startNode(); + this.next(); + return this.flowParseInterface(_declarationNode); + } else { + return inner.call(this, node); + } + }; + }); + + instance.extend("parseClassId", function (inner) { + return function (node, isStatement) { + inner.call(this, node, isStatement); + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + }; + }); + + // don't consider `void` to be a keyword as then it'll use the void token type + // and set startExpr + instance.extend("isKeyword", function (inner) { + return function (name) { + if (this.state.inType && name === "void") { + return false; + } else { + return inner.call(this, name); + } + }; + }); + + instance.extend("readToken", function (inner) { + return function (code) { + if (this.state.inType && (code === 62 || code === 60)) { + return this.finishOp(_tokenizerTypes.types.relational, 1); + } else { + return inner.call(this, code); + } + }; + }); + + instance.extend("jsx_readToken", function (inner) { + return function () { + if (!this.state.inType) return inner.call(this); + }; + }); + + function typeCastToParameter(node) { + node.expression.typeAnnotation = node.typeAnnotation; + return node.expression; + } + + instance.extend("toAssignableList", function (inner) { + return function (exprList, isBinding) { + for (var i = 0; i < exprList.length; i++) { + var expr = exprList[i]; + if (expr && expr.type === "TypeCastExpression") { + exprList[i] = typeCastToParameter(expr); + } + } + return inner.call(this, exprList, isBinding); + }; + }); + + instance.extend("toReferencedList", function () { + return function (exprList) { + for (var i = 0; i < exprList.length; i++) { + var expr = exprList[i]; + if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { + this.raise(expr.start, "Unexpected type cast"); + } + } + + return exprList; + }; + }); + + instance.extend("parseExprListItem", function (inner) { + return function (allowEmpty, refShorthandDefaultPos) { + var container = this.startNode(); + var node = inner.call(this, allowEmpty, refShorthandDefaultPos); + if (this.match(_tokenizerTypes.types.colon)) { + container._exprListItem = true; + container.expression = node; + container.typeAnnotation = this.flowParseTypeAnnotation(); + return this.finishNode(container, "TypeCastExpression"); + } else { + return node; + } + }; + }); + + instance.extend("parseClassProperty", function (inner) { + return function (node) { + if (this.match(_tokenizerTypes.types.colon)) { + node.typeAnnotation = this.flowParseTypeAnnotation(); + } + return inner.call(this, node); + }; + }); + + instance.extend("isClassProperty", function (inner) { + return function () { + return this.match(_tokenizerTypes.types.colon) || inner.call(this); + }; + }); + + instance.extend("parseClassMethod", function () { + return function (classBody, method, isGenerator, isAsync) { + var typeParameters; + if (this.isRelational("<")) { + typeParameters = this.flowParseTypeParameterDeclaration(); + } + method.value = this.parseMethod(isGenerator, isAsync); + method.value.typeParameters = typeParameters; + classBody.body.push(this.finishNode(method, "MethodDefinition")); + }; + }); + + instance.extend("parseClassSuper", function (inner) { + return function (node, isStatement) { + inner.call(this, node, isStatement); + if (node.superClass && this.isRelational("<")) { + node.superTypeParameters = this.flowParseTypeParameterInstantiation(); + } + if (this.isContextual("implements")) { + this.next(); + var implemented = node["implements"] = []; + do { + var _node = this.startNode(); + _node.id = this.parseIdent(); + if (this.isRelational("<")) { + _node.typeParameters = this.flowParseTypeParameterInstantiation(); + } else { + _node.typeParameters = null; + } + implemented.push(this.finishNode(_node, "ClassImplements")); + } while (this.eat(_tokenizerTypes.types.comma)); + } + }; + }); + + instance.extend("parseObjPropValue", function (inner) { + return function (prop) { + var typeParameters; + + // method shorthand + if (this.isRelational("<")) { + typeParameters = this.flowParseTypeParameterDeclaration(); + if (!this.match(_tokenizerTypes.types.parenL)) this.unexpected(); + } + + inner.apply(this, arguments); + + // add typeParameters if we found them + if (typeParameters) { + prop.value.typeParameters = typeParameters; + } + }; + }); + + instance.extend("parseAssignableListItemTypes", function () { + return function (param) { + if (this.eat(_tokenizerTypes.types.question)) { + param.optional = true; + } + if (this.match(_tokenizerTypes.types.colon)) { + param.typeAnnotation = this.flowParseTypeAnnotation(); + } + this.finishNode(param, param.type); + return param; + }; + }); + + instance.extend("parseImportSpecifiers", function (inner) { + return function (node) { + node.importKind = "value"; + + var kind = this.match(_tokenizerTypes.types._typeof) ? "typeof" : this.isContextual("type") ? "type" : null; + if (kind) { + var lh = this.lookahead(); + if (lh.type === _tokenizerTypes.types.name && lh.value !== "from" || lh.type === _tokenizerTypes.types.braceL || lh.type === _tokenizerTypes.types.star) { + this.next(); + node.importKind = kind; + } + } + + inner.call(this, node); + }; + }); + + // function foo() {} + instance.extend("parseFunctionParams", function (inner) { + return function (node) { + if (this.isRelational("<")) { + node.typeParameters = this.flowParseTypeParameterDeclaration(); + } + inner.call(this, node); + }; + }); + + // var foo: string = bar + instance.extend("parseVarHead", function (inner) { + return function (decl) { + inner.call(this, decl); + if (this.match(_tokenizerTypes.types.colon)) { + decl.id.typeAnnotation = this.flowParseTypeAnnotation(); + this.finishNode(decl.id, decl.id.type); + } + }; + }); + + // var foo = (async (): number => {}); + instance.extend("parseAsyncArrowFromCallExpression", function (inner) { + return function (node, call) { + if (this.match(_tokenizerTypes.types.colon)) { + node.returnType = this.flowParseTypeAnnotation(); + } + + return inner.call(this, node, call); + }; + }); + + instance.extend("parseParenAndDistinguishExpression", function (inner) { + return function (startPos, startLoc, canBeArrow, isAsync) { + startPos = startPos || this.state.start; + startLoc = startLoc || this.state.startLoc; + + if (this.lookahead().type === _tokenizerTypes.types.parenR) { + // var foo = (): number => {}; + this.expect(_tokenizerTypes.types.parenL); + this.expect(_tokenizerTypes.types.parenR); + + var node = this.startNodeAt(startPos, startLoc); + if (this.match(_tokenizerTypes.types.colon)) node.returnType = this.flowParseTypeAnnotation(); + this.expect(_tokenizerTypes.types.arrow); + return this.parseArrowExpression(node, [], isAsync); + } else { + // var foo = (foo): number => {}; + var node = inner.call(this, startPos, startLoc, canBeArrow, isAsync); + + if (this.match(_tokenizerTypes.types.colon)) { + var state = this.state.clone(); + try { + return this.parseParenItem(node, startPos, startLoc, true); + } catch (err) { + if (err instanceof SyntaxError) { + this.state = state; + return node; + } else { + throw err; + } + } + } else { + return node; + } + } + }; + }); +}; + +module.exports = exports["default"]; +},{"616":616,"628":628}],623:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _xhtml = _dereq_(624); + +var _xhtml2 = _interopRequireDefault(_xhtml); + +var _tokenizerTypes = _dereq_(628); + +var _tokenizerContext = _dereq_(625); + +var _parser = _dereq_(616); + +var _parser2 = _interopRequireDefault(_parser); + +var _utilIdentifier = _dereq_(629); + +var _utilWhitespace = _dereq_(631); + +var HEX_NUMBER = /^[\da-fA-F]+$/; +var DECIMAL_NUMBER = /^\d+$/; + +_tokenizerContext.types.j_oTag = new _tokenizerContext.TokContext("...", true, true); + +_tokenizerTypes.types.jsxName = new _tokenizerTypes.TokenType("jsxName"); +_tokenizerTypes.types.jsxText = new _tokenizerTypes.TokenType("jsxText", { beforeExpr: true }); +_tokenizerTypes.types.jsxTagStart = new _tokenizerTypes.TokenType("jsxTagStart"); +_tokenizerTypes.types.jsxTagEnd = new _tokenizerTypes.TokenType("jsxTagEnd"); + +_tokenizerTypes.types.jsxTagStart.updateContext = function () { + this.state.context.push(_tokenizerContext.types.j_expr); // treat as beginning of JSX expression + this.state.context.push(_tokenizerContext.types.j_oTag); // start opening tag context + this.state.exprAllowed = false; +}; + +_tokenizerTypes.types.jsxTagEnd.updateContext = function (prevType) { + var out = this.state.context.pop(); + if (out === _tokenizerContext.types.j_oTag && prevType === _tokenizerTypes.types.slash || out === _tokenizerContext.types.j_cTag) { + this.state.context.pop(); + this.state.exprAllowed = this.curContext() === _tokenizerContext.types.j_expr; + } else { + this.state.exprAllowed = true; + } +}; + +var pp = _parser2["default"].prototype; + +// Reads inline JSX contents token. + +pp.jsxReadToken = function () { + var out = "", + chunkStart = this.state.pos; + for (;;) { + if (this.state.pos >= this.input.length) { + this.raise(this.state.start, "Unterminated JSX contents"); + } + + var ch = this.input.charCodeAt(this.state.pos); + + switch (ch) { + case 60: // "<" + case 123: + // "{" + if (this.state.pos === this.state.start) { + if (ch === 60 && this.state.exprAllowed) { + ++this.state.pos; + return this.finishToken(_tokenizerTypes.types.jsxTagStart); + } + return this.getTokenFromCode(ch); + } + out += this.input.slice(chunkStart, this.state.pos); + return this.finishToken(_tokenizerTypes.types.jsxText, out); + + case 38: + // "&" + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + break; + + default: + if (_utilWhitespace.isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(true); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + } +}; + +pp.jsxReadNewLine = function (normalizeCRLF) { + var ch = this.input.charCodeAt(this.state.pos); + var out; + ++this.state.pos; + if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { + ++this.state.pos; + out = normalizeCRLF ? "\n" : "\r\n"; + } else { + out = String.fromCharCode(ch); + } + ++this.state.curLine; + this.state.lineStart = this.state.pos; + + return out; +}; + +pp.jsxReadString = function (quote) { + var out = "", + chunkStart = ++this.state.pos; + for (;;) { + if (this.state.pos >= this.input.length) { + this.raise(this.state.start, "Unterminated string constant"); + } + + var ch = this.input.charCodeAt(this.state.pos); + if (ch === quote) break; + if (ch === 38) { + // "&" + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadEntity(); + chunkStart = this.state.pos; + } else if (_utilWhitespace.isNewLine(ch)) { + out += this.input.slice(chunkStart, this.state.pos); + out += this.jsxReadNewLine(false); + chunkStart = this.state.pos; + } else { + ++this.state.pos; + } + } + out += this.input.slice(chunkStart, this.state.pos++); + return this.finishToken(_tokenizerTypes.types.string, out); +}; + +pp.jsxReadEntity = function () { + var str = "", + count = 0, + entity; + var ch = this.input[this.state.pos]; + + var startPos = ++this.state.pos; + while (this.state.pos < this.input.length && count++ < 10) { + ch = this.input[this.state.pos++]; + if (ch === ";") { + if (str[0] === "#") { + if (str[1] === "x") { + str = str.substr(2); + if (HEX_NUMBER.test(str)) entity = String.fromCharCode(parseInt(str, 16)); + } else { + str = str.substr(1); + if (DECIMAL_NUMBER.test(str)) entity = String.fromCharCode(parseInt(str, 10)); + } + } else { + entity = _xhtml2["default"][str]; + } + break; + } + str += ch; + } + if (!entity) { + this.state.pos = startPos; + return "&"; + } + return entity; +}; + +// Read a JSX identifier (valid tag or attribute name). +// +// Optimized version since JSX identifiers can"t contain +// escape characters and so can be read as single slice. +// Also assumes that first character was already checked +// by isIdentifierStart in readToken. + +pp.jsxReadWord = function () { + var ch, + start = this.state.pos; + do { + ch = this.input.charCodeAt(++this.state.pos); + } while (_utilIdentifier.isIdentifierChar(ch) || ch === 45); // "-" + return this.finishToken(_tokenizerTypes.types.jsxName, this.input.slice(start, this.state.pos)); +}; + +// Transforms JSX element name to string. + +function getQualifiedJSXName(object) { + if (object.type === "JSXIdentifier") { + return object.name; + } + + if (object.type === "JSXNamespacedName") { + return object.namespace.name + ":" + object.name.name; + } + + if (object.type === "JSXMemberExpression") { + return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); + } +} + +// Parse next token as JSX identifier + +pp.jsxParseIdentifier = function () { + var node = this.startNode(); + if (this.match(_tokenizerTypes.types.jsxName)) { + node.name = this.state.value; + } else if (this.state.type.keyword) { + node.name = this.state.type.keyword; + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "JSXIdentifier"); +}; + +// Parse namespaced identifier. + +pp.jsxParseNamespacedName = function () { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var name = this.jsxParseIdentifier(); + if (!this.eat(_tokenizerTypes.types.colon)) return name; + + var node = this.startNodeAt(startPos, startLoc); + node.namespace = name; + node.name = this.jsxParseIdentifier(); + return this.finishNode(node, "JSXNamespacedName"); +}; + +// Parses element name in any form - namespaced, member +// or single identifier. + +pp.jsxParseElementName = function () { + var startPos = this.state.start, + startLoc = this.state.startLoc; + var node = this.jsxParseNamespacedName(); + while (this.eat(_tokenizerTypes.types.dot)) { + var newNode = this.startNodeAt(startPos, startLoc); + newNode.object = node; + newNode.property = this.jsxParseIdentifier(); + node = this.finishNode(newNode, "JSXMemberExpression"); + } + return node; +}; + +// Parses any type of JSX attribute value. + +pp.jsxParseAttributeValue = function () { + var node; + switch (this.state.type) { + case _tokenizerTypes.types.braceL: + node = this.jsxParseExpressionContainer(); + if (node.expression.type === "JSXEmptyExpression") { + this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); + } else { + return node; + } + + case _tokenizerTypes.types.jsxTagStart: + case _tokenizerTypes.types.string: + node = this.parseExprAtom(); + node.rawValue = null; + return node; + + default: + this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); + } +}; + +// JSXEmptyExpression is unique type since it doesn"t actually parse anything, +// and so it should start at the end of last read token (left brace) and finish +// at the beginning of the next one (right brace). + +pp.jsxParseEmptyExpression = function () { + var tmp = this.state.start; + this.state.start = this.state.lastTokEnd; + this.state.lastTokEnd = tmp; + + tmp = this.state.startLoc; + this.state.startLoc = this.state.lastTokEndLoc; + this.state.lastTokEndLoc = tmp; + + return this.finishNode(this.startNode(), "JSXEmptyExpression"); +}; + +// Parses JSX expression enclosed into curly brackets. + +pp.jsxParseExpressionContainer = function () { + var node = this.startNode(); + this.next(); + if (this.match(_tokenizerTypes.types.braceR)) { + node.expression = this.jsxParseEmptyExpression(); + } else { + node.expression = this.parseExpression(); + } + this.expect(_tokenizerTypes.types.braceR); + return this.finishNode(node, "JSXExpressionContainer"); +}; + +// Parses following JSX attribute name-value pair. + +pp.jsxParseAttribute = function () { + var node = this.startNode(); + if (this.eat(_tokenizerTypes.types.braceL)) { + this.expect(_tokenizerTypes.types.ellipsis); + node.argument = this.parseMaybeAssign(); + this.expect(_tokenizerTypes.types.braceR); + return this.finishNode(node, "JSXSpreadAttribute"); + } + node.name = this.jsxParseNamespacedName(); + node.value = this.eat(_tokenizerTypes.types.eq) ? this.jsxParseAttributeValue() : null; + return this.finishNode(node, "JSXAttribute"); +}; + +// Parses JSX opening tag starting after "<". + +pp.jsxParseOpeningElementAt = function (startPos, startLoc) { + var node = this.startNodeAt(startPos, startLoc); + node.attributes = []; + node.name = this.jsxParseElementName(); + while (!this.match(_tokenizerTypes.types.slash) && !this.match(_tokenizerTypes.types.jsxTagEnd)) { + node.attributes.push(this.jsxParseAttribute()); + } + node.selfClosing = this.eat(_tokenizerTypes.types.slash); + this.expect(_tokenizerTypes.types.jsxTagEnd); + return this.finishNode(node, "JSXOpeningElement"); +}; + +// Parses JSX closing tag starting after ""); + } + } + + node.openingElement = openingElement; + node.closingElement = closingElement; + node.children = children; + if (this.match(_tokenizerTypes.types.relational) && this.state.value === "<") { + this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); + } + return this.finishNode(node, "JSXElement"); +}; + +// Parses entire JSX element from current position. + +pp.jsxParseElement = function () { + var startPos = this.state.start, + startLoc = this.state.startLoc; + this.next(); + return this.jsxParseElementAt(startPos, startLoc); +}; + +exports["default"] = function (instance) { + instance.extend("parseExprAtom", function (inner) { + return function (refShortHandDefaultPos) { + if (this.match(_tokenizerTypes.types.jsxText)) { + var node = this.parseLiteral(this.state.value); + // https://github.com/babel/babel/issues/2078 + node.rawValue = null; + return node; + } else if (this.match(_tokenizerTypes.types.jsxTagStart)) { + return this.jsxParseElement(); + } else { + return inner.call(this, refShortHandDefaultPos); + } + }; + }); + + instance.extend("readToken", function (inner) { + return function (code) { + var context = this.curContext(); + + if (context === _tokenizerContext.types.j_expr) { + return this.jsxReadToken(); + } + + if (context === _tokenizerContext.types.j_oTag || context === _tokenizerContext.types.j_cTag) { + if (_utilIdentifier.isIdentifierStart(code)) { + return this.jsxReadWord(); + } + + if (code === 62) { + ++this.state.pos; + return this.finishToken(_tokenizerTypes.types.jsxTagEnd); + } + + if ((code === 34 || code === 39) && context === _tokenizerContext.types.j_oTag) { + return this.jsxReadString(code); + } + } + + if (code === 60 && this.state.exprAllowed) { + ++this.state.pos; + return this.finishToken(_tokenizerTypes.types.jsxTagStart); + } + + return inner.call(this, code); + }; + }); + + instance.extend("updateContext", function (inner) { + return function (prevType) { + if (this.match(_tokenizerTypes.types.braceL)) { + var curContext = this.curContext(); + if (curContext === _tokenizerContext.types.j_oTag) { + this.state.context.push(_tokenizerContext.types.b_expr); + } else if (curContext === _tokenizerContext.types.j_expr) { + this.state.context.push(_tokenizerContext.types.b_tmpl); + } else { + inner.call(this, prevType); + } + this.state.exprAllowed = true; + } else if (this.match(_tokenizerTypes.types.slash) && prevType === _tokenizerTypes.types.jsxTagStart) { + this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore + this.state.context.push(_tokenizerContext.types.j_cTag); // reconsider as closing tag context + this.state.exprAllowed = false; + } else { + return inner.call(this, prevType); + } + }; + }); +}; + +module.exports = exports["default"]; +},{"616":616,"624":624,"625":625,"628":628,"629":629,"631":631}],624:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +exports["default"] = { + quot: "\"", + amp: "&", + apos: "'", + lt: "<", + gt: ">", + nbsp: " ", + iexcl: "¡", + cent: "¢", + pound: "£", + curren: "¤", + yen: "¥", + brvbar: "¦", + sect: "§", + uml: "¨", + copy: "©", + ordf: "ª", + laquo: "«", + not: "¬", + shy: "­", + reg: "®", + macr: "¯", + deg: "°", + plusmn: "±", + sup2: "²", + sup3: "³", + acute: "´", + micro: "µ", + para: "¶", + middot: "·", + cedil: "¸", + sup1: "¹", + ordm: "º", + raquo: "»", + frac14: "¼", + frac12: "½", + frac34: "¾", + iquest: "¿", + Agrave: "À", + Aacute: "Á", + Acirc: "Â", + Atilde: "Ã", + Auml: "Ä", + Aring: "Å", + AElig: "Æ", + Ccedil: "Ç", + Egrave: "È", + Eacute: "É", + Ecirc: "Ê", + Euml: "Ë", + Igrave: "Ì", + Iacute: "Í", + Icirc: "Î", + Iuml: "Ï", + ETH: "Ð", + Ntilde: "Ñ", + Ograve: "Ò", + Oacute: "Ó", + Ocirc: "Ô", + Otilde: "Õ", + Ouml: "Ö", + times: "×", + Oslash: "Ø", + Ugrave: "Ù", + Uacute: "Ú", + Ucirc: "Û", + Uuml: "Ü", + Yacute: "Ý", + THORN: "Þ", + szlig: "ß", + agrave: "à", + aacute: "á", + acirc: "â", + atilde: "ã", + auml: "ä", + aring: "å", + aelig: "æ", + ccedil: "ç", + egrave: "è", + eacute: "é", + ecirc: "ê", + euml: "ë", + igrave: "ì", + iacute: "í", + icirc: "î", + iuml: "ï", + eth: "ð", + ntilde: "ñ", + ograve: "ò", + oacute: "ó", + ocirc: "ô", + otilde: "õ", + ouml: "ö", + divide: "÷", + oslash: "ø", + ugrave: "ù", + uacute: "ú", + ucirc: "û", + uuml: "ü", + yacute: "ý", + thorn: "þ", + yuml: "ÿ", + OElig: "Œ", + oelig: "œ", + Scaron: "Š", + scaron: "š", + Yuml: "Ÿ", + fnof: "ƒ", + circ: "ˆ", + tilde: "˜", + Alpha: "Α", + Beta: "Β", + Gamma: "Γ", + Delta: "Δ", + Epsilon: "Ε", + Zeta: "Ζ", + Eta: "Η", + Theta: "Θ", + Iota: "Ι", + Kappa: "Κ", + Lambda: "Λ", + Mu: "Μ", + Nu: "Ν", + Xi: "Ξ", + Omicron: "Ο", + Pi: "Π", + Rho: "Ρ", + Sigma: "Σ", + Tau: "Τ", + Upsilon: "Υ", + Phi: "Φ", + Chi: "Χ", + Psi: "Ψ", + Omega: "Ω", + alpha: "α", + beta: "β", + gamma: "γ", + delta: "δ", + epsilon: "ε", + zeta: "ζ", + eta: "η", + theta: "θ", + iota: "ι", + kappa: "κ", + lambda: "λ", + mu: "μ", + nu: "ν", + xi: "ξ", + omicron: "ο", + pi: "π", + rho: "ρ", + sigmaf: "ς", + sigma: "σ", + tau: "τ", + upsilon: "υ", + phi: "φ", + chi: "χ", + psi: "ψ", + omega: "ω", + thetasym: "ϑ", + upsih: "ϒ", + piv: "ϖ", + ensp: " ", + emsp: " ", + thinsp: " ", + zwnj: "‌", + zwj: "‍", + lrm: "‎", + rlm: "‏", + ndash: "–", + mdash: "—", + lsquo: "‘", + rsquo: "’", + sbquo: "‚", + ldquo: "“", + rdquo: "”", + bdquo: "„", + dagger: "†", + Dagger: "‡", + bull: "•", + hellip: "…", + permil: "‰", + prime: "′", + Prime: "″", + lsaquo: "‹", + rsaquo: "›", + oline: "‾", + frasl: "⁄", + euro: "€", + image: "ℑ", + weierp: "℘", + real: "ℜ", + trade: "™", + alefsym: "ℵ", + larr: "←", + uarr: "↑", + rarr: "→", + darr: "↓", + harr: "↔", + crarr: "↵", + lArr: "⇐", + uArr: "⇑", + rArr: "⇒", + dArr: "⇓", + hArr: "⇔", + forall: "∀", + part: "∂", + exist: "∃", + empty: "∅", + nabla: "∇", + isin: "∈", + notin: "∉", + ni: "∋", + prod: "∏", + sum: "∑", + minus: "−", + lowast: "∗", + radic: "√", + prop: "∝", + infin: "∞", + ang: "∠", + and: "∧", + or: "∨", + cap: "∩", + cup: "∪", + "int": "∫", + there4: "∴", + sim: "∼", + cong: "≅", + asymp: "≈", + ne: "≠", + equiv: "≡", + le: "≤", + ge: "≥", + sub: "⊂", + sup: "⊃", + nsub: "⊄", + sube: "⊆", + supe: "⊇", + oplus: "⊕", + otimes: "⊗", + perp: "⊥", + sdot: "⋅", + lceil: "⌈", + rceil: "⌉", + lfloor: "⌊", + rfloor: "⌋", + lang: "〈", + rang: "〉", + loz: "◊", + spades: "♠", + clubs: "♣", + hearts: "♥", + diams: "♦" +}; +module.exports = exports["default"]; +},{}],625:[function(_dereq_,module,exports){ +// The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design + +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _types = _dereq_(628); + +var TokContext = function TokContext(token, isExpr, preserveSpace, override) { + _classCallCheck(this, TokContext); + + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; +}; + +exports.TokContext = TokContext; +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", true), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { + return p.readTmplToken(); + }), + f_expr: new TokContext("function", true) +}; + +exports.types = types; +// Token-specific context update code + +_types.types.parenR.updateContext = _types.types.braceR.updateContext = function () { + if (this.state.context.length === 1) { + this.state.exprAllowed = true; + return; + } + + var out = this.state.context.pop(); + if (out === types.b_stat && this.curContext() === types.f_expr) { + this.state.context.pop(); + this.state.exprAllowed = false; + } else if (out === types.b_tmpl) { + this.state.exprAllowed = true; + } else { + this.state.exprAllowed = !out.isExpr; + } +}; + +_types.types.braceL.updateContext = function (prevType) { + this.state.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.state.exprAllowed = true; +}; + +_types.types.dollarBraceL.updateContext = function () { + this.state.context.push(types.b_tmpl); + this.state.exprAllowed = true; +}; + +_types.types.parenL.updateContext = function (prevType) { + var statementParens = prevType === _types.types._if || prevType === _types.types._for || prevType === _types.types._with || prevType === _types.types._while; + this.state.context.push(statementParens ? types.p_stat : types.p_expr); + this.state.exprAllowed = true; +}; + +_types.types.incDec.updateContext = function () { + // tokExprAllowed stays unchanged +}; + +_types.types._function.updateContext = function () { + if (this.curContext() !== types.b_stat) { + this.state.context.push(types.f_expr); + } + + this.state.exprAllowed = false; +}; + +_types.types.backQuote.updateContext = function () { + if (this.curContext() === types.q_tmpl) { + this.state.context.pop(); + } else { + this.state.context.push(types.q_tmpl); + } + this.state.exprAllowed = false; +}; +},{"628":628}],626:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +// istanbul ignore next + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +// istanbul ignore next + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _utilIdentifier = _dereq_(629); + +var _types = _dereq_(628); + +var _context = _dereq_(625); + +var _utilLocation = _dereq_(630); + +var _utilWhitespace = _dereq_(631); + +var _state = _dereq_(627); + +var _state2 = _interopRequireDefault(_state); + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(state) { + _classCallCheck(this, Token); + + this.type = state.type; + this.value = state.value; + this.start = state.start; + this.end = state.end; + this.loc = new _utilLocation.SourceLocation(state.startLoc, state.endLoc); +} + +// ## Tokenizer + +// Are we running under Rhino? +/* global Packages */ +; + +exports.Token = Token; +var isRhino = typeof Packages === "object" && Object.prototype.toString.call(Packages) === "[object JavaPackage]"; + +// Parse a regular expression. Some context-awareness is necessary, +// since a '/' inside a '[]' set does not end the expression. + +function tryCreateRegexp(src, flags, throwErrorStart) { + try { + return new RegExp(src, flags); + } catch (e) { + if (throwErrorStart !== undefined) { + if (e instanceof SyntaxError) this.raise(throwErrorStart, "Error parsing regular expression: " + e.message); + this.raise(e); + } + } +} + +var regexpUnicodeSupport = !!tryCreateRegexp("￿", "u"); + +function codePointToString(code) { + // UTF-16 Decoding + if (code <= 0xFFFF) return String.fromCharCode(code); + return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00); +} + +var Tokenizer = (function () { + function Tokenizer(input) { + _classCallCheck(this, Tokenizer); + + this.state = new _state2["default"](); + this.state.init(input); + } + + // Move to the next token + + Tokenizer.prototype.next = function next() { + this.state.tokens.push(new Token(this.state)); + + this.state.lastTokEnd = this.state.end; + this.state.lastTokStart = this.state.start; + this.state.lastTokEndLoc = this.state.endLoc; + this.state.lastTokStartLoc = this.state.startLoc; + this.nextToken(); + }; + + // TODO + + Tokenizer.prototype.eat = function eat(type) { + if (this.match(type)) { + this.next(); + return true; + } else { + return false; + } + }; + + // TODO + + Tokenizer.prototype.match = function match(type) { + return this.state.type === type; + }; + + // TODO + + Tokenizer.prototype.lookahead = function lookahead() { + var old = this.state; + this.state = old.clone(); + this.next(); + var curr = this.state.clone(); + this.state = old; + return curr; + }; + + // Toggle strict mode. Re-reads the next number or string to please + // pedantic tests (`"use strict"; 010;` should fail). + + Tokenizer.prototype.setStrict = function setStrict(strict) { + this.strict = strict; + if (!this.match(_types.types.num) && !this.match(_types.types.string)) return; + this.state.pos = this.state.start; + while (this.state.pos < this.state.lineStart) { + this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; + --this.state.curLine; + } + this.nextToken(); + }; + + Tokenizer.prototype.curContext = function curContext() { + return this.state.context[this.state.context.length - 1]; + }; + + // Read a single token, updating the parser object's token-related + // properties. + + Tokenizer.prototype.nextToken = function nextToken() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) this.skipSpace(); + + this.state.start = this.state.pos; + this.state.startLoc = this.state.curPosition(); + if (this.state.pos >= this.input.length) return this.finishToken(_types.types.eof); + + if (curContext.override) { + return curContext.override(this); + } else { + return this.readToken(this.fullCharCodeAtPos()); + } + }; + + Tokenizer.prototype.readToken = function readToken(code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (_utilIdentifier.isIdentifierStart(code, true) || code === 92 /* '\' */) return this.readWord(); + + return this.getTokenFromCode(code); + }; + + Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() { + var code = this.input.charCodeAt(this.state.pos); + if (code <= 0xd7ff || code >= 0xe000) return code; + + var next = this.input.charCodeAt(this.state.pos + 1); + return (code << 10) + next - 0x35fdc00; + }; + + Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "CommentBlock" : "CommentLine", + value: text, + start: start, + end: end, + loc: new _utilLocation.SourceLocation(startLoc, endLoc), + range: [start, end] + }; + + this.state.tokens.push(comment); + this.state.comments.push(comment); + this.addComment(comment); + }; + + Tokenizer.prototype.skipBlockComment = function skipBlockComment() { + var startLoc = this.state.curPosition(); + var start = this.state.pos, + end = this.input.indexOf("*/", this.state.pos += 2); + if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + + this.state.pos = end + 2; + _utilWhitespace.lineBreakG.lastIndex = start; + var match = undefined; + while ((match = _utilWhitespace.lineBreakG.exec(this.input)) && match.index < this.state.pos) { + ++this.state.curLine; + this.state.lineStart = match.index + match[0].length; + } + + this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); + }; + + Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) { + var start = this.state.pos; + var startLoc = this.state.curPosition(); + var ch = this.input.charCodeAt(this.state.pos += startSkip); + while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { + ++this.state.pos; + ch = this.input.charCodeAt(this.state.pos); + } + + this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); + }; + + // Called at the start of the parse and after every token. Skips + // whitespace and comments, and. + + Tokenizer.prototype.skipSpace = function skipSpace() { + loop: while (this.state.pos < this.input.length) { + var ch = this.input.charCodeAt(this.state.pos); + switch (ch) { + case 32:case 160: + // ' ' + ++this.state.pos; + break; + + case 13: + if (this.input.charCodeAt(this.state.pos + 1) === 10) { + ++this.state.pos; + } + + case 10:case 8232:case 8233: + ++this.state.pos; + ++this.state.curLine; + this.state.lineStart = this.state.pos; + break; + + case 47: + // '/' + switch (this.input.charCodeAt(this.state.pos + 1)) { + case 42: + // '*' + this.skipBlockComment(); + break; + + case 47: + this.skipLineComment(2); + break; + + default: + break loop; + } + break; + + default: + if (ch > 8 && ch < 14 || ch >= 5760 && _utilWhitespace.nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.state.pos; + } else { + break loop; + } + } + } + }; + + // Called at the end of every token. Sets `end`, `val`, and + // maintains `context` and `exprAllowed`, and skips the space after + // the token, so that the next one's `start` will point at the + // right position. + + Tokenizer.prototype.finishToken = function finishToken(type, val) { + this.state.end = this.state.pos; + this.state.endLoc = this.state.curPosition(); + var prevType = this.state.type; + this.state.type = type; + this.state.value = val; + + this.updateContext(prevType); + }; + + // ### Token reading + + // This is the function that is called to fetch the next token. It + // is somewhat obscure, because it works in character codes rather + // than characters, and because operator parsing has been inlined + // into it. + // + // All in the name of speed. + // + + Tokenizer.prototype.readToken_dot = function readToken_dot() { + var next = this.input.charCodeAt(this.state.pos + 1); + if (next >= 48 && next <= 57) { + return this.readNumber(true); + } + + var next2 = this.input.charCodeAt(this.state.pos + 2); + if (next === 46 && next2 === 46) { + // 46 = dot '.' + this.state.pos += 3; + return this.finishToken(_types.types.ellipsis); + } else { + ++this.state.pos; + return this.finishToken(_types.types.dot); + } + }; + + Tokenizer.prototype.readToken_slash = function readToken_slash() { + // '/' + if (this.state.exprAllowed) { + ++this.state.pos; + return this.readRegexp(); + } + + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + return this.finishOp(_types.types.assign, 2); + } else { + return this.finishOp(_types.types.slash, 1); + } + }; + + Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) { + // '%*' + var type = code === 42 ? _types.types.star : _types.types.modulo; + var width = 1; + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === 42 && this.options.features["es7.exponentiationOperator"]) { + // '*' + width++; + next = this.input.charCodeAt(this.state.pos + 2); + type = _types.types.exponent; + } + + if (next === 61) { + width++; + type = _types.types.assign; + } + + return this.finishOp(type, width); + }; + + Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) { + // '|&' + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === code) return this.finishOp(code === 124 ? _types.types.logicalOR : _types.types.logicalAND, 2); + if (next === 61) return this.finishOp(_types.types.assign, 2); + return this.finishOp(code === 124 ? _types.types.bitwiseOR : _types.types.bitwiseAND, 1); + }; + + Tokenizer.prototype.readToken_caret = function readToken_caret() { + // '^' + var next = this.input.charCodeAt(this.state.pos + 1); + if (next === 61) { + return this.finishOp(_types.types.assign, 2); + } else { + return this.finishOp(_types.types.bitwiseXOR, 1); + } + }; + + Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) { + // '+-' + var next = this.input.charCodeAt(this.state.pos + 1); + + if (next === code) { + if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(_types.types.incDec, 2); + } + + if (next === 61) { + return this.finishOp(_types.types.assign, 2); + } else { + return this.finishOp(_types.types.plusMin, 1); + } + }; + + Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { + // '<>' + var next = this.input.charCodeAt(this.state.pos + 1); + var size = 1; + + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(_types.types.assign, size + 1); + return this.finishOp(_types.types.bitShift, size); + } + + if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { + if (this.inModule) this.unexpected(); + // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(_types.types.incDec, 2); + } + + if (next === 61) { + return this.finishOp(_types.types.assign, 2); + } else { + return this.finishOp(_types.types.plusMin, 1); + } + }; + + Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { + // '<>' + var next = this.input.charCodeAt(this.state.pos + 1); + var size = 1; + + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(_types.types.assign, size + 1); + return this.finishOp(_types.types.bitShift, size); + } + + if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { + if (this.inModule) this.unexpected(); + // ` + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts b/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js b/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..22438da --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/package.json b/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..623fbc3 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/browserify-sign/node_modules/readable-stream/package.json b/node_modules/browserify-sign/node_modules/readable-stream/package.json new file mode 100644 index 0000000..514c178 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/package.json @@ -0,0 +1,52 @@ +{ + "name": "readable-stream", + "version": "2.3.8", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "assert": "^1.4.0", + "babel-polyfill": "^6.9.1", + "buffer": "^4.9.0", + "lolex": "^2.3.2", + "nyc": "^6.4.0", + "tap": "^0.7.0", + "tape": "^4.8.0" + }, + "scripts": { + "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js", + "cover": "nyc npm test", + "report": "nyc report --reporter=lcov" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false, + "./readable.js": "./readable-browser.js", + "./writable.js": "./writable-browser.js", + "./duplex.js": "./duplex-browser.js", + "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js" + }, + "nyc": { + "include": [ + "lib/**.js" + ] + }, + "license": "MIT" +} diff --git a/node_modules/browserify-sign/node_modules/readable-stream/passthrough.js b/node_modules/browserify-sign/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..ffd791d --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require('./readable').PassThrough diff --git a/node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js b/node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js new file mode 100644 index 0000000..e503725 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js @@ -0,0 +1,7 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/node_modules/browserify-sign/node_modules/readable-stream/readable.js b/node_modules/browserify-sign/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..ec89ec5 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/readable.js @@ -0,0 +1,19 @@ +var Stream = require('stream'); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = require('./lib/_stream_readable.js'); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = require('./lib/_stream_writable.js'); + exports.Duplex = require('./lib/_stream_duplex.js'); + exports.Transform = require('./lib/_stream_transform.js'); + exports.PassThrough = require('./lib/_stream_passthrough.js'); +} diff --git a/node_modules/browserify-sign/node_modules/readable-stream/transform.js b/node_modules/browserify-sign/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..b1baba2 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require('./readable').Transform diff --git a/node_modules/browserify-sign/node_modules/readable-stream/writable-browser.js b/node_modules/browserify-sign/node_modules/readable-stream/writable-browser.js new file mode 100644 index 0000000..ebdde6a --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/writable-browser.js @@ -0,0 +1 @@ +module.exports = require('./lib/_stream_writable.js'); diff --git a/node_modules/browserify-sign/node_modules/readable-stream/writable.js b/node_modules/browserify-sign/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..3211a6f --- /dev/null +++ b/node_modules/browserify-sign/node_modules/readable-stream/writable.js @@ -0,0 +1,8 @@ +var Stream = require("stream") +var Writable = require("./lib/_stream_writable.js") + +if (process.env.READABLE_STREAM === 'disable') { + module.exports = Stream && Stream.Writable || Writable +} else { + module.exports = Writable +} diff --git a/node_modules/browserify-sign/node_modules/string_decoder/.travis.yml b/node_modules/browserify-sign/node_modules/string_decoder/.travis.yml new file mode 100644 index 0000000..3347a72 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g +notifications: + email: false +matrix: + fast_finish: true + include: + - node_js: '0.8' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.10' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.11' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: '0.12' + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 1 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 2 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 3 + env: + - TASK=test + - NPM_LEGACY=true + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 6 + env: TASK=test + - node_js: 7 + env: TASK=test + - node_js: 8 + env: TASK=test + - node_js: 9 + env: TASK=test diff --git a/node_modules/browserify-sign/node_modules/string_decoder/LICENSE b/node_modules/browserify-sign/node_modules/string_decoder/LICENSE new file mode 100644 index 0000000..778edb2 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/LICENSE @@ -0,0 +1,48 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + diff --git a/node_modules/browserify-sign/node_modules/string_decoder/README.md b/node_modules/browserify-sign/node_modules/string_decoder/README.md new file mode 100644 index 0000000..5fd5831 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/README.md @@ -0,0 +1,47 @@ +# string_decoder + +***Node-core v8.9.4 string_decoder for userland*** + + +[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/) +[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/) + + +```bash +npm install --save string_decoder +``` + +***Node-core string_decoder for userland*** + +This package is a mirror of the string_decoder implementation in Node-core. + +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). + +As of version 1.0.0 **string_decoder** uses semantic versioning. + +## Previous versions + +Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. + +## Update + +The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version. + +## Streams Working Group + +`string_decoder` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + +See [readable-stream](https://github.com/nodejs/readable-stream) for +more details. diff --git a/node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js b/node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js new file mode 100644 index 0000000..2e89e63 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js @@ -0,0 +1,296 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +/**/ + +var Buffer = require('safe-buffer').Buffer; +/**/ + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} \ No newline at end of file diff --git a/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/LICENSE b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/README.md b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..22438da --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js @@ -0,0 +1,62 @@ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/package.json b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..623fbc3 --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/package.json @@ -0,0 +1,37 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.1.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^4.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + } +} diff --git a/node_modules/browserify-sign/node_modules/string_decoder/package.json b/node_modules/browserify-sign/node_modules/string_decoder/package.json new file mode 100644 index 0000000..518c3eb --- /dev/null +++ b/node_modules/browserify-sign/node_modules/string_decoder/package.json @@ -0,0 +1,31 @@ +{ + "name": "string_decoder", + "version": "1.1.1", + "description": "The string_decoder module from Node core", + "main": "lib/string_decoder.js", + "dependencies": { + "safe-buffer": "~5.1.0" + }, + "devDependencies": { + "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/parallel/*.js && node test/verify-dependencies", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/string_decoder.git" + }, + "homepage": "https://github.com/nodejs/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT" +} diff --git a/node_modules/browserify-sign/package.json b/node_modules/browserify-sign/package.json new file mode 100644 index 0000000..d0ca089 --- /dev/null +++ b/node_modules/browserify-sign/package.json @@ -0,0 +1,72 @@ +{ + "name": "browserify-sign", + "version": "4.2.3", + "description": "adds node crypto signing for browsers", + "bugs": { + "url": "https://github.com/crypto-browserify/browserify-sign/issues" + }, + "license": "ISC", + "files": [ + "browser", + "index.js", + "algos.js" + ], + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/crypto-browserify/browserify-sign.git" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint --ext=js,mjs .", + "tests-only": "nyc tape 'test/**/*.js'", + "pretest": "npm run lint", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "semver": "^6.3.1", + "tape": "^5.7.5" + }, + "browser": "browser/index.js", + "engines": { + "node": ">= 0.12" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/node_modules/browserify-zlib/.npmignore b/node_modules/browserify-zlib/.npmignore new file mode 100644 index 0000000..2752eb9 --- /dev/null +++ b/node_modules/browserify-zlib/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +.DS_Store diff --git a/node_modules/browserify-zlib/.travis.yml b/node_modules/browserify-zlib/.travis.yml new file mode 100644 index 0000000..87f8cd9 --- /dev/null +++ b/node_modules/browserify-zlib/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" \ No newline at end of file diff --git a/node_modules/browserify-zlib/README.md b/node_modules/browserify-zlib/README.md new file mode 100644 index 0000000..61f323a --- /dev/null +++ b/node_modules/browserify-zlib/README.md @@ -0,0 +1,22 @@ +# browserify-zlib + +Emulates Node's [zlib](http://nodejs.org/api/zlib.html) module for [Browserify](http://browserify.org) +using [pako](https://github.com/nodeca/pako). It uses the actual Node source code and passes the Node zlib tests +by emulating the C++ binding that actually calls zlib. + +[![browser support](https://ci.testling.com/devongovett/browserify-zlib.png) +](https://ci.testling.com/devongovett/browserify-zlib) + +[![node tests](https://travis-ci.org/devongovett/browserify-zlib.svg) +](https://travis-ci.org/devongovett/browserify-zlib) + +## Not implemented + +The following options/methods are not supported because pako does not support them yet. + +* The `params` method +* The `dictionary` option + +## License + +MIT diff --git a/node_modules/browserify-zlib/package.json b/node_modules/browserify-zlib/package.json new file mode 100644 index 0000000..dfa960d --- /dev/null +++ b/node_modules/browserify-zlib/package.json @@ -0,0 +1,40 @@ +{ + "name": "browserify-zlib", + "version": "0.1.4", + "description": "Full zlib module for browserify", + "keywords": ["zlib", "browserify"], + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": { + "pako": "~0.2.0" + }, + "devDependencies": { + "tape": "^2.12.3", + "brfs": "^1.0.1" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/22..latest", + "firefox/16..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6", + "android-browser/latest" + ] + }, + "scripts": { + "test": "node_modules/tape/bin/tape test/*.js" + }, + "main": "src/index.js", + "author": "Devon Govett ", + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/devongovett/browserify-zlib.git" + } +} diff --git a/node_modules/browserify-zlib/src/binding.js b/node_modules/browserify-zlib/src/binding.js new file mode 100644 index 0000000..7244b43 --- /dev/null +++ b/node_modules/browserify-zlib/src/binding.js @@ -0,0 +1,236 @@ +var msg = require('pako/lib/zlib/messages'); +var zstream = require('pako/lib/zlib/zstream'); +var zlib_deflate = require('pako/lib/zlib/deflate.js'); +var zlib_inflate = require('pako/lib/zlib/inflate.js'); +var constants = require('pako/lib/zlib/constants'); + +for (var key in constants) { + exports[key] = constants[key]; +} + +// zlib modes +exports.NONE = 0; +exports.DEFLATE = 1; +exports.INFLATE = 2; +exports.GZIP = 3; +exports.GUNZIP = 4; +exports.DEFLATERAW = 5; +exports.INFLATERAW = 6; +exports.UNZIP = 7; + +/** + * Emulate Node's zlib C++ layer for use by the JS layer in index.js + */ +function Zlib(mode) { + if (mode < exports.DEFLATE || mode > exports.UNZIP) + throw new TypeError("Bad argument"); + + this.mode = mode; + this.init_done = false; + this.write_in_progress = false; + this.pending_close = false; + this.windowBits = 0; + this.level = 0; + this.memLevel = 0; + this.strategy = 0; + this.dictionary = null; +} + +Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) { + this.windowBits = windowBits; + this.level = level; + this.memLevel = memLevel; + this.strategy = strategy; + // dictionary not supported. + + if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) + this.windowBits += 16; + + if (this.mode === exports.UNZIP) + this.windowBits += 32; + + if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) + this.windowBits = -this.windowBits; + + this.strm = new zstream(); + + switch (this.mode) { + case exports.DEFLATE: + case exports.GZIP: + case exports.DEFLATERAW: + var status = zlib_deflate.deflateInit2( + this.strm, + this.level, + exports.Z_DEFLATED, + this.windowBits, + this.memLevel, + this.strategy + ); + break; + case exports.INFLATE: + case exports.GUNZIP: + case exports.INFLATERAW: + case exports.UNZIP: + var status = zlib_inflate.inflateInit2( + this.strm, + this.windowBits + ); + break; + default: + throw new Error("Unknown mode " + this.mode); + } + + if (status !== exports.Z_OK) { + this._error(status); + return; + } + + this.write_in_progress = false; + this.init_done = true; +}; + +Zlib.prototype.params = function() { + throw new Error("deflateParams Not supported"); +}; + +Zlib.prototype._writeCheck = function() { + if (!this.init_done) + throw new Error("write before init"); + + if (this.mode === exports.NONE) + throw new Error("already finalized"); + + if (this.write_in_progress) + throw new Error("write already in progress"); + + if (this.pending_close) + throw new Error("close is pending"); +}; + +Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) { + this._writeCheck(); + this.write_in_progress = true; + + var self = this; + process.nextTick(function() { + self.write_in_progress = false; + var res = self._write(flush, input, in_off, in_len, out, out_off, out_len); + self.callback(res[0], res[1]); + + if (self.pending_close) + self.close(); + }); + + return this; +}; + +// set method for Node buffers, used by pako +function bufferSet(data, offset) { + for (var i = 0; i < data.length; i++) { + this[offset + i] = data[i]; + } +} + +Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) { + this._writeCheck(); + return this._write(flush, input, in_off, in_len, out, out_off, out_len); +}; + +Zlib.prototype._write = function(flush, input, in_off, in_len, out, out_off, out_len) { + this.write_in_progress = true; + + if (flush !== exports.Z_NO_FLUSH && + flush !== exports.Z_PARTIAL_FLUSH && + flush !== exports.Z_SYNC_FLUSH && + flush !== exports.Z_FULL_FLUSH && + flush !== exports.Z_FINISH && + flush !== exports.Z_BLOCK) { + throw new Error("Invalid flush value"); + } + + if (input == null) { + input = new Buffer(0); + in_len = 0; + in_off = 0; + } + + if (out._set) + out.set = out._set; + else + out.set = bufferSet; + + var strm = this.strm; + strm.avail_in = in_len; + strm.input = input; + strm.next_in = in_off; + strm.avail_out = out_len; + strm.output = out; + strm.next_out = out_off; + + switch (this.mode) { + case exports.DEFLATE: + case exports.GZIP: + case exports.DEFLATERAW: + var status = zlib_deflate.deflate(strm, flush); + break; + case exports.UNZIP: + case exports.INFLATE: + case exports.GUNZIP: + case exports.INFLATERAW: + var status = zlib_inflate.inflate(strm, flush); + break; + default: + throw new Error("Unknown mode " + this.mode); + } + + if (status !== exports.Z_STREAM_END && status !== exports.Z_OK) { + this._error(status); + } + + this.write_in_progress = false; + return [strm.avail_in, strm.avail_out]; +}; + +Zlib.prototype.close = function() { + if (this.write_in_progress) { + this.pending_close = true; + return; + } + + this.pending_close = false; + + if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) { + zlib_deflate.deflateEnd(this.strm); + } else { + zlib_inflate.inflateEnd(this.strm); + } + + this.mode = exports.NONE; +}; + +Zlib.prototype.reset = function() { + switch (this.mode) { + case exports.DEFLATE: + case exports.DEFLATERAW: + var status = zlib_deflate.deflateReset(this.strm); + break; + case exports.INFLATE: + case exports.INFLATERAW: + var status = zlib_inflate.inflateReset(this.strm); + break; + } + + if (status !== exports.Z_OK) { + this._error(status); + } +}; + +Zlib.prototype._error = function(status) { + this.onerror(msg[status] + ': ' + this.strm.msg, status); + + this.write_in_progress = false; + if (this.pending_close) + this.close(); +}; + +exports.Zlib = Zlib; diff --git a/node_modules/browserify-zlib/src/index.js b/node_modules/browserify-zlib/src/index.js new file mode 100644 index 0000000..032689c --- /dev/null +++ b/node_modules/browserify-zlib/src/index.js @@ -0,0 +1,610 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Transform = require('_stream_transform'); + +var binding = require('./binding'); +var util = require('util'); +var assert = require('assert').ok; + +// zlib doesn't provide these, so kludge them in following the same +// const naming scheme zlib uses. +binding.Z_MIN_WINDOWBITS = 8; +binding.Z_MAX_WINDOWBITS = 15; +binding.Z_DEFAULT_WINDOWBITS = 15; + +// fewer than 64 bytes per chunk is stupid. +// technically it could work with as few as 8, but even 64 bytes +// is absurdly low. Usually a MB or more is best. +binding.Z_MIN_CHUNK = 64; +binding.Z_MAX_CHUNK = Infinity; +binding.Z_DEFAULT_CHUNK = (16 * 1024); + +binding.Z_MIN_MEMLEVEL = 1; +binding.Z_MAX_MEMLEVEL = 9; +binding.Z_DEFAULT_MEMLEVEL = 8; + +binding.Z_MIN_LEVEL = -1; +binding.Z_MAX_LEVEL = 9; +binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION; + +// expose all the zlib constants +Object.keys(binding).forEach(function(k) { + if (k.match(/^Z/)) exports[k] = binding[k]; +}); + +// translation table for return codes. +exports.codes = { + Z_OK: binding.Z_OK, + Z_STREAM_END: binding.Z_STREAM_END, + Z_NEED_DICT: binding.Z_NEED_DICT, + Z_ERRNO: binding.Z_ERRNO, + Z_STREAM_ERROR: binding.Z_STREAM_ERROR, + Z_DATA_ERROR: binding.Z_DATA_ERROR, + Z_MEM_ERROR: binding.Z_MEM_ERROR, + Z_BUF_ERROR: binding.Z_BUF_ERROR, + Z_VERSION_ERROR: binding.Z_VERSION_ERROR +}; + +Object.keys(exports.codes).forEach(function(k) { + exports.codes[exports.codes[k]] = k; +}); + +exports.Deflate = Deflate; +exports.Inflate = Inflate; +exports.Gzip = Gzip; +exports.Gunzip = Gunzip; +exports.DeflateRaw = DeflateRaw; +exports.InflateRaw = InflateRaw; +exports.Unzip = Unzip; + +exports.createDeflate = function(o) { + return new Deflate(o); +}; + +exports.createInflate = function(o) { + return new Inflate(o); +}; + +exports.createDeflateRaw = function(o) { + return new DeflateRaw(o); +}; + +exports.createInflateRaw = function(o) { + return new InflateRaw(o); +}; + +exports.createGzip = function(o) { + return new Gzip(o); +}; + +exports.createGunzip = function(o) { + return new Gunzip(o); +}; + +exports.createUnzip = function(o) { + return new Unzip(o); +}; + + +// Convenience methods. +// compress/decompress a string or buffer in one step. +exports.deflate = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new Deflate(opts), buffer, callback); +}; + +exports.deflateSync = function(buffer, opts) { + return zlibBufferSync(new Deflate(opts), buffer); +}; + +exports.gzip = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new Gzip(opts), buffer, callback); +}; + +exports.gzipSync = function(buffer, opts) { + return zlibBufferSync(new Gzip(opts), buffer); +}; + +exports.deflateRaw = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new DeflateRaw(opts), buffer, callback); +}; + +exports.deflateRawSync = function(buffer, opts) { + return zlibBufferSync(new DeflateRaw(opts), buffer); +}; + +exports.unzip = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new Unzip(opts), buffer, callback); +}; + +exports.unzipSync = function(buffer, opts) { + return zlibBufferSync(new Unzip(opts), buffer); +}; + +exports.inflate = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new Inflate(opts), buffer, callback); +}; + +exports.inflateSync = function(buffer, opts) { + return zlibBufferSync(new Inflate(opts), buffer); +}; + +exports.gunzip = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new Gunzip(opts), buffer, callback); +}; + +exports.gunzipSync = function(buffer, opts) { + return zlibBufferSync(new Gunzip(opts), buffer); +}; + +exports.inflateRaw = function(buffer, opts, callback) { + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + return zlibBuffer(new InflateRaw(opts), buffer, callback); +}; + +exports.inflateRawSync = function(buffer, opts) { + return zlibBufferSync(new InflateRaw(opts), buffer); +}; + +function zlibBuffer(engine, buffer, callback) { + var buffers = []; + var nread = 0; + + engine.on('error', onError); + engine.on('end', onEnd); + + engine.end(buffer); + flow(); + + function flow() { + var chunk; + while (null !== (chunk = engine.read())) { + buffers.push(chunk); + nread += chunk.length; + } + engine.once('readable', flow); + } + + function onError(err) { + engine.removeListener('end', onEnd); + engine.removeListener('readable', flow); + callback(err); + } + + function onEnd() { + var buf = Buffer.concat(buffers, nread); + buffers = []; + callback(null, buf); + engine.close(); + } +} + +function zlibBufferSync(engine, buffer) { + if (typeof buffer === 'string') + buffer = new Buffer(buffer); + if (!Buffer.isBuffer(buffer)) + throw new TypeError('Not a string or buffer'); + + var flushFlag = binding.Z_FINISH; + + return engine._processChunk(buffer, flushFlag); +} + +// generic zlib +// minimal 2-byte header +function Deflate(opts) { + if (!(this instanceof Deflate)) return new Deflate(opts); + Zlib.call(this, opts, binding.DEFLATE); +} + +function Inflate(opts) { + if (!(this instanceof Inflate)) return new Inflate(opts); + Zlib.call(this, opts, binding.INFLATE); +} + + + +// gzip - bigger header, same deflate compression +function Gzip(opts) { + if (!(this instanceof Gzip)) return new Gzip(opts); + Zlib.call(this, opts, binding.GZIP); +} + +function Gunzip(opts) { + if (!(this instanceof Gunzip)) return new Gunzip(opts); + Zlib.call(this, opts, binding.GUNZIP); +} + + + +// raw - no header +function DeflateRaw(opts) { + if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts); + Zlib.call(this, opts, binding.DEFLATERAW); +} + +function InflateRaw(opts) { + if (!(this instanceof InflateRaw)) return new InflateRaw(opts); + Zlib.call(this, opts, binding.INFLATERAW); +} + + +// auto-detect header. +function Unzip(opts) { + if (!(this instanceof Unzip)) return new Unzip(opts); + Zlib.call(this, opts, binding.UNZIP); +} + + +// the Zlib class they all inherit from +// This thing manages the queue of requests, and returns +// true or false if there is anything in the queue when +// you call the .write() method. + +function Zlib(opts, mode) { + this._opts = opts = opts || {}; + this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK; + + Transform.call(this, opts); + + if (opts.flush) { + if (opts.flush !== binding.Z_NO_FLUSH && + opts.flush !== binding.Z_PARTIAL_FLUSH && + opts.flush !== binding.Z_SYNC_FLUSH && + opts.flush !== binding.Z_FULL_FLUSH && + opts.flush !== binding.Z_FINISH && + opts.flush !== binding.Z_BLOCK) { + throw new Error('Invalid flush flag: ' + opts.flush); + } + } + this._flushFlag = opts.flush || binding.Z_NO_FLUSH; + + if (opts.chunkSize) { + if (opts.chunkSize < exports.Z_MIN_CHUNK || + opts.chunkSize > exports.Z_MAX_CHUNK) { + throw new Error('Invalid chunk size: ' + opts.chunkSize); + } + } + + if (opts.windowBits) { + if (opts.windowBits < exports.Z_MIN_WINDOWBITS || + opts.windowBits > exports.Z_MAX_WINDOWBITS) { + throw new Error('Invalid windowBits: ' + opts.windowBits); + } + } + + if (opts.level) { + if (opts.level < exports.Z_MIN_LEVEL || + opts.level > exports.Z_MAX_LEVEL) { + throw new Error('Invalid compression level: ' + opts.level); + } + } + + if (opts.memLevel) { + if (opts.memLevel < exports.Z_MIN_MEMLEVEL || + opts.memLevel > exports.Z_MAX_MEMLEVEL) { + throw new Error('Invalid memLevel: ' + opts.memLevel); + } + } + + if (opts.strategy) { + if (opts.strategy != exports.Z_FILTERED && + opts.strategy != exports.Z_HUFFMAN_ONLY && + opts.strategy != exports.Z_RLE && + opts.strategy != exports.Z_FIXED && + opts.strategy != exports.Z_DEFAULT_STRATEGY) { + throw new Error('Invalid strategy: ' + opts.strategy); + } + } + + if (opts.dictionary) { + if (!Buffer.isBuffer(opts.dictionary)) { + throw new Error('Invalid dictionary: it should be a Buffer instance'); + } + } + + this._binding = new binding.Zlib(mode); + + var self = this; + this._hadError = false; + this._binding.onerror = function(message, errno) { + // there is no way to cleanly recover. + // continuing only obscures problems. + self._binding = null; + self._hadError = true; + + var error = new Error(message); + error.errno = errno; + error.code = exports.codes[errno]; + self.emit('error', error); + }; + + var level = exports.Z_DEFAULT_COMPRESSION; + if (typeof opts.level === 'number') level = opts.level; + + var strategy = exports.Z_DEFAULT_STRATEGY; + if (typeof opts.strategy === 'number') strategy = opts.strategy; + + this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, + level, + opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, + strategy, + opts.dictionary); + + this._buffer = new Buffer(this._chunkSize); + this._offset = 0; + this._closed = false; + this._level = level; + this._strategy = strategy; + + this.once('end', this.close); +} + +util.inherits(Zlib, Transform); + +Zlib.prototype.params = function(level, strategy, callback) { + if (level < exports.Z_MIN_LEVEL || + level > exports.Z_MAX_LEVEL) { + throw new RangeError('Invalid compression level: ' + level); + } + if (strategy != exports.Z_FILTERED && + strategy != exports.Z_HUFFMAN_ONLY && + strategy != exports.Z_RLE && + strategy != exports.Z_FIXED && + strategy != exports.Z_DEFAULT_STRATEGY) { + throw new TypeError('Invalid strategy: ' + strategy); + } + + if (this._level !== level || this._strategy !== strategy) { + var self = this; + this.flush(binding.Z_SYNC_FLUSH, function() { + self._binding.params(level, strategy); + if (!self._hadError) { + self._level = level; + self._strategy = strategy; + if (callback) callback(); + } + }); + } else { + process.nextTick(callback); + } +}; + +Zlib.prototype.reset = function() { + return this._binding.reset(); +}; + +// This is the _flush function called by the transform class, +// internally, when the last chunk has been written. +Zlib.prototype._flush = function(callback) { + this._transform(new Buffer(0), '', callback); +}; + +Zlib.prototype.flush = function(kind, callback) { + var ws = this._writableState; + + if (typeof kind === 'function' || (kind === void 0 && !callback)) { + callback = kind; + kind = binding.Z_FULL_FLUSH; + } + + if (ws.ended) { + if (callback) + process.nextTick(callback); + } else if (ws.ending) { + if (callback) + this.once('end', callback); + } else if (ws.needDrain) { + var self = this; + this.once('drain', function() { + self.flush(callback); + }); + } else { + this._flushFlag = kind; + this.write(new Buffer(0), '', callback); + } +}; + +Zlib.prototype.close = function(callback) { + if (callback) + process.nextTick(callback); + + if (this._closed) + return; + + this._closed = true; + + this._binding.close(); + + var self = this; + process.nextTick(function() { + self.emit('close'); + }); +}; + +Zlib.prototype._transform = function(chunk, encoding, cb) { + var flushFlag; + var ws = this._writableState; + var ending = ws.ending || ws.ended; + var last = ending && (!chunk || ws.length === chunk.length); + + if (!chunk === null && !Buffer.isBuffer(chunk)) + return cb(new Error('invalid input')); + + // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag. + // If it's explicitly flushing at some other time, then we use + // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression + // goodness. + if (last) + flushFlag = binding.Z_FINISH; + else { + flushFlag = this._flushFlag; + // once we've flushed the last of the queue, stop flushing and + // go back to the normal behavior. + if (chunk.length >= ws.length) { + this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH; + } + } + + var self = this; + this._processChunk(chunk, flushFlag, cb); +}; + +Zlib.prototype._processChunk = function(chunk, flushFlag, cb) { + var availInBefore = chunk && chunk.length; + var availOutBefore = this._chunkSize - this._offset; + var inOff = 0; + + var self = this; + + var async = typeof cb === 'function'; + + if (!async) { + var buffers = []; + var nread = 0; + + var error; + this.on('error', function(er) { + error = er; + }); + + do { + var res = this._binding.writeSync(flushFlag, + chunk, // in + inOff, // in_off + availInBefore, // in_len + this._buffer, // out + this._offset, //out_off + availOutBefore); // out_len + } while (!this._hadError && callback(res[0], res[1])); + + if (this._hadError) { + throw error; + } + + var buf = Buffer.concat(buffers, nread); + this.close(); + + return buf; + } + + var req = this._binding.write(flushFlag, + chunk, // in + inOff, // in_off + availInBefore, // in_len + this._buffer, // out + this._offset, //out_off + availOutBefore); // out_len + + req.buffer = chunk; + req.callback = callback; + + function callback(availInAfter, availOutAfter) { + if (self._hadError) + return; + + var have = availOutBefore - availOutAfter; + assert(have >= 0, 'have should not go down'); + + if (have > 0) { + var out = self._buffer.slice(self._offset, self._offset + have); + self._offset += have; + // serve some output to the consumer. + if (async) { + self.push(out); + } else { + buffers.push(out); + nread += out.length; + } + } + + // exhausted the output buffer, or used all the input create a new one. + if (availOutAfter === 0 || self._offset >= self._chunkSize) { + availOutBefore = self._chunkSize; + self._offset = 0; + self._buffer = new Buffer(self._chunkSize); + } + + if (availOutAfter === 0) { + // Not actually done. Need to reprocess. + // Also, update the availInBefore to the availInAfter value, + // so that if we have to hit it a third (fourth, etc.) time, + // it'll have the correct byte counts. + inOff += (availInBefore - availInAfter); + availInBefore = availInAfter; + + if (!async) + return true; + + var newReq = self._binding.write(flushFlag, + chunk, + inOff, + availInBefore, + self._buffer, + self._offset, + self._chunkSize); + newReq.callback = callback; // this same function + newReq.buffer = chunk; + return; + } + + if (!async) + return false; + + // finished with the chunk. + cb(); + } +}; + +util.inherits(Deflate, Zlib); +util.inherits(Inflate, Zlib); +util.inherits(Gzip, Zlib); +util.inherits(Gunzip, Zlib); +util.inherits(DeflateRaw, Zlib); +util.inherits(InflateRaw, Zlib); +util.inherits(Unzip, Zlib); diff --git a/node_modules/browserify-zlib/test/fixtures/elipses.txt b/node_modules/browserify-zlib/test/fixtures/elipses.txt new file mode 100644 index 0000000..6105600 --- /dev/null +++ b/node_modules/browserify-zlib/test/fixtures/elipses.txt @@ -0,0 +1 @@ +………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………… \ No newline at end of file diff --git a/node_modules/browserify-zlib/test/fixtures/empty.txt b/node_modules/browserify-zlib/test/fixtures/empty.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/node_modules/browserify-zlib/test/fixtures/empty.txt @@ -0,0 +1 @@ + diff --git a/node_modules/browserify-zlib/test/fixtures/person.jpg b/node_modules/browserify-zlib/test/fixtures/person.jpg new file mode 100644 index 0000000..4f71881 Binary files /dev/null and b/node_modules/browserify-zlib/test/fixtures/person.jpg differ diff --git a/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary-fail.js b/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary-fail.js new file mode 100644 index 0000000..fd35a01 --- /dev/null +++ b/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary-fail.js @@ -0,0 +1,48 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var common = require('../common.js'); +var assert = require('assert'); +var zlib = require('zlib'); + +// Should raise an error, not trigger an assertion in src/node_zlib.cc +(function() { + var stream = zlib.createInflate(); + + stream.on('error', common.mustCall(function(err) { + assert(/Missing dictionary/.test(err.message)); + })); + + // String "test" encoded with dictionary "dict". + stream.write(Buffer([0x78,0xBB,0x04,0x09,0x01,0xA5])); +})(); + +// Should raise an error, not trigger an assertion in src/node_zlib.cc +(function() { + var stream = zlib.createInflate({ dictionary: Buffer('fail') }); + + stream.on('error', common.mustCall(function(err) { + assert(/Bad dictionary/.test(err.message)); + })); + + // String "test" encoded with dictionary "dict". + stream.write(Buffer([0x78,0xBB,0x04,0x09,0x01,0xA5])); +})(); diff --git a/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary.js b/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary.js new file mode 100644 index 0000000..58da810 --- /dev/null +++ b/node_modules/browserify-zlib/test/ignored/test-zlib-dictionary.js @@ -0,0 +1,95 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// test compression/decompression with dictionary + +var common = require('../common.js'); +var assert = require('assert'); +var zlib = require('zlib'); +var path = require('path'); + +var spdyDict = new Buffer([ + 'optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-', + 'languageauthorizationexpectfromhostif-modified-sinceif-matchif-none-matchi', + 'f-rangeif-unmodifiedsincemax-forwardsproxy-authorizationrangerefererteuser', + '-agent10010120020120220320420520630030130230330430530630740040140240340440', + '5406407408409410411412413414415416417500501502503504505accept-rangesageeta', + 'glocationproxy-authenticatepublicretry-afterservervarywarningwww-authentic', + 'ateallowcontent-basecontent-encodingcache-controlconnectiondatetrailertran', + 'sfer-encodingupgradeviawarningcontent-languagecontent-lengthcontent-locati', + 'oncontent-md5content-rangecontent-typeetagexpireslast-modifiedset-cookieMo', + 'ndayTuesdayWednesdayThursdayFridaySaturdaySundayJanFebMarAprMayJunJulAugSe', + 'pOctNovDecchunkedtext/htmlimage/pngimage/jpgimage/gifapplication/xmlapplic', + 'ation/xhtmltext/plainpublicmax-agecharset=iso-8859-1utf-8gzipdeflateHTTP/1', + '.1statusversionurl\0' +].join('')); + +var deflate = zlib.createDeflate({ dictionary: spdyDict }); + +var input = [ + 'HTTP/1.1 200 Ok', + 'Server: node.js', + 'Content-Length: 0', + '' +].join('\r\n'); + +var called = 0; + +// +// We'll use clean-new inflate stream each time +// and .reset() old dirty deflate one +// +function run(num) { + var inflate = zlib.createInflate({ dictionary: spdyDict }); + + if (num === 2) { + deflate.reset(); + deflate.removeAllListeners('data'); + } + + // Put data into deflate stream + deflate.on('data', function(chunk) { + inflate.write(chunk); + }); + + // Get data from inflate stream + var output = []; + inflate.on('data', function(chunk) { + output.push(chunk); + }); + inflate.on('end', function() { + called++; + + assert.equal(output.join(''), input); + + if (num < 2) run(num + 1); + }); + + deflate.write(input); + deflate.flush(function() { + inflate.end(); + }); +} +run(1); + +process.on('exit', function() { + assert.equal(called, 2); +}); diff --git a/node_modules/browserify-zlib/test/ignored/test-zlib-params.js b/node_modules/browserify-zlib/test/ignored/test-zlib-params.js new file mode 100644 index 0000000..006f1ea --- /dev/null +++ b/node_modules/browserify-zlib/test/ignored/test-zlib-params.js @@ -0,0 +1,33 @@ +var common = require('../common.js'); +var assert = require('assert'); +var zlib = require('zlib'); +var path = require('path'); +var fs = require('fs'); + +var file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')), + chunkSize = 24 * 1024, + opts = { level: 9, strategy: zlib.Z_DEFAULT_STRATEGY }, + deflater = zlib.createDeflate(opts); + +var chunk1 = file.slice(0, chunkSize), + chunk2 = file.slice(chunkSize), + blkhdr = new Buffer([0x00, 0x48, 0x82, 0xb7, 0x7d]), + expected = Buffer.concat([blkhdr, chunk2]), + actual; + +deflater.write(chunk1, function() { + deflater.params(0, zlib.Z_DEFAULT_STRATEGY, function() { + while (deflater.read()); + deflater.end(chunk2, function() { + var bufs = [], buf; + while (buf = deflater.read()) + bufs.push(buf); + actual = Buffer.concat(bufs); + }); + }); + while (deflater.read()); +}); + +process.once('exit', function() { + assert.deepEqual(actual, expected); +}); diff --git a/node_modules/browserify-zlib/test/package.json b/node_modules/browserify-zlib/test/package.json new file mode 100644 index 0000000..189e120 --- /dev/null +++ b/node_modules/browserify-zlib/test/package.json @@ -0,0 +1,7 @@ +{ + "browserify": { + "transform": [ + "brfs" + ] + } +} \ No newline at end of file diff --git a/node_modules/browserify-zlib/test/test-zlib-close-after-write.js b/node_modules/browserify-zlib/test/test-zlib-close-after-write.js new file mode 100644 index 0000000..6d5a083 --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-close-after-write.js @@ -0,0 +1,35 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var tape = require('tape'); +var zlib = require('../'); + +tape(function(t) { + t.plan(1); + + zlib.gzip('hello', function(err, out) { + var unzip = zlib.createGunzip(); + unzip.write(out); + unzip.close(function() { + t.ok(true); + }); + }); +}); diff --git a/node_modules/browserify-zlib/test/test-zlib-convenience-methods.js b/node_modules/browserify-zlib/test/test-zlib-convenience-methods.js new file mode 100644 index 0000000..223160b --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-convenience-methods.js @@ -0,0 +1,70 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// test convenience methods with and without options supplied + +var tape = require('tape'); +var zlib = require('../'); + +var expect = 'blahblahblahblahblahblah'; +var opts = { + level: 9, + chunkSize: 1024, +}; + +[ + ['gzip', 'gunzip'], + ['gzip', 'unzip'], + ['deflate', 'inflate'], + ['deflateRaw', 'inflateRaw'], +].forEach(function(method) { + tape(method.join(' '), function(t) { + t.plan(4); + + zlib[method[0]](expect, opts, function(err, result) { + zlib[method[1]](result, opts, function(err, result) { + t.deepEqual(result, new Buffer(expect), + 'Should get original string after ' + + method[0] + '/' + method[1] + ' with options.'); + }); + }); + + zlib[method[0]](expect, function(err, result) { + zlib[method[1]](result, function(err, result) { + t.deepEqual(result, new Buffer(expect), + 'Should get original string after ' + + method[0] + '/' + method[1] + ' without options.'); + }); + }); + + var result = zlib[method[0] + 'Sync'](expect, opts); + result = zlib[method[1] + 'Sync'](result, opts); + t.deepEqual(result, new Buffer(expect), + 'Should get original string after ' + + method[0] + '/' + method[1] + ' with options.'); + + result = zlib[method[0] + 'Sync'](expect); + result = zlib[method[1] + 'Sync'](result); + t.deepEqual(result, new Buffer(expect), + 'Should get original string after ' + + method[0] + '/' + method[1] + ' without options.'); + }); +}); diff --git a/node_modules/browserify-zlib/test/test-zlib-from-string.js b/node_modules/browserify-zlib/test/test-zlib-from-string.js new file mode 100644 index 0000000..0376c55 --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-from-string.js @@ -0,0 +1,89 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// test compressing and uncompressing a string with zlib + +var tape = require('tape'); +var zlib = require('../'); + +var inputString = '\u03A9\u03A9Lorem ipsum dolor sit amet, consectetur adipiscing el' + + 'it. Morbi faucibus, purus at gravida dictum, libero arcu convallis la' + + 'cus, in commodo libero metus eu nisi. Nullam commodo, neque nec porta' + + ' placerat, nisi est fermentum augue, vitae gravida tellus sapien sit ' + + 'amet tellus. Aenean non diam orci. Proin quis elit turpis. Suspendiss' + + 'e non diam ipsum. Suspendisse nec ullamcorper odio. Vestibulum arcu m' + + 'i, sodales non suscipit id, ultrices ut massa. Sed ac sem sit amet ar' + + 'cu malesuada fermentum. Nunc sed. '; +var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpm' + + 'XAKLRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWLJWkncJG5403HQXAkT3' + + 'Jw29B9uIEmToMukglZ0vS6ociBh4JG8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491Lofo' + + 'AbWh8do43oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn2t/xjhduTA1N' + + 'WyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqq' + + 'qfKBtNMhe3OZh6N95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5xzfO/Ll9'; +var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN' + + '496pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6QOUpYslaSdwkbnjT' + + 'cdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHgkbyxXihUsRQKK0raTGrVbM+cKEcPOxoYr' + + 'Lj3Uuh+gBtaHx2jjeh65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' + + 'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/tuF4XuSpKPzgGbRHV9h' + + 'N9ory+qqp8oG00yF7c5mHo33kJO8xfkckmLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2s' + + 'HnHNzRtagj5AQAA'; + +tape('deflate', function(t) { + t.plan(1); + zlib.deflate(inputString, function(err, buffer) { + t.equal(buffer.toString('base64'), expectedBase64Deflate, + 'deflate encoded string should match'); + }); +}); + +tape('gzip', function(t) { + t.plan(1); + zlib.gzip(inputString, function(err, buffer) { + // Can't actually guarantee that we'll get exactly the same + // deflated bytes when we compress a string, since the header + // depends on stuff other than the input string itself. + // However, decrypting it should definitely yield the same + // result that we're expecting, and this should match what we get + // from inflating the known valid deflate data. + zlib.gunzip(buffer, function(err, gunzipped) { + t.equal(gunzipped.toString(), inputString, + 'Should get original string after gzip/gunzip'); + }); + }); +}); + +tape('unzip deflate', function(t) { + t.plan(1); + var buffer = new Buffer(expectedBase64Deflate, 'base64'); + zlib.unzip(buffer, function(err, buffer) { + t.equal(buffer.toString(), inputString, + 'decoded inflated string should match'); + }); +}); + +tape('unzip gzip', function(t) { + t.plan(1); + buffer = new Buffer(expectedBase64Gzip, 'base64'); + zlib.unzip(buffer, function(err, buffer) { + t.equal(buffer.toString(), inputString, + 'decoded gunzipped string should match'); + }); +}); diff --git a/node_modules/browserify-zlib/test/test-zlib-invalid-input.js b/node_modules/browserify-zlib/test/test-zlib-invalid-input.js new file mode 100644 index 0000000..5ac08c3 --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-invalid-input.js @@ -0,0 +1,62 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// test uncompressing invalid input + +var tape = require('tape'), + zlib = require('../'); + +tape('non-strings', function(t) { + var nonStringInputs = [1, true, {a: 1}, ['a']]; + t.plan(12); + + nonStringInputs.forEach(function(input) { + // zlib.gunzip should not throw an error when called with bad input. + t.doesNotThrow(function() { + zlib.gunzip(input, function(err, buffer) { + // zlib.gunzip should pass the error to the callback. + t.ok(err); + }); + }); + }); +}); + +tape('unzips', function(t) { + // zlib.Unzip classes need to get valid data, or else they'll throw. + var unzips = [ zlib.Unzip(), + zlib.Gunzip(), + zlib.Inflate(), + zlib.InflateRaw() ]; + + t.plan(4); + unzips.forEach(function (uz, i) { + uz.on('error', function(er) { + t.ok(er); + }); + + uz.on('end', function(er) { + throw new Error('end event should not be emitted '+uz.constructor.name); + }); + + // this will trigger error event + uz.write('this is not valid compressed data.'); + }); +}); diff --git a/node_modules/browserify-zlib/test/test-zlib-random-byte-pipes.js b/node_modules/browserify-zlib/test/test-zlib-random-byte-pipes.js new file mode 100644 index 0000000..6dba4c2 --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-random-byte-pipes.js @@ -0,0 +1,176 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var crypto = require('crypto'); +var stream = require('stream'); +var Stream = stream.Stream; +var util = require('util'); +var tape = require('tape'); +var zlib = require('../'); + + + +// emit random bytes, and keep a shasum +function RandomReadStream(opt) { + Stream.call(this); + + this.readable = true; + this._paused = false; + this._processing = false; + + this._hasher = crypto.createHash('sha1'); + opt = opt || {}; + + // base block size. + opt.block = opt.block || 256 * 1024; + + // total number of bytes to emit + opt.total = opt.total || 256 * 1024 * 1024; + this._remaining = opt.total; + + // how variable to make the block sizes + opt.jitter = opt.jitter || 1024; + + this._opt = opt; + + this._process = this._process.bind(this); + + process.nextTick(this._process); +} + +util.inherits(RandomReadStream, Stream); + +RandomReadStream.prototype.pause = function() { + this._paused = true; + this.emit('pause'); +}; + +RandomReadStream.prototype.resume = function() { + this._paused = false; + this.emit('resume'); + this._process(); +}; + +RandomReadStream.prototype._process = function() { + if (this._processing) return; + if (this._paused) return; + + this._processing = true; + + if (!this._remaining) { + this._hash = this._hasher.digest('hex').toLowerCase().trim(); + this._processing = false; + + this.emit('end'); + return; + } + + // figure out how many bytes to output + // if finished, then just emit end. + var block = this._opt.block; + var jitter = this._opt.jitter; + if (jitter) { + block += Math.ceil(Math.random() * jitter - (jitter / 2)); + } + block = Math.min(block, this._remaining); + var buf = new Buffer(block); + for (var i = 0; i < block; i++) { + buf[i] = Math.random() * 256; + } + + this._hasher.update(buf); + + this._remaining -= block; + + this._processing = false; + + this.emit('data', buf); + process.nextTick(this._process); +}; + + +// a filter that just verifies a shasum +function HashStream() { + Stream.call(this); + + this.readable = this.writable = true; + this._hasher = crypto.createHash('sha1'); +} + +util.inherits(HashStream, Stream); + +HashStream.prototype.write = function(c) { + // Simulate the way that an fs.ReadStream returns false + // on *every* write like a jerk, only to resume a + // moment later. + this._hasher.update(c); + process.nextTick(this.resume.bind(this)); + return false; +}; + +HashStream.prototype.resume = function() { + this.emit('resume'); + process.nextTick(this.emit.bind(this, 'drain')); +}; + +HashStream.prototype.end = function(c) { + if (c) { + this.write(c); + } + this._hash = this._hasher.digest('hex').toLowerCase().trim(); + this.emit('data', this._hash); + this.emit('end'); +}; + +tape('random byte pipes', function(t) { + var inp = new RandomReadStream({ total: 1024, block: 256, jitter: 16 }); + var out = new HashStream(); + var gzip = zlib.createGzip(); + var gunz = zlib.createGunzip(); + + inp.pipe(gzip).pipe(gunz).pipe(out); + + inp.on('data', function(c) { + t.ok(c.length); + }); + + gzip.on('data', function(c) { + t.ok(c.length); + }); + + gunz.on('data', function(c) { + t.ok(c.length); + }); + + out.on('data', function(c) { + t.ok(c.length); + }); + + out.on('data', function(c) { + t.ok(c.length); + t.equal(c, inp._hash, 'hashes should match'); + }); + + out.on('end', function() { + t.end(); + }) +}); + diff --git a/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js b/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js new file mode 100644 index 0000000..5841ef8 --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-write-after-flush.js @@ -0,0 +1,55 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var tape = require('tape'); +var zlib = require('../'); +var fs = require('fs'); + +tape('write after flush', function(t) { + t.plan(2); + + var gzip = zlib.createGzip(); + var gunz = zlib.createUnzip(); + + gzip.pipe(gunz); + + var output = ''; + var input = 'A line of data\n'; + gunz.setEncoding('utf8'); + gunz.on('data', function(c) { + output += c; + }); + + gunz.on('end', function() { + t.equal(output, input); + + // Make sure that the flush flag was set back to normal + t.equal(gzip._flushFlag, zlib.Z_NO_FLUSH); + }); + + // make sure that flush/write doesn't trigger an assert failure + gzip.flush(); write(); + function write() { + gzip.write(input); + gzip.end(); + gunz.read(0); + } +}); diff --git a/node_modules/browserify-zlib/test/test-zlib-zero-byte.js b/node_modules/browserify-zlib/test/test-zlib-zero-byte.js new file mode 100644 index 0000000..88bdd8c --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib-zero-byte.js @@ -0,0 +1,41 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var tape = require('tape'); +var zlib = require('../'); + +tape('zero byte', function(t) { + t.plan(2); + var gz = zlib.Gzip() + var emptyBuffer = new Buffer(0); + var received = 0; + gz.on('data', function(c) { + received += c.length; + }); + gz.on('end', function() { + t.equal(received, 20); + }); + gz.on('finish', function() { + t.ok(true); + }); + gz.write(emptyBuffer); + gz.end(); +}); diff --git a/node_modules/browserify-zlib/test/test-zlib.js b/node_modules/browserify-zlib/test/test-zlib.js new file mode 100644 index 0000000..64c02c5 --- /dev/null +++ b/node_modules/browserify-zlib/test/test-zlib.js @@ -0,0 +1,206 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var assert = require('assert'); +var zlib = require('../'); +var path = require('path'); + +var zlibPairs = + [[zlib.Deflate, zlib.Inflate], + [zlib.Gzip, zlib.Gunzip], + [zlib.Deflate, zlib.Unzip], + [zlib.Gzip, zlib.Unzip], + [zlib.DeflateRaw, zlib.InflateRaw]]; + +// how fast to trickle through the slowstream +var trickle = [128, 1024, 1024 * 1024]; + +// tunable options for zlib classes. + +// several different chunk sizes +var chunkSize = [128, 1024, 1024 * 16, 1024 * 1024]; + +// this is every possible value. +var level = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; +var windowBits = [8, 9, 10, 11, 12, 13, 14, 15]; +var memLevel = [1, 2, 3, 4, 5, 6, 7, 8, 9]; +var strategy = [0, 1, 2, 3, 4]; + +// it's nice in theory to test every combination, but it +// takes WAY too long. Maybe a pummel test could do this? +if (!process.env.PUMMEL) { + trickle = [1024]; + chunkSize = [1024 * 16]; + level = [6]; + memLevel = [8]; + windowBits = [15]; + strategy = [0]; +} + +var fs = require('fs'); + +if (process.env.FAST) { + zlibPairs = [[zlib.Gzip, zlib.Unzip]]; +} + +var tests = { + 'person.jpg': fs.readFileSync(__dirname + '/fixtures/person.jpg'), + 'elipses.txt': fs.readFileSync(__dirname + '/fixtures/elipses.txt'), + 'empty.txt': fs.readFileSync(__dirname + '/fixtures/empty.txt') +}; + +var util = require('util'); +var stream = require('stream'); + + +// stream that saves everything +function BufferStream() { + this.chunks = []; + this.length = 0; + this.writable = true; + this.readable = true; +} + +util.inherits(BufferStream, stream.Stream); + +BufferStream.prototype.write = function(c) { + this.chunks.push(c); + this.length += c.length; + return true; +}; + +BufferStream.prototype.end = function(c) { + if (c) this.write(c); + // flatten + var buf = new Buffer(this.length); + var i = 0; + this.chunks.forEach(function(c) { + c.copy(buf, i); + i += c.length; + }); + this.emit('data', buf); + this.emit('end'); + return true; +}; + + +function SlowStream(trickle) { + this.trickle = trickle; + this.offset = 0; + this.readable = this.writable = true; +} + +util.inherits(SlowStream, stream.Stream); + +SlowStream.prototype.write = function() { + throw new Error('not implemented, just call ss.end(chunk)'); +}; + +SlowStream.prototype.pause = function() { + this.paused = true; + this.emit('pause'); +}; + +SlowStream.prototype.resume = function() { + var self = this; + if (self.ended) return; + self.emit('resume'); + if (!self.chunk) return; + self.paused = false; + emit(); + function emit() { + if (self.paused) return; + if (self.offset >= self.length) { + self.ended = true; + return self.emit('end'); + } + var end = Math.min(self.offset + self.trickle, self.length); + var c = self.chunk.slice(self.offset, end); + self.offset += c.length; + self.emit('data', c); + process.nextTick(emit); + } +}; + +SlowStream.prototype.end = function(chunk) { + // walk over the chunk in blocks. + var self = this; + self.chunk = chunk; + self.length = chunk.length; + self.resume(); + return self.ended; +}; + + + +// for each of the files, make sure that compressing and +// decompressing results in the same data, for every combination +// of the options set above. +var tape = require('tape'); + +Object.keys(tests).forEach(function(file) { + var test = tests[file]; + chunkSize.forEach(function(chunkSize) { + trickle.forEach(function(trickle) { + windowBits.forEach(function(windowBits) { + level.forEach(function(level) { + memLevel.forEach(function(memLevel) { + strategy.forEach(function(strategy) { + zlibPairs.forEach(function(pair) { + var Def = pair[0]; + var Inf = pair[1]; + var opts = { + level: level, + windowBits: windowBits, + memLevel: memLevel, + strategy: strategy + }; + + var msg = file + ' ' + + chunkSize + ' ' + + JSON.stringify(opts) + ' ' + + Def.name + ' -> ' + Inf.name; + + tape('zlib ' + msg, function(t) { + t.plan(1); + + var def = new Def(opts); + var inf = new Inf(opts); + var ss = new SlowStream(trickle); + var buf = new BufferStream(); + + // verify that the same exact buffer comes out the other end. + buf.on('data', function(c) { + t.deepEqual(c, test); + }); + + // the magic happens here. + ss.pipe(def).pipe(inf).pipe(buf); + ss.end(test); + }); + }); + }); + }); + }); + }); + }); + }); +}); diff --git a/node_modules/browserify/.travis.yml b/node_modules/browserify/.travis.yml new file mode 100644 index 0000000..74c57bf --- /dev/null +++ b/node_modules/browserify/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" +before_install: + - npm install -g npm@~1.4.6 diff --git a/node_modules/browserify/LICENSE b/node_modules/browserify/LICENSE new file mode 100644 index 0000000..c901678 --- /dev/null +++ b/node_modules/browserify/LICENSE @@ -0,0 +1,63 @@ +Some pieces from builtins/ taken from node core under this license: + +---- + +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + +---- + +buffer_ieee754.js has this license in it: + +---- + +Copyright (c) 2008-2014, Fair Oaks Labs, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Modifications to writeIEEE754 to support negative zeroes made by Brian White + +---- diff --git a/node_modules/browserify/bin/advanced.txt b/node_modules/browserify/bin/advanced.txt new file mode 100644 index 0000000..c0efe12 --- /dev/null +++ b/node_modules/browserify/bin/advanced.txt @@ -0,0 +1,100 @@ +Advanced Options: + + --insert-globals, --ig, --fast [default: false] + + Skip detection and always insert definitions for process, global, + __filename, and __dirname. + + benefit: faster builds + cost: extra bytes + + --insert-global-vars, --igv + + Comma-separated list of global variables to detect and define. + Default: __filename,__dirname,process,Buffer,global + + --detect-globals, --dg [default: true] + + Detect the presence of process, global, __filename, and __dirname and define + these values when present. + + benefit: npm modules more likely to work + cost: slower builds + + --ignore-missing, --im [default: false] + + Ignore `require()` statements that don't resolve to anything. + + --noparse=FILE + + Don't parse FILE at all. This will make bundling much, much faster for giant + libs like jquery or threejs. + + --no-builtins + + Turn off builtins. This is handy when you want to run a bundle in node which + provides the core builtins. + + --no-commondir + + Turn off setting a commondir. This is useful if you want to preserve the + original paths that a bundle was generated with. + + --no-bundle-external + + Turn off bundling of all external modules. This is useful if you only want + to bundle your local files. + + --bare + + Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars + to just "__filename,__dirname". This is handy if you want to run bundles in + node. + + --no-browser-field, --no-bf + + Turn off package.json browser field resolution. This is also handy if you + need to run a bundle in node. + + --node + + Alias for --bare and --no-browser-field. + + --full-paths + + Turn off converting module ids into numerical indexes. This is useful for + preserving the original paths that a bundle was generated with. + + --deps + + Instead of standard bundle output, print the dependency array generated by + module-deps. + + --list + + Print each file in the dependency graph. Useful for makefiles. + + --extension=EXTENSION + + Consider files with specified EXTENSION as modules, this option can used + multiple times. + + --global-transform=MODULE, -g MODULE + + Use a transform module on all files after any ordinary transforms have run. + + --plugin=MODULE, -p MODULE + + Register MODULE as a plugin. + +Passing arguments to transforms and plugins: + + For -t, -g, and -p, you may use subarg syntax to pass options to the + transforms or plugin function as the second parameter. For example: + + -t [ foo -x 3 --beep ] + + will call the `foo` transform for each applicable file by calling: + + foo(file, { x: 3, beep: true }) + diff --git a/node_modules/browserify/bin/args.js b/node_modules/browserify/bin/args.js new file mode 100644 index 0000000..cd1b675 --- /dev/null +++ b/node_modules/browserify/bin/args.js @@ -0,0 +1,259 @@ +var browserify = require('../'); +var path = require('path'); +var spawn = require('child_process').spawn; +var parseShell = require('shell-quote').parse; +var insertGlobals = require('insert-module-globals'); +var duplexer = require('duplexer2'); +var subarg = require('subarg'); +var glob = require('glob'); +var Readable = require('readable-stream').Readable; +var xtend = require('xtend'); + +module.exports = function (args, opts) { + var argv = subarg(args, { + 'boolean': [ + 'deps', 'pack', 'ig', 'dg', 'im', 'd', 'list', 'builtins', + 'commondir', 'bare', 'full-paths', 'bundle-external', 'bf', + 'node' + ], + string: [ 's', 'r', 'u', 'x', 't', 'i', 'o', 'e', 'c', 'it' ], + alias: { + ig: [ 'insert-globals', 'fast' ], + dg: [ 'detect-globals', 'detectGlobals', 'dg' ], + bf: [ 'browser-field', 'browserField' ], + im: 'ignore-missing', + it: 'ignore-transform', + igv: 'insert-global-vars', + d: 'debug', + s: 'standalone', + noParse: [ 'noparse' ], + 'full-paths': [ 'fullpaths', 'fullPaths' ], + r: 'require', + u: 'exclude', + x: 'external', + t: 'transform', + i: 'ignore', + o: 'outfile', + e: 'entry', + c: 'command', + bare: 'bear' + }, + 'default': { + ig: false, + im: false, + dg: true, + d: false, + builtins: true, + commondir: true, + 'bundle-external': true, + bf: true, + node: false + } + }); + + var entries = argv._.concat(argv.entry) + .filter(Boolean).map(function (entry) { + if (entry === '-') { + var s = process.stdin; + if (typeof s.read === 'function') return s; + // only needed for 0.8, remove at some point later: + var rs = Readable().wrap(s); + s.resume(); + return rs; + } + return entry; + }); + + if (argv.node) { + argv.bare = true; + argv.browserField = false; + } + if (argv.bare) { + argv.builtins = false; + argv.commondir = false; + argv.detectGlobals = false; + if (argv.igv === undefined) { + argv.igv = '__filename,__dirname'; + } + } + + var ignoreTransform = argv['ignore-transform'] || argv.it; + var b = browserify(xtend({ + noParse: Array.isArray(argv.noParse) ? argv.noParse : [argv.noParse], + extensions: [].concat(argv.extension).filter(Boolean), + ignoreTransform: [].concat(ignoreTransform).filter(Boolean), + entries: entries, + fullPaths: argv['full-paths'], + builtins: argv.builtins === false ? false : undefined, + commondir: argv.commondir === false ? false : undefined, + bundleExternal: argv['bundle-external'], + basedir: argv.basedir, + browserField: argv.browserField, + + detectGlobals: argv.detectGlobals, + insertGlobals: argv['insert-globals'] || argv.ig, + insertGlobalVars: insertGlobalVars, + ignoreMissing: argv['ignore-missing'] || argv.im, + debug: argv['debug'] || argv.d, + standalone: argv['standalone'] || argv.s + }, opts)); + function error (msg) { + var e = new Error(msg); + process.nextTick(function () { b.emit('error', e) }); + } + b.argv = argv; + [].concat(argv.p).concat(argv.plugin).filter(Boolean) + .forEach(function (p) { + var pf = p, pOpts = {}; + if (typeof p === 'object') { + pf = p._.shift(), pOpts = p; + } + b.plugin(pf, pOpts); + }) + ; + + [].concat(argv.ignore).filter(Boolean) + .forEach(function (i) { + b._pending ++; + glob(i, function (err, files) { + if (err) return b.emit('error', err); + if (files.length === 0) { + b.ignore(i); + } + else { + files.forEach(function (file) { b.ignore(file) }); + } + if (--b._pending === 0) b.emit('_ready'); + }); + }) + ; + + [].concat(argv.exclude).filter(Boolean) + .forEach(function (u) { + b.exclude(u); + + b._pending ++; + glob(u, function (err, files) { + if (err) return b.emit('error', err); + files.forEach(function (file) { b.exclude(file) }); + if (--b._pending === 0) b.emit('_ready'); + }); + }) + ; + + [].concat(argv.require).filter(Boolean) + .forEach(function (r) { + var xs = splitOnColon(r); + b.require(xs[0], { expose: xs.length === 1 ? xs[0] : xs[1] }) + }) + ; + + // resolve any external files and add them to the bundle as externals + [].concat(argv.external).filter(Boolean) + .forEach(function (x) { + var xs = splitOnColon(x); + if (xs.length === 2) { + add(xs[0], { expose: xs[1] }); + } + else if (/\*/.test(x)) { + b.external(x); + glob(x, function (err, files) { + files.forEach(function (file) { + add(file, {}); + }); + }); + } + else add(x, {}); + + function add (x, opts) { + if (/^[\/.]/.test(x)) b.external(path.resolve(x), opts) + else b.external(x, opts) + } + }) + ; + + [].concat(argv.transform) + .filter(Boolean) + .forEach(function (t) { addTransform(t) }) + ; + + [].concat(argv.g).concat(argv['global-transform']) + .filter(Boolean) + .forEach(function (t) { + addTransform(t, { global: true }); + }) + ; + + function addTransform (t, opts) { + if (typeof t === 'string' || typeof t === 'function') { + b.transform(opts, t); + } + else if (t && typeof t === 'object') { + if (!t._[0] || typeof t._[0] !== 'string') { + return error( + 'expected first parameter to be a transform string' + ); + } + if (opts) Object.keys(opts).forEach(function (key) { + t[key] = opts[key]; + }); + b.transform(t, t._.shift()); + } + else error('unexpected transform of type ' + typeof t); + } + + [].concat(argv.command).filter(Boolean) + .forEach(function (c) { + var cmd = parseShell(c); + b.transform(function (file) { + var env = Object.keys(process.env).reduce(function (acc, key) { + acc[key] = process.env[key]; + return acc; + }, {}); + env.FILENAME = file; + var ps = spawn(cmd[0], cmd.slice(1), { env: env }); + var error = ''; + ps.stderr.on('data', function (buf) { error += buf }); + + ps.on('exit', function (code) { + if (code === 0) return; + console.error([ + 'error running source transform command: ' + c, + error.split('\n').join('\n '), + '' + ].join('\n')); + process.exit(1); + }); + return duplexer(ps.stdin, ps.stdout); + }); + }) + ; + + if (argv.standalone === '') { + error('--standalone requires an export name argument'); + return b; + } + + var insertGlobalVars; + if (argv.igv) { + insertGlobalVars = argv.igv.split(',').reduce(function (vars, x) { + vars[x] = insertGlobals.vars[x]; + return vars; + }, {}); + } + + return b; +}; + +function splitOnColon (f) { + var pos = f.lastIndexOf(':'); + if (pos == -1) { + return [f]; // No colon + } else { + if ((/[a-zA-Z]:[\\/]/.test(f)) && (pos == 1)){ + return [f]; // Windows path and colon is part of drive name + } else { + return [f.substr(0, pos), f.substr(pos + 1)]; + } + } +} diff --git a/node_modules/browserify/bin/cmd.js b/node_modules/browserify/bin/cmd.js new file mode 100644 index 0000000..5b838bb --- /dev/null +++ b/node_modules/browserify/bin/cmd.js @@ -0,0 +1,74 @@ +#!/usr/bin/env node +var fs = require('fs'); +var JSONStream = require('JSONStream'); +var through = require('through2'); + +var b = require('./args')(process.argv.slice(2)); +process.stdout.on('error', process.exit); + +if ((b.argv._[0] === 'help' && b.argv._[1]) === 'advanced' +|| (b.argv.h || b.argv.help) === 'advanced') { + return fs.createReadStream(__dirname + '/advanced.txt') + .pipe(process.stdout) + .on('close', function () { process.exit(1) }) + ; +} +if (b.argv._[0] === 'help' || b.argv.h || b.argv.help +|| (process.argv.length <= 2 && process.stdin.isTTY)) { + return fs.createReadStream(__dirname + '/usage.txt') + .pipe(process.stdout) + .on('close', function () { process.exit(1) }) + ; +} +if (b.argv.version) { + return console.log(require('../package.json').version); +} + +b.on('error', errorExit); + +if (b.argv.pack) { + process.stdin.pipe(b.pack()).pipe(process.stdout); + process.stdin.resume(); + return; +} + +if (b.argv.deps) { + var stringify = JSONStream.stringify(); + stringify.pipe(process.stdout); + b.pipeline.get('deps').push(through.obj( + function (row, enc, next) { stringify.write(row); next() }, + function () { stringify.end() } + )); + return b.bundle(); +} + +if (b.argv.list) { + b.pipeline.get('deps').push(through.obj( + function (row, enc, next) { + console.log(row.file || row.id); + next() + } + )); + return b.bundle(); +} + +var bundle = b.bundle(); +bundle.on('error', errorExit); + +var outfile = b.argv.o || b.argv.outfile; +if (outfile) { + bundle.pipe(fs.createWriteStream(outfile)); +} +else { + bundle.pipe(process.stdout); +} + +function errorExit(err) { + if (err.stack) { + console.error(err.stack); + } + else { + console.error(String(err)); + } + process.exit(1); +} diff --git a/node_modules/browserify/bin/usage.txt b/node_modules/browserify/bin/usage.txt new file mode 100644 index 0000000..2aa58b4 --- /dev/null +++ b/node_modules/browserify/bin/usage.txt @@ -0,0 +1,34 @@ +Usage: browserify [entry files] {OPTIONS} + +Standard Options: + + --outfile, -o Write the browserify bundle to this file. + If unspecified, browserify prints to stdout. + + --require, -r A module name or file to bundle.require() + Optionally use a colon separator to set the target. + + --entry, -e An entry point of your app + + --ignore, -i Replace a file with an empty stub. Files can be globs. + + --exclude, -u Omit a file from the output bundle. Files can be globs. + + --external, -x Reference a file from another bundle. Files can be globs. + + --transform, -t Use a transform module on top-level files. + + --command, -c Use a transform command on top-level files. + + --standalone -s Generate a UMD bundle for the supplied export name. + This bundle works with other module systems and sets the name + given as a window global if no module system is found. + + --debug -d Enable source maps that allow you to debug your files + separately. + + --help, -h Show this message + +For advanced options, type `browserify --help advanced`. + +Specify a parameter. diff --git a/node_modules/browserify/changelog.markdown b/node_modules/browserify/changelog.markdown new file mode 100644 index 0000000..544989d --- /dev/null +++ b/node_modules/browserify/changelog.markdown @@ -0,0 +1,1053 @@ +# 10.2.6 + +uses the non-sync version of fs.realpath + +# 10.2.5 + +fixes an issue with symlinked files executing multiple times + +https://github.com/substack/node-browserify/issues/1063 +https://github.com/substack/node-browserify/pull/1318 + +# 10.2.4 + +fixes requiring an entry from another entry + +remove unused dep "deep-equal" and unused file "lib/_exclude.js" + +https://github.com/substack/node-browserify/pull/1268 + +# 10.2.3 + +fixes an errant space in the `--no-browser-field` flag alias +that kept it from working + +https://github.com/substack/node-browserify/issues/1286 + +# 10.2.2 + +fix tests for tap@^1.1.0 (and update tap) + +https://github.com/substack/node-browserify/pull/1276 + +# 10.2.1 + +housekeeping - removed unused code + +https://github.com/substack/node-browserify/pull/1273 + +# 10.2.0 + +remove unnecessary "isDedupe" json check. this was a hack-fix for watchify <=2.4. + +https://github.com/substack/node-browserify/pull/1244 + +fixes for the "noParse" path matcher. + +https://github.com/substack/node-browserify/pull/1259 + +add syntax check cache. this speeds up rebuilds (like when using watchify). + +https://github.com/substack/node-browserify/pull/1253 + +update to browser-pack@^5.0.0 - includes several fixes related to source maps. + +https://github.com/substack/node-browserify/pull/1257 + +# 10.1.3 + +Replace jsonstream with JSONStream + +https://github.com/substack/node-browserify/pull/1252 + +# 10.1.2 + +Replace JSONStream with jsonstream +Update deps to avoid jsonstream npm case problems + +https://github.com/substack/node-browserify/pull/1247 +https://github.com/substack/node-browserify/commit/1ca71e23 + +# 10.1.1 + +ensures that entry paths are always full paths + +https://github.com/substack/node-browserify/pull/1248 + +# 10.1.0 + +adds `--no-browser-field` and `opts.browserField = false` behavior to turn off +the package.json browser field. This is useful if you want to make a bundle with +a target of node or some environment with shimmed node primitives. + +A new alias `--node` sets `--no-browser-field` and `--bare`. + +https://github.com/substack/node-browserify/pull/1240 + +# 10.0.0 + +## Possibly Breaking Change +The ‘process’ dependency was updated to ~0.11.0, this module is inserted into bundles as the ‘process’ global/dependency. +Previously, an unhandled error thrown in a ‘process.nextTick’ task would prevent any subsequent tasks from running, forever. +The task queue now recovers from this condition, but may do so on a future browser tick. +As part of this update, ‘process.nextTick’ now accepts variadic arguments, passed to the task, added to io.js in 1.8.1. + +* [#1231](https://github.com/substack/node-browserify/pull/1231) +* [defunctzombie/node-process#38](https://github.com/defunctzombie/node-process/pull/38) +* [iojs/io.js#1077](https://github.com/iojs/io.js/pull/1077) + +## Other changes + +* Escapes JavaScript-unsafe characters from JSON. [#1211](https://github.com/substack/node-browserify/pull/1211) +* Removes ‘-v’ shortcut for ‘--version’ (conflicted with watchify) [#1222](https://github.com/substack/node-browserify/pull/1222) +* Updated ‘defined’, ‘punycode’, ‘module-deps’, and ‘xtend’ dependencies to reduce install size [#1230](https://github.com/substack/node-browserify/pull/1230) + +# 9.0.8 + +makes `.require({ expose: 'name' })` and `require('name')` work at the same time + +https://github.com/substack/node-browserify/issues/850 +https://github.com/substack/node-browserify/pull/1202 + +# 9.0.7 + +fixes an issue with catching error events on the b.bundle() stream + +https://github.com/substack/node-browserify/issues/1194 +https://github.com/substack/node-browserify/pull/1195 + +# 9.0.6 + +republishing 9.0.5 in an attempt to satisfy npm. + +# 9.0.5 + +sets the stream returned by bundle() to be readable-only + +https://github.com/substack/node-browserify/pull/1187#issuecomment-89044008 + +# 9.0.4 + +handles the colon better for drive paths and improves the test suite for windows +users + +https://github.com/substack/node-browserify/pull/1182 +https://github.com/substack/node-browserify/pull/1183 + +# 9.0.3 + +fixes a problem with deduping for json files. + +This caused problems for running bundle() multiple times on the same instance +with caching turned on, which people reported encountering using watchify. + +https://github.com/substack/node-browserify/issues/1101 +https://github.com/substack/watchify/issues/143 + +# 9.0.2 + +fixes a bug where transforms in `opts.transform` were getting run twice + +https://github.com/substack/node-browserify/issues/1124 +https://github.com/substack/node-browserify/pull/1128 + +# 9.0.1 + +fixes exposed files persisting across bundles + +https://github.com/substack/node-browserify/pull/1030 + +# 9.0.0 + +updates browser-pack which uses umd 3.0.0. +This sligtly changes how `--standalone $name` works. + +https://github.com/substack/browser-pack/pull/49 +https://github.com/substack/node-browserify/pull/1105 + +Also some tidying up around handling expose that module-deps can do now: + +https://github.com/substack/node-browserify/pull/1077 + +and some fixes to regressions involving the `'package'` event: + +https://github.com/substack/node-resolve/issues/69 + +Upstream changes in resolve/browser-resolve mean that `require('foo/bar')` works +better with the package.json browser field. You can do something like: + +``` json +{ + "browser": { "./bar": "whatever.js" } +} +``` + +# 8.1.3 + +uses / instead of \ for source map url separators on windows +https://github.com/substack/node-browserify/pull/1096 + +# 8.1.2 + +resolves mappings from the browser field for externals + +https://github.com/substack/node-browserify/pull/1100 + +# 8.1.1 + +fixes an issue with resolving exposed packages relative to the basedir + +https://github.com/substack/node-browserify/pull/1059 +https://github.com/substack/node-browserify/issues/1039 +https://github.com/daiweilu/browserify-broken-require + +# 8.1.0 + +use assert@1.3, which fixes a bug in assert.deepEqual related to argument ordering, +and ensures assert.deepEqual continues working in Chrome 40 and Firefox 35. + +use process@0.10, which adds process.umask() and a faster process.nextTick() +implementation. + +https://github.com/substack/node-browserify/pull/1018 +https://github.com/substack/node-browserify/pull/1041 + +# 8.0.3 + +passes opts.debug through to insert-module-globals so that is can insert inline +source maps for its modifications + +# 8.0.2 + +ensures that transforms always execute in the order they were added + +https://github.com/substack/node-browserify/pull/1043 + +# 8.0.1 + +fixes some file path leaks in deduped deps + +https://github.com/substack/node-browserify/pull/994 +https://github.com/substack/node-browserify/issues/951 + +# 8.0.0 + +In previous releases, the deduping logic was over-zealous about how it handled +module references for duplicates. The prior behavior would detect when the +dependency tree of a module matched an existing module in addition to having the +exact same source code to share an instance. This was originally designed to +support libraries like threejs that internally use `instanceof` checks that +don't usually work very well across multiple packages. This feature didn't pan +out and didn't work very well in practice. + +Later, a better way of deduping emerged after some unrelated tweaks to +browser-pack to support source introspection for webworkers. The reflection form +of deduping using implicit arguments is now the only kind. + +The deduping instance feature resulted in this bug: +https://github.com/substack/node-browserify/issues/1027 +which created very surprising results when duplicate files were in use. + +# 7.1.0 + +uses the new buffer@3.0.0, which passes node's own buffer test suite + +https://github.com/substack/node-browserify/pull/1040 + +# 7.0.3 + +allows modules to be bundled with local paths and exposed at the same time + +https://github.com/substack/node-browserify/pull/1033 + +# 7.0.2 + +fixes the global transform getting added each re-bundle + +https://github.com/substack/node-browserify/issues/1026 + +# 7.0.1 + +fixes rebundling (used by watchify) when transforming + +https://github.com/substack/node-browserify/issues/1012 + +also fixes https://github.com/substack/node-browserify/issues/1015 + +# 7.0.0 + +Global transforms are now resolved to an absolute path before walking files. +This fixes some bugs with local module versions taking precedence over global +transforms and unresolvable global transforms spanning system directories. + +This is a small breaking change since now transform objects live in the pipeline +between the record and deps phases. This should only affect programs that expect +records in the pipeline to only contain file objects. + +# 6.3.4 + +fixes a bug setting placeholder filenames on stream inputs to be properly unique + +# 6.3.3 + +fixes an issue with the expose property when opts.fullPaths is enabled + +This issue commonly crops up in watchify. + +https://github.com/substack/node-browserify/pull/991 +https://github.com/substack/node-browserify/issues/850 + +# 6.3.2 + +updates regexps that test for absolute and relative paths to work better on +windows + +https://github.com/substack/node-browserify/pull/948 + +# 6.3.1 + +fixes ignoreTransform for the case where transforms were given in package.json +as an array + +https://github.com/substack/node-browserify/pull/966 + +# 6.3.0 + +uses noParse for better parity with module-deps + +https://github.com/substack/node-browserify/pull/954 + +# 6.2.0 + +fixes #!shebang syntax when --bare is in effect by adding an unshebang phase to +the pipeline + +https://github.com/substack/node-browserify/issues/943 + +# 6.1.2 + +fixes the behavior for multiple external bundles + +https://github.com/substack/node-browserify/issues/933 + +# 6.1.1 + +fixes a circular dependency issue with readable-stream + +https://github.com/substack/node-browserify/pull/964 +https://github.com/substack/node-browserify/issues/963 + +# 6.1.0 + +allows transforms to be ignored throughout the entire bundle + +https://github.com/substack/node-browserify/pull/945 + +# 6.0.3 + +fixes a bug where module insert-module-globals would trigger too soon and +conflict with other transforms + +https://github.com/substack/node-browserify/issues/867 +https://github.com/substack/node-browserify/issues/895 +https://github.com/substack/node-browserify/issues/855 + +# 6.0.2 + +upgrades process to 0.8.0 +https://github.com/substack/node-browserify/pull/906 + +# 6.0.1 + +respects opts.expose in require() +https://github.com/substack/node-browserify/pull/907 + +# 6.0.0 + +resolves source map maths relative to the base url. This should help with more +reproducible builds. + +https://github.com/substack/node-browserify/pull/923 + +Version 6 is a tiny but breaking change to how source map paths work. + +Now all source map paths are relative by default. This makes it easier to have +deterministic debug builds across different systems and directories. If +browserify is installed in a project-local directory, all the source map paths +will be self-contained and relative against that location in node_modules. + +# 5.13.1 + +bails early if opts.basedir is not the correct type +https://github.com/substack/node-browserify/pull/927 + +# 5.13.0 + +exposes global browserify options to transforms under opts._flags +https://github.com/substack/node-browserify/pull/910 + +# 5.12.2 + +fixes the array form of b.external() +https://github.com/substack/node-browserify/issues/930 + +# 5.12.1 + +dedupe deps when fullPaths is on +https://github.com/substack/node-browserify/pull/917 +and fixes the crypto tests + +# 5.12.0 + +adds back the array form for add() and require(), with extra places to add +options + +# 5.11.2 + +fixes ignore for relative paths +in https://github.com/substack/node-browserify/issues/896 + +# 5.11.1 + +fixes exports across resets, which caused issues for watchify with exports +https://github.com/substack/node-browserify/pull/892 + +# 5.11.0 + +adds an implicit dependency on the original module during dedupe +https://github.com/substack/node-browserify/pull/880 + +# 5.10.1 + +fixes the command-line client to properly ignore paths that don't match a glob +https://github.com/substack/node-browserify/pull/866 + +# 5.10.0 + +adds back support for `.external(b)` on a browserify instance `b` +that was dropped on the v5 refactor + +# 5.9.3 + +buffers the record pipeline phase to start outputting after the first tick +so that user plugins can capture and modify recorder output + +# 5.9.2 + +fixes a bug with using --ignore to exclude node_modules packages on the command-line + +https://github.com/substack/node-browserify/pull/845 + +# 5.9.1 + +improves the detection for --ignore + +# 5.9.0 + +fixes bug with builtins that load json files (the 'constants' module), +new 'json' pipeline label + +https://github.com/substack/module-deps/issues/46 + +# 5.8.0 + +allow optional extensions in bin/args + +# 5.7.0 + +re-instates transforms after a reset and fixes exposing the transform events +properly + +# 5.6.1 + +makes stream entry files deterministic + +# 5.6.0 + +adds 'package' events from module-deps when a package.json file is read + +# 5.5.0 + +adds back the `'bundle'` event and copies over options correctly to reset() + +# 5.4.2 + +adds a note about derequire in standalone mode to the readme + +# 5.4.1 + +fixes an error with basedir resolving plugins from names + +# 5.4.0 + +also allows opts.plugin from the constructor like transform + +# 5.3.0 + +passes `.file` on stream inputs through to transforms +https://github.com/substack/node-browserify/issues/744 + +# 5.2.1 + +sets require() for streams to not just be entry files + +# 5.2.0 + +upgrades crypto-browserify to v3 + +# 5.1.1 + +updates --list to always print file paths + +# 5.1.0 + +adds back `.plugin()` which was mistakenly omitted + +# 5.0.8 + +fixes using debug and standalone at the same time +https://github.com/substack/node-browserify/issues/750 + +# 5.0.7 + +fixes command-line versions of -u and -x +https://github.com/substack/node-browserify/issues/821 + +# 5.0.6 + +test for --bare + +# 5.0.5 + +fix for detectGlobals, --bare +https://github.com/substack/node-browserify/issues/803 + +# 5.0.4 + +fixes --no-bundle-external with globals + +https://github.com/substack/node-browserify/issues/828 + +# 5.0.3 + +upgrades insert-module-globals to fix +https://github.com/substack/node-browserify/issues/834 + +# 5.0.2 + +fixes the changelog link https://github.com/substack/node-browserify/pull/835 + +# 5.0.1 + +adds an untracked test + +# 5.0.0 + +At a glance: + +* extensible internal labeled-stream-splicer pipeline +* bundle() - no longer accepts `opts`, callback gets a buffer +* b.deps(), b.pack(), opts.pack, opts.deps are gone +* can call bundle() multiple times on the same instance +* a better --noparse matcher +* id labeling integer index based instead of hash based +* derequire removed for performance reasons +* .external(bundle) has been removed (for now) +* semicolon at end of output +* hashing is gone so `expose: true` or explicit expose id is required for doing +multi-export bundles + +Version 5 is a big rearranging of browserify internals with more places for +external code to hook into the build pipeline. + +These changes are mostly aligned around the theme of making it easier for +external code to interface with browserify internals in a less hacky way. + +## pipeline + +Now the core of browserify is organized into a +[labeled-stream-splicer](https://npmjs.org/package/labeled-stream-splicer) +pipeline. This means that user code and plugins can hook into browserify by +pushing themselves onto the pipeline at a label: + +``` js +var browserify = require('browserify'); +var through = require('through2'); +var bundle = browserify(); + +bundle.pipeline.get('deps').push(through.obj(function (row, enc, next) { + console.log('DEP:', row.id); + this.push(row); + next(); +})); +``` + +User code can remove existing transforms or add its own hooks. These are the +labeled sections you can get a handle on with `bundle.pipeline.get()` + +* `'record'` - save inputs to play back later on subsequent `bundle()` calls +* `'deps'` - [module-deps](https://npmjs.org/package/module-deps) +* `'unbom'` - remove byte-order markers +* `'syntax'` - check for syntax errors +* `'sort'` - sort the dependencies for deterministic bundles +* `'dedupe'` - remove duplicate source contents +* `'label'` - apply integer labels to files +* `'emit-deps'` - emit `'dep'` event +* `'debug'` - apply source maps +* `'pack'` - [browser-pack](https://npmjs.org/package/browser-pack) +* `'wrap'` - apply final wrapping, `require=` and a newline and semicolon + +Because there is now a proper pipeline, `opts.pack`, `opts.deps`, `b.deps()`, +and `b.pack()` are removed. + +## bundle() + +Big changes have been made to the `bundle()` function. All options have been +moved out of the `bundle(opts)` form and into the browserify constructor. Before +there was an unclear split between which arguments went into which function. + +You can now call `bundle()` multiple times on the same instance, even in +parallel. This will greatly simplify the caching system under watchify and will +fix many long-standing bugs. + +The callback to `bundle(cb)` is now called with `cb(err, buf)` instead of +`cb(err, string)` as before. + +## labeling + +The former hashing system is removed, in favor of file paths rooted at the +`opts.basedir`, or the cwd. + +This removal means that browserify can be much more consistent about applying +integer ids, which avoids exposing system paths in bundle output. + +Hashes are used internally for deduping purposes, but they operate on the +source content only. + +## others + +The matching logic in the `--noparse` feature is greatly improved. + +derequire has been taken out of core, which should speed up `--standalone`. + +# 4.2.3 + +reverts 4.2.2 due to breaking some existing use-cases + +# 4.2.2 + +fixes a bug applying transforms to symlinked files by resolving the realpath +first https://github.com/substack/node-browserify/pull/831 + +# 4.2.1 + +SECURITY NOTICE + +Make sure your installation of browserify is using syntax-error@1.1.1 or +later. there was a security vulnerability where a malicious file could +execute code when browserified. + +The vulnerability involves breaking out of `Function()`, which was used to +check syntax for more informative errors. In node 0.10, `Function()` seems +to be implemented in terms of `eval()`, so malicious code can execute even +if the function returned by `Function()` was never called. node 0.11 does +not appear to be vulnerable. + +Thanks to Cal Leeming [cal@iops.io] +for discovering and disclosing this bug! + +# 4.2.0 + +upgrades http-browserify, crypto-browserify, and sets more versions to float +with ^ semvers + +# 4.1.11 + +fixes a bug with transform argument handling https://github.com/substack/node-browserify/pull/795 + +# 4.1.10 + +upgrades browser-resolve to get opts.path fixes https://github.com/defunctzombie/node-browser-resolve/pull/43 + +# 4.1.9 + +upgrades resolve to fix relative NODE_PATH paths https://github.com/substack/node-resolve/pull/46 + +# 4.1.8 + +bumps the module-deps version to get an ordering bugfix https://github.com/substack/module-deps/pull/39 https://github.com/substack/node-browserify/pull/774 + +# 4.1.7 + +fixes ignoreMissing when set in the constructor https://github.com/substack/node-browserify/pull/785 + +# 4.1.6 + +emits the 'id' event on the correct instance https://github.com/substack/node-browserify/pull/780 + +# 4.1.5 + +added this document + +# 4.1.4 + +fixes a bug in `ie<=8` support for querystring https://github.com/substack/node-browserify/issues/764 + +# 4.1.2 + +upgrades umd to fix some issues with --standalone https://github.com/substack/node-browserify/pull/714 + +# 4.1.1 + +makes deps() behave more like bundle() https://github.com/substack/node-browserify/issues/757 and fixes global transform precedence https://github.com/substack/node-browserify/issues/759 + +# 4.1.0 + +upgrades the version of buffer to ^2.3.0 + +# 4.0 + +Here are the new breaking changes in browserify v4. Most users should be unaffected. + +## readable-stream + +`require('stream')` is now using [readable-stream](https://npmjs.org/package/readable-stream) (but the classic-mode shim persists in stream-browserify just like in node core). This should result in much smaller files for all modules using a similar-enough version of readable-stream as browserify itself. Other modules should be relatively unaffected. + +## removed .expose() + +Removal of the previously-deprecated and obscure `bundle.expose()`. + +## took out implicit reading from stdin + +Previously if you invoked the browserify command without any entry files as arguments and stdin was a tty, stdin would be implicitly added as an entry file. This feature was causing problems so it has been removed. https://github.com/substack/node-browserify/issues/724#issuecomment-42731877 + +## more! + +In the run-up to the 4.0, [module-deps](https://npmjs.org/package/module-deps) got an extensive rewrite with minimal test changes. Mostly it was just getting really messy because it was a giant ball-of-mud closure instead of a more straightforward prototype-based implementation with more clearly-defined methods. + +The module-deps rewrite was triggered by [system paths showing up in build output](https://github.com/substack/node-browserify/issues/675) but was fixed in 3.46.1. The solution actually didn't end up needing changes in module-deps as originally anticipated but module-deps was in dire need of a cleanup. + +# 3.46.1 + +fixes a bug exposing the host path of the process module in the bundle output https://github.com/substack/insert-module-globals/pull/32 + +# 3.46.0 + +allows array arguments in b.require(), b.add(), and b.external() https://github.com/substack/node-browserify/pull/742 from @spacepluk + +# 3.45.0 + +renders complete stack traces where before they were getting truncated https://github.com/substack/node-browserify/pull/741 patch from @secoif + +# 3.44.2 + +slims down the dependency payload by 20M https://github.com/substack/node-browserify/pull/736 + +# 3.44.1 + +fixes the recursion error many people were getting https://github.com/substack/node-browserify/pull/713 Thanks to @MattMcKegg for isolating the bug! + +# 3.44.0 + +upgrades module-deps to 1.10.0 to make all the packageFilter dir argument pathways are consistent + +# 3.43.0 + +lets b.transform(opts, t) args to be swapped around since opts is more common as a last argument + +# 3.42.0 + +passes through the dir parameter in opts.packageFilter from module-deps 1.10.0 https://github.com/substack/node-browserify/pull/731 + +# 3.41.0 + +has an option to disable external files, making it easier to run bundles in node for code coverage https://github.com/substack/node-browserify/pull/672 + +# 3.40.4 + +makes --list work again https://github.com/substack/node-browserify/pull/727 + +# 3.40.3 + +merges a patch for piping via stdin and --require at the same time https://github.com/substack/node-browserify/pull/728 + +# 3.40.2 + +upgrades module-deps to fix --list for $NODE_PATH https://github.com/substack/node-browserify/issues/726 + +# 3.40.1 + +upgrades module-deps to get this packageTransform bugfix https://github.com/substack/module-deps/pull/32 + +# 3.40.0 + +modifies the behavior of opts.builtins to be more useful and intuitive https://github.com/substack/node-browserify/pull/717 + +# 3.39.0 + +adds a zlib that has parity with node https://github.com/substack/node-browserify/pull/721 + +# 3.38.0 + +upgrades derequire which uses esprima-fb https://github.com/substack/node-browserify/pull/710 + +# 3.37.2 + +adds 'close' events back to the bundle stream. This should fix some issues with watchify. + +# 3.37.1 + +fixes a bug with through being required in the bin/cmd.js instead of through2 + +# 3.37.0 + +also reverts that require('process') thing which was mistakenly briefly put in the builtins list + +# 3.37.0 + +gives streams2 semantics for bundle() https://github.com/substack/node-browserify/pull/646 + +# 3.36.1 + +fixes a dumb bug with ^ for versions that don't work in old npm clients + +# 3.36.0 + +adds require('process') and removes the path resolution for process out of insert-module-globals + +# 3.35.0 + +adds an empty tls stub to the builtins list https://github.com/substack/node-browserify/issues/703 + +# 3.34.0 + +fixes a bug with transforms not being applied in deps() https://github.com/substack/node-browserify/pull/708 + +# 3.33.1 + +fixes a bug with options in --global-transform on the command-line https://github.com/substack/node-browserify/pull/705 + +# 3.33.0 + +fixes parsing errors while maintaining es6 support by switching to esprima-fb https://github.com/substack/node-browserify/issues/698 + +# 3.32.1 + +should be easier to shinkwrap and install on windows https://github.com/substack/node-browserify/pull/684 + +# 3.32.0 + +adds --full-path and opts.fullPath to always expand ids to full paths https://github.com/substack/node-browserify/pull/668#issuecomment-36586786 + +# 3.31.2 + +fixes a bug in the subarg argument parsing for multiple transforms https://github.com/substack/node-browserify/issues/678 + +# 3.31.1 + +uses process.cwd() as the default rebase target instead of commondir https://github.com/substack/node-browserify/pull/669#issuecomment-36078282 + +# 3.31.0 + +merges https://github.com/substack/node-browserify/pull/669 which should help with more deterministic builds across systems + +# 3.30.4 + +fixes parsing the --insert-global-vars argument properly https://github.com/substack/node-browserify/pull/674 + +# 3.30.3 + +fixes exclude globbing in the arg parser https://github.com/substack/node-browserify/pull/676 + +# 3.30.2 + +included a fix for --no-builtins for non-wrapped modules https://github.com/substack/node-browserify/pull/666 + +# 3.30.1 + +upgrades buffer for a utf8 fix https://github.com/substack/node-browserify/pull/656 + +# 3.30.0 + +adds globs for -u, -i, and -x https://github.com/substack/node-browserify/issues/654 + +# 3.29.1 + +adds relatively-resolved paths to ignored and excluded files + +# 3.29.0 + +upgrades http-browserify to 1.3.1 + +# 3.28.2 + +now always includes the full package.json content in the 'package' event + +# 3.28.1 + +fixes a bug with stream entry order https://github.com/substack/node-browserify/pull/643 + +# 3.28.0 + +adds plugins for doing super fancy things like factored bundle output https://github.com/substack/node-browserify#plugins + +# 3.27.1 + +fixes a bug resolving transform modules when browserify is under a symlink + +# 3.27.0 + +adds transform configuration in the package.json browserify.transform field https://github.com/substack/module-deps#packagejson-transformkey + +# 3.26.0 + +you can pass arguments to transforms https://github.com/substack/node-browserify/blob/master/bin/advanced.txt#L67-L77 + +# 3.25.2 + +fixes a bug where the transform event didn't fire while IO was pending + +# 3.25.1 + +fixes the transform docs + +# 3.25.0 + +adds 'bundle' and 'transform' events https://github.com/substack/node-browserify#bonbundle-function-bundle- + +# 3.24.11 + +upgrades derequire to 0.6.0. That should be the last piece needed for full es6 syntax support. + +# 3.24.10 + +expands the documentation for the package.json browser and browserify.transform fields https://github.com/substack/node-browserify#packagejson + +# 3.24.9 + +fixes generator syntax and other es6-isms in browserify https://github.com/substack/node-browserify/issues/614 + +# 3.24.7 + +fixes noParse, which had accidentally been disabled in the insert-module-global changes and also closes https://github.com/substack/node-browserify/issues/504 + +# 3.24.6 + +similar to 3.24.5, 3.24.6 fixes some error reporting propagation from the browserify command + +# 3.24.3 + +fixes how require('buffer').Buffer wasn't the same as implicit Buffer https://github.com/substack/node-browserify/issues/612 + +# 3.24.2 + +fixes where the output stream didn't emit "close" in standalone mode https://github.com/substack/node-browserify/pull/608 + +# 3.24.1 + +fixes an issue where --standalone combined with expose caused a syntax error https://github.com/substack/node-browserify/issues/489 + +# 3.24.0 + +removes require() calls from --standalone so you can require() a standalone bundle again + +# 3.23.0 + +merges this tiny fix returning `this` in noParse() https://github.com/substack/node-browserify/pull/592 + +# 3.22.0 + +merges https://github.com/substack/node-browserify/pull/587 which changes the source map prefix from //@ to //# + +# 3.21.0 + +standardizes the module missing error formats to have filename, parent, and type === 'not found' fields + +# 3.20.1 + +has a fix for the case where stdin is implicitly treated as the input stream instead of a file + +# 3.20.0 + +3.20.0 is out: parity with how $NODE_PATH works in node https://github.com/substack/node-browserify/issues/593 + +# 3.19.1 + +restores support for node 0.8 by upgrading concat-stream + +# 3.0 + +A new [browserify](http://browserify.org) version is upon us, just in time for +the FESTIVE SEASON during which we in the northern hemisphere at mid to high +latitudes huddle for warmth around oxidizing hydrocarbons! + +There are 2 big changes in v3 but most code should be relatively unaffected. + +## shiny new Buffer + +[feross](https://github.com/feross) forked +the [buffer-browserify](https://npmjs.org/package/buffer-browserify) package +to create +[native-buffer-browserify](https://npmjs.org/package/native-buffer-browserify), +a `Buffer` implementation that uses `Uint8Array` to get `buf[i]` notation and +parity with the node core `Buffer` api without the performance hit of the +previous implementation and a much smaller file size. The downside is that +`Buffer` now only works in browsers with `Uint8Array` and `DataView` support. +All the other modules should maintain existing browser support. + +*Update*: a [shim was added](https://npmjs.org/package/typedarray) +to in 3.1 for Uint8Array and DataView support. Now you can use `Buffer` in every +browser. + +## direct builtin dependencies + +In v3, browserify no longer depends on +[browser-builtins](https://npmjs.org/package/browser-builtins), in favor of +depending on packages directly. Instead of having some separate packages and +some files in a `builtin/` directory like browser-builtins, browserify now uses +*only* external packages for the shims it uses. By only using external packages +we can keep browserify core focused purely on the static analysis and bundling +machinery while letting the individual packages worry about things like browser +compatibility and parity with the node core API as it evolves. + +Individual, tiny packages should also be much easier for newcomers to contribute +packages toward because they won't need to get up to speed with all the other +pieces going on and the packages can have their own tests and documentation. +Additionally, each package may find uses in other projects beside browserify +more easily and if people want variations on the versions of shims that ship +with browserify core this is easier to do when everything is separate. + +Back when we were using browser-builtins there was a large latency between +pushing out fixes to the individual packages and getting them into browserify +core because we had to wait on browser-builtins to upgrade the semvers in its +package.json. With direct dependencies we get much lower latency for package +upgrades and much more granular control over upgrading packages. + +Here is the list of packages we now directly depend on in v3: + +* [assert](https://npmjs.org/package/assert) +* [buffer](https://npmjs.org/package/native-buffer-browserify) +* [console](https://npmjs.org/package/console-browserify) +* [constants](https://npmjs.org/package/constants-browserify) +* [crypto](https://npmjs.org/package/crypto-browserify) +* [events](https://npmjs.org/package/events-browserify) +* [http](https://npmjs.org/package/http-browserify) +* [https](https://npmjs.org/package/https-browserify) +* [os](https://npmjs.org/package/os-browserify) +* [path](https://npmjs.org/package/path-browserify) +* [punycode](https://npmjs.org/package/punycode) +* [querystring](https://npmjs.org/package/querystring) +* [stream](https://npmjs.org/package/stream-browserify) +* [string_decoder](https://npmjs.org/package/string_decoder) +* [timers](https://npmjs.org/package/timers-browserify) +* [tty](https://npmjs.org/package/tty-browserify) +* [url](https://npmjs.org/package/url) +* [util](https://npmjs.org/package/util) +* [vm](https://npmjs.org/package/vm-browserify) +* [zlib](https://npmjs.org/package/zlib-browserify) + +That's it! If you're bold enough to give v3 a spin, just do: + +``` +npm install -g browserify +``` diff --git a/node_modules/browserify/example/api/browser/bar.js b/node_modules/browserify/example/api/browser/bar.js new file mode 100644 index 0000000..12bdd9f --- /dev/null +++ b/node_modules/browserify/example/api/browser/bar.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 3 }; diff --git a/node_modules/browserify/example/api/browser/foo.js b/node_modules/browserify/example/api/browser/foo.js new file mode 100644 index 0000000..4db9fff --- /dev/null +++ b/node_modules/browserify/example/api/browser/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * bar(n); +}; diff --git a/node_modules/browserify/example/api/browser/main.js b/node_modules/browserify/example/api/browser/main.js new file mode 100644 index 0000000..d271395 --- /dev/null +++ b/node_modules/browserify/example/api/browser/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log(foo(5)); diff --git a/node_modules/browserify/example/api/build.js b/node_modules/browserify/example/api/build.js new file mode 100644 index 0000000..5103a2a --- /dev/null +++ b/node_modules/browserify/example/api/build.js @@ -0,0 +1,4 @@ +var browserify = require('browserify'); +var b = browserify(); +b.add('./browser/main.js'); +b.bundle().pipe(process.stdout); diff --git a/node_modules/browserify/example/multiple_bundles/beep.js b/node_modules/browserify/example/multiple_bundles/beep.js new file mode 100644 index 0000000..e072a54 --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/beep.js @@ -0,0 +1,2 @@ +var robot = require('./robot'); +console.log(robot('beep')); diff --git a/node_modules/browserify/example/multiple_bundles/boop.js b/node_modules/browserify/example/multiple_bundles/boop.js new file mode 100644 index 0000000..15fc71f --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/boop.js @@ -0,0 +1,2 @@ +var robot = require('./robot'); +console.log(robot('boop')); diff --git a/node_modules/browserify/example/multiple_bundles/build.sh b/node_modules/browserify/example/multiple_bundles/build.sh new file mode 100644 index 0000000..1066a86 --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +browserify -r ./robot.js > static/common.js +browserify -x ./robot.js beep.js > static/beep.js +browserify -x ./robot.js boop.js > static/boop.js diff --git a/node_modules/browserify/example/multiple_bundles/robot.js b/node_modules/browserify/example/multiple_bundles/robot.js new file mode 100644 index 0000000..bb32bdc --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/robot.js @@ -0,0 +1 @@ +module.exports = function (s) { return s.toUpperCase() + '!' }; diff --git a/node_modules/browserify/example/multiple_bundles/static/beep.html b/node_modules/browserify/example/multiple_bundles/static/beep.html new file mode 100644 index 0000000..28ecb3c --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/static/beep.html @@ -0,0 +1,2 @@ + + diff --git a/node_modules/browserify/example/multiple_bundles/static/boop.html b/node_modules/browserify/example/multiple_bundles/static/boop.html new file mode 100644 index 0000000..13dab7e --- /dev/null +++ b/node_modules/browserify/example/multiple_bundles/static/boop.html @@ -0,0 +1,2 @@ + + diff --git a/node_modules/browserify/example/source_maps/build.js b/node_modules/browserify/example/source_maps/build.js new file mode 100644 index 0000000..e65bc7e --- /dev/null +++ b/node_modules/browserify/example/source_maps/build.js @@ -0,0 +1,13 @@ +var browserify = require('../..'), + path = require('path'), + fs = require('fs'), + bundlePath = path.join(__dirname, 'js', 'build', 'bundle.js'); + +browserify() + .require(require.resolve('./js/main.js'), { + entry: true, + debug: true + }) + .bundle() + .on('error', function (err) { console.error(err); }) + .pipe(fs.createWriteStream(bundlePath)); diff --git a/node_modules/browserify/example/source_maps/build.sh b/node_modules/browserify/example/source_maps/build.sh new file mode 100644 index 0000000..6ae19fb --- /dev/null +++ b/node_modules/browserify/example/source_maps/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +../../bin/cmd.js --debug -e ./js/main.js > js/build/bundle.js + +echo bundle was generated with source maps, you can now open index.html diff --git a/node_modules/browserify/example/source_maps/index.html b/node_modules/browserify/example/source_maps/index.html new file mode 100644 index 0000000..d06c889 --- /dev/null +++ b/node_modules/browserify/example/source_maps/index.html @@ -0,0 +1,11 @@ + + + + + + + + +

Open your dev tools ;)

+ + diff --git a/node_modules/browserify/example/source_maps/js/build/.npmignore b/node_modules/browserify/example/source_maps/js/build/.npmignore new file mode 100644 index 0000000..f935021 --- /dev/null +++ b/node_modules/browserify/example/source_maps/js/build/.npmignore @@ -0,0 +1 @@ +!.gitignore diff --git a/node_modules/browserify/example/source_maps/js/build/bundle.js b/node_modules/browserify/example/source_maps/js/build/bundle.js new file mode 100644 index 0000000..a807c46 --- /dev/null +++ b/node_modules/browserify/example/source_maps/js/build/bundle.js @@ -0,0 +1,28 @@ +;(function(e,t,n,r){function i(r){if(!n[r]){if(!t[r]){if(e)return e(r);throw new Error("Cannot find module '"+r+"'")}var s=n[r]={exports:{}};t[r][0](function(e){var n=t[r][1][e];return i(n?n:e)},s,s.exports)}return n[r].exports}for(var s=0;s= 0) return next(); + if (self._external.indexOf(row.file) >= 0) return next(); + + if (isAbsolutePath(row.id)) { + row.id = '/' + path.relative(basedir, row.file); + } + Object.keys(row.deps || {}).forEach(function (key) { + row.deps[key] = '/' + path.relative(basedir, row.deps[key]); + }); + this.push(row); + next(); + })); + } + return pipeline; +}; + +Browserify.prototype._createDeps = function (opts) { + var self = this; + var mopts = xtend(opts); + var basedir = defined(opts.basedir, process.cwd()); + + // Let mdeps populate these values since it will be resolving file paths + // anyway. + mopts.expose = this._expose; + mopts.extensions = [ '.js', '.json' ].concat(mopts.extensions || []); + self._extensions = mopts.extensions; + + mopts.transform = []; + mopts.transformKey = [ 'browserify', 'transform' ]; + mopts.postFilter = function (id, file, pkg) { + if (opts.postFilter && !opts.postFilter(id, file, pkg)) return false; + if (self._external.indexOf(file) >= 0) return false; + if (self._exclude.indexOf(file) >= 0) return false; + + //filter transforms on module dependencies + if (pkg && pkg.browserify && pkg.browserify.transform) { + //In edge cases it may be a string + pkg.browserify.transform = [].concat(pkg.browserify.transform) + .filter(Boolean) + .filter(self._filterTransform); + } + return true; + }; + mopts.filter = function (id) { + if (opts.filter && !opts.filter(id)) return false; + if (self._external.indexOf(id) >= 0) return false; + if (self._exclude.indexOf(id) >= 0) return false; + if (opts.bundleExternal === false && isExternalModule(id)) { + return false; + } + return true; + }; + mopts.resolve = function (id, parent, cb) { + if (self._ignore.indexOf(id) >= 0) return cb(null, paths.empty, {}); + + self._bresolve(id, parent, function (err, file, pkg) { + if (file && self._ignore.indexOf(file) >= 0) { + return cb(null, paths.empty, {}); + } + if (file && self._ignore.length) { + var nm = file.split('/node_modules/')[1]; + if (nm) { + nm = nm.split('/')[0]; + if (self._ignore.indexOf(nm) >= 0) { + return cb(null, paths.empty, {}); + } + } + } + + if (file) { + var ex = '/' + path.relative(basedir, file); + if (self._external.indexOf(ex) >= 0) { + return cb(null, ex); + } + if (self._exclude.indexOf(ex) >= 0) { + return cb(null, ex); + } + if (self._ignore.indexOf(ex) >= 0) { + return cb(null, paths.empty, {}); + } + } + if (err) cb(err, file, pkg) + else if (file) fs.realpath(file, function (err, res) { + cb(err, res, pkg); + }); + else cb(err, null, pkg) + }); + }; + + if (opts.builtins === false) { + mopts.modules = {}; + self._exclude.push.apply(self._exclude, Object.keys(builtins)); + } + else if (opts.builtins && isarray(opts.builtins)) { + mopts.modules = {}; + opts.builtins.forEach(function (key) { + mopts.modules[key] = builtins[key]; + }); + } + else if (opts.builtins && typeof opts.builtins === 'object') { + mopts.modules = opts.builtins; + } + else mopts.modules = xtend(builtins); + + Object.keys(builtins).forEach(function (key) { + if (!has(mopts.modules, key)) self._exclude.push(key); + }); + + mopts.globalTransform = []; + if (!this._bundled) { + this.once('bundle', function () { + self.pipeline.write({ + transform: globalTr, + global: true, + options: {} + }); + }); + } + + var no = [].concat(opts.noParse).filter(Boolean); + var absno = no.filter(function(x) { + return typeof x === 'string'; + }).map(function (x) { + return path.resolve(basedir, x); + }); + + function globalTr (file) { + if (opts.detectGlobals === false) return through(); + + if (opts.noParse === true) return through(); + if (no.indexOf(file) >= 0) return through(); + if (absno.indexOf(file) >= 0) return through(); + + var parts = file.split('/node_modules/'); + for (var i = 0; i < no.length; i++) { + if (typeof no[i] === 'function' && no[i](file)) { + return through(); + } + else if (no[i] === parts[parts.length-1].split('/')[0]) { + return through(); + } + else if (no[i] === parts[parts.length-1]) { + return through(); + } + } + + var vars = xtend({ + process: function () { return "require('_process')" }, + }, opts.insertGlobalVars); + + if (opts.bundleExternal === false) { + delete vars.process; + delete vars.buffer; + } + + return insertGlobals(file, xtend(opts, { + debug: opts.debug, + always: opts.insertGlobals, + basedir: opts.commondir === false + ? '/' + : opts.basedir || process.cwd() + , + vars: vars + })); + } + return mdeps(mopts); +}; + +Browserify.prototype._recorder = function (opts) { + var self = this; + var ended = false; + this._recorded = []; + + if (!this._ticked) { + process.nextTick(function () { + self._ticked = true; + self._recorded.forEach(function (row) { + stream.push(row); + }); + if (ended) stream.push(null); + }); + } + + var stream = through.obj(write, end); + return stream; + + function write (row, enc, next) { + self._recorded.push(row); + if (self._ticked) this.push(row); + next(); + } + function end () { + ended = true; + if (self._ticked) this.push(null); + } +}; + +Browserify.prototype._json = function () { + return through.obj(function (row, enc, next) { + if (/\.json$/.test(row.file)) { + row.source = 'module.exports=' + sanitize(row.source); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._unbom = function () { + return through.obj(function (row, enc, next) { + if (/^\ufeff/.test(row.source)) { + row.source = row.source.replace(/^\ufeff/, ''); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._unshebang = function () { + return through.obj(function (row, enc, next) { + if (/^#!/.test(row.source)) { + row.source = row.source.replace(/^#![^\n]*\n/, ''); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._syntax = function () { + var self = this; + return through.obj(function (row, enc, next) { + var h = shasum(row.source); + if (typeof self._syntaxCache[h] === 'undefined') { + var err = syntaxError(row.source, row.file || row.id); + if (err) return this.emit('error', err); + self._syntaxCache[h] = true; + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._dedupe = function () { + return through.obj(function (row, enc, next) { + if (!row.dedupeIndex && row.dedupe) { + row.source = 'arguments[4][' + + JSON.stringify(row.dedupe) + + '][0].apply(exports,arguments)' + ; + row.nomap = true; + } + else if (row.dedupeIndex) { + row.source = 'arguments[4][' + + JSON.stringify(row.dedupeIndex) + + '][0].apply(exports,arguments)' + ; + row.nomap = true; + } + if (row.dedupeIndex && row.indexDeps) { + row.indexDeps.dup = row.dedupeIndex; + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._label = function (opts) { + var self = this; + var basedir = defined(opts.basedir, process.cwd()); + + return through.obj(function (row, enc, next) { + var prev = row.id; + + if (self._external.indexOf(row.id) >= 0) return next(); + if (self._external.indexOf('/' + path.relative(basedir, row.id)) >= 0) { + return next(); + } + if (self._external.indexOf(row.file) >= 0) return next(); + + if (row.index) row.id = row.index; + + self.emit('label', prev, row.id); + if (row.indexDeps) row.deps = row.indexDeps || {}; + + Object.keys(row.deps).forEach(function (key) { + if (self._expose[key]) { + row.deps[key] = key; + return; + } + + var afile = path.resolve(path.dirname(row.file), key); + var rfile = '/' + path.relative(basedir, afile); + if (self._external.indexOf(rfile) >= 0) { + row.deps[key] = rfile; + } + if (self._external.indexOf(afile) >= 0) { + row.deps[key] = rfile; + } + if (self._external.indexOf(key) >= 0) { + row.deps[key] = key; + return; + } + + for (var i = 0; i < self._extensions.length; i++) { + var ex = self._extensions[i]; + if (self._external.indexOf(rfile + ex) >= 0) { + row.deps[key] = rfile + ex; + break; + } + } + }); + + if (row.entry || row.expose) { + self._bpack.standaloneModule = row.id; + } + this.push(row); + next(); + }); +}; + +Browserify.prototype._emitDeps = function () { + var self = this; + return through.obj(function (row, enc, next) { + self.emit('dep', row); + this.push(row); + next(); + }) +}; + +Browserify.prototype._debug = function (opts) { + var basedir = defined(opts.basedir, process.cwd()); + return through.obj(function (row, enc, next) { + if (opts.debug) { + row.sourceRoot = 'file://localhost'; + row.sourceFile = path.relative(basedir, row.file) + .replace(/\\/g, '/'); + } + this.push(row); + next(); + }); +}; + +Browserify.prototype.reset = function (opts) { + if (!opts) opts = {}; + var hadExports = this._bpack.hasExports; + this.pipeline = this._createPipeline(xtend(opts, this._options)); + this._bpack.hasExports = hadExports; + this._entryOrder = 0; + this._bundled = false; + this.emit('reset'); +}; + +Browserify.prototype.bundle = function (cb) { + var self = this; + if (cb && typeof cb === 'object') { + throw new Error( + 'bundle() no longer accepts option arguments.\n' + + 'Move all option arguments to the browserify() constructor.' + ); + } + if (this._bundled) { + var recorded = this._recorded; + this.reset(); + recorded.forEach(function (x) { + self.pipeline.write(x); + }); + } + var output = readonly(this.pipeline); + if (cb) { + output.on('error', cb); + this.pipeline.pipe(concat(function (body) { + cb(null, body); + })); + } + + function ready () { + self.emit('bundle', output); + self.pipeline.end(); + } + + if (this._pending === 0) ready(); + else this.once('_ready', ready); + + this._bundled = true; + return output; +}; + +function isStream (s) { return s && typeof s.pipe === 'function' } +function isAbsolutePath (file) { + var regexp = process.platform === 'win32' ? + /^\w:/ : + /^\//; + return regexp.test(file); +} +function isExternalModule (file) { + var regexp = process.platform === 'win32' ? + /^(\.|\w:)/ : + /^[\/.]/; + return !regexp.test(file); +} diff --git a/node_modules/browserify/lib/_empty.js b/node_modules/browserify/lib/_empty.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/browserify/lib/builtins.js b/node_modules/browserify/lib/builtins.js new file mode 100644 index 0000000..7432651 --- /dev/null +++ b/node_modules/browserify/lib/builtins.js @@ -0,0 +1,38 @@ +exports.assert = require.resolve('assert/'); +exports.buffer = require.resolve('buffer/'); +exports.child_process = require.resolve('./_empty.js'); +exports.cluster = require.resolve('./_empty.js'); +exports.console = require.resolve('console-browserify'); +exports.constants = require.resolve('constants-browserify'); +exports.crypto = require.resolve('crypto-browserify'); +exports.dgram = require.resolve('./_empty.js'); +exports.dns = require.resolve('./_empty.js'); +exports.domain = require.resolve('domain-browser'); +exports.events = require.resolve('events/'); +exports.fs = require.resolve('./_empty.js'); +exports.http = require.resolve('http-browserify'); +exports.https = require.resolve('https-browserify'); +exports.module = require.resolve('./_empty.js'); +exports.net = require.resolve('./_empty.js'); +exports.os = require.resolve('os-browserify/browser.js'); +exports.path = require.resolve('path-browserify'); +exports.punycode = require.resolve('punycode/'); +exports.querystring = require.resolve('querystring-es3/'); +exports.readline = require.resolve('./_empty.js'); +exports.repl = require.resolve('./_empty.js'); +exports.stream = require.resolve('stream-browserify'); +exports._stream_duplex = require.resolve('readable-stream/duplex.js'); +exports._stream_passthrough = require.resolve('readable-stream/passthrough.js'); +exports._stream_readable = require.resolve('readable-stream/readable.js'); +exports._stream_transform = require.resolve('readable-stream/transform.js'); +exports._stream_writable = require.resolve('readable-stream/writable.js'); +exports.string_decoder = require.resolve('string_decoder/'); +exports.sys = require.resolve('util/util.js'); +exports.timers = require.resolve('timers-browserify'); +exports.tls = require.resolve('./_empty.js'); +exports.tty = require.resolve('tty-browserify'); +exports.url = require.resolve('url/'); +exports.util = require.resolve('util/util.js'); +exports.vm = require.resolve('vm-browserify'); +exports.zlib = require.resolve('browserify-zlib'); +exports._process = require.resolve('process/browser'); diff --git a/node_modules/browserify/package.json b/node_modules/browserify/package.json new file mode 100644 index 0000000..f4e29b9 --- /dev/null +++ b/node_modules/browserify/package.json @@ -0,0 +1,94 @@ +{ + "name": "browserify", + "version": "10.2.6", + "description": "browser-side require() the node way", + "main": "index.js", + "bin": { + "browserify": "bin/cmd.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-browserify.git" + }, + "keywords": [ + "browser", + "require", + "commonjs", + "commonj-esque", + "bundle", + "npm", + "javascript" + ], + "dependencies": { + "JSONStream": "^1.0.3", + "assert": "~1.3.0", + "browser-pack": "^5.0.0", + "browser-resolve": "^1.7.1", + "browserify-zlib": "~0.1.2", + "buffer": "^3.0.0", + "builtins": "~0.0.3", + "commondir": "0.0.1", + "concat-stream": "~1.4.1", + "console-browserify": "^1.1.0", + "constants-browserify": "~0.0.1", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^1.3.7", + "domain-browser": "~1.1.0", + "duplexer2": "~0.0.2", + "events": "~1.0.0", + "glob": "^4.0.5", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "http-browserify": "^1.4.0", + "https-browserify": "~0.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^6.4.1", + "isarray": "0.0.1", + "labeled-stream-splicer": "^1.0.0", + "module-deps": "^3.7.11", + "os-browserify": "~0.1.1", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^1.1.1", + "readable-stream": "^1.1.13", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "~0.0.1", + "stream-browserify": "^1.0.0", + "string_decoder": "~0.10.0", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^1.0.0", + "timers-browserify": "^1.0.1", + "tty-browserify": "~0.0.0", + "url": "~0.10.1", + "util": "~0.10.1", + "vm-browserify": "~0.0.1", + "xtend": "^4.0.0" + }, + "devDependencies": { + "backbone": "~0.9.2", + "browser-unpack": "~0.0.0", + "coffee-script": "~1.5.0", + "coffeeify": "~0.6.0", + "es6ify": "~0.4.8", + "isstream": "^0.1.2", + "seq": "0.3.3", + "tap": "^1.1.0", + "temp": "^0.8.1", + "through": "^2.3.4" + }, + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "MIT" +} diff --git a/node_modules/browserify/readme.markdown b/node_modules/browserify/readme.markdown new file mode 100644 index 0000000..18d0c50 --- /dev/null +++ b/node_modules/browserify/readme.markdown @@ -0,0 +1,783 @@ +# browserify + +`require('modules')` in the browser + +Use a [node](http://nodejs.org)-style `require()` to organize your browser code +and load modules installed by [npm](https://www.npmjs.com). + +browserify will recursively analyze all the `require()` calls in your app in +order to build a bundle you can serve up to the browser in a single `` into your +html! + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install -g browserify +``` + +# usage + +``` +Usage: browserify [entry files] {OPTIONS} + +Standard Options: + + --outfile, -o Write the browserify bundle to this file. + If unspecified, browserify prints to stdout. + + --require, -r A module name or file to bundle.require() + Optionally use a colon separator to set the target. + + --entry, -e An entry point of your app + + --ignore, -i Replace a file with an empty stub. Files can be globs. + + --exclude, -u Omit a file from the output bundle. Files can be globs. + + --external, -x Reference a file from another bundle. Files can be globs. + + --transform, -t Use a transform module on top-level files. + + --command, -c Use a transform command on top-level files. + + --standalone -s Generate a UMD bundle for the supplied export name. + This bundle works with other module systems and sets the name + given as a window global if no module system is found. + + --debug -d Enable source maps that allow you to debug your files + separately. + + --help, -h Show this message + +For advanced options, type `browserify --help advanced`. + +Specify a parameter. +``` + +``` +Advanced Options: + + --insert-globals, --ig, --fast [default: false] + + Skip detection and always insert definitions for process, global, + __filename, and __dirname. + + benefit: faster builds + cost: extra bytes + + --insert-global-vars, --igv + + Comma-separated list of global variables to detect and define. + Default: __filename,__dirname,process,Buffer,global + + --detect-globals, --dg [default: true] + + Detect the presence of process, global, __filename, and __dirname and define + these values when present. + + benefit: npm modules more likely to work + cost: slower builds + + --ignore-missing, --im [default: false] + + Ignore `require()` statements that don't resolve to anything. + + --noparse=FILE + + Don't parse FILE at all. This will make bundling much, much faster for giant + libs like jquery or threejs. + + --no-builtins + + Turn off builtins. This is handy when you want to run a bundle in node which + provides the core builtins. + + --no-commondir + + Turn off setting a commondir. This is useful if you want to preserve the + original paths that a bundle was generated with. + + --no-bundle-external + + Turn off bundling of all external modules. This is useful if you only want + to bundle your local files. + + --bare + + Alias for both --no-builtins, --no-commondir, and sets --insert-global-vars + to just "__filename,__dirname". This is handy if you want to run bundles in + node. + + --no-browser-field, --no-bf + + Turn off package.json browser field resolution. This is also handy if you + need to run a bundle in node. + + --node + + Alias for --bare and --no-browser-field. + + --full-paths + + Turn off converting module ids into numerical indexes. This is useful for + preserving the original paths that a bundle was generated with. + + --deps + + Instead of standard bundle output, print the dependency array generated by + module-deps. + + --list + + Print each file in the dependency graph. Useful for makefiles. + + --extension=EXTENSION + + Consider files with specified EXTENSION as modules, this option can used + multiple times. + + --global-transform=MODULE, -g MODULE + + Use a transform module on all files after any ordinary transforms have run. + + --plugin=MODULE, -p MODULE + + Register MODULE as a plugin. + +Passing arguments to transforms and plugins: + + For -t, -g, and -p, you may use subarg syntax to pass options to the + transforms or plugin function as the second parameter. For example: + + -t [ foo -x 3 --beep ] + + will call the `foo` transform for each applicable file by calling: + + foo(file, { x: 3, beep: true }) + +``` + +# compatibility + +Many [npm](http://npmjs.org) modules that don't do IO will just work after being +browserified. Others take more work. + +Many node built-in modules have been wrapped to work in the browser, but only +when you explicitly `require()` or use their functionality. + +When you `require()` any of these modules, you will get a browser-specific shim: + +* [assert](https://www.npmjs.com/package/assert) +* [buffer](https://www.npmjs.com/package/buffer) +* [console](https://www.npmjs.com/package/console-browserify) +* [constants](https://www.npmjs.com/package/constants-browserify) +* [crypto](https://www.npmjs.com/package/crypto-browserify) +* [domain](https://www.npmjs.com/package/domain-browser) +* [events](https://www.npmjs.com/package/events) +* [http](https://www.npmjs.com/package/http-browserify) +* [https](https://www.npmjs.com/package/https-browserify) +* [os](https://www.npmjs.com/package/os-browserify) +* [path](https://www.npmjs.com/package/path-browserify) +* [punycode](https://www.npmjs.com/package/punycode) +* [querystring](https://www.npmjs.com/package/querystring) +* [stream](https://www.npmjs.com/package/stream-browserify) +* [string_decoder](https://www.npmjs.com/package/string_decoder) +* [timers](https://www.npmjs.com/package/timers-browserify) +* [tty](https://www.npmjs.com/package/tty-browserify) +* [url](https://www.npmjs.com/package/url) +* [util](https://www.npmjs.com/package/util) +* [vm](https://www.npmjs.com/package/vm-browserify) +* [zlib](https://www.npmjs.com/package/browserify-zlib) + +Additionally, if you use any of these variables, they +[will be defined](https://github.com/substack/insert-module-globals) +in the bundled output in a browser-appropriate way: + +* [process](https://www.npmjs.com/package/process) +* [Buffer](https://www.npmjs.com/package/buffer) +* global - top-level scope object (window) +* __filename - file path of the currently executing file +* __dirname - directory path of the currently executing file + +# more examples + +## external requires + +You can just as easily create a bundle that will export a `require()` function so +you can `require()` modules from another script tag. Here we'll create a +`bundle.js` with the [through](https://www.npmjs.com/package/through) +and [duplexer](https://www.npmjs.com/package/duplexer) modules. + +``` +$ browserify -r through -r duplexer -r ./my-file.js:my-module > bundle.js +``` + +Then in your page you can do: + +``` html + + +``` + +## external source maps + +If you prefer the source maps be saved to a separate `.js.map` source map file, you may use +[exorcist](https://github.com/thlorenz/exorcist) in order to achieve that. It's as simple as: + +``` +$ browserify main.js --debug | exorcist bundle.js.map > bundle.js +``` + +Learn about additional options [here](https://github.com/thlorenz/exorcist#usage). + +## multiple bundles + +If browserify finds a `require`d function already defined in the page scope, it +will fall back to that function if it didn't find any matches in its own set of +bundled modules. + +In this way, you can use browserify to split up bundles among multiple pages to +get the benefit of caching for shared, infrequently-changing modules, while +still being able to use `require()`. Just use a combination of `--external` and +`--require` to factor out common dependencies. + +For example, if a website with 2 pages, `beep.js`: + +``` js +var robot = require('./robot.js'); +console.log(robot('beep')); +``` + +and `boop.js`: + +``` js +var robot = require('./robot.js'); +console.log(robot('boop')); +``` + +both depend on `robot.js`: + +``` js +module.exports = function (s) { return s.toUpperCase() + '!' }; +``` + +``` +$ browserify -r ./robot.js > static/common.js +$ browserify -x ./robot.js beep.js > static/beep.js +$ browserify -x ./robot.js boop.js > static/boop.js +``` + +Then on the beep page you can have: + +``` html + + +``` + +while the boop page can have: + +``` html + + +``` + +This approach using `-r` and `-x` works fine for a small number of split assets, +but there are plugins for automatically factoring out components which are +described in the +[partitioning section of the browserify handbook](https://github.com/substack/browserify-handbook#partitioning). + +## api example + +You can use the API directly too: + +``` js +var browserify = require('browserify'); +var b = browserify(); +b.add('./browser/main.js'); +b.bundle().pipe(process.stdout); +``` + +# methods + +``` js +var browserify = require('browserify') +``` + +## `browserify([files] [, opts])` + +Returns a new browserify instance. + +
+
+files +
+ +
+String, file object, or array of those types (they may be mixed) specifying entry file(s). +
+ +
+opts +
+ +
+Object. +
+
+ +`files` and `opts` are both optional, but must be in the order shown if both are +passed. + +Entry files may be passed in `files` and / or `opts.entries`. + +If an entry file is a stream, its contents will be used. You should pass +`opts.basedir` when using streaming files so that relative requires can be +resolved. + +`opts.entries` has the same definition as `files`. + +`opts.noParse` is an array which will skip all require() and global parsing for +each file in the array. Use this for giant libs like jquery or threejs that +don't have any requires or node-style globals but take forever to parse. + +`opts.extensions` is an array of optional extra extensions for the module lookup +machinery to use when the extension has not been specified. +By default browserify considers only `.js` and `.json` files in such cases. + +`opts.basedir` is the directory that browserify starts bundling from for +filenames that start with `.`. + +`opts.paths` is an array of directories that browserify searches when looking +for modules which are not referenced using relative path. Can be absolute or +relative to `basedir`. Equivalent of setting `NODE_PATH` environmental variable +when calling `browserify` command. + +`opts.commondir` sets the algorithm used to parse out the common paths. Use +`false` to turn this off, otherwise it uses the +[commondir](https://www.npmjs.com/package/commondir) module. + +`opts.fullPaths` disables converting module ids into numerical indexes. This is +useful for preserving the original paths that a bundle was generated with. + +`opts.builtins` sets the list of built-ins to use, which by default is set in +`lib/builtins.js` in this distribution. + +`opts.bundleExternal` boolean option to set if external modules should be +bundled. Defaults to true. + +When `opts.insertGlobals` is true, always insert `process`, `global`, +`__filename`, and `__dirname` without analyzing the AST for faster builds but +larger output bundles. Default false. + +When `opts.detectGlobals` is true, scan all files for `process`, `global`, +`__filename`, and `__dirname`, defining as necessary. With this option npm +modules are more likely to work but bundling takes longer. Default true. + +When `opts.debug` is true, add a source map inline to the end of the bundle. +This makes debugging easier because you can see all the original files if +you are in a modern enough browser. + +When `opts.standalone` is a non-empty string, a standalone module is created +with that name and a [umd](https://github.com/forbeslindesay/umd) wrapper. +You can use namespaces in the standalone global export using a `.` in the string +name as a separator, for example `'A.B.C'`. The global export will be [sanitized +and camel cased](https://github.com/ForbesLindesay/umd#name-casing-and-characters). + +Note that in standalone mode the `require()` calls from the original source will +still be around, which may trip up AMD loaders scanning for `require()` calls. +You can remove these calls with +[derequire](https://www.npmjs.com/package/derequire): + +``` +$ npm install -g derequire +$ browserify main.js --standalone Foo | derequire > bundle.js +``` + +`opts.insertGlobalVars` will be passed to +[insert-module-globals](http://npmjs.org/package/insert-module-globals) +as the `opts.vars` parameter. + +`opts.externalRequireName` defaults to `'require'` in `expose` mode but you can +use another name. + +Note that if files do not contain javascript source code then you also need to +specify a corresponding transform for them. + +All other options are forwarded along to +[module-deps](https://www.npmjs.com/package/module-deps) +and [browser-pack](https://www.npmjs.com/package/browser-pack) directly. + +## b.add(file, opts) + +Add an entry file from `file` that will be executed when the bundle loads. + +If `file` is an array, each item in `file` will be added as an entry file. + +## b.require(file, opts) + +Make `file` available from outside the bundle with `require(file)`. + +The `file` param is anything that can be resolved by `require.resolve()`. + +`file` can also be a stream, but you should also use `opts.basedir` so that +relative requires will be resolvable. + +If `file` is an array, each item in `file` will be required. +In `file` array form, you can use a string or object for each item. Object items +should have a `file` property and the rest of the parameters will be used for +the `opts`. + +Use the `expose` property of opts to specify a custom dependency name. +`require('./vendor/angular/angular.js', {expose: 'angular'})` enables `require('angular')` + +## b.bundle(cb) + +Bundle the files and their dependencies into a single javascript file. + +Return a readable stream with the javascript file contents or +optionally specify a `cb(err, buf)` to get the buffered results. + +## b.external(file) + +Prevent `file` from being loaded into the current bundle, instead referencing +from another bundle. + +If `file` is an array, each item in `file` will be externalized. + +If `file` is another bundle, that bundle's contents will be read and excluded +from the current bundle as the bundle in `file` gets bundled. + +## b.ignore(file) + +Prevent the module name or file at `file` from showing up in the output bundle. + +Instead you will get a file with `module.exports = {}`. + +## b.exclude(file) + +Prevent the module name or file at `file` from showing up in the output bundle. + +If your code tries to `require()` that file it will throw unless you've provided +another mechanism for loading it. + +## b.transform(tr, opts={}) + +Transform source code before parsing it for `require()` calls with the transform +function or module name `tr`. + +If `tr` is a function, it will be called with `tr(file)` and it should return a +[through-stream](https://github.com/substack/stream-handbook#through) +that takes the raw file contents and produces the transformed source. + +If `tr` is a string, it should be a module name or file path of a +[transform module](https://github.com/substack/module-deps#transforms) +with a signature of: + +``` js +var through = require('through'); +module.exports = function (file) { return through() }; +``` + +You don't need to necessarily use the +[through](https://www.npmjs.com/package/through) module. Browserify is compatible with the newer, more verbose [Transform streams](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) built into Node v0.10. + +Here's how you might compile coffee script on the fly using `.transform()`: + +``` js +var coffee = require('coffee-script'); +var through = require('through'); + +b.transform(function (file) { + var data = ''; + return through(write, end); + + function write (buf) { data += buf } + function end () { + this.queue(coffee.compile(data)); + this.queue(null); + } +}); +``` + +Note that on the command-line with the `-c` flag you can just do: + +``` +$ browserify -c 'coffee -sc' main.coffee > bundle.js +``` + +Or better still, use the [coffeeify](https://github.com/jnordberg/coffeeify) +module: + +``` +$ npm install coffeeify +$ browserify -t coffeeify main.coffee > bundle.js +``` + +If `opts.global` is `true`, the transform will operate on ALL files, despite +whether they exist up a level in a `node_modules/` directory. Use global +transforms cautiously and sparingly, since most of the time an ordinary +transform will suffice. You can also not configure global transforms in a +`package.json` like you can with ordinary transforms. + +Global transforms always run after any ordinary transforms have run. + +Transforms may obtain options from the command-line with +[subarg](https://www.npmjs.com/package/subarg) syntax: + +``` +$ browserify -t [ foo --bar=555 ] main.js +``` + +or from the api: + +``` +b.transform('foo', { bar: 555 }) +``` + +In both cases, these options are provided as the second argument to the +transform function: + +``` +module.exports = function (file, opts) { /* opts.bar === 555 */ } +``` + +Options sent to the browserify constructor are also provided under +`opts._flags`. These browserify options are sometimes required if your transform +needs to do something different when browserify is run in debug mode, for +example. + +## b.plugin(plugin, opts) + +Register a `plugin` with `opts`. Plugins can be a string module name or a +function the same as transforms. + +`plugin(b, opts)` is called with the browserify instance `b`. + +For more information, consult the plugins section below. + +## b.pipeline + +There is an internal +[labeled-stream-splicer](https://www.npmjs.com/package/labeled-stream-splicer) +pipeline with these labels: + +* `'record'` - save inputs to play back later on subsequent `bundle()` calls +* `'deps'` - [module-deps](https://www.npmjs.com/package/module-deps) +* `'json'` - adds `module.exports=` to the beginning of json files +* `'unbom'` - remove byte-order markers +* `'unshebang'` - remove #! labels on the first line +* `'syntax'` - check for syntax errors +* `'sort'` - sort the dependencies for deterministic bundles +* `'dedupe'` - remove duplicate source contents +* `'label'` - apply integer labels to files +* `'emit-deps'` - emit `'dep'` event +* `'debug'` - apply source maps +* `'pack'` - [browser-pack](https://www.npmjs.com/package/browser-pack) +* `'wrap'` - apply final wrapping, `require=` and a newline and semicolon + +You can call `b.get()` with a label name to get a handle on a stream pipeline +that you can `push()`, `unshift()`, or `splice()` to insert your own transform +streams. + +# b.reset(opts) + +Reset the pipeline back to a normal state. This function is called automatically +when `bundle()` is called multiple times. + +This function triggers a 'reset' event. + +# package.json + +browserify uses the `package.json` in its module resolution algorithm, just like +node. If there is a `"main"` field, browserify will start resolving the package +at that point. If there is no `"main"` field, browserify will look for an +`"index.js"` file in the module root directory. Here are some more +sophisticated things you can do in the package.json: + +## browser field + +There is a special "[browser](https://gist.github.com/4339901)" field you can +set in your package.json on a per-module basis to override file resolution for +browser-specific versions of files. + +For example, if you want to have a browser-specific module entry point for your +`"main"` field you can just set the `"browser"` field to a string: + +``` json +"browser": "./browser.js" +``` + +or you can have overrides on a per-file basis: + +``` json +"browser": { + "fs": "level-fs", + "./lib/ops.js": "./browser/opts.js" +} +``` + +Note that the browser field only applies to files in the local module, and like +transforms, it doesn't apply into `node_modules` directories. + +## browserify.transform + +You can specify source transforms in the package.json in the +`browserify.transform` field. There is more information about how source +transforms work in package.json on the +[module-deps readme](https://github.com/substack/module-deps#transforms). + +For example, if your module requires [brfs](https://www.npmjs.com/package/brfs), you +can add + +``` json +"browserify": { "transform": [ "brfs" ] } +``` + +to your package.json. Now when somebody `require()`s your module, brfs will +automatically be applied to the files in your module without explicit +intervention by the person using your module. Make sure to add transforms to +your package.json dependencies field. + +# events + +## b.on('file', function (file, id, parent) {}) +## b.pipeline.on('file', function (file, id, parent) {}) + +When a file is resolved for the bundle, the bundle emits a `'file'` event with +the full `file` path, the `id` string passed to `require()`, and the `parent` +object used by +[browser-resolve](https://github.com/defunctzombie/node-browser-resolve). + +You could use the `file` event to implement a file watcher to regenerate bundles +when files change. + +## b.on('package', function (pkg) {}) +## b.pipeline.on('package', function (pkg) {}) + +When a package file is read, this event fires with the contents. The package +directory is available at `pkg.__dirname`. + +## b.on('bundle', function (bundle) {}) + +When `.bundle()` is called, this event fires with the `bundle` output stream. + +## b.on('reset', function () {}) + +When the `.reset()` method is called or implicitly called by another call to +`.bundle()`, this event fires. + +## b.on('transform', function (tr, file) {}) +## b.pipeline.on('transform', function (tr, file) {}) + +When a transform is applied to a file, the `'transform'` event fires on the +bundle stream with the transform stream `tr` and the `file` that the transform +is being applied to. + +# plugins + +For some more advanced use-cases, a transform is not sufficiently extensible. +Plugins are modules that take the bundle instance as their first parameter and +an option hash as their second. + +Plugins can be used to do perform some fancy features that transforms can't do. +For example, [factor-bundle](https://www.npmjs.com/package/factor-bundle) is a +plugin that can factor out common dependencies from multiple entry-points into a +common bundle. Use plugins with `-p` and pass options to plugins with +[subarg](https://www.npmjs.com/package/subarg) syntax: + +``` +browserify x.js y.js -p [ factor-bundle -o bundle/x.js -o bundle/y.js ] \ + > bundle/common.js +``` + +For a list of plugins, consult the +[browserify-plugin tag](https://www.npmjs.com/browse/keyword/browserify-plugin) +on npm. + +# list of source transforms + +There is a [wiki page that lists the known browserify +transforms](https://github.com/substack/node-browserify/wiki/list-of-transforms). + +If you write a transform, make sure to add your transform to that wiki page and +add a package.json keyword of `browserify-transform` so that +[people can browse for all the browserify +transforms](https://www.npmjs.com/browse/keyword/browserify-transform) on npmjs.org. + +# third-party tools + +There is a [wiki page that lists the known browserify +tools](https://github.com/substack/node-browserify/wiki/browserify-tools). + +If you write a tool, make sure to add it to that wiki page and +add a package.json keyword of `browserify-tool` so that +[people can browse for all the browserify +tools](https://www.npmjs.com/browse/keyword/browserify-tool) on npmjs.org. + +# changelog + +Releases are documented in +[changelog.markdown](changelog.markdown) and on the +[browserify twitter feed](https://twitter.com/browserify). + +# license + +MIT + +![browserify!](http://substack.net/images/browserify/browserify.png) diff --git a/node_modules/browserify/test/args.js b/node_modules/browserify/test/args.js new file mode 100644 index 0000000..6f8cb02 --- /dev/null +++ b/node_modules/browserify/test/args.js @@ -0,0 +1,72 @@ +var test = require('tap').test; +var fromArgs = require('../bin/args.js'); +var path = require('path'); +var vm = require('vm'); + +test('bundle from an arguments array', function (t) { + t.plan(2); + + var b = fromArgs([ __dirname + '/entry/two.js', '-s', 'XYZ' ]); + b.bundle(function (err, src) { + t.ifError(err); + var c = { window: {} }; + vm.runInNewContext(src, c); + t.equal(c.window.XYZ, 2); + }); +}); + +test('external flag for node modules', function(t) { + t.plan(2); + + var b = fromArgs([ __dirname + '/external_args/main.js', '-x', 'backbone' ]); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, {t: t}); + }); +}); + +test('bundle from an arguments with --insert-global-vars', function (t) { + t.plan(4); + + var b = fromArgs([ + __dirname + '/global/filename.js', + '--insert-global-vars=__filename,__dirname', + '--basedir', __dirname + ]); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + t.ifError(err, 'b.bundle()'); + var c = {}, x; + vm.runInNewContext(src, c); + t.doesNotThrow(function() { + x = c.require('x'); + }, 'x = c.require(\'x\')'); + t.equal(x && x.filename, '/global/filename.js', 'x.filename'); + t.equal(x && x.dirname, '/global', 'x.dirname'); + }) +}); + +test('numeric module names', function(t) { + t.plan(1); + + var b = fromArgs([ '-x', '1337' ]); + b.bundle(function (err, src) { + t.ifError(err); + }); +}); + +test('entry expose', function (t) { + t.plan(3) + + var b = fromArgs([ + path.join(__dirname, '/entry_expose/main.js'), + '--require', path.join(__dirname, '/entry_expose/main.js') + ':x', + ]); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + function log (msg) { t.equal(msg, 'wow') } + vm.runInNewContext(src, c); + t.equal(c.require('x'), 555); + }) +}); diff --git a/node_modules/browserify/test/array.js b/node_modules/browserify/test/array.js new file mode 100644 index 0000000..990bc65 --- /dev/null +++ b/node_modules/browserify/test/array.js @@ -0,0 +1,74 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('array add', function (t) { + var expected = [ 'ONE', 'TWO', 'THREE' ]; + t.plan(expected.length); + + var b = browserify(); + var files = [ + __dirname + '/array/one.js', + __dirname + '/array/two.js', + __dirname + '/array/three.js' + ]; + b.add(files); + b.bundle(function (err, src) { + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); + +test('array require', function (t) { + t.plan(3); + + var b = browserify(); + var files = [ 'isarray', 'subarg' ]; + b.require(files); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + + t.equal(c.require('isarray')([]), true); + t.equal(c.require('isarray')({}), false); + t.deepEqual(c.require('subarg')(['-x', '3']), { x: 3, _: [] }); + }); +}); + +test('array require opts', function (t) { + t.plan(3); + + var b = browserify(); + var files = [ + { file: require.resolve('isarray'), expose: 'abc' }, + { file: require.resolve('subarg'), expose: 'def' } + ]; + b.require(files); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + + t.equal(c.require('abc')([]), true); + t.equal(c.require('abc')({}), false); + t.deepEqual(c.require('def')(['-x', '3']), { x: 3, _: [] }); + }); +}); + +test('array external', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/external/main.js'); + b.external(['util','freelist']); + b.bundle(function (err, src) { + if (err) return t.fail(err); + vm.runInNewContext( + 'function require (x) {' + + 'if (x==="freelist") return function (n) { return n + 1000 }' + + '}' + + src, + { t: t } + ); + }); +}); diff --git a/node_modules/browserify/test/array/one.js b/node_modules/browserify/test/array/one.js new file mode 100644 index 0000000..c6312fd --- /dev/null +++ b/node_modules/browserify/test/array/one.js @@ -0,0 +1 @@ +console.log('ONE'); diff --git a/node_modules/browserify/test/array/three.js b/node_modules/browserify/test/array/three.js new file mode 100644 index 0000000..77a6c3a --- /dev/null +++ b/node_modules/browserify/test/array/three.js @@ -0,0 +1 @@ +console.log('THREE'); diff --git a/node_modules/browserify/test/array/two.js b/node_modules/browserify/test/array/two.js new file mode 100644 index 0000000..fa60b5a --- /dev/null +++ b/node_modules/browserify/test/array/two.js @@ -0,0 +1 @@ +console.log('TWO'); diff --git a/node_modules/browserify/test/backbone.js b/node_modules/browserify/test/backbone.js new file mode 100644 index 0000000..03e6f69 --- /dev/null +++ b/node_modules/browserify/test/backbone.js @@ -0,0 +1,23 @@ +var browserify = require('../'); +var vm = require('vm'); +var backbone = require('backbone'); +var test = require('tap').test; + +test('backbone', function (t) { + t.plan(3); + var b = browserify(); + b.require('backbone'); + b.bundle(function (err, buf) { + t.ok(Buffer.isBuffer(buf)); + var src = buf.toString('utf8'); + t.ok(src.length > 0); + + var c = { console: console }; + vm.runInNewContext(src, c); + t.deepEqual( + Object.keys(backbone).sort(), + Object.keys(c.require('backbone')).sort() + ); + t.end(); + }); +}); diff --git a/node_modules/browserify/test/bare.js b/node_modules/browserify/test/bare.js new file mode 100644 index 0000000..2ef1031 --- /dev/null +++ b/node_modules/browserify/test/bare.js @@ -0,0 +1,39 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('bare', function (t) { + t.plan(4); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-', '--bare' + ]); + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + Buffer: function (s) { return s.toLowerCase() }, + console: { + log: function (msg) { t.equal(msg, 'abc') } + } + }); + vm.runInNewContext(body, { + Buffer: Buffer, + console: { + log: function (msg) { + t.ok(Buffer.isBuffer(msg)); + t.equal(msg.toString('utf8'), 'ABC') + } + } + }); + })); + ps.stdin.end('console.log(Buffer("ABC"))'); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/bare_shebang.js b/node_modules/browserify/test/bare_shebang.js new file mode 100644 index 0000000..c47bf44 --- /dev/null +++ b/node_modules/browserify/test/bare_shebang.js @@ -0,0 +1,37 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('bare shebang', function (t) { + t.plan(4); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-', '--bare' + ]); + ps.stderr.pipe(process.stderr); + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body, { + Buffer: function (s) { return s.toLowerCase() }, + console: { + log: function (msg) { t.equal(msg, 'woo') } + } + }); + vm.runInNewContext(body, { + Buffer: Buffer, + console: { + log: function (msg) { + t.ok(Buffer.isBuffer(msg)); + t.equal(msg.toString('utf8'), 'WOO') + } + } + }); + })); + ps.stdin.end('#!/usr/bin/env node\nconsole.log(Buffer("WOO"))'); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/bin.js b/node_modules/browserify/test/bin.js new file mode 100644 index 0000000..cb7b17a --- /dev/null +++ b/node_modules/browserify/test/bin.js @@ -0,0 +1,31 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('bin', function (t) { + t.plan(3); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + 'entry/main.js' + ]); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.equal(code, 0); + t.equal(err, ''); + + var allDone = false; + var c = { done : function () { allDone = true } }; + + vm.runInNewContext(src, c); + t.ok(allDone); + }); +}); diff --git a/node_modules/browserify/test/bin_entry.js b/node_modules/browserify/test/bin_entry.js new file mode 100644 index 0000000..f7e9af3 --- /dev/null +++ b/node_modules/browserify/test/bin_entry.js @@ -0,0 +1,31 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('bin --entry', function (t) { + t.plan(3); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '--entry', 'entry/main.js' + ]); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.equal(code, 0); + t.equal(err, ''); + + var allDone = false; + var c = { done : function () { allDone = true } }; + + vm.runInNewContext(src, c); + t.ok(allDone); + }); +}); diff --git a/node_modules/browserify/test/bin_tr_error.js b/node_modules/browserify/test/bin_tr_error.js new file mode 100644 index 0000000..039704c --- /dev/null +++ b/node_modules/browserify/test/bin_tr_error.js @@ -0,0 +1,23 @@ +var browserify = require('../'); +var spawn = require('child_process').spawn; +var test = require('tap').test; +var path = require('path') + +test('function transform', function (t) { + t.plan(3); + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-t', './tr.js', './main.js' + ], {cwd: path.resolve(__dirname, 'bin_tr_error')}); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.notEqual(code, 0); + var errorFile = path.resolve(__dirname, 'bin_tr_error', 'tr.js'); + t.notEqual(err.indexOf('there was error'), -1, 'Error should contain error message') + t.notEqual(err.indexOf(errorFile), -1, 'Error should contain stack trace') + }); +}); diff --git a/node_modules/browserify/test/bin_tr_error/main.js b/node_modules/browserify/test/bin_tr_error/main.js new file mode 100644 index 0000000..ec448ae --- /dev/null +++ b/node_modules/browserify/test/bin_tr_error/main.js @@ -0,0 +1 @@ +t.equal(XXX * 5, 555); diff --git a/node_modules/browserify/test/bin_tr_error/tr.js b/node_modules/browserify/test/bin_tr_error/tr.js new file mode 100644 index 0000000..c4e537e --- /dev/null +++ b/node_modules/browserify/test/bin_tr_error/tr.js @@ -0,0 +1,12 @@ +var through = require('through2'); + +module.exports = function (file, opts) { + var data = ''; + return through(write, end); + + function write (buf, enc, next) { data += buf; next() } + function end () { + this.emit('error', new Error('there was error')) + this.push(null); + } +}; diff --git a/node_modules/browserify/test/bom.js b/node_modules/browserify/test/bom.js new file mode 100644 index 0000000..78cca51 --- /dev/null +++ b/node_modules/browserify/test/bom.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('byte order marker', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/bom/hello.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + var c = { + console: { log: function (msg) { + t.equal(msg, 'hello'); + } } + }; + vm.runInNewContext(src, c); + t.notOk(/\ufeff/.test(src.toString('utf8'))); + }); +}); diff --git a/node_modules/browserify/test/bom/hello.js b/node_modules/browserify/test/bom/hello.js new file mode 100644 index 0000000..03b374a --- /dev/null +++ b/node_modules/browserify/test/bom/hello.js @@ -0,0 +1 @@ +console.log('hello') diff --git a/node_modules/browserify/test/browser_field_file.js b/node_modules/browserify/test/browser_field_file.js new file mode 100644 index 0000000..cecaef2 --- /dev/null +++ b/node_modules/browserify/test/browser_field_file.js @@ -0,0 +1,13 @@ +var test = require('tap').test; +var vm = require('vm'); +var browserify = require('../'); + +test('browser field file no ext', function (t) { + t.plan(2); + var b = browserify(__dirname + '/browser_field_file/xyz'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 'cool beans') } + }); +}); diff --git a/node_modules/browserify/test/browser_field_file/package.json b/node_modules/browserify/test/browser_field_file/package.json new file mode 100644 index 0000000..f146bcc --- /dev/null +++ b/node_modules/browserify/test/browser_field_file/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "./xyz": "wow.js" + } +} diff --git a/node_modules/browserify/test/browser_field_file/wow.js b/node_modules/browserify/test/browser_field_file/wow.js new file mode 100644 index 0000000..eca0d75 --- /dev/null +++ b/node_modules/browserify/test/browser_field_file/wow.js @@ -0,0 +1 @@ +console.log('cool beans'); diff --git a/node_modules/browserify/test/buffer.js b/node_modules/browserify/test/buffer.js new file mode 100644 index 0000000..5a2747f --- /dev/null +++ b/node_modules/browserify/test/buffer.js @@ -0,0 +1,142 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('utf8 buffer to base64', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + if (err) return t.fail(err); + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("Ձאab", "utf8").toString("base64"), + new Buffer("Ձאab", "utf8").toString("base64") + ); + }); +}); + +test('utf8 buffer to hex', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("Ձאab", "utf8").toString("hex"), + new Buffer("Ձאab", "utf8").toString("hex") + ); + }); +}); + +test('ascii buffer to base64', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("123456!@#$%^", "ascii").toString("base64"), + new Buffer("123456!@#$%^", "ascii").toString("base64") + ); + }); +}); + +test('ascii buffer to hex', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("123456!@#$%^", "ascii").toString("hex"), + new Buffer("123456!@#$%^", "ascii").toString("hex") + ); + }); +}); + +test('base64 buffer to utf8', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("1YHXkGFi", "base64").toString("utf8"), + new Buffer("1YHXkGFi", "base64").toString("utf8") + ); + }); +}); + +test('hex buffer to utf8', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + var B = c.require('buffer'); + t.equal( + new B.Buffer("d581d7906162", "hex").toString("utf8"), + new Buffer("d581d7906162", "hex").toString("utf8") + ); + }); +}); + +test('base64 buffer to ascii', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii"), + new Buffer("MTIzNDU2IUAjJCVe", "base64").toString("ascii") + ); + }); +}); + +test('hex buffer to ascii', function (t) { + t.plan(1); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + t.equal( + new c.require('buffer').Buffer("31323334353621402324255e", "hex").toString("ascii"), + new Buffer("31323334353621402324255e", "hex").toString("ascii") + ); + }); +}); + +test('indexing a buffer', function (t) { + t.plan(5); + var b = browserify(); + b.require('buffer'); + b.bundle(function (err, src) { + var c = context(); + vm.runInNewContext(src, c); + var buf = c.require('buffer').Buffer('abc'); + t.equal(buf[0], 97); + t.equal(buf[1], 98); + t.equal(buf[2], 99); + t.equal(buf[3], undefined); + t.equal(buf.toString('utf8'), 'abc'); + }); +}); + +function context () { + return { + ArrayBuffer: ArrayBuffer, + Uint8Array: Uint8Array, + DataView: DataView + }; +} diff --git a/node_modules/browserify/test/bundle-bundle-external.js b/node_modules/browserify/test/bundle-bundle-external.js new file mode 100644 index 0000000..559e7f1 --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var test = require('tap').test; + +var pubdir = __dirname; +var dir = pubdir + '/bundle-bundle-external'; + +var opt = { + debug: true, + basedir: pubdir, + exposeAll: true +}; + +test('bundle bundle external', function (t) { + t.plan(1); + var bundle1 = browserify(opt); + var name = dir + '/foo.js'; + bundle1.require(name, { entry: true, expose: name, basedir: pubdir }); + + var bundle2 = browserify({ + debug: true, + basedir: pubdir, + entries: [ dir + '/baz.js' ] + }); + + // adding and removing this line causes failure // + //bundle2.external(bundle1); + + bundle2.bundle(function(err, src) { + t.ifError(err); + }); +}); diff --git a/node_modules/browserify/test/bundle-bundle-external/bar.js b/node_modules/browserify/test/bundle-bundle-external/bar.js new file mode 100644 index 0000000..8079379 --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external/bar.js @@ -0,0 +1,2 @@ +module.exports = 'bar'; +done(); diff --git a/node_modules/browserify/test/bundle-bundle-external/baz.js b/node_modules/browserify/test/bundle-bundle-external/baz.js new file mode 100644 index 0000000..1dda5de --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external/baz.js @@ -0,0 +1,3 @@ +var foo = require('./foo'); +assert.equal(foo, 'foo'); +done(); diff --git a/node_modules/browserify/test/bundle-bundle-external/foo.js b/node_modules/browserify/test/bundle-bundle-external/foo.js new file mode 100644 index 0000000..99cf946 --- /dev/null +++ b/node_modules/browserify/test/bundle-bundle-external/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); +assert.equal(bar, 'bar'); + +module.exports = 'foo'; +done(); diff --git a/node_modules/browserify/test/bundle-stream.js b/node_modules/browserify/test/bundle-stream.js new file mode 100644 index 0000000..4193b33 --- /dev/null +++ b/node_modules/browserify/test/bundle-stream.js @@ -0,0 +1,18 @@ +var browserify = require('../'); +var test = require('tap').test; + +var isReadable = require('isstream').isReadable; +var isWritable = require('isstream').isWritable; + +test('bundle is readable stream', function (t) { + t.plan(4); + var b = browserify(__dirname + '/entry/main.js'); + b.on('bundle', function(bundle) { + t.ok(isReadable(bundle)); + t.notok(isWritable(bundle)); + }); + + var stream = b.bundle(); + t.ok(isReadable(stream)); + t.notok(isWritable(stream)); +}); diff --git a/node_modules/browserify/test/bundle.js b/node_modules/browserify/test/bundle.js new file mode 100644 index 0000000..115317a --- /dev/null +++ b/node_modules/browserify/test/bundle.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('bundle', function (t) { + var b = browserify(); + b.require('seq'); + b.bundle(function (err, src) { + t.plan(3); + + t.ifError(err); + t.ok(src.length > 0); + + var c = { + setTimeout : setTimeout, + clearTimeout : clearTimeout, + console : console + }; + vm.runInNewContext(src, c); + + c.require('seq')([1,2,3]) + .parMap_(function (next, x) { + setTimeout(function () { + next.ok(x * 100) + }, 10) + }) + .seq(function (x,y,z) { + t.deepEqual([x,y,z], [100,200,300]); + t.end(); + }) + ; + }); +}); diff --git a/node_modules/browserify/test/bundle_external.js b/node_modules/browserify/test/bundle_external.js new file mode 100644 index 0000000..05a0ac2 --- /dev/null +++ b/node_modules/browserify/test/bundle_external.js @@ -0,0 +1,26 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('bundle external', function (t) { + t.plan(3); + + var expected = [ + { name: 'beep', value: 111 }, + { name: 't-rex', value: 5 } + ]; + + var b = browserify({ bundleExternal: false }); + b.add(__dirname + '/bundle_external/main.js'); + b.bundle(function (err, src) { + var c = { + t: t, + require: function (name) { + var r = expected.shift(); + t.equal(name, r.name); + return r.value; + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/bundle_external/boop.js b/node_modules/browserify/test/bundle_external/boop.js new file mode 100644 index 0000000..e785264 --- /dev/null +++ b/node_modules/browserify/test/bundle_external/boop.js @@ -0,0 +1,4 @@ +var robot = require('./robot.js'); +var trex = require('t-rex'); + +module.exports = function (n) { return robot(n) * trex }; diff --git a/node_modules/browserify/test/bundle_external/main.js b/node_modules/browserify/test/bundle_external/main.js new file mode 100644 index 0000000..88e3f1d --- /dev/null +++ b/node_modules/browserify/test/bundle_external/main.js @@ -0,0 +1,4 @@ +var beep = require('beep'); +var boop = require('./boop.js'); + +t.equal(boop(beep), 560); diff --git a/node_modules/browserify/test/bundle_external/robot.js b/node_modules/browserify/test/bundle_external/robot.js new file mode 100644 index 0000000..2a569dd --- /dev/null +++ b/node_modules/browserify/test/bundle_external/robot.js @@ -0,0 +1 @@ +module.exports = function (n) { return n + 1 }; diff --git a/node_modules/browserify/test/bundle_external_global.js b/node_modules/browserify/test/bundle_external_global.js new file mode 100644 index 0000000..47a9c94 --- /dev/null +++ b/node_modules/browserify/test/bundle_external_global.js @@ -0,0 +1,24 @@ +var test = require('tap').test; +var browserify = require('../'); +var through = require('through2'); +var vm = require('vm'); + +test('bundle external global', function (t) { + t.plan(1); + + var stream = through(); + stream.push('console.log(process)'); + stream.push(null); + + var b = browserify({ bundleExternal: false }); + b.add(stream); + b.bundle(function (err, src) { + vm.runInNewContext(src, { + console: { log: log }, + process: process + }); + function log (msg) { + t.equal(typeof msg.nextTick, 'function'); + } + }); +}); diff --git a/node_modules/browserify/test/bundle_sourcemap.js b/node_modules/browserify/test/bundle_sourcemap.js new file mode 100644 index 0000000..02b8f43 --- /dev/null +++ b/node_modules/browserify/test/bundle_sourcemap.js @@ -0,0 +1,32 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('bundle in debug mode', function (t) { + t.plan(3); + + var b = browserify({ debug: true }); + b.require('seq'); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var secondtolastLine = src.split('\n').slice(-2); + + t.ok(typeof src === 'string'); + t.ok(src.length > 0); + t.ok(/^\/\/# sourceMappingURL=/.test(secondtolastLine), 'includes sourcemap'); + }); +}); + +test('bundle in non debug mode', function (t) { + t.plan(3); + + var b = browserify(); + b.require('seq'); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var secondtolastLine = src.split('\n').slice(-2); + + t.ok(typeof src === 'string'); + t.ok(src.length > 0); + t.notOk(/^\/\/# sourceMappingURL=/.test(secondtolastLine), 'includes no sourcemap'); + }); +}); diff --git a/node_modules/browserify/test/catch.js b/node_modules/browserify/test/catch.js new file mode 100644 index 0000000..f85b67b --- /dev/null +++ b/node_modules/browserify/test/catch.js @@ -0,0 +1,22 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('catch pipeline errors with a callback', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/catch/main.js'); + b.bundle(function (err, src) { + t.ok(err); + t.ok(/no_such_file/.test(err)); + }); +}); + +test('catch pipeline errors with an event', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/catch/main.js').bundle(); + b.on('error', function (err) { + t.ok(err); + t.ok(/no_such_file/.test(err)); + }); +}); diff --git a/node_modules/browserify/test/catch/main.js b/node_modules/browserify/test/catch/main.js new file mode 100644 index 0000000..a522a65 --- /dev/null +++ b/node_modules/browserify/test/catch/main.js @@ -0,0 +1 @@ +require('./no_such_file'); diff --git a/node_modules/browserify/test/circular.js b/node_modules/browserify/test/circular.js new file mode 100644 index 0000000..92efade --- /dev/null +++ b/node_modules/browserify/test/circular.js @@ -0,0 +1,34 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('circular', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/circular/main.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); + +test('circular expose', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/circular/main.js'); + b.require(__dirname + '/circular/a.js', { expose: './a.js' }); + b.require(__dirname + '/circular/b.js', { expose: './b.js' }); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); + +test('circular require', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/circular/main.js'); + b.require(__dirname + '/circular/a.js'); + b.require(__dirname + '/circular/b.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/circular/a.js b/node_modules/browserify/test/circular/a.js new file mode 100644 index 0000000..f3adf1d --- /dev/null +++ b/node_modules/browserify/test/circular/a.js @@ -0,0 +1,3 @@ +exports.a = 1; +exports.b = require('./b'); +exports.a = 5; diff --git a/node_modules/browserify/test/circular/b.js b/node_modules/browserify/test/circular/b.js new file mode 100644 index 0000000..f342a84 --- /dev/null +++ b/node_modules/browserify/test/circular/b.js @@ -0,0 +1 @@ +module.exports = 2 + require('./a').a diff --git a/node_modules/browserify/test/circular/main.js b/node_modules/browserify/test/circular/main.js new file mode 100644 index 0000000..cbabf97 --- /dev/null +++ b/node_modules/browserify/test/circular/main.js @@ -0,0 +1 @@ +t.deepEqual(require('./a.js'), { a: 5, b: 3 }); diff --git a/node_modules/browserify/test/coffee_bin.js b/node_modules/browserify/test/coffee_bin.js new file mode 100644 index 0000000..e505692 --- /dev/null +++ b/node_modules/browserify/test/coffee_bin.js @@ -0,0 +1,36 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('compiling coffee with -c', function (t) { + t.plan(4); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-c', '"' + process.execPath + '" "' + __dirname + '/../node_modules/coffee-script/bin/coffee" -sc', + 'coffee_bin/main.coffee' + ]); + var src = ''; + var err = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.on('data', function (buf) { err += buf }); + + ps.on('exit', function (code) { + t.equal(code, 0); + t.equal(err, ''); + + var msgs = [ 'hello world!', 'from x!' ]; + var c = { + console: { + log: function (msg) { + t.equal(msg, msgs.shift()); + } + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/coffee_bin/main.coffee b/node_modules/browserify/test/coffee_bin/main.coffee new file mode 100644 index 0000000..e9b9dc9 --- /dev/null +++ b/node_modules/browserify/test/coffee_bin/main.coffee @@ -0,0 +1,2 @@ +console.log "hello world!" +require './x.coffee' diff --git a/node_modules/browserify/test/coffee_bin/x.coffee b/node_modules/browserify/test/coffee_bin/x.coffee new file mode 100644 index 0000000..3bbf3ca --- /dev/null +++ b/node_modules/browserify/test/coffee_bin/x.coffee @@ -0,0 +1 @@ +console.log "from x!" diff --git a/node_modules/browserify/test/coffeeify.js b/node_modules/browserify/test/coffeeify.js new file mode 100644 index 0000000..176008c --- /dev/null +++ b/node_modules/browserify/test/coffeeify.js @@ -0,0 +1,19 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('coffeeify with an implicit global', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/coffeeify/main.coffee'); + b.transform('coffeeify'); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { + console: { log: log }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }); + function log (msg) { t.equal(msg, 'eyo') } + }); +}); diff --git a/node_modules/browserify/test/coffeeify/main.coffee b/node_modules/browserify/test/coffeeify/main.coffee new file mode 100644 index 0000000..3e6a9e8 --- /dev/null +++ b/node_modules/browserify/test/coffeeify/main.coffee @@ -0,0 +1,2 @@ +process.nextTick -> + console.log 'eyo' diff --git a/node_modules/browserify/test/comment.js b/node_modules/browserify/test/comment.js new file mode 100644 index 0000000..f22278f --- /dev/null +++ b/node_modules/browserify/test/comment.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('trailing comment', function (t) { + t.plan(1); + var b = browserify(__dirname + '/comment/main.js'); + b.bundle(function (err, src) { + var c = { + ex : function (obj) { + t.same(obj, 1234); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/comment/main.js b/node_modules/browserify/test/comment/main.js new file mode 100644 index 0000000..2eca526 --- /dev/null +++ b/node_modules/browserify/test/comment/main.js @@ -0,0 +1,2 @@ +ex(1234) +// test \ No newline at end of file diff --git a/node_modules/browserify/test/constants.js b/node_modules/browserify/test/constants.js new file mode 100644 index 0000000..0efbc6d --- /dev/null +++ b/node_modules/browserify/test/constants.js @@ -0,0 +1,18 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var through = require('through2'); + +test('constants', function (t) { + t.plan(2); + var stream = through(); + stream.push('console.log(require("constants").ENOENT)'); + stream.push(null); + var b = browserify(stream); + + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 2) } + }); +}); diff --git a/node_modules/browserify/test/crypto.js b/node_modules/browserify/test/crypto.js new file mode 100644 index 0000000..23d77cb --- /dev/null +++ b/node_modules/browserify/test/crypto.js @@ -0,0 +1,39 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); +var concat = require('concat-stream'); + +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); + +fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); + +test('*-browserify libs from node_modules/', function (t) { + t.plan(2); + + var bin = __dirname + '/../bin/cmd.js'; + var ps = spawn(process.execPath, [ bin, 'main.js' ], { cwd : tmpdir }); + + ps.stderr.pipe(process.stderr, { end : false }); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); + + ps.stdout.pipe(concat(function (src) { + var c = { + Int32Array: Int32Array, + ArrayBuffer: ArrayBuffer, + Uint8Array: Uint8Array, + DataView: DataView, + beep : function (c) { + t.equal(typeof c.createHash, 'function'); + }, + require: function () {} + }; + vm.runInNewContext(src.toString('utf8'), c); + })); +}); diff --git a/node_modules/browserify/test/crypto_ig.js b/node_modules/browserify/test/crypto_ig.js new file mode 100644 index 0000000..67965fc --- /dev/null +++ b/node_modules/browserify/test/crypto_ig.js @@ -0,0 +1,39 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); +var concat = require('concat-stream'); + +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); + +fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); + +test('crypto --insertGlobals', function (t) { + t.plan(2); + + var bin = __dirname + '/../bin/cmd.js'; + var ps = spawn(process.execPath, [ bin, 'main.js', '--ig' ], { cwd : tmpdir }); + + ps.stderr.pipe(process.stderr, { end : false }); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); + + ps.stdout.pipe(concat(function (src) { + var c = { + Int32Array: Int32Array, + ArrayBuffer: ArrayBuffer, + Uint8Array: Uint8Array, + DataView: DataView, + beep : function (c) { + t.equal(typeof c.createHash, 'function'); + }, + require: function () {} + }; + vm.runInNewContext(src.toString('utf8'), c); + })); +}); diff --git a/node_modules/browserify/test/cycle.js b/node_modules/browserify/test/cycle.js new file mode 100644 index 0000000..6cfd3c2 --- /dev/null +++ b/node_modules/browserify/test/cycle.js @@ -0,0 +1,13 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('cycle', function (t) { + t.plan(2); + var b = browserify(__dirname + '/cycle/entry.js'); + b.bundle(function (err, body) { + t.ifError(err); + vm.runInNewContext(body); + t.ok(true); + }); +}); diff --git a/node_modules/browserify/test/cycle/README.md b/node_modules/browserify/test/cycle/README.md new file mode 100644 index 0000000..d41c397 --- /dev/null +++ b/node_modules/browserify/test/cycle/README.md @@ -0,0 +1,16 @@ +browserify-bug-713 +================== + +substack/node-browserify#713 breaks resolving an identical module multiple time from different locations when the module has a circular require. + +## Reproduce + +Module requires two copies of the same module (identical apart from path) and the sub module has a circular require. + +## Example + +This is the case with [readable-stream](https://github.com/isaacs/readable-stream). If two different modules depend on the same version readable-stream (and no npm dedupe), then both of those modules are required in the same project, browserify throws a `RangeError: Maximum call stack size exceeded` + +See https://github.com/isaacs/readable-stream/blob/master/lib/_stream_writable.js#L134 and https://github.com/isaacs/readable-stream/blob/master/lib/_stream_duplex.js#L44 + +This issue is most likely related: substack/node-browserify#735 diff --git a/node_modules/browserify/test/cycle/entry.js b/node_modules/browserify/test/cycle/entry.js new file mode 100644 index 0000000..6a8dd8e --- /dev/null +++ b/node_modules/browserify/test/cycle/entry.js @@ -0,0 +1,15 @@ +// RE: substack/node-browserify#713 + +// https://github.com/substack/node-browserify/pull/713 breaks resolving +// an identical module multiple time from different locations when the +// module has a circular require. + +// other than path, mod1 and mod2 are identical + +require('./mod1/a') +require('./mod2/a') + +// browserify entry.js + +// works in 3.37.2 +// >= 3.38 throws RangeError: Maximum call stack size exceeded \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod1/a.js b/node_modules/browserify/test/cycle/mod1/a.js new file mode 100644 index 0000000..c40d2fe --- /dev/null +++ b/node_modules/browserify/test/cycle/mod1/a.js @@ -0,0 +1 @@ +require('./b') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod1/b.js b/node_modules/browserify/test/cycle/mod1/b.js new file mode 100644 index 0000000..54c7b9c --- /dev/null +++ b/node_modules/browserify/test/cycle/mod1/b.js @@ -0,0 +1 @@ +require('./a') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod2/a.js b/node_modules/browserify/test/cycle/mod2/a.js new file mode 100644 index 0000000..c40d2fe --- /dev/null +++ b/node_modules/browserify/test/cycle/mod2/a.js @@ -0,0 +1 @@ +require('./b') \ No newline at end of file diff --git a/node_modules/browserify/test/cycle/mod2/b.js b/node_modules/browserify/test/cycle/mod2/b.js new file mode 100644 index 0000000..54c7b9c --- /dev/null +++ b/node_modules/browserify/test/cycle/mod2/b.js @@ -0,0 +1 @@ +require('./a') \ No newline at end of file diff --git a/node_modules/browserify/test/debug_standalone.js b/node_modules/browserify/test/debug_standalone.js new file mode 100644 index 0000000..23a06cc --- /dev/null +++ b/node_modules/browserify/test/debug_standalone.js @@ -0,0 +1,64 @@ +var test = require('tap').test; +var browserify = require('../'); +var through = require('through2'); +var vm = require('vm'); + +test('ordinary debug', function (t) { + t.plan(1); + + var stream = through(); + stream.push('console.log(1+2)'); + stream.push(null); + + var b = browserify({ debug: true }); + b.add(stream); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var last = src.split('\n').slice(-2)[0]; + t.ok( + /\/\/# sourceMappingURL=data:application\/json;charset:utf-8;base64,[\w+\/=]+$/ + .test(last) + ); + }); +}); + +test('debug standalone', function (t) { + t.plan(1); + + var stream = through(); + stream.push('console.log(1+2)'); + stream.push(null); + + var b = browserify({ debug: true, standalone: 'xyz' }); + b.add(stream); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var last = src.split('\n').slice(-2)[0]; + t.ok( + /\/\/# sourceMappingURL=data:application\/json;charset:utf-8;base64,[\w+\/=]+$/ + .test(last) + ); + }); +}); + +test('debug standalone exposed', function (t) { + t.plan(2); + + var stream = through(); + stream.push('console.log(1+2)'); + stream.push(null); + + var b = browserify({ debug: true, standalone: 'xyz' }); + b.require(__dirname + '/debug_standalone/x.js', { expose: 'xxx' }); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + var last = src.split('\n').slice(-2)[0]; + t.ok( + /\/\/# sourceMappingURL=data:application\/json;charset:utf-8;base64,[\w+\/=]+$/ + .test(last) + ); + var c = { window: {} }; + vm.runInNewContext(src, c); + t.equal(c.window.xyz, 555); + }); +}); diff --git a/node_modules/browserify/test/debug_standalone/x.js b/node_modules/browserify/test/debug_standalone/x.js new file mode 100644 index 0000000..3e842e7 --- /dev/null +++ b/node_modules/browserify/test/debug_standalone/x.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/dedupe-deps.js b/node_modules/browserify/test/dedupe-deps.js new file mode 100644 index 0000000..4fab4da --- /dev/null +++ b/node_modules/browserify/test/dedupe-deps.js @@ -0,0 +1,43 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('identical content gets deduped and the row gets an implicit dep on the original source', function (t) { + t.plan(1) + + var rows = []; + browserify() + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var deduped = rows.filter(function (x) { return x.dedupeIndex }); + var d = deduped[0]; + + t.deepEqual(d.deps, { 'dup': d.dedupeIndex }, "adds implicit dep"); + } +}) + +test('identical content gets deduped with fullPaths', function (t) { + t.plan(1) + + var rows = []; + browserify({fullPaths: true}) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var deduped = rows.filter(function (x) { return x.dedupe }); + var d = deduped[0]; + + t.deepEqual( + d.source, + 'arguments[4]['+ JSON.stringify(d.dedupe) + '][0]' + + '.apply(exports,arguments)', + "dedupes content" + ); + } +}) diff --git a/node_modules/browserify/test/dedupe-nomap.js b/node_modules/browserify/test/dedupe-nomap.js new file mode 100644 index 0000000..906fadc --- /dev/null +++ b/node_modules/browserify/test/dedupe-nomap.js @@ -0,0 +1,64 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('identical content gets deduped and the row gets a "nomap" flag set when sourcemaps are turned on', function (t) { + t.plan(4) + + var rows = []; + browserify({ debug: true }) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var nomappeds = rows.filter(function (x) { return x.nomap }); + var nm = nomappeds[0]; + + t.equal(rows.length, 3, 'packs 3 rows'); + t.equal(nomappeds.length, 1, 'one of has nomapped flag set'); + t.equal( + rows.filter(function (x) { + return x.id == nm.dedupeIndex + }).length, + 1, + '2 rows with the same hash as the duplicate exist' + ); + t.similar( + nm.source, + /arguments\[4\]\[.+\]\[0\]\.apply\(exports,arguments\)$/, + 'redirects duplicate to original via require call' + ); + } +}) + +test('identical content gets deduped and the row gets a "nomap" flag set when sourcemaps are turned off', function (t) { + t.plan(4) + + var rows = []; + browserify({ debug: false }) + .on('dep', [].push.bind(rows)) + .require(require.resolve('./dup'), { entry: true }) + .bundle(check); + + function check(err, src) { + if (err) return t.fail(err); + var nomappeds = rows.filter(function (x) { return x.nomap }); + var nm = nomappeds[0]; + + t.equal(rows.length, 3, 'packs 3 rows'); + t.equal(nomappeds.length, 1, 'one of has nomapped flag set'); + t.equal( + rows.filter(function (x) { + return x.id == nm.dedupeIndex + }).length, + 1, + '2 rows with the same hash as the duplicate exist' + ); + t.similar( + nm.source, + /arguments\[4\]\[.+\]\[0\]\.apply\(exports,arguments\)$/, + 'redirects duplicate to original via require call' + ); + } +}) diff --git a/node_modules/browserify/test/delay.js b/node_modules/browserify/test/delay.js new file mode 100644 index 0000000..6335ee8 --- /dev/null +++ b/node_modules/browserify/test/delay.js @@ -0,0 +1,24 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('delay for pipelines', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/delay/main.js'); + b.pipeline.get('record').push(through.obj(function (row, enc, next) { + if (row.file) { + t.equal(row.file, __dirname + '/delay/main.js'); + row.file = __dirname + '/delay/diverted.js'; + } + this.push(row); + next(); + })); + + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 900) } + }); +}); diff --git a/node_modules/browserify/test/delay/diverted.js b/node_modules/browserify/test/delay/diverted.js new file mode 100644 index 0000000..3037cd9 --- /dev/null +++ b/node_modules/browserify/test/delay/diverted.js @@ -0,0 +1 @@ +console.log(900) diff --git a/node_modules/browserify/test/delay/main.js b/node_modules/browserify/test/delay/main.js new file mode 100644 index 0000000..67eaa25 --- /dev/null +++ b/node_modules/browserify/test/delay/main.js @@ -0,0 +1 @@ +console.log(500) diff --git a/node_modules/browserify/test/dep.js b/node_modules/browserify/test/dep.js new file mode 100644 index 0000000..13ee026 --- /dev/null +++ b/node_modules/browserify/test/dep.js @@ -0,0 +1,25 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('dependency events', function (t) { + t.plan(4); + var b = browserify(__dirname + '/entry/main.js'); + var deps = []; + b.on('dep', function (row) { + deps.push({ id: row.id, deps: row.deps }); + t.equal(typeof row.source, 'string'); + }); + + b.bundle(function (err, src) { + t.deepEqual(deps.sort(cmp), [ + { id: 1, deps: { './one': 2, './two': 3 } }, + { id: 2, deps: {} }, + { id: 3, deps: {} } + ]); + }); + + function cmp (a, b) { + return a.id < b.id ? -1 : 1; + } +}); diff --git a/node_modules/browserify/test/dollar.js b/node_modules/browserify/test/dollar.js new file mode 100644 index 0000000..872cee5 --- /dev/null +++ b/node_modules/browserify/test/dollar.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('dollar', function (t) { + t.plan(2); + var b = browserify(); + b.require(__dirname + '/dollar/dollar/index.js', { expose: 'dollar' }); + b.bundle(function (err, src) { + t.ok(src.length > 0); + + var c = {}; + vm.runInNewContext(src, c); + var res = vm.runInNewContext('require("dollar")(100)', c); + t.equal(res, 10000); + }); +}); diff --git a/node_modules/browserify/test/dollar/dollar/index.js b/node_modules/browserify/test/dollar/dollar/index.js new file mode 100644 index 0000000..a6012aa --- /dev/null +++ b/node_modules/browserify/test/dollar/dollar/index.js @@ -0,0 +1,7 @@ +// foo $ bar $ baz + +var $ = function (x) { + return x * 100; +}; + +module.exports = $; diff --git a/node_modules/browserify/test/double_buffer.js b/node_modules/browserify/test/double_buffer.js new file mode 100644 index 0000000..1535eb9 --- /dev/null +++ b/node_modules/browserify/test/double_buffer.js @@ -0,0 +1,14 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('double buffer', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/double_buffer/main.js'); + b.require('buffer'); + b.bundle(function (err, src) { + if (err) return t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/double_buffer/explicit.js b/node_modules/browserify/test/double_buffer/explicit.js new file mode 100644 index 0000000..fa76b1f --- /dev/null +++ b/node_modules/browserify/test/double_buffer/explicit.js @@ -0,0 +1 @@ +module.exports = require('buffer').Buffer diff --git a/node_modules/browserify/test/double_buffer/implicit.js b/node_modules/browserify/test/double_buffer/implicit.js new file mode 100644 index 0000000..70c9e75 --- /dev/null +++ b/node_modules/browserify/test/double_buffer/implicit.js @@ -0,0 +1 @@ +module.exports = Buffer diff --git a/node_modules/browserify/test/double_buffer/main.js b/node_modules/browserify/test/double_buffer/main.js new file mode 100644 index 0000000..bf124fd --- /dev/null +++ b/node_modules/browserify/test/double_buffer/main.js @@ -0,0 +1,4 @@ +var implicit = require('./implicit.js'); +var explicit = require('./explicit.js'); + +t.equal(implicit, explicit); diff --git a/node_modules/browserify/test/double_bundle.js b/node_modules/browserify/test/double_bundle.js new file mode 100644 index 0000000..d5b9a1b --- /dev/null +++ b/node_modules/browserify/test/double_bundle.js @@ -0,0 +1,24 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle', function (t) { + t.plan(5); + + var b = browserify(__dirname + '/entry/main.js'); + b.bundle(function (err, src0) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src0, c); + + b.bundle(function (err, src1) { + t.ifError(err); + t.equal(src1.toString('utf8'), src0.toString('utf8')); + }); + }); +}); diff --git a/node_modules/browserify/test/double_bundle_error.js b/node_modules/browserify/test/double_bundle_error.js new file mode 100644 index 0000000..02ff015 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle error', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/double_bundle_error/main.js'); + var x = b.bundle(); + x.on('error', function (err) { + t.ok(err); + var y = b.bundle(); + y.on('error', function (err) { + t.ok(err); + }); + }); +}); diff --git a/node_modules/browserify/test/double_bundle_error/main.js b/node_modules/browserify/test/double_bundle_error/main.js new file mode 100644 index 0000000..89bb8a0 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/main.js @@ -0,0 +1 @@ +done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/double_bundle_error/needs_three.js b/node_modules/browserify/test/double_bundle_error/needs_three.js new file mode 100644 index 0000000..9def415 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/needs_three.js @@ -0,0 +1 @@ +require("three"); diff --git a/node_modules/browserify/test/double_bundle_error/one.js b/node_modules/browserify/test/double_bundle_error/one.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/double_bundle_error/package.json b/node_modules/browserify/test/double_bundle_error/package.json new file mode 100644 index 0000000..ad2f403 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "three": "./three.js" + } +} diff --git a/node_modules/browserify/test/double_bundle_error/three.js b/node_modules/browserify/test/double_bundle_error/three.js new file mode 100644 index 0000000..b15da27 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/three.js @@ -0,0 +1,3 @@ +require('./nosuchfile.js'); + +module.exports = 3; diff --git a/node_modules/browserify/test/double_bundle_error/two.js b/node_modules/browserify/test/double_bundle_error/two.js new file mode 100644 index 0000000..72461a5 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_error/two.js @@ -0,0 +1 @@ +module.exports = require('./three.js') - 1; diff --git a/node_modules/browserify/test/double_bundle_json.js b/node_modules/browserify/test/double_bundle_json.js new file mode 100644 index 0000000..ac72709 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json.js @@ -0,0 +1,37 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); +var xtend = require('xtend'); + +test('double bundle json', function (t) { + t.plan(6); + var expected0 = [ 'a=500', 'b=500' ]; + var expected1 = [ 'a=500', 'b=500' ]; + + function log0 (msg) { t.equal(msg, expected0.shift()) } + function log1 (msg) { t.equal(msg, expected1.shift()) } + + var cache = {}; + var b = browserify(__dirname + '/double_bundle_json/index.js', { + cache: cache + }); + b.pipeline.get('deps').push(through.obj(function(row, enc, next) { + cache[row.file] = { + source: row.source, + deps: xtend(row.deps) + }; + this.push(row); + next(); + })); + b.bundle(function (err, src0) { + t.ifError(err); + vm.runInNewContext(src0, { console: { log: log0 } }); + delete cache[__dirname + '/double_bundle_json/index.js']; + + b.bundle(function (err, src1) { + t.ifError(err); + vm.runInNewContext(src1, { console: { log: log1 } }); + }); + }); +}); diff --git a/node_modules/browserify/test/double_bundle_json/a.json b/node_modules/browserify/test/double_bundle_json/a.json new file mode 100644 index 0000000..bf0cf63 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json/a.json @@ -0,0 +1 @@ +{"x":500} diff --git a/node_modules/browserify/test/double_bundle_json/b.json b/node_modules/browserify/test/double_bundle_json/b.json new file mode 100644 index 0000000..bf0cf63 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json/b.json @@ -0,0 +1 @@ +{"x":500} diff --git a/node_modules/browserify/test/double_bundle_json/index.js b/node_modules/browserify/test/double_bundle_json/index.js new file mode 100644 index 0000000..fd8f682 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_json/index.js @@ -0,0 +1,5 @@ +var a = require('./a.json'); +var b = require('./b.json'); + +console.log('a=' + a.x); +console.log('b=' + b.x); diff --git a/node_modules/browserify/test/double_bundle_parallel.js b/node_modules/browserify/test/double_bundle_parallel.js new file mode 100644 index 0000000..ffeed20 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_parallel.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle parallel', function (t) { + t.plan(7); + + var sources = []; + var b = browserify(__dirname + '/entry/main.js'); + + var pending = 2; + b.bundle(check(0)); + b.bundle(check(1)); + + function check (index) { + return function (err, src) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src, c); + sources[index] = src.toString('utf8'); + if (--pending === 0) done(); + }; + } + + function done () { + t.equal(sources[0], sources[1]); + } +}); diff --git a/node_modules/browserify/test/double_bundle_parallel_cache.js b/node_modules/browserify/test/double_bundle_parallel_cache.js new file mode 100644 index 0000000..521eda4 --- /dev/null +++ b/node_modules/browserify/test/double_bundle_parallel_cache.js @@ -0,0 +1,35 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('double bundle parallel cached', function (t) { + t.plan(7); + + var sources = []; + var b = browserify(__dirname + '/entry/main.js', { + cache: {} + }); + + var pending = 2; + b.bundle(check(0)); + b.bundle(check(1)); + + function check (index) { + return function (err, src) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src, c); + sources[index] = src.toString('utf8'); + if (--pending === 0) done(); + }; + } + + function done () { + t.equal(sources[0], sources[1]); + } +}); diff --git a/node_modules/browserify/test/dup/foo-dup.js b/node_modules/browserify/test/dup/foo-dup.js new file mode 100644 index 0000000..8fadf88 --- /dev/null +++ b/node_modules/browserify/test/dup/foo-dup.js @@ -0,0 +1,4 @@ +// something on first line +module.exports = function () { + console.log('I like to duplicate myself'); +}; diff --git a/node_modules/browserify/test/dup/foo.js b/node_modules/browserify/test/dup/foo.js new file mode 100644 index 0000000..8fadf88 --- /dev/null +++ b/node_modules/browserify/test/dup/foo.js @@ -0,0 +1,4 @@ +// something on first line +module.exports = function () { + console.log('I like to duplicate myself'); +}; diff --git a/node_modules/browserify/test/dup/index.js b/node_modules/browserify/test/dup/index.js new file mode 100644 index 0000000..ea44288 --- /dev/null +++ b/node_modules/browserify/test/dup/index.js @@ -0,0 +1,5 @@ +var foo = require('./foo'); +var foodup = require('./foo-dup'); + +foo(); +foodup(); diff --git a/node_modules/browserify/test/entry.js b/node_modules/browserify/test/entry.js new file mode 100644 index 0000000..34d91e9 --- /dev/null +++ b/node_modules/browserify/test/entry.js @@ -0,0 +1,42 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('entry', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, __dirname + '/entry/main.js'); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); + +test('entry via add', function (t) { + t.plan(3); + + var b = browserify(); + b.add(__dirname + '/entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, __dirname + '/entry/main.js'); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/entry/main.js b/node_modules/browserify/test/entry/main.js new file mode 100644 index 0000000..89bb8a0 --- /dev/null +++ b/node_modules/browserify/test/entry/main.js @@ -0,0 +1 @@ +done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/entry/needs_three.js b/node_modules/browserify/test/entry/needs_three.js new file mode 100644 index 0000000..9def415 --- /dev/null +++ b/node_modules/browserify/test/entry/needs_three.js @@ -0,0 +1 @@ +require("three"); diff --git a/node_modules/browserify/test/entry/one.js b/node_modules/browserify/test/entry/one.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/browserify/test/entry/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/entry/package.json b/node_modules/browserify/test/entry/package.json new file mode 100644 index 0000000..ad2f403 --- /dev/null +++ b/node_modules/browserify/test/entry/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "three": "./three.js" + } +} diff --git a/node_modules/browserify/test/entry/three.js b/node_modules/browserify/test/entry/three.js new file mode 100644 index 0000000..690aad3 --- /dev/null +++ b/node_modules/browserify/test/entry/three.js @@ -0,0 +1 @@ +module.exports = 3; diff --git a/node_modules/browserify/test/entry/two.js b/node_modules/browserify/test/entry/two.js new file mode 100644 index 0000000..4bbffde --- /dev/null +++ b/node_modules/browserify/test/entry/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/entry_exec.js b/node_modules/browserify/test/entry_exec.js new file mode 100644 index 0000000..c70281e --- /dev/null +++ b/node_modules/browserify/test/entry_exec.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('only execute entry files', function (t) { + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/entry_exec/main.js'); + b.require(__dirname + '/entry_exec/fail.js'); + b.bundle(function (err, src) { + var c = { t: t }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/entry_exec/fail.js b/node_modules/browserify/test/entry_exec/fail.js new file mode 100644 index 0000000..8da5557 --- /dev/null +++ b/node_modules/browserify/test/entry_exec/fail.js @@ -0,0 +1 @@ +t.fail('only entry files should get executed right away'); diff --git a/node_modules/browserify/test/entry_exec/main.js b/node_modules/browserify/test/entry_exec/main.js new file mode 100644 index 0000000..98331f4 --- /dev/null +++ b/node_modules/browserify/test/entry_exec/main.js @@ -0,0 +1 @@ +t.ok(true); diff --git a/node_modules/browserify/test/entry_expose.js b/node_modules/browserify/test/entry_expose.js new file mode 100644 index 0000000..2323c2c --- /dev/null +++ b/node_modules/browserify/test/entry_expose.js @@ -0,0 +1,19 @@ +var test = require('tap').test; +var browserify = require('../'); +var path = require('path'); +var vm = require('vm'); + +test('entry expose', function (t) { + t.plan(3) + + var b = browserify(); + b.add(__dirname + '/entry_expose/main.js'); + b.require(__dirname + '/entry_expose/main.js', { expose: 'x' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + function log (msg) { t.equal(msg, 'wow') } + vm.runInNewContext(src, c); + t.equal(c.require('x'), 555); + }) +}); diff --git a/node_modules/browserify/test/entry_expose/main.js b/node_modules/browserify/test/entry_expose/main.js new file mode 100644 index 0000000..bf2b2d6 --- /dev/null +++ b/node_modules/browserify/test/entry_expose/main.js @@ -0,0 +1,2 @@ +console.log('wow'); +module.exports = 555; diff --git a/node_modules/browserify/test/entry_relative.js b/node_modules/browserify/test/entry_relative.js new file mode 100644 index 0000000..f1ae37f --- /dev/null +++ b/node_modules/browserify/test/entry_relative.js @@ -0,0 +1,44 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('entry - relative path', function (t) { + process.chdir(__dirname); + + t.plan(3); + + var b = browserify('entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, __dirname + '/entry/main.js'); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); + +test('entry - relative path via add', function (t) { + t.plan(3); + + var b = browserify({basedir: __dirname}); + b.add('entry/main.js'); + b.on('dep', function(row) { + if (row.entry) t.equal(row.file, __dirname + '/entry/main.js'); + }); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/error_code.js b/node_modules/browserify/test/error_code.js new file mode 100644 index 0000000..2f3734c --- /dev/null +++ b/node_modules/browserify/test/error_code.js @@ -0,0 +1,24 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); + +test('error code', function (t) { + t.plan(2); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + path.resolve(__dirname, 'error_code/src.js') + ]); + var err = ''; + ps.stderr.on('data', function (buf) { err += buf }); + ps.stderr.on('end', function () { + t.ok(/^(Syntax|Parse)Error:/m.test(err)); + }); + + ps.on('exit', function (code) { + t.notEqual(code, 0); + }); +}); diff --git a/node_modules/browserify/test/error_code/src.js b/node_modules/browserify/test/error_code/src.js new file mode 100644 index 0000000..e85c07c --- /dev/null +++ b/node_modules/browserify/test/error_code/src.js @@ -0,0 +1,2 @@ +var x = { +var y = 6; diff --git a/node_modules/browserify/test/export.js b/node_modules/browserify/test/export.js new file mode 100644 index 0000000..def4dfd --- /dev/null +++ b/node_modules/browserify/test/export.js @@ -0,0 +1,35 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('no exports when no files are loaded', function (t) { + t.plan(1); + var b = browserify(); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.same(Object.keys(c), []); + }); +}); + +test('no exports when entries are defined', function (t) { + t.plan(1); + var b = browserify(); + b.add(__dirname + '/export/entry.js'); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.same(c, {}); + }); +}); + +test('require export when files are required', function (t) { + t.plan(1); + var b = browserify(); + b.require(__dirname + '/export/entry.js'); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.same(Object.keys(c), [ 'require' ]); + }); +}); diff --git a/node_modules/browserify/test/export/entry.js b/node_modules/browserify/test/export/entry.js new file mode 100644 index 0000000..6f037f8 --- /dev/null +++ b/node_modules/browserify/test/export/entry.js @@ -0,0 +1 @@ +// nop diff --git a/node_modules/browserify/test/external.js b/node_modules/browserify/test/external.js new file mode 100644 index 0000000..a107a4c --- /dev/null +++ b/node_modules/browserify/test/external.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('external', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/external/main.js'); + b.external('freelist'); + b.bundle(function (err, src) { + if (err) return t.fail(err); + vm.runInNewContext( + 'function require (x) {' + + 'if (x==="freelist") return function (n) { return n + 1000 }' + + '}' + + src, + { t: t } + ); + }); +}); diff --git a/node_modules/browserify/test/external/main.js b/node_modules/browserify/test/external/main.js new file mode 100644 index 0000000..82ceeda --- /dev/null +++ b/node_modules/browserify/test/external/main.js @@ -0,0 +1,2 @@ +t.equal(require('freelist')(5), 1005); +t.equal(require('./x.js')(6), 1016); diff --git a/node_modules/browserify/test/external/x.js b/node_modules/browserify/test/external/x.js new file mode 100644 index 0000000..a587ef4 --- /dev/null +++ b/node_modules/browserify/test/external/x.js @@ -0,0 +1,3 @@ +var fl = require('freelist'); + +module.exports = function (n) { return fl(n) + 10 }; diff --git a/node_modules/browserify/test/external_args/main.js b/node_modules/browserify/test/external_args/main.js new file mode 100644 index 0000000..b19e6c1 --- /dev/null +++ b/node_modules/browserify/test/external_args/main.js @@ -0,0 +1,10 @@ +try { + var Backbone = require('backbone'); + throw new Error('module included'); +} catch (e) { + if (e.message === 'module included') { + throw e; + } else { + t.ok(true); + } +} \ No newline at end of file diff --git a/node_modules/browserify/test/external_shim.js b/node_modules/browserify/test/external_shim.js new file mode 100644 index 0000000..63739c0 --- /dev/null +++ b/node_modules/browserify/test/external_shim.js @@ -0,0 +1,27 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('requiring a shimmed module name from an external bundle', function (t) { + var b1 = browserify(); + var b2 = browserify(); + + b1.require(__dirname + '/external_shim/bundle1.js', { expose: 'bundle1' }); + b2.external(b1); + b2.require(__dirname + '/external_shim/bundle2.js', { expose: 'bundle2' }); + + b1.bundle(function (err, src1) { + b2.bundle(function (err, src2) { + t.plan(1); + + var c = { + console: console, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + vm.runInNewContext(src1 + src2, c); + + t.ok(c.require('bundle1').shim === c.require('bundle2').shim); + }); + }); +}); diff --git a/node_modules/browserify/test/external_shim/bundle1.js b/node_modules/browserify/test/external_shim/bundle1.js new file mode 100644 index 0000000..4753f09 --- /dev/null +++ b/node_modules/browserify/test/external_shim/bundle1.js @@ -0,0 +1 @@ +exports.shim = require('shim'); diff --git a/node_modules/browserify/test/external_shim/bundle2.js b/node_modules/browserify/test/external_shim/bundle2.js new file mode 100644 index 0000000..4753f09 --- /dev/null +++ b/node_modules/browserify/test/external_shim/bundle2.js @@ -0,0 +1 @@ +exports.shim = require('shim'); diff --git a/node_modules/browserify/test/external_shim/package.json b/node_modules/browserify/test/external_shim/package.json new file mode 100644 index 0000000..2047ac6 --- /dev/null +++ b/node_modules/browserify/test/external_shim/package.json @@ -0,0 +1,5 @@ +{ + "browser": { + "shim": "./shim.js" + } +} \ No newline at end of file diff --git a/node_modules/browserify/test/external_shim/shim.js b/node_modules/browserify/test/external_shim/shim.js new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/browserify/test/externalize.js b/node_modules/browserify/test/externalize.js new file mode 100644 index 0000000..b290a3a --- /dev/null +++ b/node_modules/browserify/test/externalize.js @@ -0,0 +1,59 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var concat = require('concat-stream'); +var path = require('path'); +var fs = require('fs'); +var vm = require('vm'); + +var temp = require('temp'); +temp.track(); +var tmpdir = temp.mkdirSync({prefix: 'browserify-test'}); +var pubdir = path.join(tmpdir, 'public'); + +fs.mkdirSync(pubdir); +fs.writeFileSync( + path.join(tmpdir, 'robot.js'), + fs.readFileSync(path.join(__dirname, 'externalize/robot.js')) +); +fs.writeFileSync( + path.join(tmpdir, 'beep.js'), + fs.readFileSync(path.join(__dirname, 'externalize/beep.js')) +); +fs.writeFileSync( + path.join(tmpdir, 'boop.js'), + fs.readFileSync(path.join(__dirname, 'externalize/boop.js')) +); + +test('externalize bin', function (t) { + t.plan(5); + + var commands = [ + [ '-r', './robot.js', '-o', path.join(pubdir, 'common.js') ], + [ '-x', './robot.js', 'beep.js', '-o', path.join(pubdir, 'beep.js') ], + [ '-x', './robot.js', 'boop.js', '-o', path.join(pubdir, 'boop.js') ] + ]; + (function next () { + if (commands.length === 0) { + var common = fs.readFileSync(path.join(pubdir, 'common.js')); + var beep = fs.readFileSync(path.join(pubdir, 'beep.js')); + var boop = fs.readFileSync(path.join(pubdir, 'boop.js')); + + vm.runInNewContext(common + beep, { + console: { log: function (msg) { t.equal(msg, 'BEEP!') } } + }); + vm.runInNewContext(common + boop, { + console: { log: function (msg) { t.equal(msg, 'BOOP!') } } + }); + } + else { + var args = commands.shift(); + args.unshift(path.join(__dirname, '../bin/cmd.js')); + var ps = spawn(process.execPath, args, { cwd: tmpdir }); + ps.stderr.pipe(process.stderr); + ps.on('exit', function (code) { + t.equal(code, 0, 'exit code'); + next() + }); + } + })(); +}); diff --git a/node_modules/browserify/test/externalize/beep.js b/node_modules/browserify/test/externalize/beep.js new file mode 100644 index 0000000..4daf2bd --- /dev/null +++ b/node_modules/browserify/test/externalize/beep.js @@ -0,0 +1,2 @@ +var robot = require('./robot.js'); +console.log(robot('beep')); \ No newline at end of file diff --git a/node_modules/browserify/test/externalize/boop.js b/node_modules/browserify/test/externalize/boop.js new file mode 100644 index 0000000..586e87f --- /dev/null +++ b/node_modules/browserify/test/externalize/boop.js @@ -0,0 +1,2 @@ +var robot = require('./robot.js'); +console.log(robot('boop')); \ No newline at end of file diff --git a/node_modules/browserify/test/externalize/robot.js b/node_modules/browserify/test/externalize/robot.js new file mode 100644 index 0000000..8a7ccd8 --- /dev/null +++ b/node_modules/browserify/test/externalize/robot.js @@ -0,0 +1 @@ +module.exports = function (s) { return s.toUpperCase() + '!' }; \ No newline at end of file diff --git a/node_modules/browserify/test/fake.js b/node_modules/browserify/test/fake.js new file mode 100644 index 0000000..a62fb93 --- /dev/null +++ b/node_modules/browserify/test/fake.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('fake', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/fake/fake_fs.js', { expose: 'fs' }); + b.add(__dirname + '/fake/main.js'); + b.bundle(function (err, src) { + var c = { t: t }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/fake/fake_fs.js b/node_modules/browserify/test/fake/fake_fs.js new file mode 100644 index 0000000..1ebc261 --- /dev/null +++ b/node_modules/browserify/test/fake/fake_fs.js @@ -0,0 +1 @@ +exports.party = function () { return 'PaRtY!1!1!' }; diff --git a/node_modules/browserify/test/fake/main.js b/node_modules/browserify/test/fake/main.js new file mode 100644 index 0000000..fd4339a --- /dev/null +++ b/node_modules/browserify/test/fake/main.js @@ -0,0 +1,2 @@ +var fs = require('fs'); +t.equal(fs.party(), 'PaRtY!1!1!'); diff --git a/node_modules/browserify/test/field.js b/node_modules/browserify/test/field.js new file mode 100644 index 0000000..8353504 --- /dev/null +++ b/node_modules/browserify/test/field.js @@ -0,0 +1,72 @@ +var assert = require('assert'); +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('fieldString', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/string.js', { expose: './string.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./string.js'), + 'browser' + ); + }); +}); + +test('fieldObject', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/object.js', { expose: './object.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./object.js'), + '!browser' + ); + }); +}); + +test('missObject', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/miss.js', { expose: './miss.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./miss.js'), + '!browser' + ); + }); +}); + +test('fieldSub', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/field/sub.js', { expose: './sub.js' }); + b.bundle(function (err, src) { + if (err) return t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('./sub.js'), + 'browser' + ); + }); +}); diff --git a/node_modules/browserify/test/field/miss.js b/node_modules/browserify/test/field/miss.js new file mode 100644 index 0000000..3619990 --- /dev/null +++ b/node_modules/browserify/test/field/miss.js @@ -0,0 +1 @@ +module.exports = require('z-miss') diff --git a/node_modules/browserify/test/field/object.js b/node_modules/browserify/test/field/object.js new file mode 100644 index 0000000..c373dc9 --- /dev/null +++ b/node_modules/browserify/test/field/object.js @@ -0,0 +1 @@ +module.exports = require('z-object') diff --git a/node_modules/browserify/test/field/string.js b/node_modules/browserify/test/field/string.js new file mode 100644 index 0000000..ee4c65d --- /dev/null +++ b/node_modules/browserify/test/field/string.js @@ -0,0 +1 @@ +module.exports = require('z-string') diff --git a/node_modules/browserify/test/field/sub.js b/node_modules/browserify/test/field/sub.js new file mode 100644 index 0000000..8c662a9 --- /dev/null +++ b/node_modules/browserify/test/field/sub.js @@ -0,0 +1 @@ +module.exports = require('z-sub') diff --git a/node_modules/browserify/test/file_event.js b/node_modules/browserify/test/file_event.js new file mode 100644 index 0000000..285ccaf --- /dev/null +++ b/node_modules/browserify/test/file_event.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var path = require('path'); + +test('file event', function (t) { + t.plan(8); + + var b = browserify(__dirname + '/entry/main.js'); + var files = { + 'main.js': __dirname + '/entry/main.js', + 'one.js': './one', + 'two.js': './two' + }; + + b.on('file', function (file, id) { + var key = path.basename(file); + t.equal(file, path.join(__dirname, 'entry', key)); + t.equal(id, files[key]); + delete files[key]; + }); + + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/five_bundle.js b/node_modules/browserify/test/five_bundle.js new file mode 100644 index 0000000..473f037 --- /dev/null +++ b/node_modules/browserify/test/five_bundle.js @@ -0,0 +1,30 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('five bundle', function (t) { + t.plan(3+4*2); + + var b = browserify(__dirname + '/entry/main.js'); + var source; + + b.bundle(function (err, src0) { + t.ifError(err); + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + } + }; + vm.runInNewContext(src0, c); + + (function next (count) { + if (count === 5) return; + b.bundle(function (err, src1) { + t.ifError(err); + t.equal(src1.toString('utf8'), src0.toString('utf8')); + next(count+1); + }); + })(1); + }); +}); diff --git a/node_modules/browserify/test/full_paths.js b/node_modules/browserify/test/full_paths.js new file mode 100644 index 0000000..11431be --- /dev/null +++ b/node_modules/browserify/test/full_paths.js @@ -0,0 +1,58 @@ +var unpack = require('browser-unpack'); +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); +var path = require('path'); + +var deps = [ + path.join(__dirname, '/entry/main.js'), + path.join(__dirname, '/entry/one.js'), + path.join(__dirname, '/entry/two.js') +]; + +test('fullPaths enabled', function (t) { + t.plan(3); + + var b = browserify({ + entries: [ deps[0] ], + fullPaths: true + }); + + b.bundle(function (err, src) { + unpack(src).forEach(function(dep) { + t.notEqual(deps.indexOf(dep.id), -1, 'full path name for dep.id'); + }); + }); +}); + +test('fullPaths disabled', function (t) { + t.plan(3); + + var b = browserify({ + entries: [ deps[0] ], + fullPaths: false + }); + + b.bundle(function (err, src) { + unpack(src).forEach(function(dep) { + t.equal(deps.indexOf(dep.id), -1, 'full path name no longer available'); + }); + }); +}); + +test('fullPaths enabled, with custom exposed dependency name', function (t) { + t.plan(1); + + var b = browserify({ + entries: [__dirname + '/entry/needs_three.js'], + fullPaths: true + }); + + b.require(__dirname + '/entry/three.js', { expose: 'three' }); + + b.bundle(function (err, src) { + t.doesNotThrow(function () { + vm.runInNewContext(src, { console: console, t: t }); + }); + }); +}); diff --git a/node_modules/browserify/test/glob.js b/node_modules/browserify/test/glob.js new file mode 100644 index 0000000..4ac8093 --- /dev/null +++ b/node_modules/browserify/test/glob.js @@ -0,0 +1,29 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('glob', function (t) { + var expected = [ 'a', '!x', 'z', 'b', '!y' ]; + t.plan(expected.length + 1); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + 'a.js', 'b.js', + '-u', 'vendor/*.js' + ], { cwd: __dirname + '/glob' }); + ps.stderr.pipe(process.stderr); + ps.stdout.pipe(concat(function (body) { + var c = { console: { log: log } }; + vm.runInNewContext(body.toString('utf8'), c); + function log (msg) { t.equal(msg, expected.shift()) } + })); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/glob/a.js b/node_modules/browserify/test/glob/a.js new file mode 100644 index 0000000..97fe11a --- /dev/null +++ b/node_modules/browserify/test/glob/a.js @@ -0,0 +1,6 @@ +console.log('a'); + +try { require('./vendor/x.js') } +catch (err) { console.log('!x') } + +require('./lib/z.js') diff --git a/node_modules/browserify/test/glob/b.js b/node_modules/browserify/test/glob/b.js new file mode 100644 index 0000000..fedd5f4 --- /dev/null +++ b/node_modules/browserify/test/glob/b.js @@ -0,0 +1,5 @@ +console.log('b'); + +try { require('./vendor/y.js') } +catch (err) { console.log('!y') } + diff --git a/node_modules/browserify/test/glob/lib/z.js b/node_modules/browserify/test/glob/lib/z.js new file mode 100644 index 0000000..0475609 --- /dev/null +++ b/node_modules/browserify/test/glob/lib/z.js @@ -0,0 +1 @@ +console.log('z'); diff --git a/node_modules/browserify/test/glob/vendor/x.js b/node_modules/browserify/test/glob/vendor/x.js new file mode 100644 index 0000000..5eee864 --- /dev/null +++ b/node_modules/browserify/test/glob/vendor/x.js @@ -0,0 +1 @@ +console.log('x'); diff --git a/node_modules/browserify/test/glob/vendor/y.js b/node_modules/browserify/test/glob/vendor/y.js new file mode 100644 index 0000000..78a89b3 --- /dev/null +++ b/node_modules/browserify/test/glob/vendor/y.js @@ -0,0 +1 @@ +console.log('y'); diff --git a/node_modules/browserify/test/global.js b/node_modules/browserify/test/global.js new file mode 100644 index 0000000..b860abb --- /dev/null +++ b/node_modules/browserify/test/global.js @@ -0,0 +1,90 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('global', function (t) { + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/global/main.js'); + b.bundle(function (err, src) { + var c = { + t : t, + a : 555, + }; + c.self = c; + vm.runInNewContext(src, c); + }); +}); + +test('__filename and __dirname with insertGlobals: true', function (t) { + t.plan(2); + + var b = browserify({ + insertGlobals: true, + basedir: __dirname + '/global' + }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = {}; + c.self = c; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, '/filename.js'); + t.equal(x.dirname, '/'); + }); +}); + +test('__filename and __dirname', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname + '/global' }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, '/filename.js'); + t.equal(x.dirname, '/'); + }); +}); + +test('__filename and __dirname with basedir', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, '/global/filename.js'); + t.equal(x.dirname, '/global'); + }); +}); + +test('process.nextTick', function (t) { + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/global/tick.js'); + b.bundle(function (err, src) { + var c = { t: t, setTimeout: setTimeout, clearTimeout: clearTimeout }; + vm.runInNewContext(src, c); + }); +}); + +test('Buffer', function (t) { + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/global/buffer.js'); + b.bundle(function (err, src) { + var c = { + t: t, + Uint8Array: Uint8Array, + DataView: DataView + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/global/buffer.js b/node_modules/browserify/test/global/buffer.js new file mode 100644 index 0000000..fec6eeb --- /dev/null +++ b/node_modules/browserify/test/global/buffer.js @@ -0,0 +1,2 @@ +t.equal(Buffer('xyz').toString('base64'), 'eHl6'); +t.equal(Buffer('eHl6', 'base64').toString(), 'xyz'); diff --git a/node_modules/browserify/test/global/filename.js b/node_modules/browserify/test/global/filename.js new file mode 100644 index 0000000..85dc112 --- /dev/null +++ b/node_modules/browserify/test/global/filename.js @@ -0,0 +1,2 @@ +exports.filename = __filename; +exports.dirname = __dirname; diff --git a/node_modules/browserify/test/global/main.js b/node_modules/browserify/test/global/main.js new file mode 100644 index 0000000..d77852b --- /dev/null +++ b/node_modules/browserify/test/global/main.js @@ -0,0 +1,2 @@ +t.equal(a, 555); +t.equal(a, global.a); diff --git a/node_modules/browserify/test/global/tick.js b/node_modules/browserify/test/global/tick.js new file mode 100644 index 0000000..428f3ef --- /dev/null +++ b/node_modules/browserify/test/global/tick.js @@ -0,0 +1,3 @@ +process.nextTick(function () { + t.ok(true); +}); diff --git a/node_modules/browserify/test/global_coffeeify.js b/node_modules/browserify/test/global_coffeeify.js new file mode 100644 index 0000000..00aa54a --- /dev/null +++ b/node_modules/browserify/test/global_coffeeify.js @@ -0,0 +1,19 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('coffeeify globally', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/coffeeify/main.coffee'); + b.transform('coffeeify', { global: true }); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { + console: { log: log }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }); + function log (msg) { t.equal(msg, 'eyo') } + }); +}); diff --git a/node_modules/browserify/test/global_noparse.js b/node_modules/browserify/test/global_noparse.js new file mode 100644 index 0000000..decd772 --- /dev/null +++ b/node_modules/browserify/test/global_noparse.js @@ -0,0 +1,101 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('global noparse module', function (t) { + t.plan(2); + + var b = browserify({ + noParse: 'aaa' + }); + b.require(__dirname + '/global/node_modules/aaa', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse module file', function (t) { + t.plan(2); + + var b = browserify({ + noParse: 'aaa/index.js' + }); + b.require(__dirname + '/global/node_modules/aaa', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse module deep file', function (t) { + t.plan(2); + + var b = browserify({ + noParse: 'robot/lib/beep.js' + }); + b.require(__dirname + '/global/node_modules/robot', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse basedir', function (t) { + t.plan(2); + + var b = browserify({ + basedir: __dirname + '/global', + noParse: 'filename.js' + }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); + +test('global noparse function', function (t) { + t.plan(2); + + var b = browserify({ + noParse: function(file) { + return file === __dirname + '/global/filename.js'; + } + }); + b.require(__dirname + '/global/filename.js', { expose: 'x' }); + b.bundle(function (err, src) { + var c = { + __filename: __filename, + __dirname: __dirname + }; + vm.runInNewContext(src, c); + var x = c.require('x'); + t.equal(x.filename, __filename); + t.equal(x.dirname, __dirname); + }); +}); diff --git a/node_modules/browserify/test/global_recorder.js b/node_modules/browserify/test/global_recorder.js new file mode 100644 index 0000000..7fdc07f --- /dev/null +++ b/node_modules/browserify/test/global_recorder.js @@ -0,0 +1,22 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('recorded global tr', function (t) { + t.plan(6); + + var b = browserify(__dirname + '/global_recorder/main.js'); + var context = { + console: { log: function (msg) { t.equal(msg, 'wow') } } + }; + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, context); + t.equal(b._recorded.length, 2); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, context); + t.equal(b._recorded.length, 2); + }); + }); +}); diff --git a/node_modules/browserify/test/global_recorder/main.js b/node_modules/browserify/test/global_recorder/main.js new file mode 100644 index 0000000..6036bec --- /dev/null +++ b/node_modules/browserify/test/global_recorder/main.js @@ -0,0 +1 @@ +console.log('wow'); diff --git a/node_modules/browserify/test/hash.js b/node_modules/browserify/test/hash.js new file mode 100644 index 0000000..a459a40 --- /dev/null +++ b/node_modules/browserify/test/hash.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('hash', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/hash/main.js'); + b.bundle(function (err, buf) { + var c = { t: t }; + var src = buf.toString('utf8'); + t.equal(src.match(RegExp('// FILE CONTENTS', 'g')).length, 1); + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/hash/foo/other.js b/node_modules/browserify/test/hash/foo/other.js new file mode 100644 index 0000000..f4e8d9d --- /dev/null +++ b/node_modules/browserify/test/hash/foo/other.js @@ -0,0 +1 @@ +module.exports = 5; diff --git a/node_modules/browserify/test/hash/foo/two.js b/node_modules/browserify/test/hash/foo/two.js new file mode 100644 index 0000000..86c05b9 --- /dev/null +++ b/node_modules/browserify/test/hash/foo/two.js @@ -0,0 +1,2 @@ +// FILE CONTENTS +module.exports = 111 * require('./other.js'); diff --git a/node_modules/browserify/test/hash/main.js b/node_modules/browserify/test/hash/main.js new file mode 100644 index 0000000..b37dd88 --- /dev/null +++ b/node_modules/browserify/test/hash/main.js @@ -0,0 +1,2 @@ +t.equal(require('./foo/two.js'), 555); +t.equal(require('./one.js'), 333); diff --git a/node_modules/browserify/test/hash/one.js b/node_modules/browserify/test/hash/one.js new file mode 100644 index 0000000..86c05b9 --- /dev/null +++ b/node_modules/browserify/test/hash/one.js @@ -0,0 +1,2 @@ +// FILE CONTENTS +module.exports = 111 * require('./other.js'); diff --git a/node_modules/browserify/test/hash/other.js b/node_modules/browserify/test/hash/other.js new file mode 100644 index 0000000..690aad3 --- /dev/null +++ b/node_modules/browserify/test/hash/other.js @@ -0,0 +1 @@ +module.exports = 3; diff --git a/node_modules/browserify/test/hash_instance_context.js b/node_modules/browserify/test/hash_instance_context.js new file mode 100644 index 0000000..dda45aa --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context.js @@ -0,0 +1,25 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('hash instances with hashed contexts', function (t) { + t.plan(17); + + var b = browserify(__dirname + '/hash_instance_context/main.js'); + b.bundle(function (err, buf) { + var c = { t: t }; + var src = buf.toString('utf8'); + t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 2); + + t.equal(src.match(RegExp('// FILE F TWO', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G TWO', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE H TWO', 'g')).length, 2); + + t.equal(src.match(RegExp('// FILE F THREE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G THREE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE H THREE', 'g')).length, 1); + + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/hash_instance_context/main.js b/node_modules/browserify/test/hash_instance_context/main.js new file mode 100644 index 0000000..db1e23e --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/main.js @@ -0,0 +1,17 @@ +var A = require('./one/f.js'); +var B = require('./one/dir/f.js'); +t.notEqual(A, B); +t.equal(A(), 555); +t.equal(B(), 333); + +var C = require('./two/f.js'); +var D = require('./two/dir/f.js'); +t.notEqual(C, D); +t.equal(C(), 555); +t.equal(D(), 333); + +var E = require('./three/f.js'); +var F = require('./three/dir/f.js'); +t.notEqual(E, F); +t.equal(E(), 555); +t.equal(F(), 555); diff --git a/node_modules/browserify/test/hash_instance_context/one/dir/f.js b/node_modules/browserify/test/hash_instance_context/one/dir/f.js new file mode 100644 index 0000000..a315c1e --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/dir/f.js @@ -0,0 +1,3 @@ +// FILE F ONE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/one/dir/g.js b/node_modules/browserify/test/hash_instance_context/one/dir/g.js new file mode 100644 index 0000000..9cab61b --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/dir/g.js @@ -0,0 +1,2 @@ +// FILE G ONE +module.exports = 3 diff --git a/node_modules/browserify/test/hash_instance_context/one/f.js b/node_modules/browserify/test/hash_instance_context/one/f.js new file mode 100644 index 0000000..a315c1e --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/f.js @@ -0,0 +1,3 @@ +// FILE F ONE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/one/g.js b/node_modules/browserify/test/hash_instance_context/one/g.js new file mode 100644 index 0000000..8373032 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/one/g.js @@ -0,0 +1,2 @@ +// FILE G ONE +module.exports = 5 diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/f.js b/node_modules/browserify/test/hash_instance_context/three/dir/f.js new file mode 100644 index 0000000..51b1e73 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/dir/f.js @@ -0,0 +1,3 @@ +// FILE F THREE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/g.js b/node_modules/browserify/test/hash_instance_context/three/dir/g.js new file mode 100644 index 0000000..654f021 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/dir/g.js @@ -0,0 +1,2 @@ +// FILE G THREE +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/three/dir/h.js b/node_modules/browserify/test/hash_instance_context/three/dir/h.js new file mode 100644 index 0000000..afcc80f --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/dir/h.js @@ -0,0 +1,2 @@ +// FILE H THREE +module.exports = 4 diff --git a/node_modules/browserify/test/hash_instance_context/three/f.js b/node_modules/browserify/test/hash_instance_context/three/f.js new file mode 100644 index 0000000..51b1e73 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/f.js @@ -0,0 +1,3 @@ +// FILE F THREE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/three/g.js b/node_modules/browserify/test/hash_instance_context/three/g.js new file mode 100644 index 0000000..654f021 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/g.js @@ -0,0 +1,2 @@ +// FILE G THREE +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/three/h.js b/node_modules/browserify/test/hash_instance_context/three/h.js new file mode 100644 index 0000000..afcc80f --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/three/h.js @@ -0,0 +1,2 @@ +// FILE H THREE +module.exports = 4 diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/f.js b/node_modules/browserify/test/hash_instance_context/two/dir/f.js new file mode 100644 index 0000000..1178f93 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/dir/f.js @@ -0,0 +1,3 @@ +// FILE F TWO +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/g.js b/node_modules/browserify/test/hash_instance_context/two/dir/g.js new file mode 100644 index 0000000..b940ee7 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/dir/g.js @@ -0,0 +1,2 @@ +// FILE G TWO +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/two/dir/h.js b/node_modules/browserify/test/hash_instance_context/two/dir/h.js new file mode 100644 index 0000000..74a8a7a --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/dir/h.js @@ -0,0 +1,2 @@ +// FILE H TWO +module.exports = 2 diff --git a/node_modules/browserify/test/hash_instance_context/two/f.js b/node_modules/browserify/test/hash_instance_context/two/f.js new file mode 100644 index 0000000..1178f93 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/f.js @@ -0,0 +1,3 @@ +// FILE F TWO +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/hash_instance_context/two/g.js b/node_modules/browserify/test/hash_instance_context/two/g.js new file mode 100644 index 0000000..b940ee7 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/g.js @@ -0,0 +1,2 @@ +// FILE G TWO +module.exports = require('./h.js') + 1; diff --git a/node_modules/browserify/test/hash_instance_context/two/h.js b/node_modules/browserify/test/hash_instance_context/two/h.js new file mode 100644 index 0000000..42684f0 --- /dev/null +++ b/node_modules/browserify/test/hash_instance_context/two/h.js @@ -0,0 +1,2 @@ +// FILE H TWO +module.exports = 4 diff --git a/node_modules/browserify/test/identical.js b/node_modules/browserify/test/identical.js new file mode 100644 index 0000000..7d0deae --- /dev/null +++ b/node_modules/browserify/test/identical.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('identical', function (t) { + var expected = [ 0, 1, 0, 1 ]; + t.plan(expected.length + 1); + + var b = browserify(__dirname + '/identical/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src.toString('utf8'), { + console: { log: log } + }); + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); diff --git a/node_modules/browserify/test/identical/main.js b/node_modules/browserify/test/identical/main.js new file mode 100644 index 0000000..c2e83ed --- /dev/null +++ b/node_modules/browserify/test/identical/main.js @@ -0,0 +1,6 @@ +var x = require('./x'); +var y = require('./y'); +console.log(x()); +console.log(x()); +console.log(y()); +console.log(y()); diff --git a/node_modules/browserify/test/identical/x.js b/node_modules/browserify/test/identical/x.js new file mode 100644 index 0000000..13c441d --- /dev/null +++ b/node_modules/browserify/test/identical/x.js @@ -0,0 +1,2 @@ +var i = 0; +module.exports = function () { return i++ }; diff --git a/node_modules/browserify/test/identical/y.js b/node_modules/browserify/test/identical/y.js new file mode 100644 index 0000000..13c441d --- /dev/null +++ b/node_modules/browserify/test/identical/y.js @@ -0,0 +1,2 @@ +var i = 0; +module.exports = function () { return i++ }; diff --git a/node_modules/browserify/test/identical_different.js b/node_modules/browserify/test/identical_different.js new file mode 100644 index 0000000..a2e7911 --- /dev/null +++ b/node_modules/browserify/test/identical_different.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('identical', function (t) { + var expected = [ 1, 2, 10, 110 ]; + t.plan(expected.length + 1); + + var b = browserify(__dirname + '/identical_different/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src.toString('utf8'), { + console: { log: log } + }); + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); diff --git a/node_modules/browserify/test/identical_different/main.js b/node_modules/browserify/test/identical_different/main.js new file mode 100644 index 0000000..5a4154b --- /dev/null +++ b/node_modules/browserify/test/identical_different/main.js @@ -0,0 +1,6 @@ +var x = require('./x'); +var y = require('./wow/y'); +console.log(x()); +console.log(x()); +console.log(y()); +console.log(y()); diff --git a/node_modules/browserify/test/identical_different/wow/y.js b/node_modules/browserify/test/identical_different/wow/y.js new file mode 100644 index 0000000..0b8636f --- /dev/null +++ b/node_modules/browserify/test/identical_different/wow/y.js @@ -0,0 +1,3 @@ +var op = require('op'); +var i = 0; +module.exports = function () { i = op(i); return i }; diff --git a/node_modules/browserify/test/identical_different/x.js b/node_modules/browserify/test/identical_different/x.js new file mode 100644 index 0000000..0b8636f --- /dev/null +++ b/node_modules/browserify/test/identical_different/x.js @@ -0,0 +1,3 @@ +var op = require('op'); +var i = 0; +module.exports = function () { i = op(i); return i }; diff --git a/node_modules/browserify/test/ignore.js b/node_modules/browserify/test/ignore.js new file mode 100644 index 0000000..29e483d --- /dev/null +++ b/node_modules/browserify/test/ignore.js @@ -0,0 +1,72 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('ignore', function (t) { + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/ignore/main.js'); + b.ignore( __dirname + '/ignore/skip.js'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('ignore by package or id', function (t) { + t.plan(3); + + var b = browserify(); + b.add(__dirname + '/ignore/by-id.js'); + b.ignore('events'); + b.ignore('beep'); + b.ignore('bad id'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('ignore files referenced by relative path', function (t) { + // Change the current working directory relative to this file + var cwd = process.cwd(); + process.chdir(__dirname); + + t.plan(1); + + var b = browserify(); + b.add(__dirname + '/ignore/by-relative.js'); + b.ignore('./ignore/ignored/skip.js'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); + + // Revert CWD + process.chdir(cwd); +}); + +test('do not ignore files with relative paths that do not resolve', function (t) { + // Change the current working directory to the ignore folder + var cwd = process.cwd(); + process.chdir(__dirname + '/ignore'); + + t.plan(2); + + var b = browserify(); + b.add(__dirname + '/ignore/double-skip.js'); + + b.ignore('./skip.js'); + + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); + + // Revert CWD + process.chdir(cwd); +}); diff --git a/node_modules/browserify/test/ignore/by-id.js b/node_modules/browserify/test/ignore/by-id.js new file mode 100644 index 0000000..61c0baa --- /dev/null +++ b/node_modules/browserify/test/ignore/by-id.js @@ -0,0 +1,3 @@ +t.deepEqual(require('events'), {}); +t.deepEqual(require('bad id'), {}); +t.deepEqual(require('beep'), {}); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/by-relative.js b/node_modules/browserify/test/ignore/by-relative.js new file mode 100644 index 0000000..e50676e --- /dev/null +++ b/node_modules/browserify/test/ignore/by-relative.js @@ -0,0 +1,5 @@ +/** + * This test is to check to make sure that files that are ignored do not get + * bundled when referenced with a nested relative path. + */ +t.deepEqual(require('./relative'), {}); diff --git a/node_modules/browserify/test/ignore/double-skip.js b/node_modules/browserify/test/ignore/double-skip.js new file mode 100644 index 0000000..ad61cce --- /dev/null +++ b/node_modules/browserify/test/ignore/double-skip.js @@ -0,0 +1,2 @@ +t.deepEqual(require('./skip.js'), {}); +t.deepEqual(require('./double-skip/index'), {foo: 'bar'}); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/double-skip/index.js b/node_modules/browserify/test/ignore/double-skip/index.js new file mode 100644 index 0000000..affe2f2 --- /dev/null +++ b/node_modules/browserify/test/ignore/double-skip/index.js @@ -0,0 +1 @@ +module.exports = require('./skip.js'); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/double-skip/skip.js b/node_modules/browserify/test/ignore/double-skip/skip.js new file mode 100644 index 0000000..1922194 --- /dev/null +++ b/node_modules/browserify/test/ignore/double-skip/skip.js @@ -0,0 +1,5 @@ +// this module should return something + +module.exports = { + foo: 'bar' +}; diff --git a/node_modules/browserify/test/ignore/ignored/skip.js b/node_modules/browserify/test/ignore/ignored/skip.js new file mode 100644 index 0000000..006521e --- /dev/null +++ b/node_modules/browserify/test/ignore/ignored/skip.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore/main.js b/node_modules/browserify/test/ignore/main.js new file mode 100644 index 0000000..0149b75 --- /dev/null +++ b/node_modules/browserify/test/ignore/main.js @@ -0,0 +1 @@ +t.deepEqual(require('./skip.js'), {}); diff --git a/node_modules/browserify/test/ignore/relative/index.js b/node_modules/browserify/test/ignore/relative/index.js new file mode 100644 index 0000000..3f73c32 --- /dev/null +++ b/node_modules/browserify/test/ignore/relative/index.js @@ -0,0 +1 @@ +module.exports = require('../ignored/skip.js'); \ No newline at end of file diff --git a/node_modules/browserify/test/ignore/skip.js b/node_modules/browserify/test/ignore/skip.js new file mode 100644 index 0000000..006521e --- /dev/null +++ b/node_modules/browserify/test/ignore/skip.js @@ -0,0 +1 @@ +t.fail('this file should have been skipped'); diff --git a/node_modules/browserify/test/ignore_browser_field.js b/node_modules/browserify/test/ignore_browser_field.js new file mode 100644 index 0000000..a925f2e --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field.js @@ -0,0 +1,21 @@ +var test = require('tap').test; +var browserify = require('../'); +var path = require('path'); +var mainfile = path.join(__dirname, 'ignore_browser_field/main.js'); +var vm = require('vm'); + +test('ignore browser field', function (t) { + t.plan(3); + var b = browserify(mainfile, { browserField: false }); + var expected = [ 'A:NODE', 'B:X.JS' ]; + + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + + function log (msg) { + t.equal(msg, expected.shift()); + } + }); +}); diff --git a/node_modules/browserify/test/ignore_browser_field/main.js b/node_modules/browserify/test/ignore_browser_field/main.js new file mode 100644 index 0000000..bae4a22 --- /dev/null +++ b/node_modules/browserify/test/ignore_browser_field/main.js @@ -0,0 +1,2 @@ +console.log(require('a')); +console.log(require('b')); diff --git a/node_modules/browserify/test/ignore_missing.js b/node_modules/browserify/test/ignore_missing.js new file mode 100644 index 0000000..ddf72ed --- /dev/null +++ b/node_modules/browserify/test/ignore_missing.js @@ -0,0 +1,41 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('ignoreMissing option', function (t) { + t.test('on browserify', function(t) { + t.plan(1); + + var ignored = browserify({ + entries: [__dirname + '/ignore_missing/main.js'], + ignoreMissing: true + }); + + ignored.bundle(function(err) { + t.ok(!err, "bundle completed with missing file ignored"); + }); + }); + + t.test('on .bundle', function(t) { + t.plan(1); + + var ignored = browserify(__dirname + '/ignore_missing/main.js', { + ignoreMissing: true + }); + + ignored.bundle(function(err) { + t.ok(!err, "bundle completed with missing file ignored"); + }); + }); + + t.test('defaults to false', function (t) { + t.plan(1); + + var expected = browserify(__dirname + '/ignore_missing/main.js'); + + expected.bundle(function(err) { + t.ok(err, 'ignoreMissing was false, an error was raised'); + }); + }); + + t.end(); +}); diff --git a/node_modules/browserify/test/ignore_missing/main.js b/node_modules/browserify/test/ignore_missing/main.js new file mode 100644 index 0000000..a522a65 --- /dev/null +++ b/node_modules/browserify/test/ignore_missing/main.js @@ -0,0 +1 @@ +require('./no_such_file'); diff --git a/node_modules/browserify/test/json.js b/node_modules/browserify/test/json.js new file mode 100644 index 0000000..ffa5333 --- /dev/null +++ b/node_modules/browserify/test/json.js @@ -0,0 +1,44 @@ +var browserify = require('../'); +var fs = require('fs'); +var vm = require('vm'); +var test = require('tap').test; + +test('json', function (t) { + t.plan(2); + var b = browserify(); + b.add(__dirname + '/json/main.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + var c = { + ex : function (obj) { + t.same(obj, { beep : 'boop', x : 555 }); + } + }; + vm.runInNewContext(src, c); + }); +}); + +test('verify evil json', function(t) { + t.plan(1); + fs.readFile(__dirname + '/json/evil-chars.json', function(err, data) { + if (err) t.fail(err); + t.throws(function() { + vm.runInNewContext('(' + data.toString() + ')'); + }); + }); +}); + +test('evil json', function (t) { + t.plan(2); + var b = browserify(); + b.add(__dirname + '/json/evil.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + var c = { + ex : function (obj) { + t.same(obj, { evil : '\u2028\u2029' }); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/json/beep.json b/node_modules/browserify/test/json/beep.json new file mode 100644 index 0000000..d85cfe5 --- /dev/null +++ b/node_modules/browserify/test/json/beep.json @@ -0,0 +1,4 @@ +{ + "beep" : "boop", + "x" : 555 +} diff --git a/node_modules/browserify/test/json/evil-chars.json b/node_modules/browserify/test/json/evil-chars.json new file mode 100644 index 0000000..4a5851b --- /dev/null +++ b/node_modules/browserify/test/json/evil-chars.json @@ -0,0 +1,3 @@ +{ + "evil": "

" +} diff --git a/node_modules/browserify/test/json/evil.js b/node_modules/browserify/test/json/evil.js new file mode 100644 index 0000000..767e9cb --- /dev/null +++ b/node_modules/browserify/test/json/evil.js @@ -0,0 +1,2 @@ +ex(require('./evil-chars.json')); +ex(require('./evil-chars')); diff --git a/node_modules/browserify/test/json/main.js b/node_modules/browserify/test/json/main.js new file mode 100644 index 0000000..f459f30 --- /dev/null +++ b/node_modules/browserify/test/json/main.js @@ -0,0 +1,2 @@ +ex(require('./beep.json')); +ex(require('./beep')); diff --git a/node_modules/browserify/test/leak.js b/node_modules/browserify/test/leak.js new file mode 100644 index 0000000..7479640 --- /dev/null +++ b/node_modules/browserify/test/leak.js @@ -0,0 +1,57 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var path = require('path'); +var through = require('through2'); + +var os = require('os'); +var tmpdir = (os.tmpdir || os.tmpDir)(); +var dir = path.join( + tmpdir, + 'browserify-test-' + Math.random(), + 'aaabbbzzz' +); +var dirstring = dir.split(path.sep).slice(-2).join(path.sep); + +test('leaking information about system paths (process)', function (t) { + t.plan(4); + + var b = browserify({ basedir: dir }); + var stream = through(); + stream.push('process.nextTick(function () {' + + 't.ok(true)' + + '})' + ); + stream.push(null); + b.add(stream); + + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + t.equal(src.indexOf(dirstring), -1, 'temp directory visible'); + t.equal(src.indexOf(process.cwd()), -1, 'cwd directory visible'); + t.equal(src.indexOf('/home'), -1, 'home directory visible'); + vm.runInNewContext(src, { + t: t, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }); + }); +}); + +test('leaking information about system paths (Buffer)', function (t) { + t.plan(4); + + var b = browserify({ basedir: dir }); + var stream = through(); + stream.push('t.equal(Buffer("eHl6", "base64").toString(), "xyz")'); + stream.push(null); + b.add(stream); + + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + t.equal(src.indexOf(dirstring), -1, 'temp directory visible'); + t.equal(src.indexOf(process.cwd()), -1, 'cwd directory visible'); + t.equal(src.indexOf('/home'), -1, 'home directory visible'); + vm.runInNewContext(src, { t: t, setTimeout: setTimeout }); + }); +}); diff --git a/node_modules/browserify/test/maxlisteners.js b/node_modules/browserify/test/maxlisteners.js new file mode 100644 index 0000000..11cfd82 --- /dev/null +++ b/node_modules/browserify/test/maxlisteners.js @@ -0,0 +1,13 @@ +var test = require('tap').test; +var browserify = require('../'); +var vm = require('vm'); + +test('setMaxListener', function (t) { + t.plan(1); + var b = browserify(); + b.add(__dirname + '/maxlisteners/main.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src); + t.ok(true); // didn't crash + }); +}); diff --git a/node_modules/browserify/test/maxlisteners/main.js b/node_modules/browserify/test/maxlisteners/main.js new file mode 100644 index 0000000..a5496a6 --- /dev/null +++ b/node_modules/browserify/test/maxlisteners/main.js @@ -0,0 +1,3 @@ +var EventEmitter = require('events').EventEmitter +var ee = new EventEmitter; +ee.setMaxListeners(5); diff --git a/node_modules/browserify/test/multi_bundle.js b/node_modules/browserify/test/multi_bundle.js new file mode 100644 index 0000000..05411d3 --- /dev/null +++ b/node_modules/browserify/test/multi_bundle.js @@ -0,0 +1,86 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('multi bundle', function (t) { + t.plan(5); + + var core = browserify(); + core.require(__dirname + '/multi_bundle/b.js', { expose: true }); + + var app = browserify([__dirname + '/multi_bundle/a.js']); + // inform this bundle that b exists in another bundle + app.external(__dirname + '/multi_bundle/b.js'); + + core.bundle(function (err, src) { + var c = { + console: console, + t : t, + baton: { + times: 0 + } + }; + + // loading core will cause no require to run + vm.runInNewContext(src, c); + t.equal(c.baton.times, 0); + + // loading the app will require + app.bundle(function (err, src) { + vm.runInNewContext(src, c); + + // b required for the first time + t.equal(c.baton.times, 1); + + // running the file again + // because it is using the same b, no reloading + vm.runInNewContext(src, c); + + // b should not have been required again + // because it was part of the core bundle + t.equal(c.baton.times, 1); + }); + }); +}); + +// re-enable this in future releases +test('multi bundle', function (t) { + t.plan(8); + + var core = browserify({ exposeAll: true }); + core.require(__dirname + '/multi_bundle/a.js', { expose: true }); + + var app = browserify([__dirname + '/multi_bundle/c.js']); + // inform this bundle that b exists in another bundle + app.external(core); + + core.bundle(function (err, src) { + var c = { + console: console, + t : t, + baton: { + times: 0 + } + }; + + // loading core will cause no require to run + vm.runInNewContext(src, c); + t.equal(c.baton.times, 0); + + // loading the app will require + app.bundle(function (err, src) { + vm.runInNewContext(src, c); + + // b required for the first time + t.equal(c.baton.times, 1); + + // running the file again + // because it is using the same b, no reloading + vm.runInNewContext(src, c); + + // b should not have been required again + // because it was part of the core bundle + t.equal(c.baton.times, 1); + }); + }); +}); diff --git a/node_modules/browserify/test/multi_bundle/_prelude.js b/node_modules/browserify/test/multi_bundle/_prelude.js new file mode 100644 index 0000000..95eb4bc --- /dev/null +++ b/node_modules/browserify/test/multi_bundle/_prelude.js @@ -0,0 +1 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof unique_require=="function"&&unique_require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof unique_require=="function"&&unique_require;for(var o=0;o -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry relative', function (t) { + t.plan(6); + + var rTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', ''); + }); + + var b = browserify({ + entries: [rTestFiles[0], rTestFiles[1]], + basedir: __dirname + }); + b.add(rTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry relative cwd', function (t) { + t.plan(6); + + var rTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', './'); + }); + + var b = browserify({ + entries: [rTestFiles[0], rTestFiles[1]], + basedir: __dirname + }); + b.add(rTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('entries as streams', function (t) { + t.plan(6); + + // commondir blows up with streams and without basedir + var opts = { basedir: __dirname + '/multi_entry' }; + + var b = browserify([ + fs.createReadStream(testFiles[0]), + fs.createReadStream(testFiles[1]) + ], opts); + b.add(fs.createReadStream(testFiles[2])); + + b.on('dep', function(row) { + if (row.entry) { + t.similar( + row.file, + RegExp(__dirname + '/multi_entry/_stream_[\\d].js'), + 'should be full entry path' + ); + } + }); + + b.bundle(function (err, src) { + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/multi_entry/a.js b/node_modules/browserify/test/multi_entry/a.js new file mode 100644 index 0000000..d4e250e --- /dev/null +++ b/node_modules/browserify/test/multi_entry/a.js @@ -0,0 +1,2 @@ +times ++; +t.equal(times, 1); diff --git a/node_modules/browserify/test/multi_entry/b.js b/node_modules/browserify/test/multi_entry/b.js new file mode 100644 index 0000000..bed7bbb --- /dev/null +++ b/node_modules/browserify/test/multi_entry/b.js @@ -0,0 +1,2 @@ +times ++; +t.equal(times, 2); diff --git a/node_modules/browserify/test/multi_entry/c.js b/node_modules/browserify/test/multi_entry/c.js new file mode 100644 index 0000000..ac3c174 --- /dev/null +++ b/node_modules/browserify/test/multi_entry/c.js @@ -0,0 +1,2 @@ +times ++; +t.equal(times, 3); diff --git a/node_modules/browserify/test/multi_entry_cross_require.js b/node_modules/browserify/test/multi_entry_cross_require.js new file mode 100644 index 0000000..0cc1a88 --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require.js @@ -0,0 +1,92 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +var testFiles = [ + __dirname + '/multi_entry_cross_require/a.js', + __dirname + '/multi_entry_cross_require/lib/b.js', + __dirname + '/multi_entry_cross_require/c.js' +]; + +test('multi entry cross require', function (t) { + t.plan(8); + + var b = browserify([ + testFiles[0], + testFiles[1] + ]); + b.add(testFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + if (err) throw err; + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry cross require - relative cwd', function (t) { + t.plan(8); + + var dsTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', './'); + }); + + var b = browserify({ + entries: [dsTestFiles[0], dsTestFiles[1]], + basedir: __dirname + }); + b.add(dsTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + if (err) throw err; + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); + +test('multi entry cross require - relative', function (t) { + t.plan(8); + + var rTestFiles = testFiles.map(function(x) { + return x.replace(__dirname + '/', ''); + }); + + var b = browserify({ + entries: [rTestFiles[0], rTestFiles[1]], + basedir: __dirname + }); + b.add(rTestFiles[2]); + + b.on('dep', function(row) { + if (row.entry) { + t.ok(testFiles.indexOf(row.file) > -1, 'should contain full entry path'); + } + }); + + b.bundle(function (err, src) { + if (err) throw err; + var c = { + times : 0, + t : t + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/multi_entry_cross_require/a.js b/node_modules/browserify/test/multi_entry_cross_require/a.js new file mode 100644 index 0000000..0223daf --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require/a.js @@ -0,0 +1,8 @@ +times ++; +t.equal(times, 1); + +var b = require('./lib/b'); +t.equal(times, 2); + +b.foo(); +t.equal(times, 3); diff --git a/node_modules/browserify/test/multi_entry_cross_require/c.js b/node_modules/browserify/test/multi_entry_cross_require/c.js new file mode 100644 index 0000000..e191838 --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require/c.js @@ -0,0 +1,7 @@ +times++; +t.equal(times, 4); + +var b = require('./lib/b'); +b.foo(); + +t.equal(times, 5); diff --git a/node_modules/browserify/test/multi_entry_cross_require/lib/b.js b/node_modules/browserify/test/multi_entry_cross_require/lib/b.js new file mode 100644 index 0000000..e7d2dad --- /dev/null +++ b/node_modules/browserify/test/multi_entry_cross_require/lib/b.js @@ -0,0 +1,5 @@ +times++; + +module.exports.foo = function() { + times++; +}; diff --git a/node_modules/browserify/test/multi_require.js b/node_modules/browserify/test/multi_require.js new file mode 100644 index 0000000..a1b3f64 --- /dev/null +++ b/node_modules/browserify/test/multi_require.js @@ -0,0 +1,18 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('require same file locally and globally', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/multi_require/main.js', { + basedir: __dirname + }); + b.require('./multi_require/a.js', {expose: 'a'}); + + b.bundle(function (err, src) { + t.ifError(err); + var c = {t: t}; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/multi_require/a.js b/node_modules/browserify/test/multi_require/a.js new file mode 100644 index 0000000..18dea67 --- /dev/null +++ b/node_modules/browserify/test/multi_require/a.js @@ -0,0 +1,3 @@ +module.exports = function() { + return 'a'; +} diff --git a/node_modules/browserify/test/multi_require/main.js b/node_modules/browserify/test/multi_require/main.js new file mode 100644 index 0000000..6f548ec --- /dev/null +++ b/node_modules/browserify/test/multi_require/main.js @@ -0,0 +1,4 @@ +var localA = require('./a.js'); +var globalA = require('a'); + +t.equal(localA, globalA); diff --git a/node_modules/browserify/test/multi_symlink.js b/node_modules/browserify/test/multi_symlink.js new file mode 100644 index 0000000..913c7a3 --- /dev/null +++ b/node_modules/browserify/test/multi_symlink.js @@ -0,0 +1,13 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('multiple symlink execution', function (t) { + t.plan(1); + var b = browserify(__dirname + '/multi_symlink/main.js'); + b.bundle(function (err, src) { + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + function log (msg) { t.equal(msg, 'X') } + }); +}); diff --git a/node_modules/browserify/test/multi_symlink/main.js b/node_modules/browserify/test/multi_symlink/main.js new file mode 100644 index 0000000..0f904dc --- /dev/null +++ b/node_modules/browserify/test/multi_symlink/main.js @@ -0,0 +1,2 @@ +require('./x.js'); +require('./y.js'); diff --git a/node_modules/browserify/test/multi_symlink/x.js b/node_modules/browserify/test/multi_symlink/x.js new file mode 100644 index 0000000..e894542 --- /dev/null +++ b/node_modules/browserify/test/multi_symlink/x.js @@ -0,0 +1 @@ +console.log('X'); diff --git a/node_modules/browserify/test/no_builtins.js b/node_modules/browserify/test/no_builtins.js new file mode 100644 index 0000000..900754a --- /dev/null +++ b/node_modules/browserify/test/no_builtins.js @@ -0,0 +1,63 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('builtins false', function (t) { + t.plan(1); + + var b = browserify({ + entries: [ __dirname + '/no_builtins/main.js' ], + commondir: false, + builtins: false + }); + b.bundle(function (err, src) { + var c = { + console: { log: function (msg) { + t.equal(msg, 'beep boop\n'); + } }, + require: require + }; + vm.runInNewContext(src, c); + }); +}); + +test('builtins []', function (t) { + t.plan(1); + var b = browserify({ + entries: [ __dirname + '/no_builtins/main.js' ], + commondir: false, + builtins: [] + }); + b.bundle(function (err, src) { + var c = { + console: { log: function (msg) { + t.equal(msg, 'beep boop\n'); + } }, + require: require + }; + vm.runInNewContext(src, c); + }); +}); + +test('builtins object', function (t) { + t.plan(2); + var b = browserify({ + entries: [ __dirname + '/no_builtins/main.js' ], + commondir: false, + builtins: { + fs: require.resolve('./no_builtins/extra/fs.js'), + tls: require.resolve('./no_builtins/extra/tls.js') + } + }); + var expected = [ + 'WRITE CODE EVERY DAY', + 'WHATEVER' + ]; + b.bundle(function (err, src) { + var c = { console: { log: log }, require: require }; + function log (msg) { + t.equal(msg, expected.shift()); + } + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/no_builtins/extra/fs.js b/node_modules/browserify/test/no_builtins/extra/fs.js new file mode 100644 index 0000000..b8bdd44 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/extra/fs.js @@ -0,0 +1 @@ +exports.readFileSync = function () { return 'WHATEVER' }; diff --git a/node_modules/browserify/test/no_builtins/extra/tls.js b/node_modules/browserify/test/no_builtins/extra/tls.js new file mode 100644 index 0000000..ceea2a6 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/extra/tls.js @@ -0,0 +1 @@ +console.log('WRITE CODE EVERY DAY'); diff --git a/node_modules/browserify/test/no_builtins/main.js b/node_modules/browserify/test/no_builtins/main.js new file mode 100644 index 0000000..f2dadc6 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/main.js @@ -0,0 +1,4 @@ +var fs = require('fs'); +var tls = require('tls'); + +console.log(fs.readFileSync(__dirname + '/x.txt', 'utf8')); diff --git a/node_modules/browserify/test/no_builtins/x.txt b/node_modules/browserify/test/no_builtins/x.txt new file mode 100644 index 0000000..fae06e3 --- /dev/null +++ b/node_modules/browserify/test/no_builtins/x.txt @@ -0,0 +1 @@ +beep boop diff --git a/node_modules/browserify/test/noparse.js b/node_modules/browserify/test/noparse.js new file mode 100644 index 0000000..7d0b3b2 --- /dev/null +++ b/node_modules/browserify/test/noparse.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var test = require('tap').test; +var path = require('path'); + +test('noParse array', function (t) { + process.chdir(__dirname); + + t.plan(2); + + var actual = []; + var expected = [ + 'noparse/a.js', + 'noparse/b.js', + 'noparse/dir1/1.js', + 'noparse/node_modules/robot/main.js' + ].map(function (x) {return path.resolve(x);}).sort(); + + var b = browserify({ + entries: [ __dirname + '/noparse/a.js' ], + noParse: [ + __dirname + '/noparse/dir1/1.js', + __dirname + '/noparse/node_modules/robot/main.js' + ] + }); + b.on('dep', function(dep) { actual.push(dep.file); }); + b.bundle(function (err, src) { + actual.sort(); + t.ifError(err); + t.deepEqual(actual, expected); + }); +}); diff --git a/node_modules/browserify/test/noparse/a.js b/node_modules/browserify/test/noparse/a.js new file mode 100644 index 0000000..076812a --- /dev/null +++ b/node_modules/browserify/test/noparse/a.js @@ -0,0 +1,4 @@ +module.exports = { + a: true, + b: require('./b') +}; diff --git a/node_modules/browserify/test/noparse/b.js b/node_modules/browserify/test/noparse/b.js new file mode 100644 index 0000000..de0ba55 --- /dev/null +++ b/node_modules/browserify/test/noparse/b.js @@ -0,0 +1,5 @@ +module.exports = { + b: true, + 1: require('./dir1/1'), + robot: require('robot') +}; diff --git a/node_modules/browserify/test/noparse/dir1/1.js b/node_modules/browserify/test/noparse/dir1/1.js new file mode 100644 index 0000000..960968b --- /dev/null +++ b/node_modules/browserify/test/noparse/dir1/1.js @@ -0,0 +1,4 @@ +module.exports = { + 1: true, + 2: require('./dir2/2') +}; diff --git a/node_modules/browserify/test/noparse/dir1/dir2/2.js b/node_modules/browserify/test/noparse/dir1/dir2/2.js new file mode 100644 index 0000000..ef4ba19 --- /dev/null +++ b/node_modules/browserify/test/noparse/dir1/dir2/2.js @@ -0,0 +1,3 @@ +module.exports = { + 2: true +}; diff --git a/node_modules/browserify/test/pack.js b/node_modules/browserify/test/pack.js new file mode 100644 index 0000000..68a6e2c --- /dev/null +++ b/node_modules/browserify/test/pack.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var through = require('through2'); +var test = require('tap').test; + +var fs = require('fs'); +var sources = { + 1: fs.readFileSync(__dirname + '/entry/main.js', 'utf8'), + 2: fs.readFileSync(__dirname + '/entry/one.js', 'utf8'), + 3: fs.readFileSync(__dirname + '/entry/two.js', 'utf8') +}; + +var deps = { + 1: { './two': 3, './one': 2 }, + 2: {}, + 3: {} +}; + +test('custom packer', function (t) { + t.plan(7); + + var b = browserify(__dirname + '/entry/main.js'); + b.pipeline.get('pack').splice(0,1, through.obj(function (row, enc, next) { + t.equal(sources[row.id], row.source); + t.deepEqual(deps[row.id], row.deps); + this.push(row.id + '\n'); + next(); + })); + b.pipeline.get('wrap').splice(0); + b.bundle(function (err, src) { + t.equal(src.toString('utf8'), '1\n2\n3\n'); + }); +}); diff --git a/node_modules/browserify/test/paths.js b/node_modules/browserify/test/paths.js new file mode 100644 index 0000000..c3d5728 --- /dev/null +++ b/node_modules/browserify/test/paths.js @@ -0,0 +1,32 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('$NODE_PATHS', function (t) { + t.plan(3); + var paths = [ __dirname + '/paths/x', __dirname + '/paths/y' ]; + var sep = /^win/i.test(process.platform) ? ';' : ':'; + + process.env.NODE_PATH = (process.env.NODE_PATHS || '') + .split(sep).concat(paths).join(sep) + ; + + var b = browserify(__dirname + '/paths/main.js'); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('opts.paths', function (t) { + t.plan(3); + + var b = browserify({ + paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.bundle(function (err, src) { + if (err) t.fail(err); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/paths/main.js b/node_modules/browserify/test/paths/main.js new file mode 100644 index 0000000..ec0d8a1 --- /dev/null +++ b/node_modules/browserify/test/paths/main.js @@ -0,0 +1,3 @@ +t.equal(require('aaa'), 'AX'); +t.equal(require('bbb'), 'BY'); +t.equal(require('ccc'), 'CX'); diff --git a/node_modules/browserify/test/paths/x/aaa/index.js b/node_modules/browserify/test/paths/x/aaa/index.js new file mode 100644 index 0000000..b76ce87 --- /dev/null +++ b/node_modules/browserify/test/paths/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'AX' diff --git a/node_modules/browserify/test/paths/x/ccc/index.js b/node_modules/browserify/test/paths/x/ccc/index.js new file mode 100644 index 0000000..882058e --- /dev/null +++ b/node_modules/browserify/test/paths/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CX' diff --git a/node_modules/browserify/test/paths/y/bbb/index.js b/node_modules/browserify/test/paths/y/bbb/index.js new file mode 100644 index 0000000..5dbca44 --- /dev/null +++ b/node_modules/browserify/test/paths/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'BY' diff --git a/node_modules/browserify/test/paths/y/ccc/index.js b/node_modules/browserify/test/paths/y/ccc/index.js new file mode 100644 index 0000000..d0043d1 --- /dev/null +++ b/node_modules/browserify/test/paths/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY' diff --git a/node_modules/browserify/test/paths_transform.js b/node_modules/browserify/test/paths_transform.js new file mode 100644 index 0000000..bd06070 --- /dev/null +++ b/node_modules/browserify/test/paths_transform.js @@ -0,0 +1,76 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +function ensureTransform(t, buf) { + var srcAsString = (buf||'').toString('utf-8'), + containsAX = srcAsString.indexOf('AX') > -1, + containsAZ = srcAsString.indexOf('AZ') > -1; + t.notOk(containsAX,"should not contain AX's"); + t.ok(containsAZ,"should contain AZ's"); +} + +test('absolute paths with transform property', function (t) { + t.plan(6); + + var b = browserify({ + transform: ['tr'], + basedir: __dirname, + paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); + +test('relative paths with transform property', function (t) { + t.plan(6); + + var b = browserify({ + transform: ['tr'], + basedir: __dirname, + paths: [ './paths/x', './paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); + + +test('absolute paths with transform method', function (t) { + t.plan(6); + + var b = browserify({ + basedir: __dirname, + paths: [ __dirname + '/paths/x', __dirname + '/paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.transform('tr'); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); + + +test('relative paths with transform method', function (t) { + t.plan(6); + var b = browserify({ + basedir: __dirname, + paths: ['./paths/x', './paths/y' ], + entries: __dirname + '/paths/main.js' + }); + b.transform('tr'); + b.bundle(function (err, src) { + t.ifError(err); + ensureTransform(t,src); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/pipeline_deps.js b/node_modules/browserify/test/pipeline_deps.js new file mode 100644 index 0000000..8f847a7 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps.js @@ -0,0 +1,22 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('deps pipeline', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/pipeline_deps/main.js'); + b.pipeline.get('deps').push(through.obj(function (row, enc, next) { + row.source = row.source.replace(/111/g, '11111'); + this.push(row); + next(); + })); + + b.bundle(function (err, src) { + Function([ 'console' ], src)({ log: log }); + function log (msg) { + t.equal(msg, 'main: 56055'); + } + }); +}); diff --git a/node_modules/browserify/test/pipeline_deps/bar.js b/node_modules/browserify/test/pipeline_deps/bar.js new file mode 100644 index 0000000..c57fa53 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/bar.js @@ -0,0 +1,3 @@ +module.exports = function (n) { + return n * 100; +}; diff --git a/node_modules/browserify/test/pipeline_deps/foo.js b/node_modules/browserify/test/pipeline_deps/foo.js new file mode 100644 index 0000000..c62e638 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/foo.js @@ -0,0 +1,5 @@ +var bar = require('./bar'); + +module.exports = function (n) { + return n * 111 + bar(n); +}; diff --git a/node_modules/browserify/test/pipeline_deps/main.js b/node_modules/browserify/test/pipeline_deps/main.js new file mode 100644 index 0000000..8c71d79 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/main.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('main: ' + foo(5)); diff --git a/node_modules/browserify/test/pipeline_deps/xyz.js b/node_modules/browserify/test/pipeline_deps/xyz.js new file mode 100644 index 0000000..dff6877 --- /dev/null +++ b/node_modules/browserify/test/pipeline_deps/xyz.js @@ -0,0 +1,2 @@ +var foo = require('./foo'); +console.log('xyz: ' + foo(6)); diff --git a/node_modules/browserify/test/pkg.js b/node_modules/browserify/test/pkg.js new file mode 100644 index 0000000..753e6d8 --- /dev/null +++ b/node_modules/browserify/test/pkg.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var path = require('path'); + +var pkg = require('./pkg/package.json'); +pkg.__dirname = path.join(__dirname, 'pkg'); + +test('package', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/pkg/main.js'); + b.on('package', function (pkg_) { + t.deepEqual(pkg_, pkg); + }); + + b.bundle(function (err) { + t.ifError(err); + }); +}); diff --git a/node_modules/browserify/test/pkg/main.js b/node_modules/browserify/test/pkg/main.js new file mode 100644 index 0000000..07a8fbf --- /dev/null +++ b/node_modules/browserify/test/pkg/main.js @@ -0,0 +1 @@ +console.log(555) diff --git a/node_modules/browserify/test/pkg/package.json b/node_modules/browserify/test/pkg/package.json new file mode 100644 index 0000000..cc806a7 --- /dev/null +++ b/node_modules/browserify/test/pkg/package.json @@ -0,0 +1 @@ +{ "beep": "boop" } diff --git a/node_modules/browserify/test/pkg_event.js b/node_modules/browserify/test/pkg_event.js new file mode 100644 index 0000000..77ada96 --- /dev/null +++ b/node_modules/browserify/test/pkg_event.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var path = require('path'); +var vm = require('vm'); +var test = require('tap').test; + +var expected = [ + readpkg('pkg_event'), + readpkg('pkg_event/node_modules/aaa'), + readpkg('pkg_event/node_modules/aaa/lib') +]; + +test('package event', function (t) { + t.plan(2 + expected.length); + + var b = browserify(__dirname + '/pkg_event/main.js'); + b.on('package', function (pkg) { + t.deepEqual(pkg, expected.shift()); + }); + + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 555) } + }); +}); + +function readpkg (dir) { + var pkg = require(path.join(__dirname, dir, 'package.json')); + pkg.__dirname = path.join(__dirname, dir); + return pkg; +} diff --git a/node_modules/browserify/test/pkg_event/main.js b/node_modules/browserify/test/pkg_event/main.js new file mode 100644 index 0000000..bef366a --- /dev/null +++ b/node_modules/browserify/test/pkg_event/main.js @@ -0,0 +1 @@ +console.log(require('aaa')) diff --git a/node_modules/browserify/test/pkg_event/package.json b/node_modules/browserify/test/pkg_event/package.json new file mode 100644 index 0000000..21d82d8 --- /dev/null +++ b/node_modules/browserify/test/pkg_event/package.json @@ -0,0 +1,3 @@ +{ + "name": "pkg_event" +} diff --git a/node_modules/browserify/test/plugin.js b/node_modules/browserify/test/plugin.js new file mode 100644 index 0000000..be143a3 --- /dev/null +++ b/node_modules/browserify/test/plugin.js @@ -0,0 +1,28 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('plugin fn', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/plugin/main.js', { basedir: __dirname }); + b.plugin(function (b_) { + t.equal(b, b_); + }); + + b.bundle(function (err, src) { + t.ifError(err); + }); +}); + +test('plugin module', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/plugin/main.js', { basedir: __dirname }); + b.plugin('plugin-foo', { msg: 'beep boop' }); + + b.bundle(function (err, src) { + t.ifError(err); + t.equal(src.toString('utf8'), 'beep boop'); + }); +}); diff --git a/node_modules/browserify/test/plugin/main.js b/node_modules/browserify/test/plugin/main.js new file mode 100644 index 0000000..3e842e7 --- /dev/null +++ b/node_modules/browserify/test/plugin/main.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/process.js b/node_modules/browserify/test/process.js new file mode 100644 index 0000000..83ffa14 --- /dev/null +++ b/node_modules/browserify/test/process.js @@ -0,0 +1,21 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('implicit process global', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/process/main.js'); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + }, + setTimeout: setTimeout, + clearTimeout: clearTimeout + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/process/main.js b/node_modules/browserify/test/process/main.js new file mode 100644 index 0000000..0895579 --- /dev/null +++ b/node_modules/browserify/test/process/main.js @@ -0,0 +1,3 @@ +process.nextTick(function () { + done(require('./one'), require('./two')); +}); diff --git a/node_modules/browserify/test/process/one.js b/node_modules/browserify/test/process/one.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/browserify/test/process/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/process/two.js b/node_modules/browserify/test/process/two.js new file mode 100644 index 0000000..4bbffde --- /dev/null +++ b/node_modules/browserify/test/process/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/relative_dedupe.js b/node_modules/browserify/test/relative_dedupe.js new file mode 100644 index 0000000..5a4a252 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('relative dedupe', function (t) { + var expected = [ 'a a', 'a b', 'b a', 'b b' ]; + t.plan(expected.length + 1); + + var b = browserify(__dirname + '/relative_dedupe/main.js'); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + }); + + function log (msg) { t.equal(msg, expected.shift()) } +}); diff --git a/node_modules/browserify/test/relative_dedupe/a/a.js b/node_modules/browserify/test/relative_dedupe/a/a.js new file mode 100644 index 0000000..fd6bd94 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/a/a.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("a a") +}; diff --git a/node_modules/browserify/test/relative_dedupe/a/b.js b/node_modules/browserify/test/relative_dedupe/a/b.js new file mode 100644 index 0000000..3bdfe50 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/a/b.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("a b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/a/index.js b/node_modules/browserify/test/relative_dedupe/a/index.js new file mode 100644 index 0000000..5002ffc --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/a/index.js @@ -0,0 +1,4 @@ +module.exports = { + a: require("./a"), + b: require("./b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/b/a.js b/node_modules/browserify/test/relative_dedupe/b/a.js new file mode 100644 index 0000000..eb66e54 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/b/a.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("b a") +}; diff --git a/node_modules/browserify/test/relative_dedupe/b/b.js b/node_modules/browserify/test/relative_dedupe/b/b.js new file mode 100644 index 0000000..94faa62 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/b/b.js @@ -0,0 +1,3 @@ +module.exports = function() { + console.log("b b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/b/index.js b/node_modules/browserify/test/relative_dedupe/b/index.js new file mode 100644 index 0000000..5002ffc --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/b/index.js @@ -0,0 +1,4 @@ +module.exports = { + a: require("./a"), + b: require("./b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/index.js b/node_modules/browserify/test/relative_dedupe/index.js new file mode 100644 index 0000000..69ce41b --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/index.js @@ -0,0 +1,4 @@ +module.exports = { + a: require("./a"), + b: require("./b") +}; diff --git a/node_modules/browserify/test/relative_dedupe/main.js b/node_modules/browserify/test/relative_dedupe/main.js new file mode 100644 index 0000000..deb9370 --- /dev/null +++ b/node_modules/browserify/test/relative_dedupe/main.js @@ -0,0 +1,5 @@ +var ix = require('./'); +ix.a.a(); +ix.a.b(); +ix.b.a(); +ix.b.b(); diff --git a/node_modules/browserify/test/require_cache.js b/node_modules/browserify/test/require_cache.js new file mode 100644 index 0000000..871e055 --- /dev/null +++ b/node_modules/browserify/test/require_cache.js @@ -0,0 +1,19 @@ +var vm = require('vm'); +var browserify = require('../'); +var test = require('tap').test; + +test('cached require results', function (t) { + t.plan(1); + + var b = browserify(); + b.require('seq'); + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + + var seq0 = c.require('seq'); + var seq1 = c.require('seq'); + + t.ok(seq0 === seq1); + }); +}); diff --git a/node_modules/browserify/test/require_expose.js b/node_modules/browserify/test/require_expose.js new file mode 100644 index 0000000..60f9383 --- /dev/null +++ b/node_modules/browserify/test/require_expose.js @@ -0,0 +1,53 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('require expose external module', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname }); + b.require('beep', { expose: 'bip' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { }; + vm.runInNewContext(src, c); + t.equal(c.require('bip'), 'boop'); + }) +}); + +test('renaming builtin', function (t) { + t.plan(2); + + var b = browserify({ basedir: __dirname }); + b.require('os', { expose: 'bone' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { }; + vm.runInNewContext(src, c); + t.equal(c.require('bone').platform(), 'browser'); + }) +}); + +test('exposed modules do not leak across bundles', function (t) { + var bundle1, bundle2; + + bundle1 = browserify(); + bundle1.add(__dirname + '/require_expose/main.js'); + bundle1.require(__dirname + '/require_expose/some_dep.js', { expose: 'foo' }); + + bundle1.bundle(function (err, src) { + if (err) t.fail(err); + + var c = {}; + vm.runInNewContext(src, c); + t.equal(c.foo, 'some_dep'); + + bundle2 = browserify(); + bundle2.add(__dirname + '/require_expose/main.js'); + + bundle2.bundle(function (err) { + t.ok(err && err.message.match(/Cannot find module 'foo'/), 'should fail with missing module'); + t.end(); + }); + }); +}); diff --git a/node_modules/browserify/test/require_expose/main.js b/node_modules/browserify/test/require_expose/main.js new file mode 100644 index 0000000..f99908f --- /dev/null +++ b/node_modules/browserify/test/require_expose/main.js @@ -0,0 +1 @@ +foo = require('foo'); diff --git a/node_modules/browserify/test/require_expose/some_dep.js b/node_modules/browserify/test/require_expose/some_dep.js new file mode 100644 index 0000000..353c90d --- /dev/null +++ b/node_modules/browserify/test/require_expose/some_dep.js @@ -0,0 +1 @@ +module.exports = 'some_dep'; diff --git a/node_modules/browserify/test/reset.js b/node_modules/browserify/test/reset.js new file mode 100644 index 0000000..dad18b3 --- /dev/null +++ b/node_modules/browserify/test/reset.js @@ -0,0 +1,31 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('reset', function (t) { + t.plan(4); + + var b = browserify(); + b.require('path'); + b.bundle(function (err, src) { + check(err, src); + b.bundle(function (err, src) { + check(err, src); + }); + }); + + function check (err, src) { + t.ifError(err); + var c = { + setTimeout : setTimeout, + clearTimeout : clearTimeout, + console : console + }; + vm.runInNewContext(src, c); + + t.equal( + c.require('path').join('/a', 'b'), + '/a/b' + ); + } +}); diff --git a/node_modules/browserify/test/resolve_exposed.js b/node_modules/browserify/test/resolve_exposed.js new file mode 100644 index 0000000..0d3efc2 --- /dev/null +++ b/node_modules/browserify/test/resolve_exposed.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('resolve exposed files', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/resolve_exposed/main.js', { + basedir: __dirname + '/resolve_exposed' + }); + b.require('./x.js', { expose: 'xyz' }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + function log (x) { + t.equal(x, 333); + } + }); +}); diff --git a/node_modules/browserify/test/resolve_exposed/main.js b/node_modules/browserify/test/resolve_exposed/main.js new file mode 100644 index 0000000..08a137d --- /dev/null +++ b/node_modules/browserify/test/resolve_exposed/main.js @@ -0,0 +1,2 @@ +var xyz = require('xyz'); +console.log(xyz * 111); diff --git a/node_modules/browserify/test/resolve_exposed/x.js b/node_modules/browserify/test/resolve_exposed/x.js new file mode 100644 index 0000000..6887896 --- /dev/null +++ b/node_modules/browserify/test/resolve_exposed/x.js @@ -0,0 +1 @@ +module.exports = 3 diff --git a/node_modules/browserify/test/retarget.js b/node_modules/browserify/test/retarget.js new file mode 100644 index 0000000..7670bc0 --- /dev/null +++ b/node_modules/browserify/test/retarget.js @@ -0,0 +1,25 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var vm = require('vm'); + +test('retarget with -r', function (t) { + t.plan(2); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-r', 'beep' + ], { cwd: __dirname }); + var src = ''; + ps.stdout.on('data', function (buf) { src += buf }); + ps.stderr.pipe(process.stderr); + + ps.on('exit', function (code) { + t.equal(code, 0); + + var c = {}; + vm.runInNewContext(src, c); + t.equal(c.require('beep'), 'boop'); + }); + ps.stdin.end(); +}); diff --git a/node_modules/browserify/test/reverse_multi_bundle.js b/node_modules/browserify/test/reverse_multi_bundle.js new file mode 100644 index 0000000..8d9f832 --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle.js @@ -0,0 +1,47 @@ +/** + * To be able to lazy load bundles with script loaders the loaded bundles + * must have access to modules exposed by previous bundles. + * + * In effect this is the same as adding the bundles in reverse order + **/ + +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('reverse multi bundle', function (t) { + t.plan(5); + + // Main app bundle has the main app code and the shared libarary code + var app = browserify([__dirname + '/reverse_multi_bundle/app.js']) + .external(__dirname + '/reverse_multi_bundle/lazy.js') + .require(__dirname + '/reverse_multi_bundle/shared.js', { expose: true }) + .require(__dirname + '/reverse_multi_bundle/arbitrary.js', {expose: 'not/real'}); + + // Lazily loaded bundle has only its own code even it uses code from the + // shared library. + var lazy = browserify({ + filter: function (id) { + return id !== 'not/real'; + } + }) + .require(__dirname + '/reverse_multi_bundle/lazy.js', { expose: true }) + .external(__dirname + '/reverse_multi_bundle/shared.js') + .external('not/real'); + + + app.bundle(function (err, appSrc) { + if (err) throw err; + lazy.bundle(function(err, lazySrc) { + if (err) throw err; + + var src = appSrc + ';' + lazySrc; + var c = { + setTimeout: setTimeout, + clearTimeout: clearTimeout, + t: t + }; + vm.runInNewContext(src, c); + }); + }); +}); diff --git a/node_modules/browserify/test/reverse_multi_bundle/app.js b/node_modules/browserify/test/reverse_multi_bundle/app.js new file mode 100644 index 0000000..ab6b101 --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/app.js @@ -0,0 +1,22 @@ + +t.equal( + require("./shared")(), 1, + "the main app bundle can already use the shared library" +); + +t.throws(function() { + require("./lazy"); +}, "lazy bundle is not executed yet so the lazy module cannot be required yet"); + +// Use setTimeout as script loader simulator as in real use case this would be +// a call to one. Now we just let the rest of the source code string we build +// to execute. +setTimeout(function() { + // After lazy bundle is executed we can require the lazy.js module + require("./lazy"); + t.equal( + require("./shared")(),3, + "lazy module was able to use shared code" + ); +}, 1); + diff --git a/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js b/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js new file mode 100644 index 0000000..ba7d872 --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/arbitrary.js @@ -0,0 +1,6 @@ +var i = 0; +module.exports = function() { + return ++i; +}; + +// 175e62 diff --git a/node_modules/browserify/test/reverse_multi_bundle/lazy.js b/node_modules/browserify/test/reverse_multi_bundle/lazy.js new file mode 100644 index 0000000..012cdeb --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/lazy.js @@ -0,0 +1,9 @@ +t.equal( + require("./shared")(),2, + "lazy.js can use the shared library" +); +t.equal( + require("not/real")(),1, + "lazy.js can use library code with arbitrary names" +); + diff --git a/node_modules/browserify/test/reverse_multi_bundle/shared.js b/node_modules/browserify/test/reverse_multi_bundle/shared.js new file mode 100644 index 0000000..6bb03fb --- /dev/null +++ b/node_modules/browserify/test/reverse_multi_bundle/shared.js @@ -0,0 +1,6 @@ +var i = 0; +module.exports = function() { + return ++i; +}; + +// 77aa70 diff --git a/node_modules/browserify/test/shebang.js b/node_modules/browserify/test/shebang.js new file mode 100644 index 0000000..5965ac9 --- /dev/null +++ b/node_modules/browserify/test/shebang.js @@ -0,0 +1,11 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('files with shebangs', function (t) { + t.plan(1); + var b = browserify(__dirname + '/shebang/main.js'); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/shebang/foo.js b/node_modules/browserify/test/shebang/foo.js new file mode 100644 index 0000000..3ec10cd --- /dev/null +++ b/node_modules/browserify/test/shebang/foo.js @@ -0,0 +1,2 @@ +#!/blah +module.exports = 1234; diff --git a/node_modules/browserify/test/shebang/main.js b/node_modules/browserify/test/shebang/main.js new file mode 100644 index 0000000..eb41711 --- /dev/null +++ b/node_modules/browserify/test/shebang/main.js @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +var foo = require('./foo'); +t.equal(foo, 1234); diff --git a/node_modules/browserify/test/standalone.js b/node_modules/browserify/test/standalone.js new file mode 100644 index 0000000..16c105a --- /dev/null +++ b/node_modules/browserify/test/standalone.js @@ -0,0 +1,85 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('standalone', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'stand-test' + }); + b.bundle(function (err, src) { + t.test('window global', function (t) { + t.plan(2); + var c = { + window: {}, + done : done(t) + }; + vm.runInNewContext(src + 'window.standTest(done)', c); + }); + t.test('CommonJS', function (t) { + t.plan(2); + var exp = {}; + var c = { + module: { exports: exp }, + exports: exp, + done : done(t) + }; + vm.runInNewContext(src + 'module.exports(done)', c); + }); + t.test('RequireJS', function (t) { + t.plan(2); + var c = { + define: function (dependencies, fn) { + fn()(done(t)); + } + }; + c.define.amd = true; + vm.runInNewContext(src, c); + }); + }); +}); + +test('A.B.C standalone', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'A.B.C' + }); + b.bundle(function (err, src) { + t.test('window global', function (t) { + t.plan(2); + var c = { window: {} }; + vm.runInNewContext(src, c); + c.window.A.B.C(done(t)); + }); + t.test('CommonJS', function (t) { + t.plan(2); + var exp = {}; + var c = { + module: { exports: exp }, + exports: exp + }; + vm.runInNewContext(src, c); + c.module.exports(done(t)); + }); + t.test('RequireJS', function (t) { + t.plan(2); + var c = { + define: function (dependencies, fn) { + fn()(done(t)); + } + }; + c.define.amd = true; + vm.runInNewContext(src, c); + }); + }); +}); + +function done(t) { + return function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + }; +} diff --git a/node_modules/browserify/test/standalone/main.js b/node_modules/browserify/test/standalone/main.js new file mode 100644 index 0000000..400038d --- /dev/null +++ b/node_modules/browserify/test/standalone/main.js @@ -0,0 +1,3 @@ +module.exports = function (cb) { + cb(require('./one'), require('./two')); +}; \ No newline at end of file diff --git a/node_modules/browserify/test/standalone/one.js b/node_modules/browserify/test/standalone/one.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/browserify/test/standalone/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/standalone/two.js b/node_modules/browserify/test/standalone/two.js new file mode 100644 index 0000000..4bbffde --- /dev/null +++ b/node_modules/browserify/test/standalone/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/standalone_events.js b/node_modules/browserify/test/standalone_events.js new file mode 100644 index 0000000..eb42afb --- /dev/null +++ b/node_modules/browserify/test/standalone_events.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var test = require('tap').test; + +test('standalone bundle close event', {timeout: 1000}, function (t) { + t.plan(1); + + var ended = false; + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'stand-test' + }); + var r = b.bundle(); + r.resume(); + r.on('end', function() { + t.ok(!ended); + ended = true; + t.end(); + }); +}); diff --git a/node_modules/browserify/test/standalone_sourcemap.js b/node_modules/browserify/test/standalone_sourcemap.js new file mode 100644 index 0000000..a11c454 --- /dev/null +++ b/node_modules/browserify/test/standalone_sourcemap.js @@ -0,0 +1,55 @@ +var browserify = require('../'); +var fs = require('fs'); +var vm = require('vm'); +var test = require('tap').test; + +test('standalone in debug mode', function (t) { + t.plan(3); + + var main = fs.readFileSync(__dirname + '/standalone/main.js'); + + var b = browserify(__dirname + '/standalone/main.js', { + standalone: 'stand-test', + debug: true + }); + b.bundle(function (err, buf) { + var src = buf.toString('utf8'); + t.test('window global', function (t) { + t.plan(2); + var c = { + window: {}, + done : done(t) + }; + vm.runInNewContext(src + '\nwindow.standTest(done)', c); + }); + t.test('CommonJS', function (t) { + t.plan(2); + var exp = {}; + var c = { + module: { exports: exp }, + exports: exp, + done : done(t) + }; + vm.runInNewContext(src + '\nmodule.exports(done)', c); + }); + t.test('RequireJS', function (t) { + t.plan(2); + var c = { + define: function (dependencies, fn) { + fn()(done(t)); + } + }; + c.define.amd = true; + vm.runInNewContext(src, c); + }); + }); +}); + +function done(t) { + return function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + }; +} + diff --git a/node_modules/browserify/test/stdin.js b/node_modules/browserify/test/stdin.js new file mode 100644 index 0000000..da5415d --- /dev/null +++ b/node_modules/browserify/test/stdin.js @@ -0,0 +1,35 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var concat = require('concat-stream'); +var path = require('path'); +var vm = require('vm'); + +test('stdin', function (t) { + t.plan(2); + + var cwd = process.cwd(); + process.chdir(__dirname); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + '-' + ]); + + ps.stdout.pipe(concat(function (body) { + var c = { console: { + log: function (msg) { + t.equal(msg, 'hello'); + } + } }; + vm.runInNewContext(body, c); + })); + ps.stderr.pipe(process.stderr); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); + + ps.stdin.write("console.log('hello')"); + ps.stdin.end(); + +}); diff --git a/node_modules/browserify/test/stream.js b/node_modules/browserify/test/stream.js new file mode 100644 index 0000000..a15a5ee --- /dev/null +++ b/node_modules/browserify/test/stream.js @@ -0,0 +1,15 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var fs = require('fs'); + +test('stream', function (t) { + t.plan(2); + + var stream = fs.createReadStream(__dirname + '/stream/main.js'); + var b = browserify(stream, { basedir: __dirname + '/stream' }); + + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/stream/bar.js b/node_modules/browserify/test/stream/bar.js new file mode 100644 index 0000000..5828b13 --- /dev/null +++ b/node_modules/browserify/test/stream/bar.js @@ -0,0 +1 @@ +module.exports = require('./foo.js') * 4 / 3 diff --git a/node_modules/browserify/test/stream/foo.js b/node_modules/browserify/test/stream/foo.js new file mode 100644 index 0000000..9123882 --- /dev/null +++ b/node_modules/browserify/test/stream/foo.js @@ -0,0 +1 @@ +module.exports = 333 diff --git a/node_modules/browserify/test/stream/main.js b/node_modules/browserify/test/stream/main.js new file mode 100644 index 0000000..33063b2 --- /dev/null +++ b/node_modules/browserify/test/stream/main.js @@ -0,0 +1,2 @@ +t.equal(require('./foo.js'), 333); +t.equal(require('./bar.js'), 444); diff --git a/node_modules/browserify/test/stream_file.js b/node_modules/browserify/test/stream_file.js new file mode 100644 index 0000000..100471c --- /dev/null +++ b/node_modules/browserify/test/stream_file.js @@ -0,0 +1,29 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var fs = require('fs'); +var through = require('through2'); +var path = require('path'); + +test('stream file', function (t) { + var expected = {}; + expected[ path.join(__dirname, 'stream/fake.js') ] = true; + expected[ path.join(__dirname, 'stream/bar.js' ) ] = true; + expected[ path.join(__dirname, 'stream/foo.js' ) ] = true; + + t.plan(5); + + var stream = fs.createReadStream(__dirname + '/stream/main.js'); + stream.file = path.join(__dirname, '/stream/fake.js'); + + var b = browserify(stream, { basedir: __dirname + '/stream' }); + b.transform(function (file) { + t.ok(expected[file]); + delete expected[file]; + return through(); + }); + + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/subdep.js b/node_modules/browserify/test/subdep.js new file mode 100644 index 0000000..fd58d6e --- /dev/null +++ b/node_modules/browserify/test/subdep.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('subdep', function (t) { + t.plan(1); + + var b = browserify(); + b.require(__dirname + '/subdep/index.js', { expose: 'subdep' }); + + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + t.equal(c.require('subdep'), 'zzz'); + }); +}); diff --git a/node_modules/browserify/test/subdep/index.js b/node_modules/browserify/test/subdep/index.js new file mode 100644 index 0000000..f05301b --- /dev/null +++ b/node_modules/browserify/test/subdep/index.js @@ -0,0 +1 @@ +module.exports = require('qq'); diff --git a/node_modules/browserify/test/subdep/package.json b/node_modules/browserify/test/subdep/package.json new file mode 100644 index 0000000..518d22a --- /dev/null +++ b/node_modules/browserify/test/subdep/package.json @@ -0,0 +1,6 @@ +{ + "dependencies" : { + "qq" : "*" + }, + "main" : "index.js" +} diff --git a/node_modules/browserify/test/symlink_dedupe.js b/node_modules/browserify/test/symlink_dedupe.js new file mode 100644 index 0000000..00d21d1 --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe.js @@ -0,0 +1,16 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('hash instances with hashed contexts', function (t) { + t.plan(5); + + var b = browserify(__dirname + '/symlink_dedupe/main.js'); + b.bundle(function (err, buf) { + var c = { t: t }; + var src = buf.toString('utf8'); + t.equal(src.match(RegExp('// FILE F ONE', 'g')).length, 1); + t.equal(src.match(RegExp('// FILE G ONE', 'g')).length, 1); + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/symlink_dedupe/main.js b/node_modules/browserify/test/symlink_dedupe/main.js new file mode 100644 index 0000000..92ff18d --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe/main.js @@ -0,0 +1,6 @@ +var A = require('./one/f.js'); +var B = require('./one/dir/f.js'); +t.equal(A, B); +t.equal(A(), 555); +t.equal(B(), 555); + diff --git a/node_modules/browserify/test/symlink_dedupe/one/f.js b/node_modules/browserify/test/symlink_dedupe/one/f.js new file mode 100644 index 0000000..a315c1e --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe/one/f.js @@ -0,0 +1,3 @@ +// FILE F ONE +var G = require('./g.js'); +module.exports = function () { return 111 * G }; diff --git a/node_modules/browserify/test/symlink_dedupe/one/g.js b/node_modules/browserify/test/symlink_dedupe/one/g.js new file mode 100644 index 0000000..8373032 --- /dev/null +++ b/node_modules/browserify/test/symlink_dedupe/one/g.js @@ -0,0 +1,2 @@ +// FILE G ONE +module.exports = 5 diff --git a/node_modules/browserify/test/syntax_cache.js b/node_modules/browserify/test/syntax_cache.js new file mode 100644 index 0000000..ff2a5de --- /dev/null +++ b/node_modules/browserify/test/syntax_cache.js @@ -0,0 +1,47 @@ +var Seq = require('seq'); +var browserify = require('../'); +var test = require('tap').test; +var shasum = require('shasum'); + +test('syntax cache - valid', function (t) { + t.plan(2); + + var expectedCache = {} + var cacheKey; + + var b = browserify(__dirname + '/syntax_cache/valid.js'); + b.once('dep', function(row) { + cacheKey = shasum(row.source); + expectedCache[cacheKey] = true; + }); + + Seq() + .seq(function() { b.bundle(this); }) + .seq(function() { + t.deepEqual(b._syntaxCache, expectedCache); + b._syntaxCache[cacheKey] = expectedCache[cacheKey] = 'beep'; + b.bundle(function(err, src) { + // if the cache worked, the "cacheKey" + // should not be reset to "true" + t.deepEqual(b._syntaxCache, expectedCache); + }); + }); +}); + +test('syntax cache - skip invalid', function (t) { + t.plan(5); + + var b = browserify(__dirname + '/syntax_cache/invalid.js'); + + Seq() + .seq(function() { b.bundle(this); }) + .catch(function(lastErr) { + t.deepEqual(b._syntaxCache, {}); + t.similar(String(lastErr), /ParseError/); + b.bundle(function(err, src) { + t.deepEqual(b._syntaxCache, {}); + t.similar(String(err), /ParseError/); + t.notEqual(lastErr, err, 'errors should be unique'); + }); + }); +}); diff --git a/node_modules/browserify/test/syntax_cache/invalid.js b/node_modules/browserify/test/syntax_cache/invalid.js new file mode 100644 index 0000000..e85c07c --- /dev/null +++ b/node_modules/browserify/test/syntax_cache/invalid.js @@ -0,0 +1,2 @@ +var x = { +var y = 6; diff --git a/node_modules/browserify/test/syntax_cache/valid.js b/node_modules/browserify/test/syntax_cache/valid.js new file mode 100644 index 0000000..cf4f426 --- /dev/null +++ b/node_modules/browserify/test/syntax_cache/valid.js @@ -0,0 +1,2 @@ +var x = {}; +var y = 6; diff --git a/node_modules/browserify/test/tr.js b/node_modules/browserify/test/tr.js new file mode 100644 index 0000000..69c7248 --- /dev/null +++ b/node_modules/browserify/test/tr.js @@ -0,0 +1,28 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('function transform', function (t) { + t.plan(7); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform({ global: true }, function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/ZZZ/g, '1')); + next(); + }); + }); + b.transform(function (file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '5') + .replace(/BBB/g, '50') + ); + next(); + }) + }); + b.bundle(function (err, src) { + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/tr/f.js b/node_modules/browserify/test/tr/f.js new file mode 100644 index 0000000..a56a097 --- /dev/null +++ b/node_modules/browserify/test/tr/f.js @@ -0,0 +1,2 @@ +t.equal(XYZ, 909); +module.exports = function (x) { return x + BBB } diff --git a/node_modules/browserify/test/tr/main.js b/node_modules/browserify/test/tr/main.js new file mode 100644 index 0000000..8503c47 --- /dev/null +++ b/node_modules/browserify/test/tr/main.js @@ -0,0 +1,9 @@ +var f = require('./f.js'); +var m = require('m'); +var g = require('g'); +t.equal(require('./subdir/g.js'), 999); + +t.equal(m(f(AAA)), 555, 'transformation scope'); +t.equal(g(3), 332, 'sub-transformation applied'); +t.equal(typeof GGG, 'undefined', 'GGG leak'); +t.equal(XYZ, 909); diff --git a/node_modules/browserify/test/tr/package.json b/node_modules/browserify/test/tr/package.json new file mode 100644 index 0000000..6687fa1 --- /dev/null +++ b/node_modules/browserify/test/tr/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "xyz" ] + } +} diff --git a/node_modules/browserify/test/tr/subdir/g.js b/node_modules/browserify/test/tr/subdir/g.js new file mode 100644 index 0000000..047280d --- /dev/null +++ b/node_modules/browserify/test/tr/subdir/g.js @@ -0,0 +1 @@ +module.exports = XYZ + 90; diff --git a/node_modules/browserify/test/tr_args.js b/node_modules/browserify/test/tr_args.js new file mode 100644 index 0000000..ace4530 --- /dev/null +++ b/node_modules/browserify/test/tr_args.js @@ -0,0 +1,24 @@ +var test = require('tap').test; +var spawn = require('child_process').spawn; +var path = require('path'); +var concat = require('concat-stream'); +var vm = require('vm'); + +test('transform arguments', function (t) { + t.plan(2); + + var ps = spawn(process.execPath, [ + path.resolve(__dirname, '../bin/cmd.js'), + __dirname + '/tr_args/main.js', + '-t', '[', __dirname + '/tr_args/tr.js', '-x', '1', ']' + ]); + + ps.stderr.pipe(process.stderr); + ps.stdout.pipe(concat(function (body) { + vm.runInNewContext(body.toString('utf8'), { t: t }); + })); + + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff --git a/node_modules/browserify/test/tr_args/main.js b/node_modules/browserify/test/tr_args/main.js new file mode 100644 index 0000000..ec448ae --- /dev/null +++ b/node_modules/browserify/test/tr_args/main.js @@ -0,0 +1 @@ +t.equal(XXX * 5, 555); diff --git a/node_modules/browserify/test/tr_args/tr.js b/node_modules/browserify/test/tr_args/tr.js new file mode 100644 index 0000000..6d0a1a8 --- /dev/null +++ b/node_modules/browserify/test/tr_args/tr.js @@ -0,0 +1,12 @@ +var through = require('through2'); + +module.exports = function (file, opts) { + var data = ''; + return through(write, end); + + function write (buf, enc, next) { data += buf; next() } + function end () { + this.push(data.replace(/X/g, opts.x)); + this.push(null); + } +}; diff --git a/node_modules/browserify/test/tr_error.js b/node_modules/browserify/test/tr_error.js new file mode 100644 index 0000000..e7d857c --- /dev/null +++ b/node_modules/browserify/test/tr_error.js @@ -0,0 +1,33 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('transform errors errback', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform(function (file) { + return through(function (buf) { + this.emit('error', new Error('blah')); + }) + }); + b.bundle(function (err, src) { + t.ok(/^blah/.test(err.message)); + t.equal(src, undefined); + }); +}); + +test('transform errors propagate', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform(function (file) { + return through(function (buf) { + this.emit('error', new Error('blah')); + }); + }); + b.bundle().on('error', function (err) { + t.ok(/^blah/.test(err.message)); + }); +}); diff --git a/node_modules/browserify/test/tr_flags.js b/node_modules/browserify/test/tr_flags.js new file mode 100644 index 0000000..b6bff92 --- /dev/null +++ b/node_modules/browserify/test/tr_flags.js @@ -0,0 +1,36 @@ +var through = require('through2'); +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('--debug passed to transforms', function (t) { + var empty = require.resolve('../lib/_empty'); + + t.plan(3); + + [true, false].forEach(function(debug) { + var b = browserify(empty, { debug: debug }); + + b.transform(function(file, opts) { + t.equal(opts._flags.debug, debug, 'debug: ' + debug); + return through(); + }); + + b.bundle(function (err, src) { + if (err) return t.fail(err.message); + }); + }); + + var b = browserify(empty, { debug: true }); + + b.transform({ + _flags: Infinity + }, function(file, opts) { + t.equal(opts._flags, Infinity, 'transform arguents are preserved'); + return through(); + }); + + b.bundle(function(err, src) { + if (err) return t.fail(err.message); + }); +}); diff --git a/node_modules/browserify/test/tr_global.js b/node_modules/browserify/test/tr_global.js new file mode 100644 index 0000000..941eaf4 --- /dev/null +++ b/node_modules/browserify/test/tr_global.js @@ -0,0 +1,17 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('global transform precedence', function (t) { + t.plan(1); + + var b = browserify(__dirname + '/tr_global/main.js', { + basedir: __dirname + '/tr_global' + }); + b.transform('tr', { global: true }); + b.bundle(function (err, src) { + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 444) } + }); +}); diff --git a/node_modules/browserify/test/tr_global/main.js b/node_modules/browserify/test/tr_global/main.js new file mode 100644 index 0000000..208d369 --- /dev/null +++ b/node_modules/browserify/test/tr_global/main.js @@ -0,0 +1 @@ +console.log(require('x')); diff --git a/node_modules/browserify/test/tr_no_entry.js b/node_modules/browserify/test/tr_no_entry.js new file mode 100644 index 0000000..f41d9ce --- /dev/null +++ b/node_modules/browserify/test/tr_no_entry.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var test = require('tap').test; +var path = require('path') + +test('transform with no entry files', function (t) { + process.chdir(__dirname); + + t.plan(2); + var b = browserify(); + b.transform('tr'); + b.require(path.join(__dirname, 'tr_no_entry/main.js'), { + expose: 'yoyo' + }); + b.bundle(function (err, body) { + t.ifError(err); + var src = body.toString('utf8') + 'require("yoyo")'; + var con = { log: function (msg) { t.equal(msg, 'ZZZ') } }; + Function('console', src)(con); + }); +}); diff --git a/node_modules/browserify/test/tr_no_entry/main.js b/node_modules/browserify/test/tr_no_entry/main.js new file mode 100644 index 0000000..3dce908 --- /dev/null +++ b/node_modules/browserify/test/tr_no_entry/main.js @@ -0,0 +1 @@ +console.log('XXX'); diff --git a/node_modules/browserify/test/tr_once.js b/node_modules/browserify/test/tr_once.js new file mode 100644 index 0000000..a892189 --- /dev/null +++ b/node_modules/browserify/test/tr_once.js @@ -0,0 +1,21 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); +var path = require('path'); + +test('transform exactly once', function (t) { + t.plan(3); + + var b = browserify(__dirname + '/tr_once/main.js', { + transform: function (file) { + t.equal(file, path.join(__dirname, 'tr_once/main.js') ); + return through(); + } + }); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { console: { log: log } }); + function log (msg) { t.equal(msg, 'wow') } + }); +}); diff --git a/node_modules/browserify/test/tr_once/main.js b/node_modules/browserify/test/tr_once/main.js new file mode 100644 index 0000000..6036bec --- /dev/null +++ b/node_modules/browserify/test/tr_once/main.js @@ -0,0 +1 @@ +console.log('wow'); diff --git a/node_modules/browserify/test/tr_order.js b/node_modules/browserify/test/tr_order.js new file mode 100644 index 0000000..020b86e --- /dev/null +++ b/node_modules/browserify/test/tr_order.js @@ -0,0 +1,23 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('function transform', function (t) { + debugger; + t.plan(8); + + var b = browserify(__dirname + '/tr/main.js'); + b.transform({ global: true }, function (file) { + return through(function (buf, enc, next) { + this.push(String(buf).replace(/ZZZ/g, '1')); + next(); + }); + }); + b.transform(__dirname + '/tr_order/replace_aaa'); + b.transform(__dirname + '/tr_order/replace_bbb.js'); + b.bundle(function (err, src) { + t.ifError(err); + vm.runInNewContext(src, { t: t }); + }); +}); diff --git a/node_modules/browserify/test/tr_order/replace_aaa.js b/node_modules/browserify/test/tr_order/replace_aaa.js new file mode 100644 index 0000000..f1af976 --- /dev/null +++ b/node_modules/browserify/test/tr_order/replace_aaa.js @@ -0,0 +1,10 @@ +var through = require('through2'); + +module.exports = function(file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '5') + ); + next(); + }) +} diff --git a/node_modules/browserify/test/tr_order/replace_bbb.js b/node_modules/browserify/test/tr_order/replace_bbb.js new file mode 100644 index 0000000..cf57725 --- /dev/null +++ b/node_modules/browserify/test/tr_order/replace_bbb.js @@ -0,0 +1,11 @@ +var through = require('through2'); + +module.exports = function(file) { + return through(function (buf, enc, next) { + this.push(String(buf) + .replace(/AAA/g, '6') + .replace(/BBB/g, '50') + ); + next(); + }) +} diff --git a/node_modules/browserify/test/tr_symlink.js b/node_modules/browserify/test/tr_symlink.js new file mode 100644 index 0000000..c02d9c4 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink.js @@ -0,0 +1,21 @@ +// based on this scenario: +// https://github.com/substack/node-browserify/pull/831#issuecomment-49546902 + +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; +var through = require('through2'); + +test('transform symlink', function (t) { + t.plan(3); + var expected = [ 9, 555 ]; + var b = browserify(__dirname + '/tr_symlink/app/main.js', { + basedir: __dirname + '/tr_symlink/app' + }); + b.bundle(function (err, src) { + t.ifError(err); + var c = { console: { log: log } }; + vm.runInNewContext(src, c); + function log (msg) { t.equal(msg, expected.shift()) } + }); +}); diff --git a/node_modules/browserify/test/tr_symlink/a-module/index.js b/node_modules/browserify/test/tr_symlink/a-module/index.js new file mode 100644 index 0000000..3e842e7 --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/a-module/index.js @@ -0,0 +1 @@ +module.exports = 555 diff --git a/node_modules/browserify/test/tr_symlink/app/main.js b/node_modules/browserify/test/tr_symlink/app/main.js new file mode 100644 index 0000000..196452e --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/main.js @@ -0,0 +1,4 @@ +var a = require('aaa'); + +console.log(5); +console.log(a); diff --git a/node_modules/browserify/test/tr_symlink/app/package.json b/node_modules/browserify/test/tr_symlink/app/package.json new file mode 100644 index 0000000..2f2bbff --- /dev/null +++ b/node_modules/browserify/test/tr_symlink/app/package.json @@ -0,0 +1,5 @@ +{ + "browserify": { + "transform": [ "tr" ] + } +} diff --git a/node_modules/browserify/test/unicode.js b/node_modules/browserify/test/unicode.js new file mode 100644 index 0000000..2b68515 --- /dev/null +++ b/node_modules/browserify/test/unicode.js @@ -0,0 +1,19 @@ +var browserify = require('../'); +var vm = require('vm'); +var test = require('tap').test; + +test('unicode entry', function (t) { + t.plan(2); + + var b = browserify(__dirname + '/unicode/main.js'); + b.bundle(function (err, src) { + var c = { + done : function (one, two) { + t.equal(one, 1); + t.equal(two, 2); + t.end(); + } + }; + vm.runInNewContext(src, c); + }); +}); diff --git a/node_modules/browserify/test/unicode/main.js b/node_modules/browserify/test/unicode/main.js new file mode 100644 index 0000000..89bb8a0 --- /dev/null +++ b/node_modules/browserify/test/unicode/main.js @@ -0,0 +1 @@ +done(require('./one'), require('./two')); \ No newline at end of file diff --git a/node_modules/browserify/test/unicode/one.js b/node_modules/browserify/test/unicode/one.js new file mode 100644 index 0000000..bd816ea --- /dev/null +++ b/node_modules/browserify/test/unicode/one.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/node_modules/browserify/test/unicode/two.js b/node_modules/browserify/test/unicode/two.js new file mode 100644 index 0000000..4bbffde --- /dev/null +++ b/node_modules/browserify/test/unicode/two.js @@ -0,0 +1 @@ +module.exports = 2; diff --git a/node_modules/browserify/test/util.js b/node_modules/browserify/test/util.js new file mode 100644 index 0000000..760acf1 --- /dev/null +++ b/node_modules/browserify/test/util.js @@ -0,0 +1,62 @@ +var browserify = require('../'); +var test = require('tap').test; +var util = require('util'); +var vm = require('vm'); + +test('util.inspect', function (t) { + t.plan(1); + + var b = browserify(); + b.require('util'); + b.bundle(function (err ,src) { + var c = {}; + vm.runInNewContext(src, c); + t.equal( + c.require('util').inspect([1,2,3]), + util.inspect([1,2,3]) + ); + }); +}); + +test('util.inherits', function (t) { + t.plan(2); + + var b = browserify(); + b.require('util'); + b.require('events'); + + b.bundle(function (err, src) { + var c = {}; + vm.runInNewContext(src, c); + var EE = c.require('events').EventEmitter; + + function Beep () {} + c.require('util').inherits(Beep, EE); + var beep = new Beep; + + t.ok(beep instanceof Beep); + t.ok(beep instanceof EE); + }); +}); + +test('util.inherits without Object.create', function (t) { + t.plan(2); + var b = browserify(); + b.require('util'); + b.require('events'); + + b.bundle(function (err, src) { + var c = { Object : { prototype: Object.prototype } }; + vm.runInNewContext(src, c); + var EE = c.require('events').EventEmitter; + + function Beep () {} + Beep.prototype = {}; + + c.require('util').inherits(Beep, EE); + var beep = new Beep; + + t.ok(beep instanceof Beep); + t.ok(beep instanceof EE); + }); +}); diff --git a/node_modules/browserify/test/yield.js b/node_modules/browserify/test/yield.js new file mode 100644 index 0000000..666c0e2 --- /dev/null +++ b/node_modules/browserify/test/yield.js @@ -0,0 +1,20 @@ +var browserify = require('../'); +var test = require('tap').test; +var vm = require('vm'); + +test('yield', function (t) { + t.plan(6); + var b = browserify(__dirname + '/yield/main.js'); + b.transform('es6ify'); + + b.bundle(function (err, src) { + t.error(err); + var c = { console: { log: log } }; + var index = 0; + vm.runInNewContext(src, c); + + function log (msg) { + t.equal(index++, msg); + } + }); +}); diff --git a/node_modules/browserify/test/yield/f.js b/node_modules/browserify/test/yield/f.js new file mode 100644 index 0000000..8bb123b --- /dev/null +++ b/node_modules/browserify/test/yield/f.js @@ -0,0 +1,5 @@ +module.exports = function *() { + for (var i = 0; i < 5; i++) { + yield i; + } +} diff --git a/node_modules/browserify/test/yield/main.js b/node_modules/browserify/test/yield/main.js new file mode 100644 index 0000000..5a2e6bb --- /dev/null +++ b/node_modules/browserify/test/yield/main.js @@ -0,0 +1,4 @@ +var f = require('./f.js')(); +for (var r = f.next(); !r.done; r = f.next()) { + console.log(r.value); +} diff --git a/node_modules/buffer-xor/.npmignore b/node_modules/buffer-xor/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/buffer-xor/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/buffer-xor/.travis.yml b/node_modules/buffer-xor/.travis.yml new file mode 100644 index 0000000..d9f695b --- /dev/null +++ b/node_modules/buffer-xor/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +before_install: + - "npm install npm -g" +node_js: + - "0.12" +env: + - TEST_SUITE=standard + - TEST_SUITE=unit +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/buffer-xor/LICENSE b/node_modules/buffer-xor/LICENSE new file mode 100644 index 0000000..bba5218 --- /dev/null +++ b/node_modules/buffer-xor/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Daniel Cousens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/buffer-xor/README.md b/node_modules/buffer-xor/README.md new file mode 100644 index 0000000..007f058 --- /dev/null +++ b/node_modules/buffer-xor/README.md @@ -0,0 +1,41 @@ +# buffer-xor + +[![TRAVIS](https://secure.travis-ci.org/crypto-browserify/buffer-xor.png)](http://travis-ci.org/crypto-browserify/buffer-xor) +[![NPM](http://img.shields.io/npm/v/buffer-xor.svg)](https://www.npmjs.org/package/buffer-xor) + +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) + +A simple module for bitwise-xor on buffers. + + +## Examples + +``` javascript +var xor = require("buffer-xor") +var a = new Buffer('00ff0f', 'hex') +var b = new Buffer('f0f0', 'hex') + +console.log(xor(a, b)) +// => +``` + + +Or for those seeking those few extra cycles, perform the operation in place: + +``` javascript +var xorInplace = require("buffer-xor/inplace") +var a = new Buffer('00ff0f', 'hex') +var b = new Buffer('f0f0', 'hex') + +console.log(xorInplace(a, b)) +// => +// NOTE: xorInplace will return the shorter slice of its parameters + +// See that a has been mutated +console.log(a) +// => +``` + + +## License [MIT](LICENSE) + diff --git a/node_modules/buffer-xor/index.js b/node_modules/buffer-xor/index.js new file mode 100644 index 0000000..85ee6f6 --- /dev/null +++ b/node_modules/buffer-xor/index.js @@ -0,0 +1,10 @@ +module.exports = function xor (a, b) { + var length = Math.min(a.length, b.length) + var buffer = new Buffer(length) + + for (var i = 0; i < length; ++i) { + buffer[i] = a[i] ^ b[i] + } + + return buffer +} diff --git a/node_modules/buffer-xor/inline.js b/node_modules/buffer-xor/inline.js new file mode 100644 index 0000000..8797570 --- /dev/null +++ b/node_modules/buffer-xor/inline.js @@ -0,0 +1 @@ +module.exports = require('./inplace') diff --git a/node_modules/buffer-xor/inplace.js b/node_modules/buffer-xor/inplace.js new file mode 100644 index 0000000..d71c172 --- /dev/null +++ b/node_modules/buffer-xor/inplace.js @@ -0,0 +1,9 @@ +module.exports = function xorInplace (a, b) { + var length = Math.min(a.length, b.length) + + for (var i = 0; i < length; ++i) { + a[i] = a[i] ^ b[i] + } + + return a.slice(0, length) +} diff --git a/node_modules/buffer-xor/package.json b/node_modules/buffer-xor/package.json new file mode 100644 index 0000000..5074b02 --- /dev/null +++ b/node_modules/buffer-xor/package.json @@ -0,0 +1,37 @@ +{ + "name": "buffer-xor", + "version": "1.0.3", + "description": "A simple module for bitwise-xor on buffers", + "main": "index.js", + "scripts": { + "standard": "standard", + "test": "npm run-script unit", + "unit": "mocha" + }, + "repository": { + "type": "git", + "url": "https://github.com/crypto-browserify/buffer-xor.git" + }, + "bugs": { + "url": "https://github.com/crypto-browserify/buffer-xor/issues" + }, + "homepage": "https://github.com/crypto-browserify/buffer-xor", + "keywords": [ + "bits", + "bitwise", + "buffer", + "buffer-xor", + "crypto", + "inline", + "math", + "memory", + "performance", + "xor" + ], + "author": "Daniel Cousens", + "license": "MIT", + "devDependencies": { + "mocha": "*", + "standard": "*" + } +} diff --git a/node_modules/buffer-xor/test/fixtures.json b/node_modules/buffer-xor/test/fixtures.json new file mode 100644 index 0000000..6f3431e --- /dev/null +++ b/node_modules/buffer-xor/test/fixtures.json @@ -0,0 +1,23 @@ +[ + { + "a": "000f", + "b": "f0ff", + "expected": "f0f0" + }, + { + "a": "000f0f", + "b": "f0ff", + "mutated": "f0f00f", + "expected": "f0f0" + }, + { + "a": "000f", + "b": "f0ffff", + "expected": "f0f0" + }, + { + "a": "000000", + "b": "000000", + "expected": "000000" + } +] diff --git a/node_modules/buffer-xor/test/index.js b/node_modules/buffer-xor/test/index.js new file mode 100644 index 0000000..06eacab --- /dev/null +++ b/node_modules/buffer-xor/test/index.js @@ -0,0 +1,38 @@ +/* global describe, it */ + +var assert = require('assert') +var xor = require('../') +var xorInplace = require('../inplace') +var fixtures = require('./fixtures') + +describe('xor', function () { + fixtures.forEach(function (f) { + it('returns ' + f.expected + ' for ' + f.a + '/' + f.b, function () { + var a = new Buffer(f.a, 'hex') + var b = new Buffer(f.b, 'hex') + var actual = xor(a, b) + + assert.equal(actual.toString('hex'), f.expected) + + // a/b unchanged + assert.equal(a.toString('hex'), f.a) + assert.equal(b.toString('hex'), f.b) + }) + }) +}) + +describe('xor/inplace', function () { + fixtures.forEach(function (f) { + it('returns ' + f.expected + ' for ' + f.a + '/' + f.b, function () { + var a = new Buffer(f.a, 'hex') + var b = new Buffer(f.b, 'hex') + var actual = xorInplace(a, b) + + assert.equal(actual.toString('hex'), f.expected) + + // a mutated, b unchanged + assert.equal(a.toString('hex'), f.mutated || f.expected) + assert.equal(b.toString('hex'), f.b) + }) + }) +}) diff --git a/node_modules/buffer/.travis.yml b/node_modules/buffer/.travis.yml new file mode 100644 index 0000000..abf846f --- /dev/null +++ b/node_modules/buffer/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - '4' +sudo: false +env: + global: + - secure: AUsK+8fYSpwIMHcVt8Mu9SpG9RPHp4XDAwCQfpU3d5U65q8OVVC6C+XjvnNmEd2PoEJRHem8ZXEyRVfGM1sttKZLZP70TEKZOpOiRQnZiTQCAJ92TfGsDj/F4LoWSjUZUpfeg9b3iSp8G5dVw3+q9QZPIu6eykASK6bfcg//Cyg= + - secure: eQBKJWu7XbhAN4ZvOOhMenC0IPpoYj+wZVVzzsLwUppfJqlrHV0CUW8rJdvZNiaGhYhoyHTnAcynpTE5kZfg3XjevOvF8PGY5wUYCki9BI+rp+pvVPZE/DNUAQpFR2gd2nxMJ4kYv7GVb6i/DfuqJa0h8IuY4zcMuKWwbQd3Az8= diff --git a/node_modules/buffer/.zuul.yml b/node_modules/buffer/.zuul.yml new file mode 100644 index 0000000..a0b4b39 --- /dev/null +++ b/node_modules/buffer/.zuul.yml @@ -0,0 +1,22 @@ +ui: tape +scripts: + - "./test/_polyfill.js" +browsers: + - name: chrome + version: -2..latest + - name: firefox + version: -2..latest + - name: safari + version: [6, 7, 8, 9..latest] + - name: ie + version: 8..latest + - name: microsoftedge + version: 20..latest + - name: opera + version: 11..latest + - name: iphone + version: [5.1, 6.1, 7.1, 8.4, 9.1..latest] + - name: ipad + version: [5.1, 6.1, 7.1, 8.4, 9.1..latest] + - name: android + version: 4.0..latest diff --git a/node_modules/buffer/LICENSE b/node_modules/buffer/LICENSE new file mode 100644 index 0000000..d6bf75d --- /dev/null +++ b/node_modules/buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh, and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/buffer/README.md b/node_modules/buffer/README.md new file mode 100644 index 0000000..671607f --- /dev/null +++ b/node_modules/buffer/README.md @@ -0,0 +1,364 @@ +# buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] + +#### The buffer module from [node.js](http://nodejs.org/), for the browser. + +[![saucelabs][saucelabs-image]][saucelabs-url] + +[travis-image]: https://img.shields.io/travis/feross/buffer.svg?style=flat +[travis-url]: https://travis-ci.org/feross/buffer +[npm-image]: https://img.shields.io/npm/v/buffer.svg?style=flat +[npm-url]: https://npmjs.org/package/buffer +[downloads-image]: https://img.shields.io/npm/dm/buffer.svg?style=flat +[saucelabs-image]: https://saucelabs.com/browser-matrix/buffer.svg +[saucelabs-url]: https://saucelabs.com/u/buffer + +With [browserify](http://browserify.org), simply `require('buffer')` or use the `Buffer` global and you will get this module. + +The goal is to provide an API that is 100% identical to +[node's Buffer API](http://iojs.org/api/buffer.html). Read the +[official docs](http://iojs.org/api/buffer.html) for the full list of properties, +instance methods, and class methods that are supported. + +## features + +- Manipulate binary data like a boss, in all browsers -- even IE6! +- Super fast. Backed by Typed Arrays (`Uint8Array`/`ArrayBuffer`, not `Object`) +- Extremely small bundle size (**5.04KB minified + gzipped**, 35.5KB with comments) +- Excellent browser support (IE 6+, Chrome 4+, Firefox 3+, Safari 5.1+, Opera 11+, iOS, etc.) +- Preserves Node API exactly, with one important difference (see below) +- `.slice()` returns instances of the same type (Buffer) +- Square-bracket `buf[4]` notation works, even in old browsers like IE6! +- Does not modify any browser prototypes or put anything on `window` +- Comprehensive test suite (including all buffer tests from node.js core) + + +## install + +To use this module directly (without browserify), install it: + +```bash +npm install buffer +``` + +This module was previously called **native-buffer-browserify**, but please use **buffer** +from now on. + +A standalone bundle is available [here](https://wzrd.in/standalone/buffer), for non-browserify users. + + +## usage + +The module's API is identical to node's `Buffer` API. Read the +[official docs](http://iojs.org/api/buffer.html) for the full list of properties, +instance methods, and class methods that are supported. + +As mentioned above, `require('buffer')` or use the `Buffer` global with +[browserify](http://browserify.org) and this module will automatically be included +in your bundle. Almost any npm module will work in the browser, even if it assumes that +the node `Buffer` API will be available. + +To depend on this module explicitly (without browserify), require it like this: + +```js +var Buffer = require('buffer/').Buffer // note: the trailing slash is important! +``` + +To require this module explicitly, use `require('buffer/')` which tells the node.js module +lookup algorithm (also used by browserify) to use the **npm module** named `buffer` +instead of the **node.js core** module named `buffer`! + + +## how does it work? + +`Buffer` is a subclass of `Uint8Array` augmented with all the `Buffer` API methods. +The `Uint8Array` prototype is not modified. + + +## one minor difference + +#### In old browsers, `buf.slice()` does not modify parent buffer's memory + +If you only support modern browsers (specifically, those with typed array support), +then this issue does not affect you. If you support super old browsers, then read on. + +In node, the `slice()` method returns a new `Buffer` that shares underlying memory +with the original Buffer. When you modify one buffer, you modify the other. +[Read more.](http://iojs.org/api/buffer.html#buffer_buf_slice_start_end) + +In browsers with typed array support, this `Buffer` implementation supports this +behavior. In browsers without typed arrays, an alternate buffer implementation is +used that is based on `Object` which has no mechanism to point separate +`Buffer`s to the same underlying slab of memory. + +You can see which browser versions lack typed array support +[here](https://github.com/feross/buffer/blob/master/index.js#L20-L46). + + +## tracking the latest node api + +This module tracks the Buffer API in the latest (unstable) version of node.js. The Buffer +API is considered **stable** in the +[node stability index](http://nodejs.org/docs/latest/api/documentation.html#documentation_stability_index), +so it is unlikely that there will ever be breaking changes. +Nonetheless, when/if the Buffer API changes in node, this module's API will change +accordingly. + +## performance + +See perf tests in `/perf`. + +`BrowserBuffer` is the browser `buffer` module (this repo). `Uint8Array` is included as a +sanity check (since `BrowserBuffer` uses `Uint8Array` under the hood, `Uint8Array` will +always be at least a bit faster). Finally, `NodeBuffer` is the node.js buffer module, +which is included to compare against. + +### Chrome 38 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 11,457,464 ops/sec | ±0.86% | 66 | ✓ | +| Uint8Array#bracket-notation | 10,824,332 ops/sec | ±0.74% | 65 | | +| | | | | +| BrowserBuffer#concat | 450,532 ops/sec | ±0.76% | 68 | | +| Uint8Array#concat | 1,368,911 ops/sec | ±1.50% | 62 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 903,001 ops/sec | ±0.96% | 67 | | +| Uint8Array#copy(16000) | 1,422,441 ops/sec | ±1.04% | 66 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 11,431,358 ops/sec | ±0.46% | 69 | | +| Uint8Array#copy(16) | 13,944,163 ops/sec | ±1.12% | 68 | ✓ | +| | | | | +| BrowserBuffer#new(16000) | 106,329 ops/sec | ±6.70% | 44 | | +| Uint8Array#new(16000) | 131,001 ops/sec | ±2.85% | 31 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 1,554,491 ops/sec | ±1.60% | 65 | | +| Uint8Array#new(16) | 6,623,930 ops/sec | ±1.66% | 65 | ✓ | +| | | | | +| BrowserBuffer#readDoubleBE | 112,830 ops/sec | ±0.51% | 69 | ✓ | +| DataView#getFloat64 | 93,500 ops/sec | ±0.57% | 68 | | +| | | | | +| BrowserBuffer#readFloatBE | 146,678 ops/sec | ±0.95% | 68 | ✓ | +| DataView#getFloat32 | 99,311 ops/sec | ±0.41% | 67 | | +| | | | | +| BrowserBuffer#readUInt32LE | 843,214 ops/sec | ±0.70% | 69 | ✓ | +| DataView#getUint32 | 103,024 ops/sec | ±0.64% | 67 | | +| | | | | +| BrowserBuffer#slice | 1,013,941 ops/sec | ±0.75% | 67 | | +| Uint8Array#subarray | 1,903,928 ops/sec | ±0.53% | 67 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 61,387 ops/sec | ±0.90% | 67 | | +| DataView#setFloat32 | 141,249 ops/sec | ±0.40% | 66 | ✓ | + + +### Firefox 33 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 20,800,421 ops/sec | ±1.84% | 60 | | +| Uint8Array#bracket-notation | 20,826,235 ops/sec | ±2.02% | 61 | ✓ | +| | | | | +| BrowserBuffer#concat | 153,076 ops/sec | ±2.32% | 61 | | +| Uint8Array#concat | 1,255,674 ops/sec | ±8.65% | 52 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 1,105,312 ops/sec | ±1.16% | 63 | | +| Uint8Array#copy(16000) | 1,615,911 ops/sec | ±0.55% | 66 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 16,357,599 ops/sec | ±0.73% | 68 | | +| Uint8Array#copy(16) | 31,436,281 ops/sec | ±1.05% | 68 | ✓ | +| | | | | +| BrowserBuffer#new(16000) | 52,995 ops/sec | ±6.01% | 35 | | +| Uint8Array#new(16000) | 87,686 ops/sec | ±5.68% | 45 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 252,031 ops/sec | ±1.61% | 66 | | +| Uint8Array#new(16) | 8,477,026 ops/sec | ±0.49% | 68 | ✓ | +| | | | | +| BrowserBuffer#readDoubleBE | 99,871 ops/sec | ±0.41% | 69 | | +| DataView#getFloat64 | 285,663 ops/sec | ±0.70% | 68 | ✓ | +| | | | | +| BrowserBuffer#readFloatBE | 115,540 ops/sec | ±0.42% | 69 | | +| DataView#getFloat32 | 288,722 ops/sec | ±0.82% | 68 | ✓ | +| | | | | +| BrowserBuffer#readUInt32LE | 633,926 ops/sec | ±1.08% | 67 | ✓ | +| DataView#getUint32 | 294,808 ops/sec | ±0.79% | 64 | | +| | | | | +| BrowserBuffer#slice | 349,425 ops/sec | ±0.46% | 69 | | +| Uint8Array#subarray | 5,965,819 ops/sec | ±0.60% | 65 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 59,980 ops/sec | ±0.41% | 67 | | +| DataView#setFloat32 | 317,634 ops/sec | ±0.63% | 68 | ✓ | + +### Safari 8 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 10,279,729 ops/sec | ±2.25% | 56 | ✓ | +| Uint8Array#bracket-notation | 10,030,767 ops/sec | ±2.23% | 59 | | +| | | | | +| BrowserBuffer#concat | 144,138 ops/sec | ±1.38% | 65 | | +| Uint8Array#concat | 4,950,764 ops/sec | ±1.70% | 63 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 1,058,548 ops/sec | ±1.51% | 64 | | +| Uint8Array#copy(16000) | 1,409,666 ops/sec | ±1.17% | 65 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 6,282,529 ops/sec | ±1.88% | 58 | | +| Uint8Array#copy(16) | 11,907,128 ops/sec | ±2.87% | 58 | ✓ | +| | | | | +| BrowserBuffer#new(16000) | 101,663 ops/sec | ±3.89% | 57 | | +| Uint8Array#new(16000) | 22,050,818 ops/sec | ±6.51% | 46 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 176,072 ops/sec | ±2.13% | 64 | | +| Uint8Array#new(16) | 24,385,731 ops/sec | ±5.01% | 51 | ✓ | +| | | | | +| BrowserBuffer#readDoubleBE | 41,341 ops/sec | ±1.06% | 67 | | +| DataView#getFloat64 | 322,280 ops/sec | ±0.84% | 68 | ✓ | +| | | | | +| BrowserBuffer#readFloatBE | 46,141 ops/sec | ±1.06% | 65 | | +| DataView#getFloat32 | 337,025 ops/sec | ±0.43% | 69 | ✓ | +| | | | | +| BrowserBuffer#readUInt32LE | 151,551 ops/sec | ±1.02% | 66 | | +| DataView#getUint32 | 308,278 ops/sec | ±0.94% | 67 | ✓ | +| | | | | +| BrowserBuffer#slice | 197,365 ops/sec | ±0.95% | 66 | | +| Uint8Array#subarray | 9,558,024 ops/sec | ±3.08% | 58 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 17,518 ops/sec | ±1.03% | 63 | | +| DataView#setFloat32 | 319,751 ops/sec | ±0.48% | 68 | ✓ | + + +### Node 0.11.14 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 10,489,828 ops/sec | ±3.25% | 90 | | +| Uint8Array#bracket-notation | 10,534,884 ops/sec | ±0.81% | 92 | ✓ | +| NodeBuffer#bracket-notation | 10,389,910 ops/sec | ±0.97% | 87 | | +| | | | | +| BrowserBuffer#concat | 487,830 ops/sec | ±2.58% | 88 | | +| Uint8Array#concat | 1,814,327 ops/sec | ±1.28% | 88 | ✓ | +| NodeBuffer#concat | 1,636,523 ops/sec | ±1.88% | 73 | | +| | | | | +| BrowserBuffer#copy(16000) | 1,073,665 ops/sec | ±0.77% | 90 | | +| Uint8Array#copy(16000) | 1,348,517 ops/sec | ±0.84% | 89 | ✓ | +| NodeBuffer#copy(16000) | 1,289,533 ops/sec | ±0.82% | 93 | | +| | | | | +| BrowserBuffer#copy(16) | 12,782,706 ops/sec | ±0.74% | 85 | | +| Uint8Array#copy(16) | 14,180,427 ops/sec | ±0.93% | 92 | ✓ | +| NodeBuffer#copy(16) | 11,083,134 ops/sec | ±1.06% | 89 | | +| | | | | +| BrowserBuffer#new(16000) | 141,678 ops/sec | ±3.30% | 67 | | +| Uint8Array#new(16000) | 161,491 ops/sec | ±2.96% | 60 | | +| NodeBuffer#new(16000) | 292,699 ops/sec | ±3.20% | 55 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 1,655,466 ops/sec | ±2.41% | 82 | | +| Uint8Array#new(16) | 14,399,926 ops/sec | ±0.91% | 94 | ✓ | +| NodeBuffer#new(16) | 3,894,696 ops/sec | ±0.88% | 92 | | +| | | | | +| BrowserBuffer#readDoubleBE | 109,582 ops/sec | ±0.75% | 93 | ✓ | +| DataView#getFloat64 | 91,235 ops/sec | ±0.81% | 90 | | +| NodeBuffer#readDoubleBE | 88,593 ops/sec | ±0.96% | 81 | | +| | | | | +| BrowserBuffer#readFloatBE | 139,854 ops/sec | ±1.03% | 85 | ✓ | +| DataView#getFloat32 | 98,744 ops/sec | ±0.80% | 89 | | +| NodeBuffer#readFloatBE | 92,769 ops/sec | ±0.94% | 93 | | +| | | | | +| BrowserBuffer#readUInt32LE | 710,861 ops/sec | ±0.82% | 92 | | +| DataView#getUint32 | 117,893 ops/sec | ±0.84% | 91 | | +| NodeBuffer#readUInt32LE | 851,412 ops/sec | ±0.72% | 93 | ✓ | +| | | | | +| BrowserBuffer#slice | 1,673,877 ops/sec | ±0.73% | 94 | | +| Uint8Array#subarray | 6,919,243 ops/sec | ±0.67% | 90 | ✓ | +| NodeBuffer#slice | 4,617,604 ops/sec | ±0.79% | 93 | | +| | | | | +| BrowserBuffer#writeFloatBE | 66,011 ops/sec | ±0.75% | 93 | | +| DataView#setFloat32 | 127,760 ops/sec | ±0.72% | 93 | ✓ | +| NodeBuffer#writeFloatBE | 103,352 ops/sec | ±0.83% | 93 | | + +### iojs 1.8.1 + +| Method | Operations | Accuracy | Sampled | Fastest | +|:-------|:-----------|:---------|:--------|:-------:| +| BrowserBuffer#bracket-notation | 10,990,488 ops/sec | ±1.11% | 91 | | +| Uint8Array#bracket-notation | 11,268,757 ops/sec | ±0.65% | 97 | | +| NodeBuffer#bracket-notation | 11,353,260 ops/sec | ±0.83% | 94 | ✓ | +| | | | | +| BrowserBuffer#concat | 378,954 ops/sec | ±0.74% | 94 | | +| Uint8Array#concat | 1,358,288 ops/sec | ±0.97% | 87 | | +| NodeBuffer#concat | 1,934,050 ops/sec | ±1.11% | 78 | ✓ | +| | | | | +| BrowserBuffer#copy(16000) | 894,538 ops/sec | ±0.56% | 84 | | +| Uint8Array#copy(16000) | 1,442,656 ops/sec | ±0.71% | 96 | | +| NodeBuffer#copy(16000) | 1,457,898 ops/sec | ±0.53% | 92 | ✓ | +| | | | | +| BrowserBuffer#copy(16) | 12,870,457 ops/sec | ±0.67% | 95 | | +| Uint8Array#copy(16) | 16,643,989 ops/sec | ±0.61% | 93 | ✓ | +| NodeBuffer#copy(16) | 14,885,848 ops/sec | ±0.74% | 94 | | +| | | | | +| BrowserBuffer#new(16000) | 109,264 ops/sec | ±4.21% | 63 | | +| Uint8Array#new(16000) | 138,916 ops/sec | ±1.87% | 61 | | +| NodeBuffer#new(16000) | 281,449 ops/sec | ±3.58% | 51 | ✓ | +| | | | | +| BrowserBuffer#new(16) | 1,362,935 ops/sec | ±0.56% | 99 | | +| Uint8Array#new(16) | 6,193,090 ops/sec | ±0.64% | 95 | ✓ | +| NodeBuffer#new(16) | 4,745,425 ops/sec | ±1.56% | 90 | | +| | | | | +| BrowserBuffer#readDoubleBE | 118,127 ops/sec | ±0.59% | 93 | ✓ | +| DataView#getFloat64 | 107,332 ops/sec | ±0.65% | 91 | | +| NodeBuffer#readDoubleBE | 116,274 ops/sec | ±0.94% | 95 | | +| | | | | +| BrowserBuffer#readFloatBE | 150,326 ops/sec | ±0.58% | 95 | ✓ | +| DataView#getFloat32 | 110,541 ops/sec | ±0.57% | 98 | | +| NodeBuffer#readFloatBE | 121,599 ops/sec | ±0.60% | 87 | | +| | | | | +| BrowserBuffer#readUInt32LE | 814,147 ops/sec | ±0.62% | 93 | | +| DataView#getUint32 | 137,592 ops/sec | ±0.64% | 90 | | +| NodeBuffer#readUInt32LE | 931,650 ops/sec | ±0.71% | 96 | ✓ | +| | | | | +| BrowserBuffer#slice | 878,590 ops/sec | ±0.68% | 93 | | +| Uint8Array#subarray | 2,843,308 ops/sec | ±1.02% | 90 | | +| NodeBuffer#slice | 4,998,316 ops/sec | ±0.68% | 90 | ✓ | +| | | | | +| BrowserBuffer#writeFloatBE | 65,927 ops/sec | ±0.74% | 93 | | +| DataView#setFloat32 | 139,823 ops/sec | ±0.97% | 89 | ✓ | +| NodeBuffer#writeFloatBE | 135,763 ops/sec | ±0.65% | 96 | | +| | | | | + +## Testing the project + +First, install the project: + + npm install + +Then, to run tests in Node.js, run: + + npm run test-node + +To test locally in a browser, you can run: + + npm run test-browser-local + +This will print out a URL that you can then open in a browser to run the tests, using [Zuul](https://github.com/defunctzombie/zuul). + +To run automated browser tests using Saucelabs, ensure that your `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` environment variables are set, then run: + + npm test + +This is what's run in Travis, to check against various browsers. The list of browsers is kept in the `.zuul.yml` file. + +## JavaScript Standard Style + +This module uses [JavaScript Standard Style](https://github.com/feross/standard). + +[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard) + +To test that the code conforms to the style, `npm install` and run: + + ./node_modules/.bin/standard + +## credit + +This was originally forked from [buffer-browserify](https://github.com/toots/buffer-browserify). + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org), and other contributors. Originally forked from an MIT-licensed module by Romain Beauxis. diff --git a/node_modules/buffer/bin/download-node-tests.js b/node_modules/buffer/bin/download-node-tests.js new file mode 100644 index 0000000..c1a8846 --- /dev/null +++ b/node_modules/buffer/bin/download-node-tests.js @@ -0,0 +1,126 @@ +#!/usr/bin/env node + +var concat = require('concat-stream') +var fs = require('fs') +var hyperquest = require('hyperquest') +var cp = require('child_process') +var split = require('split') +var through = require('through2') + +var url = 'https://api.github.com/repos/nodejs/io.js/contents' +var dirs = [ + '/test/parallel', + '/test/pummel' +] + +cp.execSync('rm -rf node/*.js', { cwd: __dirname + '/../test' }) +cp.execSync('rm -rf node-es6/*.js', { cwd: __dirname + '/../test' }) + +var httpOpts = { + headers: { + 'User-Agent': null + // auth if github rate-limits you... + // 'Authorization': 'Basic ' + Buffer('username:password').toString('base64'), + } +} + +dirs.forEach(function (dir) { + var req = hyperquest(url + dir, httpOpts) + req.pipe(concat(function (data) { + if (req.response.statusCode !== 200) { + throw new Error(url + dir + ': ' + data.toString()) + } + downloadBufferTests(dir, JSON.parse(data)) + })) +}) + +function downloadBufferTests (dir, files) { + files.forEach(function (file) { + if (!/test-buffer.*/.test(file.name)) return + + var path + if (file.name === 'test-buffer-iterator.js' || + file.name === 'test-buffer-arraybuffer.js') { + path = __dirname + '/../test/node-es6/' + file.name + } else if (file.name === 'test-buffer-fakes.js') { + // These teses only apply to node, where they're calling into C++ and need to + // ensure the prototype can't be faked, or else there will be a segfault. + return + } else { + path = __dirname + '/../test/node/' + file.name + } + + console.log(file.download_url) + hyperquest(file.download_url, httpOpts) + .pipe(split()) + .pipe(testfixer(file.name)) + .pipe(fs.createWriteStream(path)) + .on('finish', function () { + console.log('wrote ' + file.name) + }) + }) +} + +function testfixer (filename) { + var firstline = true + + return through(function (line, enc, cb) { + line = line.toString() + + if (firstline) { + // require buffer explicitly + var preamble = 'if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false;\n' + + 'var Buffer = require(\'../../\').Buffer;' + if (/use strict/.test(line)) line += '\n' + preamble + else line + preamble + '\n' + line + firstline = false + } + + // use `var` instead of `const`/`let` + line = line.replace(/(const|let) /g, 'var ') + + // make `require('common')` work + line = line.replace(/(var common = require.*)/g, 'var common = {};') + + // use `Buffer.isBuffer` instead of `instanceof Buffer` + line = line.replace(/buf instanceof Buffer/g, 'Buffer.isBuffer(buf)') + + // require browser buffer + line = line.replace(/(.*)require\('buffer'\)(.*)/g, '$1require(\'../../\')$2') + + // smalloc is only used for kMaxLength + line = line.replace( + /require\('smalloc'\)/g, + '{ kMaxLength: process.env.OBJECT_IMPL ? 0x3fffffff : 0x7fffffff }' + ) + + // comment out console logs + line = line.replace(/(.*console\..*)/g, '// $1') + + // we can't reliably test typed array max-sizes in the browser + if (filename === 'test-buffer-big.js') { + line = line.replace(/(.*new Int8Array.*RangeError.*)/, '// $1') + line = line.replace(/(.*new ArrayBuffer.*RangeError.*)/, '// $1') + line = line.replace(/(.*new Float64Array.*RangeError.*)/, '// $1') + } + + // https://github.com/iojs/io.js/blob/v0.12/test/parallel/test-buffer.js#L38 + // we can't run this because we need to support + // browsers that don't have typed arrays + if (filename === 'test-buffer.js') { + line = line.replace(/b\[0\] = -1;/, 'b[0] = 255;') + } + + // https://github.com/iojs/io.js/blob/v0.12/test/parallel/test-buffer.js#L1138 + // unfortunately we can't run this as it touches + // node streams which do an instanceof check + // and crypto-browserify doesn't work in old + // versions of ie + if (filename === 'test-buffer.js') { + line = line.replace(/^(\s*)(var crypto = require.*)/, '$1// $2') + line = line.replace(/(crypto.createHash.*\))/, '1 /*$1*/') + } + + cb(null, line + '\n') + }) +} diff --git a/node_modules/buffer/bin/test.js b/node_modules/buffer/bin/test.js new file mode 100644 index 0000000..2fc368b --- /dev/null +++ b/node_modules/buffer/bin/test.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +var cp = require('child_process') + +var runBrowserTests = !process.env.TRAVIS_PULL_REQUEST || + process.env.TRAVIS_PULL_REQUEST === 'false' + +var node = cp.spawn('npm', ['run', 'test-node'], { stdio: 'inherit' }) +node.on('close', function (code) { + if (code === 0 && runBrowserTests) { + var browser = cp.spawn('npm', ['run', 'test-browser'], { stdio: 'inherit' }) + browser.on('close', function (code) { + process.exit(code) + }) + } else { + process.exit(code) + } +}) diff --git a/node_modules/buffer/index.js b/node_modules/buffer/index.js new file mode 100644 index 0000000..59a4ec2 --- /dev/null +++ b/node_modules/buffer/index.js @@ -0,0 +1,1548 @@ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + +'use strict' + +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var isArray = require('isarray') + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 // not used by this implementation + +var rootParent = {} + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Safari 5-7 lacks support for changing the `Object.prototype.constructor` property + * on objects. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +function typedArraySupport () { + function Bar () {} + try { + var arr = new Uint8Array(1) + arr.foo = function () { return 42 } + arr.constructor = Bar + return arr.foo() === 42 && // typed array instances can be augmented + arr.constructor === Bar && // constructor can be set + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (arg) { + if (!(this instanceof Buffer)) { + // Avoid going through an ArgumentsAdaptorTrampoline in the common case. + if (arguments.length > 1) return new Buffer(arg, arguments[1]) + return new Buffer(arg) + } + + if (!Buffer.TYPED_ARRAY_SUPPORT) { + this.length = 0 + this.parent = undefined + } + + // Common case. + if (typeof arg === 'number') { + return fromNumber(this, arg) + } + + // Slightly less common case. + if (typeof arg === 'string') { + return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') + } + + // Unusual. + return fromObject(this, arg) +} + +function fromNumber (that, length) { + that = allocate(that, length < 0 ? 0 : checked(length) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < length; i++) { + that[i] = 0 + } + } + return that +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') encoding = 'utf8' + + // Assumption: byteLength() return value is always < kMaxLength. + var length = byteLength(string, encoding) | 0 + that = allocate(that, length) + + that.write(string, encoding) + return that +} + +function fromObject (that, object) { + if (Buffer.isBuffer(object)) return fromBuffer(that, object) + + if (isArray(object)) return fromArray(that, object) + + if (object == null) { + throw new TypeError('must start with number, buffer, array or string') + } + + if (typeof ArrayBuffer !== 'undefined') { + if (object.buffer instanceof ArrayBuffer) { + return fromTypedArray(that, object) + } + if (object instanceof ArrayBuffer) { + return fromArrayBuffer(that, object) + } + } + + if (object.length) return fromArrayLike(that, object) + + return fromJsonObject(that, object) +} + +function fromBuffer (that, buffer) { + var length = checked(buffer.length) | 0 + that = allocate(that, length) + buffer.copy(that, 0, 0, length) + return that +} + +function fromArray (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +// Duplicate of fromArray() to keep fromArray() monomorphic. +function fromTypedArray (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + // Truncating the elements is probably not what people expect from typed + // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior + // of the old Buffer constructor. + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array) { + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + array.byteLength + that = Buffer._augment(new Uint8Array(array)) + } else { + // Fallback: Return an object instance of the Buffer class + that = fromTypedArray(that, new Uint8Array(array)) + } + return that +} + +function fromArrayLike (that, array) { + var length = checked(array.length) | 0 + that = allocate(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +// Deserialize { type: 'Buffer', data: [1,2,3,...] } into a Buffer object. +// Returns a zero-length buffer for inputs that don't conform to the spec. +function fromJsonObject (that, object) { + var array + var length = 0 + + if (object.type === 'Buffer' && isArray(object.data)) { + array = object.data + length = checked(array.length) | 0 + } + that = allocate(that, length) + + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array +} else { + // pre-set for values that may exist in the future + Buffer.prototype.length = undefined + Buffer.prototype.parent = undefined +} + +function allocate (that, length) { + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = Buffer._augment(new Uint8Array(length)) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that.length = length + that._isBuffer = true + } + + var fromPool = length !== 0 && length <= Buffer.poolSize >>> 1 + if (fromPool) that.parent = rootParent + + return that +} + +function checked (length) { + // Note: cannot use `length < kMaxLength` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (subject, encoding) { + if (!(this instanceof SlowBuffer)) return new SlowBuffer(subject, encoding) + + var buf = new Buffer(subject, encoding) + delete buf.parent + return buf +} + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + var i = 0 + var len = Math.min(x, y) + while (i < len) { + if (a[i] !== b[i]) break + + ++i + } + + if (i !== len) { + x = a[i] + y = b[i] + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) throw new TypeError('list argument must be an Array of Buffers.') + + if (list.length === 0) { + return new Buffer(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; i++) { + length += list[i].length + } + } + + var buf = new Buffer(length) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +function byteLength (string, encoding) { + if (typeof string !== 'string') string = '' + string + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'binary': + // Deprecated + case 'raw': + case 'raws': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + start = start | 0 + end = end === undefined || end === Infinity ? this.length : end | 0 + + if (!encoding) encoding = 'utf8' + if (start < 0) start = 0 + if (end > this.length) end = this.length + if (end <= start) return '' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'binary': + return binarySlice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} + +Buffer.prototype.compare = function compare (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return 0 + return Buffer.compare(this, b) +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset) { + if (byteOffset > 0x7fffffff) byteOffset = 0x7fffffff + else if (byteOffset < -0x80000000) byteOffset = -0x80000000 + byteOffset >>= 0 + + if (this.length === 0) return -1 + if (byteOffset >= this.length) return -1 + + // Negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) + + if (typeof val === 'string') { + if (val.length === 0) return -1 // special case: looking for empty string always fails + return String.prototype.indexOf.call(this, val, byteOffset) + } + if (Buffer.isBuffer(val)) { + return arrayIndexOf(this, val, byteOffset) + } + if (typeof val === 'number') { + if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { + return Uint8Array.prototype.indexOf.call(this, val, byteOffset) + } + return arrayIndexOf(this, [ val ], byteOffset) + } + + function arrayIndexOf (arr, val, byteOffset) { + var foundIndex = -1 + for (var i = 0; byteOffset + i < arr.length; i++) { + if (arr[byteOffset + i] === val[foundIndex === -1 ? 0 : i - foundIndex]) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === val.length) return byteOffset + foundIndex + } else { + foundIndex = -1 + } + } + return -1 + } + + throw new TypeError('val must be string, number or Buffer') +} + +// `get` is deprecated +Buffer.prototype.get = function get (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` is deprecated +Buffer.prototype.set = function set (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new Error('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) throw new Error('Invalid hex string') + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + var swap = encoding + encoding = offset + offset = length | 0 + length = swap + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'binary': + return binaryWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function binarySlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; i++) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + } + + if (newBuf.length) newBuf.parent = this.parent || this + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') + if (value > max || value < min) throw new RangeError('value is out of bounds') + if (offset + ext > buf.length) throw new RangeError('index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0) + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = value < 0 ? 1 : 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = value < 0 ? 1 : 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (value > max || value < min) throw new RangeError('value is out of bounds') + if (offset + ext > buf.length) throw new RangeError('index out of range') + if (offset < 0) throw new RangeError('index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; i--) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; i++) { + target[i + targetStart] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), targetStart) + } + + return len +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function fill (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + if (end < start) throw new RangeError('end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + if (start < 0 || start >= this.length) throw new RangeError('start out of bounds') + if (end < 0 || end > this.length) throw new RangeError('end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function toArrayBuffer () { + if (typeof Uint8Array !== 'undefined') { + if (Buffer.TYPED_ARRAY_SUPPORT) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new TypeError('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function _augment (arr) { + arr.constructor = Buffer + arr._isBuffer = true + + // save reference to original Uint8Array set method before overwriting + arr._set = arr.set + + // deprecated + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.indexOf = BP.indexOf + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUIntLE = BP.readUIntLE + arr.readUIntBE = BP.readUIntBE + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readIntLE = BP.readIntLE + arr.readIntBE = BP.readIntBE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUIntLE = BP.writeUIntLE + arr.writeUIntBE = BP.writeUIntBE + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeIntLE = BP.writeIntLE + arr.writeIntBE = BP.writeIntBE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; i++) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; i++) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} diff --git a/node_modules/buffer/node_modules/isarray/.npmignore b/node_modules/buffer/node_modules/isarray/.npmignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/node_modules/buffer/node_modules/isarray/.travis.yml b/node_modules/buffer/node_modules/isarray/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/buffer/node_modules/isarray/Makefile b/node_modules/buffer/node_modules/isarray/Makefile new file mode 100644 index 0000000..787d56e --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/Makefile @@ -0,0 +1,6 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test + diff --git a/node_modules/buffer/node_modules/isarray/README.md b/node_modules/buffer/node_modules/isarray/README.md new file mode 100644 index 0000000..16d2c59 --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/buffer/node_modules/isarray/component.json b/node_modules/buffer/node_modules/isarray/component.json new file mode 100644 index 0000000..9e31b68 --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/node_modules/buffer/node_modules/isarray/index.js b/node_modules/buffer/node_modules/isarray/index.js new file mode 100644 index 0000000..a57f634 --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/buffer/node_modules/isarray/package.json b/node_modules/buffer/node_modules/isarray/package.json new file mode 100644 index 0000000..1a4317a --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/package.json @@ -0,0 +1,45 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tape": "~2.13.4" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "scripts": { + "test": "tape test.js" + } +} diff --git a/node_modules/buffer/node_modules/isarray/test.js b/node_modules/buffer/node_modules/isarray/test.js new file mode 100644 index 0000000..e0c3444 --- /dev/null +++ b/node_modules/buffer/node_modules/isarray/test.js @@ -0,0 +1,20 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); + diff --git a/node_modules/buffer/package.json b/node_modules/buffer/package.json new file mode 100644 index 0000000..5ebf669 --- /dev/null +++ b/node_modules/buffer/package.json @@ -0,0 +1,74 @@ +{ + "name": "buffer", + "description": "Node.js Buffer API, for the browser", + "version": "3.6.2", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "http://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/buffer/issues" + }, + "contributors": [ + "Romain Beauxis ", + "James Halliday " + ], + "dependencies": { + "base64-js": "0.0.8", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + }, + "devDependencies": { + "benchmark": "^1.0.0", + "browserify": "^12.0.1", + "concat-stream": "^1.4.7", + "hyperquest": "^1.0.1", + "is-nan": "^1.0.1", + "split": "^1.0.0", + "standard": "^5.0.0", + "tape": "^4.0.0", + "through2": "^2.0.0", + "zuul": "^3.0.0" + }, + "homepage": "https://github.com/feross/buffer", + "keywords": [ + "buffer", + "browserify", + "compatible", + "browser", + "arraybuffer", + "uint8array", + "dataview" + ], + "license": "MIT", + "main": "index.js", + "repository": { + "type": "git", + "url": "git://github.com/feross/buffer.git" + }, + "scripts": { + "test": "standard && node ./bin/test.js", + "test-browser": "zuul -- test/*.js test/node/*.js", + "test-browser-local": "zuul --local -- test/*.js test/node/*.js", + "test-node": "tape test/*.js test/node/*.js test/node-es6/*.js && OBJECT_IMPL=true tape test/*.js test/node/*.js", + "perf": "browserify --debug perf/bracket-notation.js > perf/bundle.js && open perf/index.html", + "perf-node": "node perf/bracket-notation.js && node perf/concat.js && node perf/copy-big.js && node perf/copy.js && node perf/new-big.js && node perf/new.js && node perf/readDoubleBE.js && node perf/readFloatBE.js && node perf/readUInt32LE.js && node perf/slice.js && node perf/writeFloatBE.js", + "size": "browserify -r ./ | uglifyjs -c -m | gzip | wc -c" + }, + "standard": { + "ignore": [ + "test/node/*.js", + "test/node-es6/*.js", + "test/_polyfill.js", + "perf/*.js" + ] + }, + "jspm": { + "map": { + "./index.js": { + "node": "@node/buffer" + } + } + } +} diff --git a/node_modules/buffer/test/_polyfill.js b/node_modules/buffer/test/_polyfill.js new file mode 100644 index 0000000..61f9c18 --- /dev/null +++ b/node_modules/buffer/test/_polyfill.js @@ -0,0 +1,150 @@ +if (!Array.prototype.forEach) { + + Array.prototype.forEach = function(callback, thisArg) { + + var T, k; + + if (this == null) { + throw new TypeError(' this is null or not defined'); + } + + // 1. Let O be the result of calling ToObject passing the |this| value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if (typeof callback !== "function") { + throw new TypeError(callback + ' is not a function'); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (arguments.length > 1) { + T = thisArg; + } + + // 6. Let k be 0 + k = 0; + + // 7. Repeat, while k < len + while (k < len) { + + var kValue; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + + // i. Let kValue be the result of calling the Get internal method of O with argument Pk. + kValue = O[k]; + + // ii. Call the Call internal method of callback with T as the this value and + // argument list containing kValue, k, and O. + callback.call(T, kValue, k, O); + } + // d. Increase k by 1. + k++; + } + // 8. return undefined + }; +} + +if (!Array.isArray) { + Array.isArray = function(arg) { + return Object.prototype.toString.call(arg) === '[object Array]'; + }; +} + +if (!Array.prototype.map) { + + Array.prototype.map = function(callback, thisArg) { + + var T, A, k; + + if (this == null) { + throw new TypeError(' this is null or not defined'); + } + + // 1. Let O be the result of calling ToObject passing the |this| + // value as the argument. + var O = Object(this); + + // 2. Let lenValue be the result of calling the Get internal + // method of O with the argument "length". + // 3. Let len be ToUint32(lenValue). + var len = O.length >>> 0; + + // 4. If IsCallable(callback) is false, throw a TypeError exception. + // See: http://es5.github.com/#x9.11 + if (typeof callback !== 'function') { + throw new TypeError(callback + ' is not a function'); + } + + // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. + if (arguments.length > 1) { + T = thisArg; + } + + // 6. Let A be a new array created as if by the expression new Array(len) + // where Array is the standard built-in constructor with that name and + // len is the value of len. + A = new Array(len); + + // 7. Let k be 0 + k = 0; + + // 8. Repeat, while k < len + while (k < len) { + + var kValue, mappedValue; + + // a. Let Pk be ToString(k). + // This is implicit for LHS operands of the in operator + // b. Let kPresent be the result of calling the HasProperty internal + // method of O with argument Pk. + // This step can be combined with c + // c. If kPresent is true, then + if (k in O) { + + // i. Let kValue be the result of calling the Get internal + // method of O with argument Pk. + kValue = O[k]; + + // ii. Let mappedValue be the result of calling the Call internal + // method of callback with T as the this value and argument + // list containing kValue, k, and O. + mappedValue = callback.call(T, kValue, k, O); + + // iii. Call the DefineOwnProperty internal method of A with arguments + // Pk, Property Descriptor + // { Value: mappedValue, + // Writable: true, + // Enumerable: true, + // Configurable: true }, + // and false. + + // In browsers that support Object.defineProperty, use the following: + // Object.defineProperty(A, k, { + // value: mappedValue, + // writable: true, + // enumerable: true, + // configurable: true + // }); + + // For best browser support, use the following: + A[k] = mappedValue; + } + // d. Increase k by 1. + k++; + } + + // 9. return A + return A; + }; +} diff --git a/node_modules/buffer/test/base64.js b/node_modules/buffer/test/base64.js new file mode 100644 index 0000000..e4ecc56 --- /dev/null +++ b/node_modules/buffer/test/base64.js @@ -0,0 +1,47 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('base64: ignore whitespace', function (t) { + var text = '\n YW9ldQ== ' + var buf = new B(text, 'base64') + t.equal(buf.toString(), 'aoeu') + t.end() +}) + +test('base64: strings without padding', function (t) { + t.equal((new B('YW9ldQ', 'base64').toString()), 'aoeu') + t.end() +}) + +test('base64: newline in utf8 -- should not be an issue', function (t) { + t.equal( + new B('LS0tCnRpdGxlOiBUaHJlZSBkYXNoZXMgbWFya3MgdGhlIHNwb3QKdGFnczoK', 'base64').toString('utf8'), + '---\ntitle: Three dashes marks the spot\ntags:\n' + ) + t.end() +}) + +test('base64: newline in base64 -- should get stripped', function (t) { + t.equal( + new B('LS0tCnRpdGxlOiBUaHJlZSBkYXNoZXMgbWFya3MgdGhlIHNwb3QKdGFnczoK\nICAtIHlhbWwKICAtIGZyb250LW1hdHRlcgogIC0gZGFzaGVzCmV4cGFuZWQt', 'base64').toString('utf8'), + '---\ntitle: Three dashes marks the spot\ntags:\n - yaml\n - front-matter\n - dashes\nexpaned-' + ) + t.end() +}) + +test('base64: tab characters in base64 - should get stripped', function (t) { + t.equal( + new B('LS0tCnRpdGxlOiBUaHJlZSBkYXNoZXMgbWFya3MgdGhlIHNwb3QKdGFnczoK\t\t\t\tICAtIHlhbWwKICAtIGZyb250LW1hdHRlcgogIC0gZGFzaGVzCmV4cGFuZWQt', 'base64').toString('utf8'), + '---\ntitle: Three dashes marks the spot\ntags:\n - yaml\n - front-matter\n - dashes\nexpaned-' + ) + t.end() +}) + +test('base64: invalid non-alphanumeric characters -- should be stripped', function (t) { + t.equal( + new B('!"#$%&\'()*,.:;<=>?@[\\]^`{|}~', 'base64').toString('utf8'), + '' + ) + t.end() +}) diff --git a/node_modules/buffer/test/basic.js b/node_modules/buffer/test/basic.js new file mode 100644 index 0000000..d2fac76 --- /dev/null +++ b/node_modules/buffer/test/basic.js @@ -0,0 +1,91 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('buf.constructor is Buffer', function (t) { + var buf = new B([1, 2]) + t.strictEqual(buf.constructor, B) + t.end() +}) + +test('instanceof Buffer', function (t) { + var buf = new B([1, 2]) + t.ok(buf instanceof B) + t.end() +}) + +test('convert to Uint8Array in modern browsers', function (t) { + if (B.TYPED_ARRAY_SUPPORT) { + var buf = new B([1, 2]) + var uint8array = new Uint8Array(buf.buffer) + t.ok(uint8array instanceof Uint8Array) + t.equal(uint8array[0], 1) + t.equal(uint8array[1], 2) + } else { + t.pass('object impl: skipping test') + } + t.end() +}) + +test('indexes from a string', function (t) { + var buf = new B('abc') + t.equal(buf[0], 97) + t.equal(buf[1], 98) + t.equal(buf[2], 99) + t.end() +}) + +test('indexes from an array', function (t) { + var buf = new B([ 97, 98, 99 ]) + t.equal(buf[0], 97) + t.equal(buf[1], 98) + t.equal(buf[2], 99) + t.end() +}) + +test('setting index value should modify buffer contents', function (t) { + var buf = new B([ 97, 98, 99 ]) + t.equal(buf[2], 99) + t.equal(buf.toString(), 'abc') + + buf[2] += 10 + t.equal(buf[2], 109) + t.equal(buf.toString(), 'abm') + t.end() +}) + +test('storing negative number should cast to unsigned', function (t) { + var buf = new B(1) + + if (B.TYPED_ARRAY_SUPPORT) { + // This does not work with the object implementation -- nothing we can do! + buf[0] = -3 + t.equal(buf[0], 253) + } + + buf = new B(1) + buf.writeInt8(-3, 0) + t.equal(buf[0], 253) + + t.end() +}) + +test('test that memory is copied from array-like', function (t) { + if (B.TYPED_ARRAY_SUPPORT) { + var u = new Uint8Array(4) + var b = new B(u) + b[0] = 1 + b[1] = 2 + b[2] = 3 + b[3] = 4 + + t.equal(u[0], 0) + t.equal(u[1], 0) + t.equal(u[2], 0) + t.equal(u[3], 0) + } else { + t.pass('object impl: skipping test') + } + + t.end() +}) diff --git a/node_modules/buffer/test/compare.js b/node_modules/buffer/test/compare.js new file mode 100644 index 0000000..62b478c --- /dev/null +++ b/node_modules/buffer/test/compare.js @@ -0,0 +1,59 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('buffer.compare', function (t) { + var b = new B(1).fill('a') + var c = new B(1).fill('c') + var d = new B(2).fill('aa') + + t.equal(b.compare(c), -1) + t.equal(c.compare(d), 1) + t.equal(d.compare(b), 1) + t.equal(b.compare(d), -1) + + // static method + t.equal(B.compare(b, c), -1) + t.equal(B.compare(c, d), 1) + t.equal(B.compare(d, b), 1) + t.equal(B.compare(b, d), -1) + t.end() +}) + +test('buffer.compare argument validation', function (t) { + t.throws(function () { + var b = new B(1) + B.compare(b, 'abc') + }) + + t.throws(function () { + var b = new B(1) + B.compare('abc', b) + }) + + t.throws(function () { + var b = new B(1) + b.compare('abc') + }) + t.end() +}) + +test('buffer.equals', function (t) { + var b = new B(5).fill('abcdf') + var c = new B(5).fill('abcdf') + var d = new B(5).fill('abcde') + var e = new B(6).fill('abcdef') + + t.ok(b.equals(c)) + t.ok(!c.equals(d)) + t.ok(!d.equals(e)) + t.end() +}) + +test('buffer.equals argument validation', function (t) { + t.throws(function () { + var b = new B(1) + b.equals('abc') + }) + t.end() +}) diff --git a/node_modules/buffer/test/constructor.js b/node_modules/buffer/test/constructor.js new file mode 100644 index 0000000..1661c25 --- /dev/null +++ b/node_modules/buffer/test/constructor.js @@ -0,0 +1,154 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('new buffer from array', function (t) { + t.equal( + new B([1, 2, 3]).toString(), + '\u0001\u0002\u0003' + ) + t.end() +}) + +test('new buffer from array w/ negatives', function (t) { + t.equal( + new B([-1, -2, -3]).toString('hex'), + 'fffefd' + ) + t.end() +}) + +test('new buffer from array with mixed signed input', function (t) { + t.equal( + new B([-255, 255, -128, 128, 512, -512, 511, -511]).toString('hex'), + '01ff80800000ff01' + ) + t.end() +}) + +test('new buffer from string', function (t) { + t.equal( + new B('hey', 'utf8').toString(), + 'hey' + ) + t.end() +}) + +test('new buffer from buffer', function (t) { + var b1 = new B('asdf') + var b2 = new B(b1) + t.equal(b1.toString('hex'), b2.toString('hex')) + t.end() +}) + +test('new buffer from Uint8Array', function (t) { + if (typeof Uint8Array !== 'undefined') { + var b1 = new Uint8Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from Uint16Array', function (t) { + if (typeof Uint16Array !== 'undefined') { + var b1 = new Uint16Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from Uint32Array', function (t) { + if (typeof Uint32Array !== 'undefined') { + var b1 = new Uint32Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from Int16Array', function (t) { + if (typeof Int16Array !== 'undefined') { + var b1 = new Int16Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from Int32Array', function (t) { + if (typeof Int32Array !== 'undefined') { + var b1 = new Int32Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from Float32Array', function (t) { + if (typeof Float32Array !== 'undefined') { + var b1 = new Float32Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from Float64Array', function (t) { + if (typeof Float64Array !== 'undefined') { + var b1 = new Float64Array([0, 1, 2, 3]) + var b2 = new B(b1) + t.equal(b1.length, b2.length) + t.equal(b1[0], 0) + t.equal(b1[1], 1) + t.equal(b1[2], 2) + t.equal(b1[3], 3) + t.equal(b1[4], undefined) + } + t.end() +}) + +test('new buffer from buffer.toJSON() output', function (t) { + if (typeof JSON === 'undefined') { + // ie6, ie7 lack support + t.end() + return + } + var buf = new B('test') + var json = JSON.stringify(buf) + var obj = JSON.parse(json) + var copy = new B(obj) + t.ok(buf.equals(copy)) + t.end() +}) diff --git a/node_modules/buffer/test/deprecated.js b/node_modules/buffer/test/deprecated.js new file mode 100644 index 0000000..991d614 --- /dev/null +++ b/node_modules/buffer/test/deprecated.js @@ -0,0 +1,19 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('.get (deprecated)', function (t) { + var b = new B([7, 42]) + t.equal(b.get(0), 7) + t.equal(b.get(1), 42) + t.end() +}) + +test('.set (deprecated)', function (t) { + var b = new B(2) + b.set(7, 0) + b.set(42, 1) + t.equal(b[0], 7) + t.equal(b[1], 42) + t.end() +}) diff --git a/node_modules/buffer/test/from-string.js b/node_modules/buffer/test/from-string.js new file mode 100644 index 0000000..e25db26 --- /dev/null +++ b/node_modules/buffer/test/from-string.js @@ -0,0 +1,132 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('detect utf16 surrogate pairs', function (t) { + var text = '\uD83D\uDE38' + '\uD83D\uDCAD' + '\uD83D\uDC4D' + var buf = new B(text) + t.equal(text, buf.toString()) + t.end() +}) + +test('detect utf16 surrogate pairs over U+20000 until U+10FFFF', function (t) { + var text = '\uD842\uDFB7' + '\uD93D\uDCAD' + '\uDBFF\uDFFF' + var buf = new B(text) + t.equal(text, buf.toString()) + t.end() +}) + +test('replace orphaned utf16 surrogate lead code point', function (t) { + var text = '\uD83D\uDE38' + '\uD83D' + '\uD83D\uDC4D' + var buf = new B(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8, 0xef, 0xbf, 0xbd, 0xf0, 0x9f, 0x91, 0x8d ])) + t.end() +}) + +test('replace orphaned utf16 surrogate trail code point', function (t) { + var text = '\uD83D\uDE38' + '\uDCAD' + '\uD83D\uDC4D' + var buf = new B(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8, 0xef, 0xbf, 0xbd, 0xf0, 0x9f, 0x91, 0x8d ])) + t.end() +}) + +test('do not write partial utf16 code units', function (t) { + var f = new B([0, 0, 0, 0, 0]) + t.equal(f.length, 5) + var size = f.write('あいうえお', 'utf16le') + t.equal(size, 4) + t.deepEqual(f, new B([0x42, 0x30, 0x44, 0x30, 0x00])) + t.end() +}) + +test('handle partial utf16 code points when encoding to utf8 the way node does', function (t) { + var text = '\uD83D\uDE38' + '\uD83D\uDC4D' + + var buf = new B(8) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8, 0xf0, 0x9f, 0x91, 0x8d ])) + + buf = new B(7) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8, 0x00, 0x00, 0x00 ])) + + buf = new B(6) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8, 0x00, 0x00 ])) + + buf = new B(5) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8, 0x00 ])) + + buf = new B(4) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0xf0, 0x9f, 0x98, 0xb8 ])) + + buf = new B(3) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x00, 0x00, 0x00 ])) + + buf = new B(2) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x00, 0x00 ])) + + buf = new B(1) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x00 ])) + + t.end() +}) + +test('handle invalid utf16 code points when encoding to utf8 the way node does', function (t) { + var text = 'a' + '\uDE38\uD83D' + 'b' + + var buf = new B(8) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0xef, 0xbf, 0xbd, 0xef, 0xbf, 0xbd, 0x62 ])) + + buf = new B(7) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0xef, 0xbf, 0xbd, 0xef, 0xbf, 0xbd ])) + + buf = new B(6) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0xef, 0xbf, 0xbd, 0x00, 0x00 ])) + + buf = new B(5) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0xef, 0xbf, 0xbd, 0x00 ])) + + buf = new B(4) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0xef, 0xbf, 0xbd ])) + + buf = new B(3) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0x00, 0x00 ])) + + buf = new B(2) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61, 0x00 ])) + + buf = new B(1) + buf.fill(0) + buf.write(text) + t.deepEqual(buf, new B([ 0x61 ])) + + t.end() +}) diff --git a/node_modules/buffer/test/methods.js b/node_modules/buffer/test/methods.js new file mode 100644 index 0000000..f4bd3f2 --- /dev/null +++ b/node_modules/buffer/test/methods.js @@ -0,0 +1,127 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('buffer.toJSON', function (t) { + var data = [1, 2, 3, 4] + t.deepEqual( + new B(data).toJSON(), + { type: 'Buffer', data: [ 1, 2, 3, 4 ] } + ) + t.end() +}) + +test('buffer.copy', function (t) { + // copied from nodejs.org example + var buf1 = new B(26) + var buf2 = new B(26) + + for (var i = 0; i < 26; i++) { + buf1[i] = i + 97 // 97 is ASCII a + buf2[i] = 33 // ASCII ! + } + + buf1.copy(buf2, 8, 16, 20) + + t.equal( + buf2.toString('ascii', 0, 25), + '!!!!!!!!qrst!!!!!!!!!!!!!' + ) + t.end() +}) + +test('test offset returns are correct', function (t) { + var b = new B(16) + t.equal(4, b.writeUInt32LE(0, 0)) + t.equal(6, b.writeUInt16LE(0, 4)) + t.equal(7, b.writeUInt8(0, 6)) + t.equal(8, b.writeInt8(0, 7)) + t.equal(16, b.writeDoubleLE(0, 8)) + t.end() +}) + +test('concat() a varying number of buffers', function (t) { + var zero = [] + var one = [ new B('asdf') ] + var long = [] + for (var i = 0; i < 10; i++) { + long.push(new B('asdf')) + } + + var flatZero = B.concat(zero) + var flatOne = B.concat(one) + var flatLong = B.concat(long) + var flatLongLen = B.concat(long, 40) + + t.equal(flatZero.length, 0) + t.equal(flatOne.toString(), 'asdf') + t.deepEqual(flatOne, one[0]) + t.equal(flatLong.toString(), (new Array(10 + 1).join('asdf'))) + t.equal(flatLongLen.toString(), (new Array(10 + 1).join('asdf'))) + t.end() +}) + +test('fill', function (t) { + var b = new B(10) + b.fill(2) + t.equal(b.toString('hex'), '02020202020202020202') + t.end() +}) + +test('fill (string)', function (t) { + var b = new B(10) + b.fill('abc') + t.equal(b.toString(), 'abcabcabca') + b.fill('է') + t.equal(b.toString(), 'էէէէէ') + t.end() +}) + +test('copy() empty buffer with sourceEnd=0', function (t) { + var source = new B([42]) + var destination = new B([43]) + source.copy(destination, 0, 0, 0) + t.equal(destination.readUInt8(0), 43) + t.end() +}) + +test('copy() after slice()', function (t) { + var source = new B(200) + var dest = new B(200) + var expected = new B(200) + for (var i = 0; i < 200; i++) { + source[i] = i + dest[i] = 0 + } + + source.slice(2).copy(dest) + source.copy(expected, 0, 2) + t.deepEqual(dest, expected) + t.end() +}) + +test('copy() ascending', function (t) { + var b = new B('abcdefghij') + b.copy(b, 0, 3, 10) + t.equal(b.toString(), 'defghijhij') + t.end() +}) + +test('copy() descending', function (t) { + var b = new B('abcdefghij') + b.copy(b, 3, 0, 7) + t.equal(b.toString(), 'abcabcdefg') + t.end() +}) + +test('buffer.slice sets indexes', function (t) { + t.equal((new B('hallo')).slice(0, 5).toString(), 'hallo') + t.end() +}) + +test('buffer.slice out of range', function (t) { + t.plan(2) + t.equal((new B('hallo')).slice(0, 10).toString(), 'hallo') + t.equal((new B('hallo')).slice(10, 2).toString(), '') + t.end() +}) diff --git a/node_modules/buffer/test/node-es6/README.txt b/node_modules/buffer/test/node-es6/README.txt new file mode 100644 index 0000000..94199ff --- /dev/null +++ b/node_modules/buffer/test/node-es6/README.txt @@ -0,0 +1 @@ +node buffer tests that require ES6 (e.g. "for..of" construct) diff --git a/node_modules/buffer/test/node-es6/test-buffer-arraybuffer.js b/node_modules/buffer/test/node-es6/test-buffer-arraybuffer.js new file mode 100644 index 0000000..f0eb57c --- /dev/null +++ b/node_modules/buffer/test/node-es6/test-buffer-arraybuffer.js @@ -0,0 +1,49 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; + +var common = {}; +var assert = require('assert'); + +var Buffer = require('../../').Buffer; +var LENGTH = 16; + +var ab = new ArrayBuffer(LENGTH); +var dv = new DataView(ab); +var ui = new Uint8Array(ab); +var buf = new Buffer(ab); + + +assert.ok(Buffer.isBuffer(buf)); +// For backwards compatibility of old .parent property test that if buf is not +// a slice then .parent should be undefined. +assert.equal(buf.parent, undefined); +assert.equal(buf.buffer, ab); +assert.equal(buf.length, ab.byteLength); + + +buf.fill(0xC); +for (var i = 0; i < LENGTH; i++) { + assert.equal(ui[i], 0xC); + ui[i] = 0xF; + assert.equal(buf[i], 0xF); +} + +buf.writeUInt32LE(0xF00, 0); +buf.writeUInt32BE(0xB47, 4); +buf.writeDoubleLE(3.1415, 8); + +assert.equal(dv.getUint32(0, true), 0xF00); +assert.equal(dv.getUint32(4), 0xB47); +assert.equal(dv.getFloat64(8, true), 3.1415); + + +// Now test protecting users from doing stupid things + +assert.throws(function() { + function AB() { } + AB.__proto__ = ArrayBuffer; + AB.prototype.__proto__ = ArrayBuffer.prototype; + new Buffer(new AB()); +}, TypeError); + diff --git a/node_modules/buffer/test/node-es6/test-buffer-iterator.js b/node_modules/buffer/test/node-es6/test-buffer-iterator.js new file mode 100644 index 0000000..3aa3fbf --- /dev/null +++ b/node_modules/buffer/test/node-es6/test-buffer-iterator.js @@ -0,0 +1,65 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; +var common = {}; +var assert = require('assert'); + +var buffer = new Buffer([1, 2, 3, 4, 5]); +var arr; +var b; + +// buffers should be iterable + +arr = []; + +for (b of buffer) + arr.push(b); + +assert.deepEqual(arr, [1, 2, 3, 4, 5]); + + +// buffer iterators should be iterable + +arr = []; + +for (b of buffer[Symbol.iterator]()) + arr.push(b); + +assert.deepEqual(arr, [1, 2, 3, 4, 5]); + + +// buffer#values() should return iterator for values + +arr = []; + +for (b of buffer.values()) + arr.push(b); + +assert.deepEqual(arr, [1, 2, 3, 4, 5]); + + +// buffer#keys() should return iterator for keys + +arr = []; + +for (b of buffer.keys()) + arr.push(b); + +assert.deepEqual(arr, [0, 1, 2, 3, 4]); + + +// buffer#entries() should return iterator for entries + +arr = []; + +for (var b of buffer.entries()) + arr.push(b); + +assert.deepEqual(arr, [ + [0, 1], + [1, 2], + [2, 3], + [3, 4], + [4, 5] +]); + diff --git a/node_modules/buffer/test/node/README.txt b/node_modules/buffer/test/node/README.txt new file mode 100644 index 0000000..a0fd927 --- /dev/null +++ b/node_modules/buffer/test/node/README.txt @@ -0,0 +1 @@ +node core buffer tests diff --git a/node_modules/buffer/test/node/test-buffer-ascii.js b/node_modules/buffer/test/node/test-buffer-ascii.js new file mode 100644 index 0000000..633a677 --- /dev/null +++ b/node_modules/buffer/test/node/test-buffer-ascii.js @@ -0,0 +1,28 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; +var common = {}; +var assert = require('assert'); + +// ASCII conversion in node.js simply masks off the high bits, +// it doesn't do transliteration. +assert.equal(Buffer('hérité').toString('ascii'), 'hC)ritC)'); + +// 71 characters, 78 bytes. The ’ character is a triple-byte sequence. +var input = 'C’est, graphiquement, la réunion d’un accent aigu ' + + 'et d’un accent grave.'; + +var expected = 'Cb\u0000\u0019est, graphiquement, la rC)union ' + + 'db\u0000\u0019un accent aigu et db\u0000\u0019un ' + + 'accent grave.'; + +var buf = Buffer(input); + +for (var i = 0; i < expected.length; ++i) { + assert.equal(buf.slice(i).toString('ascii'), expected.slice(i)); + + // Skip remainder of multi-byte sequence. + if (input.charCodeAt(i) > 65535) ++i; + if (input.charCodeAt(i) > 127) ++i; +} + diff --git a/node_modules/buffer/test/node/test-buffer-bytelength.js b/node_modules/buffer/test/node/test-buffer-bytelength.js new file mode 100644 index 0000000..d63922e --- /dev/null +++ b/node_modules/buffer/test/node/test-buffer-bytelength.js @@ -0,0 +1,49 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; + +var common = {}; +var assert = require('assert'); +var Buffer = require('../../').Buffer; + +// coerce values to string +assert.equal(Buffer.byteLength(32, 'raw'), 2); +assert.equal(Buffer.byteLength(NaN, 'utf8'), 3); +assert.equal(Buffer.byteLength({}, 'raws'), 15); +assert.equal(Buffer.byteLength(), 9); + +// special case: zero length string +assert.equal(Buffer.byteLength('', 'ascii'), 0); +assert.equal(Buffer.byteLength('', 'HeX'), 0); + +// utf8 +assert.equal(Buffer.byteLength('∑éllö wørl∂!', 'utf-8'), 19); +assert.equal(Buffer.byteLength('κλμνξο', 'utf8'), 12); +assert.equal(Buffer.byteLength('挵挶挷挸挹', 'utf-8'), 15); +assert.equal(Buffer.byteLength('𠝹𠱓𠱸', 'UTF8'), 12); +// without an encoding, utf8 should be assumed +assert.equal(Buffer.byteLength('hey there'), 9); +assert.equal(Buffer.byteLength('𠱸挶νξ#xx :)'), 17); +assert.equal(Buffer.byteLength('hello world', ''), 11); +// it should also be assumed with unrecognized encoding +assert.equal(Buffer.byteLength('hello world', 'abc'), 11); +assert.equal(Buffer.byteLength('ßœ∑≈', 'unkn0wn enc0ding'), 10); + +// base64 +assert.equal(Buffer.byteLength('aGVsbG8gd29ybGQ=', 'base64'), 11); +assert.equal(Buffer.byteLength('bm9kZS5qcyByb2NrcyE=', 'base64'), 14); +assert.equal(Buffer.byteLength('aGkk', 'base64'), 3); +assert.equal(Buffer.byteLength('bHNrZGZsa3NqZmtsc2xrZmFqc2RsZmtqcw==', + 'base64'), 25); +// special padding +assert.equal(Buffer.byteLength('aaa=', 'base64'), 2); +assert.equal(Buffer.byteLength('aaaa==', 'base64'), 3); + +assert.equal(Buffer.byteLength('Il était tué'), 14); +assert.equal(Buffer.byteLength('Il était tué', 'utf8'), 14); +assert.equal(Buffer.byteLength('Il était tué', 'ascii'), 12); +assert.equal(Buffer.byteLength('Il était tué', 'binary'), 12); +['ucs2', 'ucs-2', 'utf16le', 'utf-16le'].forEach(function(encoding) { + assert.equal(24, Buffer.byteLength('Il était tué', encoding)); +}); + diff --git a/node_modules/buffer/test/node/test-buffer-concat.js b/node_modules/buffer/test/node/test-buffer-concat.js new file mode 100644 index 0000000..f6b60ae --- /dev/null +++ b/node_modules/buffer/test/node/test-buffer-concat.js @@ -0,0 +1,30 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; +var common = {}; +var assert = require('assert'); + +var zero = []; +var one = [ new Buffer('asdf') ]; +var long = []; +for (var i = 0; i < 10; i++) long.push(new Buffer('asdf')); + +var flatZero = Buffer.concat(zero); +var flatOne = Buffer.concat(one); +var flatLong = Buffer.concat(long); +var flatLongLen = Buffer.concat(long, 40); + +assert(flatZero.length === 0); +assert(flatOne.toString() === 'asdf'); +// A special case where concat used to return the first item, +// if the length is one. This check is to make sure that we don't do that. +assert(flatOne !== one[0]); +assert(flatLong.toString() === (new Array(10 + 1).join('asdf'))); +assert(flatLongLen.toString() === (new Array(10 + 1).join('asdf'))); + +assert.throws(function() { + Buffer.concat([42]); +}, TypeError); + +// console.log('ok'); + diff --git a/node_modules/buffer/test/node/test-buffer-indexof.js b/node_modules/buffer/test/node/test-buffer-indexof.js new file mode 100644 index 0000000..283b9c8 --- /dev/null +++ b/node_modules/buffer/test/node/test-buffer-indexof.js @@ -0,0 +1,79 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; +var common = {}; +var assert = require('assert'); + +var Buffer = require('../../').Buffer; + +var b = new Buffer('abcdef'); +var buf_a = new Buffer('a'); +var buf_bc = new Buffer('bc'); +var buf_f = new Buffer('f'); +var buf_z = new Buffer('z'); +var buf_empty = new Buffer(''); + +assert.equal(b.indexOf('a'), 0); +assert.equal(b.indexOf('a', 1), -1); +assert.equal(b.indexOf('a', -1), -1); +assert.equal(b.indexOf('a', -4), -1); +assert.equal(b.indexOf('a', -b.length), 0); +assert.equal(b.indexOf('a', NaN), 0); +assert.equal(b.indexOf('a', -Infinity), 0); +assert.equal(b.indexOf('a', Infinity), -1); +assert.equal(b.indexOf('bc'), 1); +assert.equal(b.indexOf('bc', 2), -1); +assert.equal(b.indexOf('bc', -1), -1); +assert.equal(b.indexOf('bc', -3), -1); +assert.equal(b.indexOf('bc', -5), 1); +assert.equal(b.indexOf('bc', NaN), 1); +assert.equal(b.indexOf('bc', -Infinity), 1); +assert.equal(b.indexOf('bc', Infinity), -1); +assert.equal(b.indexOf('f'), b.length - 1); +assert.equal(b.indexOf('z'), -1); +assert.equal(b.indexOf(''), -1); +assert.equal(b.indexOf('', 1), -1); +assert.equal(b.indexOf('', b.length + 1), -1); +assert.equal(b.indexOf('', Infinity), -1); +assert.equal(b.indexOf(buf_a), 0); +assert.equal(b.indexOf(buf_a, 1), -1); +assert.equal(b.indexOf(buf_a, -1), -1); +assert.equal(b.indexOf(buf_a, -4), -1); +assert.equal(b.indexOf(buf_a, -b.length), 0); +assert.equal(b.indexOf(buf_a, NaN), 0); +assert.equal(b.indexOf(buf_a, -Infinity), 0); +assert.equal(b.indexOf(buf_a, Infinity), -1); +assert.equal(b.indexOf(buf_bc), 1); +assert.equal(b.indexOf(buf_bc, 2), -1); +assert.equal(b.indexOf(buf_bc, -1), -1); +assert.equal(b.indexOf(buf_bc, -3), -1); +assert.equal(b.indexOf(buf_bc, -5), 1); +assert.equal(b.indexOf(buf_bc, NaN), 1); +assert.equal(b.indexOf(buf_bc, -Infinity), 1); +assert.equal(b.indexOf(buf_bc, Infinity), -1); +assert.equal(b.indexOf(buf_f), b.length - 1); +assert.equal(b.indexOf(buf_z), -1); +assert.equal(b.indexOf(buf_empty), -1); +assert.equal(b.indexOf(buf_empty, 1), -1); +assert.equal(b.indexOf(buf_empty, b.length + 1), -1); +assert.equal(b.indexOf(buf_empty, Infinity), -1); +assert.equal(b.indexOf(0x61), 0); +assert.equal(b.indexOf(0x61, 1), -1); +assert.equal(b.indexOf(0x61, -1), -1); +assert.equal(b.indexOf(0x61, -4), -1); +assert.equal(b.indexOf(0x61, -b.length), 0); +assert.equal(b.indexOf(0x61, NaN), 0); +assert.equal(b.indexOf(0x61, -Infinity), 0); +assert.equal(b.indexOf(0x61, Infinity), -1); +assert.equal(b.indexOf(0x0), -1); + +assert.throws(function() { + b.indexOf(function() { }); +}); +assert.throws(function() { + b.indexOf({}); +}); +assert.throws(function() { + b.indexOf([]); +}); + diff --git a/node_modules/buffer/test/node/test-buffer-inspect.js b/node_modules/buffer/test/node/test-buffer-inspect.js new file mode 100644 index 0000000..719444f --- /dev/null +++ b/node_modules/buffer/test/node/test-buffer-inspect.js @@ -0,0 +1,41 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; +var common = {}; +var assert = require('assert'); + +var util = require('util'); + +var buffer = require('../../'); + +buffer.INSPECT_MAX_BYTES = 2; + +var b = new Buffer(4); +b.fill('1234'); + +var s = new buffer.SlowBuffer(4); +s.fill('1234'); + +var expected = ''; + +assert.strictEqual(util.inspect(b), expected); +assert.strictEqual(util.inspect(s), expected); + +b = new Buffer(2); +b.fill('12'); + +s = new buffer.SlowBuffer(2); +s.fill('12'); + +expected = ''; + +assert.strictEqual(util.inspect(b), expected); +assert.strictEqual(util.inspect(s), expected); + +buffer.INSPECT_MAX_BYTES = Infinity; + +assert.doesNotThrow(function() { + assert.strictEqual(util.inspect(b), expected); + assert.strictEqual(util.inspect(s), expected); +}); + diff --git a/node_modules/buffer/test/node/test-buffer.js b/node_modules/buffer/test/node/test-buffer.js new file mode 100644 index 0000000..d6468f6 --- /dev/null +++ b/node_modules/buffer/test/node/test-buffer.js @@ -0,0 +1,1194 @@ +'use strict'; +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false; +var Buffer = require('../../').Buffer; +var common = {}; +var assert = require('assert'); + +var Buffer = require('../../').Buffer; +var SlowBuffer = require('../../').SlowBuffer; + +// counter to ensure unique value is always copied +var cntr = 0; + +var b = Buffer(1024); // safe constructor + +// console.log('b.length == %d', b.length); +assert.strictEqual(1024, b.length); + +b[0] = 255; +assert.strictEqual(b[0], 255); + +for (var i = 0; i < 1024; i++) { + b[i] = i % 256; +} + +for (var i = 0; i < 1024; i++) { + assert.strictEqual(i % 256, b[i]); +} + +var c = new Buffer(512); +// console.log('c.length == %d', c.length); +assert.strictEqual(512, c.length); + +// First check Buffer#fill() works as expected. + +assert.throws(function() { + Buffer(8).fill('a', -1); +}); + +assert.throws(function() { + Buffer(8).fill('a', 0, 9); +}); + +// Make sure this doesn't hang indefinitely. +Buffer(8).fill(''); + +var buf = new Buffer(64); +buf.fill(10); +for (var i = 0; i < buf.length; i++) + assert.equal(buf[i], 10); + +buf.fill(11, 0, buf.length >> 1); +for (var i = 0; i < buf.length >> 1; i++) + assert.equal(buf[i], 11); +for (var i = (buf.length >> 1) + 1; i < buf.length; i++) + assert.equal(buf[i], 10); + +buf.fill('h'); +for (var i = 0; i < buf.length; i++) + assert.equal('h'.charCodeAt(0), buf[i]); + +buf.fill(0); +for (var i = 0; i < buf.length; i++) + assert.equal(0, buf[i]); + +buf.fill(null); +for (var i = 0; i < buf.length; i++) + assert.equal(0, buf[i]); + +buf.fill(1, 16, 32); +for (var i = 0; i < 16; i++) + assert.equal(0, buf[i]); +for (; i < 32; i++) + assert.equal(1, buf[i]); +for (; i < buf.length; i++) + assert.equal(0, buf[i]); + +var buf = new Buffer(10); +buf.fill('abc'); +assert.equal(buf.toString(), 'abcabcabca'); +buf.fill('է'); +assert.equal(buf.toString(), 'էէէէէ'); + +// copy 512 bytes, from 0 to 512. +b.fill(++cntr); +c.fill(++cntr); +var copied = b.copy(c, 0, 0, 512); +// console.log('copied %d bytes from b into c', copied); +assert.strictEqual(512, copied); +for (var i = 0; i < c.length; i++) { + assert.strictEqual(b[i], c[i]); +} + +// copy c into b, without specifying sourceEnd +b.fill(++cntr); +c.fill(++cntr); +var copied = c.copy(b, 0, 0); +// console.log('copied %d bytes from c into b w/o sourceEnd', copied); +assert.strictEqual(c.length, copied); +for (var i = 0; i < c.length; i++) { + assert.strictEqual(c[i], b[i]); +} + +// copy c into b, without specifying sourceStart +b.fill(++cntr); +c.fill(++cntr); +var copied = c.copy(b, 0); +// console.log('copied %d bytes from c into b w/o sourceStart', copied); +assert.strictEqual(c.length, copied); +for (var i = 0; i < c.length; i++) { + assert.strictEqual(c[i], b[i]); +} + +// copy longer buffer b to shorter c without targetStart +b.fill(++cntr); +c.fill(++cntr); +var copied = b.copy(c); +// console.log('copied %d bytes from b into c w/o targetStart', copied); +assert.strictEqual(c.length, copied); +for (var i = 0; i < c.length; i++) { + assert.strictEqual(b[i], c[i]); +} + +// copy starting near end of b to c +b.fill(++cntr); +c.fill(++cntr); +var copied = b.copy(c, 0, b.length - Math.floor(c.length / 2)); +// console.log('copied %d bytes from end of b into beginning of c', copied); +assert.strictEqual(Math.floor(c.length / 2), copied); +for (var i = 0; i < Math.floor(c.length / 2); i++) { + assert.strictEqual(b[b.length - Math.floor(c.length / 2) + i], c[i]); +} +for (var i = Math.floor(c.length / 2) + 1; i < c.length; i++) { + assert.strictEqual(c[c.length - 1], c[i]); +} + +// try to copy 513 bytes, and check we don't overrun c +b.fill(++cntr); +c.fill(++cntr); +var copied = b.copy(c, 0, 0, 513); +// console.log('copied %d bytes from b trying to overrun c', copied); +assert.strictEqual(c.length, copied); +for (var i = 0; i < c.length; i++) { + assert.strictEqual(b[i], c[i]); +} + +// copy 768 bytes from b into b +b.fill(++cntr); +b.fill(++cntr, 256); +var copied = b.copy(b, 0, 256, 1024); +// console.log('copied %d bytes from b into b', copied); +assert.strictEqual(768, copied); +for (var i = 0; i < b.length; i++) { + assert.strictEqual(cntr, b[i]); +} + +// copy string longer than buffer length (failure will segfault) +var bb = new Buffer(10); +bb.fill('hello crazy world'); + + +var caught_error = null; + +// try to copy from before the beginning of b +caught_error = null; +try { + var copied = b.copy(c, 0, 100, 10); +} catch (err) { + caught_error = err; +} + +// copy throws at negative sourceStart +assert.throws(function() { + Buffer(5).copy(Buffer(5), 0, -1); +}, RangeError); + +// check sourceEnd resets to targetEnd if former is greater than the latter +b.fill(++cntr); +c.fill(++cntr); +var copied = b.copy(c, 0, 0, 1025); +// console.log('copied %d bytes from b into c', copied); +for (var i = 0; i < c.length; i++) { + assert.strictEqual(b[i], c[i]); +} + +// throw with negative sourceEnd +// console.log('test copy at negative sourceEnd'); +assert.throws(function() { + b.copy(c, 0, 0, -1); +}, RangeError); + +// when sourceStart is greater than sourceEnd, zero copied +assert.equal(b.copy(c, 0, 100, 10), 0); + +// when targetStart > targetLength, zero copied +assert.equal(b.copy(c, 512, 0, 10), 0); + +var caught_error; + +// invalid encoding for Buffer.toString +caught_error = null; +try { + var copied = b.toString('invalid'); +} catch (err) { + caught_error = err; +} +assert.strictEqual('Unknown encoding: invalid', caught_error.message); + +// invalid encoding for Buffer.write +caught_error = null; +try { + var copied = b.write('test string', 0, 5, 'invalid'); +} catch (err) { + caught_error = err; +} +assert.strictEqual('Unknown encoding: invalid', caught_error.message); + +// try to create 0-length buffers +new Buffer(''); +new Buffer('', 'ascii'); +new Buffer('', 'binary'); +new Buffer(0); + +// try to write a 0-length string beyond the end of b +assert.throws(function() { + b.write('', 2048); +}, RangeError); + +// throw when writing to negative offset +assert.throws(function() { + b.write('a', -1); +}, RangeError); + +// throw when writing past bounds from the pool +assert.throws(function() { + b.write('a', 2048); +}, RangeError); + +// throw when writing to negative offset +assert.throws(function() { + b.write('a', -1); +}, RangeError); + +// try to copy 0 bytes worth of data into an empty buffer +b.copy(new Buffer(0), 0, 0, 0); + +// try to copy 0 bytes past the end of the target buffer +b.copy(new Buffer(0), 1, 1, 1); +b.copy(new Buffer(1), 1, 1, 1); + +// try to copy 0 bytes from past the end of the source buffer +b.copy(new Buffer(1), 0, 2048, 2048); + +// try to toString() a 0-length slice of a buffer, both within and without the +// valid buffer range +assert.equal(new Buffer('abc').toString('ascii', 0, 0), ''); +assert.equal(new Buffer('abc').toString('ascii', -100, -100), ''); +assert.equal(new Buffer('abc').toString('ascii', 100, 100), ''); + +// try toString() with a object as a encoding +assert.equal(new Buffer('abc').toString({toString: function() { + return 'ascii'; +}}), 'abc'); + +// testing for smart defaults and ability to pass string values as offset +var writeTest = new Buffer('abcdes'); +writeTest.write('n', 'ascii'); +writeTest.write('o', 'ascii', '1'); +writeTest.write('d', '2', 'ascii'); +writeTest.write('e', 3, 'ascii'); +writeTest.write('j', 'ascii', 4); +assert.equal(writeTest.toString(), 'nodejs'); + +// ASCII slice test + +var asciiString = 'hello world'; +var offset = 100; + +for (var i = 0; i < asciiString.length; i++) { + b[i] = asciiString.charCodeAt(i); +} +var asciiSlice = b.toString('ascii', 0, asciiString.length); +assert.equal(asciiString, asciiSlice); + +var written = b.write(asciiString, offset, 'ascii'); +assert.equal(asciiString.length, written); +var asciiSlice = b.toString('ascii', offset, offset + asciiString.length); +assert.equal(asciiString, asciiSlice); + +var sliceA = b.slice(offset, offset + asciiString.length); +var sliceB = b.slice(offset, offset + asciiString.length); +for (var i = 0; i < asciiString.length; i++) { + assert.equal(sliceA[i], sliceB[i]); +} + +// UTF-8 slice test + +var utf8String = '¡hέlló wôrld!'; +var offset = 100; + +b.write(utf8String, 0, Buffer.byteLength(utf8String), 'utf8'); +var utf8Slice = b.toString('utf8', 0, Buffer.byteLength(utf8String)); +assert.equal(utf8String, utf8Slice); + +var written = b.write(utf8String, offset, 'utf8'); +assert.equal(Buffer.byteLength(utf8String), written); +utf8Slice = b.toString('utf8', offset, offset + Buffer.byteLength(utf8String)); +assert.equal(utf8String, utf8Slice); + +var sliceA = b.slice(offset, offset + Buffer.byteLength(utf8String)); +var sliceB = b.slice(offset, offset + Buffer.byteLength(utf8String)); +for (var i = 0; i < Buffer.byteLength(utf8String); i++) { + assert.equal(sliceA[i], sliceB[i]); +} + +var slice = b.slice(100, 150); +assert.equal(50, slice.length); +for (var i = 0; i < 50; i++) { + assert.equal(b[100 + i], slice[i]); +} + + +// make sure only top level parent propagates from allocPool +var b = new Buffer(5); +var c = b.slice(0, 4); +var d = c.slice(0, 2); +assert.equal(b.parent, c.parent); +assert.equal(b.parent, d.parent); + +// also from a non-pooled instance +var b = new SlowBuffer(5); +var c = b.slice(0, 4); +var d = c.slice(0, 2); + + +// Bug regression test +var testValue = '\u00F6\u65E5\u672C\u8A9E'; // ö日本語 +var buffer = new Buffer(32); +var size = buffer.write(testValue, 0, 'utf8'); +// console.log('bytes written to buffer: ' + size); +var slice = buffer.toString('utf8', 0, size); +assert.equal(slice, testValue); + + +// Test triple slice +var a = new Buffer(8); +for (var i = 0; i < 8; i++) a[i] = i; +var b = a.slice(4, 8); +assert.equal(4, b[0]); +assert.equal(5, b[1]); +assert.equal(6, b[2]); +assert.equal(7, b[3]); +var c = b.slice(2, 4); +assert.equal(6, c[0]); +assert.equal(7, c[1]); + + +var d = new Buffer([23, 42, 255]); +assert.equal(d.length, 3); +assert.equal(d[0], 23); +assert.equal(d[1], 42); +assert.equal(d[2], 255); +assert.deepEqual(d, new Buffer(d)); + +var e = new Buffer('über'); +// console.error('uber: \'%s\'', e.toString()); +assert.deepEqual(e, new Buffer([195, 188, 98, 101, 114])); + +var f = new Buffer('über', 'ascii'); +// console.error('f.length: %d (should be 4)', f.length); +assert.deepEqual(f, new Buffer([252, 98, 101, 114])); + +['ucs2', 'ucs-2', 'utf16le', 'utf-16le'].forEach(function(encoding) { + var f = new Buffer('über', encoding); +// console.error('f.length: %d (should be 8)', f.length); + assert.deepEqual(f, new Buffer([252, 0, 98, 0, 101, 0, 114, 0])); + + var f = new Buffer('привет', encoding); +// console.error('f.length: %d (should be 12)', f.length); + assert.deepEqual(f, new Buffer([63, 4, 64, 4, 56, 4, 50, 4, 53, 4, 66, 4])); + assert.equal(f.toString(encoding), 'привет'); + + var f = new Buffer([0, 0, 0, 0, 0]); + assert.equal(f.length, 5); + var size = f.write('あいうえお', encoding); +// console.error('bytes written to buffer: %d (should be 4)', size); + assert.equal(size, 4); + assert.deepEqual(f, new Buffer([0x42, 0x30, 0x44, 0x30, 0x00])); +}); + +var f = new Buffer('\uD83D\uDC4D', 'utf-16le'); // THUMBS UP SIGN (U+1F44D) +assert.equal(f.length, 4); +assert.deepEqual(f, new Buffer('3DD84DDC', 'hex')); + + +var arrayIsh = {0: 0, 1: 1, 2: 2, 3: 3, length: 4}; +var g = new Buffer(arrayIsh); +assert.deepEqual(g, new Buffer([0, 1, 2, 3])); +var strArrayIsh = {0: '0', 1: '1', 2: '2', 3: '3', length: 4}; +g = new Buffer(strArrayIsh); +assert.deepEqual(g, new Buffer([0, 1, 2, 3])); + + +// +// Test toString('base64') +// +assert.equal('TWFu', (new Buffer('Man')).toString('base64')); + +// test that regular and URL-safe base64 both work +var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff]; +assert.deepEqual(Buffer('//++/++/++//', 'base64'), Buffer(expected)); +assert.deepEqual(Buffer('__--_--_--__', 'base64'), Buffer(expected)); + +// big example +var quote = 'Man is distinguished, not only by his reason, but by this ' + + 'singular passion from other animals, which is a lust ' + + 'of the mind, that by a perseverance of delight in the continued ' + + 'and indefatigable generation of knowledge, exceeds the short ' + + 'vehemence of any carnal pleasure.'; +var expected = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24s' + + 'IGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltY' + + 'WxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZX' + + 'JzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmR' + + 'lZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo' + + 'ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4='; +assert.equal(expected, (new Buffer(quote)).toString('base64')); + + +b = new Buffer(1024); +var bytesWritten = b.write(expected, 0, 'base64'); +assert.equal(quote.length, bytesWritten); +assert.equal(quote, b.toString('ascii', 0, quote.length)); + +// check that the base64 decoder ignores whitespace +var expectedWhite = expected.slice(0, 60) + ' \n' + + expected.slice(60, 120) + ' \n' + + expected.slice(120, 180) + ' \n' + + expected.slice(180, 240) + ' \n' + + expected.slice(240, 300) + '\n' + + expected.slice(300, 360) + '\n'; +b = new Buffer(1024); +bytesWritten = b.write(expectedWhite, 0, 'base64'); +assert.equal(quote.length, bytesWritten); +assert.equal(quote, b.toString('ascii', 0, quote.length)); + +// check that the base64 decoder on the constructor works +// even in the presence of whitespace. +b = new Buffer(expectedWhite, 'base64'); +assert.equal(quote.length, b.length); +assert.equal(quote, b.toString('ascii', 0, quote.length)); + +// check that the base64 decoder ignores illegal chars +var expectedIllegal = expected.slice(0, 60) + ' \x80' + + expected.slice(60, 120) + ' \xff' + + expected.slice(120, 180) + ' \x00' + + expected.slice(180, 240) + ' \x98' + + expected.slice(240, 300) + '\x03' + + expected.slice(300, 360); +b = new Buffer(expectedIllegal, 'base64'); +assert.equal(quote.length, b.length); +assert.equal(quote, b.toString('ascii', 0, quote.length)); + + +assert.equal(new Buffer('', 'base64').toString(), ''); +assert.equal(new Buffer('K', 'base64').toString(), ''); + +// multiple-of-4 with padding +assert.equal(new Buffer('Kg==', 'base64').toString(), '*'); +assert.equal(new Buffer('Kio=', 'base64').toString(), '**'); +assert.equal(new Buffer('Kioq', 'base64').toString(), '***'); +assert.equal(new Buffer('KioqKg==', 'base64').toString(), '****'); +assert.equal(new Buffer('KioqKio=', 'base64').toString(), '*****'); +assert.equal(new Buffer('KioqKioq', 'base64').toString(), '******'); +assert.equal(new Buffer('KioqKioqKg==', 'base64').toString(), '*******'); +assert.equal(new Buffer('KioqKioqKio=', 'base64').toString(), '********'); +assert.equal(new Buffer('KioqKioqKioq', 'base64').toString(), '*********'); +assert.equal(new Buffer('KioqKioqKioqKg==', 'base64').toString(), + '**********'); +assert.equal(new Buffer('KioqKioqKioqKio=', 'base64').toString(), + '***********'); +assert.equal(new Buffer('KioqKioqKioqKioq', 'base64').toString(), + '************'); +assert.equal(new Buffer('KioqKioqKioqKioqKg==', 'base64').toString(), + '*************'); +assert.equal(new Buffer('KioqKioqKioqKioqKio=', 'base64').toString(), + '**************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioq', 'base64').toString(), + '***************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKg==', 'base64').toString(), + '****************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKio=', 'base64').toString(), + '*****************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKioq', 'base64').toString(), + '******************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKg==', 'base64').toString(), + '*******************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio=', 'base64').toString(), + '********************'); + +// no padding, not a multiple of 4 +assert.equal(new Buffer('Kg', 'base64').toString(), '*'); +assert.equal(new Buffer('Kio', 'base64').toString(), '**'); +assert.equal(new Buffer('KioqKg', 'base64').toString(), '****'); +assert.equal(new Buffer('KioqKio', 'base64').toString(), '*****'); +assert.equal(new Buffer('KioqKioqKg', 'base64').toString(), '*******'); +assert.equal(new Buffer('KioqKioqKio', 'base64').toString(), '********'); +assert.equal(new Buffer('KioqKioqKioqKg', 'base64').toString(), '**********'); +assert.equal(new Buffer('KioqKioqKioqKio', 'base64').toString(), '***********'); +assert.equal(new Buffer('KioqKioqKioqKioqKg', 'base64').toString(), + '*************'); +assert.equal(new Buffer('KioqKioqKioqKioqKio', 'base64').toString(), + '**************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKg', 'base64').toString(), + '****************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKio', 'base64').toString(), + '*****************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKg', 'base64').toString(), + '*******************'); +assert.equal(new Buffer('KioqKioqKioqKioqKioqKioqKio', 'base64').toString(), + '********************'); + +// handle padding graciously, multiple-of-4 or not +assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw==', + 'base64').length, 32); +assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw=', + 'base64').length, 32); +assert.equal(new Buffer('72INjkR5fchcxk9+VgdGPFJDxUBFR5/rMFsghgxADiw', + 'base64').length, 32); +assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg==', + 'base64').length, 31); +assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg=', + 'base64').length, 31); +assert.equal(new Buffer('w69jACy6BgZmaFvv96HG6MYksWytuZu3T1FvGnulPg', + 'base64').length, 31); + +// This string encodes single '.' character in UTF-16 +var dot = new Buffer('//4uAA==', 'base64'); +assert.equal(dot[0], 0xff); +assert.equal(dot[1], 0xfe); +assert.equal(dot[2], 0x2e); +assert.equal(dot[3], 0x00); +assert.equal(dot.toString('base64'), '//4uAA=='); + +// Writing base64 at a position > 0 should not mangle the result. +// +// https://github.com/joyent/node/issues/402 +var segments = ['TWFkbmVzcz8h', 'IFRoaXM=', 'IGlz', 'IG5vZGUuanMh']; +var buf = new Buffer(64); +var pos = 0; + +for (var i = 0; i < segments.length; ++i) { + pos += b.write(segments[i], pos, 'base64'); +} +assert.equal(b.toString('binary', 0, pos), 'Madness?! This is node.js!'); + +// Creating buffers larger than pool size. +var l = Buffer.poolSize + 5; +var s = ''; +for (i = 0; i < l; i++) { + s += 'h'; +} + +var b = new Buffer(s); + +for (i = 0; i < l; i++) { + assert.equal('h'.charCodeAt(0), b[i]); +} + +var sb = b.toString(); +assert.equal(sb.length, s.length); +assert.equal(sb, s); + + +// Single argument slice +b = new Buffer('abcde'); +assert.equal('bcde', b.slice(1).toString()); + +// slice(0,0).length === 0 +assert.equal(0, Buffer('hello').slice(0, 0).length); + +// test hex toString +// console.log('Create hex string from buffer'); +var hexb = new Buffer(256); +for (var i = 0; i < 256; i++) { + hexb[i] = i; +} +var hexStr = hexb.toString('hex'); +assert.equal(hexStr, + '000102030405060708090a0b0c0d0e0f' + + '101112131415161718191a1b1c1d1e1f' + + '202122232425262728292a2b2c2d2e2f' + + '303132333435363738393a3b3c3d3e3f' + + '404142434445464748494a4b4c4d4e4f' + + '505152535455565758595a5b5c5d5e5f' + + '606162636465666768696a6b6c6d6e6f' + + '707172737475767778797a7b7c7d7e7f' + + '808182838485868788898a8b8c8d8e8f' + + '909192939495969798999a9b9c9d9e9f' + + 'a0a1a2a3a4a5a6a7a8a9aaabacadaeaf' + + 'b0b1b2b3b4b5b6b7b8b9babbbcbdbebf' + + 'c0c1c2c3c4c5c6c7c8c9cacbcccdcecf' + + 'd0d1d2d3d4d5d6d7d8d9dadbdcdddedf' + + 'e0e1e2e3e4e5e6e7e8e9eaebecedeeef' + + 'f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'); + +// console.log('Create buffer from hex string'); +var hexb2 = new Buffer(hexStr, 'hex'); +for (var i = 0; i < 256; i++) { + assert.equal(hexb2[i], hexb[i]); +} + +// test an invalid slice end. +// console.log('Try to slice off the end of the buffer'); +var b = new Buffer([1, 2, 3, 4, 5]); +var b2 = b.toString('hex', 1, 10000); +var b3 = b.toString('hex', 1, 5); +var b4 = b.toString('hex', 1); +assert.equal(b2, b3); +assert.equal(b2, b4); + + +function buildBuffer(data) { + if (Array.isArray(data)) { + var buffer = new Buffer(data.length); + data.forEach(function(v, k) { + buffer[k] = v; + }); + return buffer; + } + return null; +} + +var x = buildBuffer([0x81, 0xa3, 0x66, 0x6f, 0x6f, 0xa3, 0x62, 0x61, 0x72]); + +// console.log(x.inspect()); +assert.equal('', x.inspect()); + +var z = x.slice(4); +// console.log(z.inspect()); +// console.log(z.length); +assert.equal(5, z.length); +assert.equal(0x6f, z[0]); +assert.equal(0xa3, z[1]); +assert.equal(0x62, z[2]); +assert.equal(0x61, z[3]); +assert.equal(0x72, z[4]); + +var z = x.slice(0); +// console.log(z.inspect()); +// console.log(z.length); +assert.equal(z.length, x.length); + +var z = x.slice(0, 4); +// console.log(z.inspect()); +// console.log(z.length); +assert.equal(4, z.length); +assert.equal(0x81, z[0]); +assert.equal(0xa3, z[1]); + +var z = x.slice(0, 9); +// console.log(z.inspect()); +// console.log(z.length); +assert.equal(9, z.length); + +var z = x.slice(1, 4); +// console.log(z.inspect()); +// console.log(z.length); +assert.equal(3, z.length); +assert.equal(0xa3, z[0]); + +var z = x.slice(2, 4); +// console.log(z.inspect()); +// console.log(z.length); +assert.equal(2, z.length); +assert.equal(0x66, z[0]); +assert.equal(0x6f, z[1]); + +assert.equal(0, Buffer('hello').slice(0, 0).length); + +['ucs2', 'ucs-2', 'utf16le', 'utf-16le'].forEach(function(encoding) { + var b = new Buffer(10); + b.write('あいうえお', encoding); + assert.equal(b.toString(encoding), 'あいうえお'); +}); + +// Binary encoding should write only one byte per character. +var b = Buffer([0xde, 0xad, 0xbe, 0xef]); +var s = String.fromCharCode(0xffff); +b.write(s, 0, 'binary'); +assert.equal(0xff, b[0]); +assert.equal(0xad, b[1]); +assert.equal(0xbe, b[2]); +assert.equal(0xef, b[3]); +s = String.fromCharCode(0xaaee); +b.write(s, 0, 'binary'); +assert.equal(0xee, b[0]); +assert.equal(0xad, b[1]); +assert.equal(0xbe, b[2]); +assert.equal(0xef, b[3]); + +// #1210 Test UTF-8 string includes null character +var buf = new Buffer('\0'); +assert.equal(buf.length, 1); +buf = new Buffer('\0\0'); +assert.equal(buf.length, 2); + +buf = new Buffer(2); +var written = buf.write(''); // 0byte +assert.equal(written, 0); +written = buf.write('\0'); // 1byte (v8 adds null terminator) +assert.equal(written, 1); +written = buf.write('a\0'); // 1byte * 2 +assert.equal(written, 2); +written = buf.write('あ'); // 3bytes +assert.equal(written, 0); +written = buf.write('\0あ'); // 1byte + 3bytes +assert.equal(written, 1); +written = buf.write('\0\0あ'); // 1byte * 2 + 3bytes +assert.equal(written, 2); + +buf = new Buffer(10); +written = buf.write('あいう'); // 3bytes * 3 (v8 adds null terminator) +assert.equal(written, 9); +written = buf.write('あいう\0'); // 3bytes * 3 + 1byte +assert.equal(written, 10); + +// #243 Test write() with maxLength +var buf = new Buffer(4); +buf.fill(0xFF); +var written = buf.write('abcd', 1, 2, 'utf8'); +// console.log(buf); +assert.equal(written, 2); +assert.equal(buf[0], 0xFF); +assert.equal(buf[1], 0x61); +assert.equal(buf[2], 0x62); +assert.equal(buf[3], 0xFF); + +buf.fill(0xFF); +written = buf.write('abcd', 1, 4); +// console.log(buf); +assert.equal(written, 3); +assert.equal(buf[0], 0xFF); +assert.equal(buf[1], 0x61); +assert.equal(buf[2], 0x62); +assert.equal(buf[3], 0x63); + +buf.fill(0xFF); +written = buf.write('abcd', 'utf8', 1, 2); // legacy style +// console.log(buf); +assert.equal(written, 2); +assert.equal(buf[0], 0xFF); +assert.equal(buf[1], 0x61); +assert.equal(buf[2], 0x62); +assert.equal(buf[3], 0xFF); + +buf.fill(0xFF); +written = buf.write('abcdef', 1, 2, 'hex'); +// console.log(buf); +assert.equal(written, 2); +assert.equal(buf[0], 0xFF); +assert.equal(buf[1], 0xAB); +assert.equal(buf[2], 0xCD); +assert.equal(buf[3], 0xFF); + +['ucs2', 'ucs-2', 'utf16le', 'utf-16le'].forEach(function(encoding) { + buf.fill(0xFF); + written = buf.write('abcd', 0, 2, encoding); +// console.log(buf); + assert.equal(written, 2); + assert.equal(buf[0], 0x61); + assert.equal(buf[1], 0x00); + assert.equal(buf[2], 0xFF); + assert.equal(buf[3], 0xFF); +}); + +// test offset returns are correct +var b = new Buffer(16); +assert.equal(4, b.writeUInt32LE(0, 0)); +assert.equal(6, b.writeUInt16LE(0, 4)); +assert.equal(7, b.writeUInt8(0, 6)); +assert.equal(8, b.writeInt8(0, 7)); +assert.equal(16, b.writeDoubleLE(0, 8)); + +// test unmatched surrogates not producing invalid utf8 output +// ef bf bd = utf-8 representation of unicode replacement character +// see https://codereview.chromium.org/121173009/ +buf = new Buffer('ab\ud800cd', 'utf8'); +assert.equal(buf[0], 0x61); +assert.equal(buf[1], 0x62); +assert.equal(buf[2], 0xef); +assert.equal(buf[3], 0xbf); +assert.equal(buf[4], 0xbd); +assert.equal(buf[5], 0x63); +assert.equal(buf[6], 0x64); + +// test for buffer overrun +buf = new Buffer([0, 0, 0, 0, 0]); // length: 5 +var sub = buf.slice(0, 4); // length: 4 +written = sub.write('12345', 'binary'); +assert.equal(written, 4); +assert.equal(buf[4], 0); + +// Check for fractional length args, junk length args, etc. +// https://github.com/joyent/node/issues/1758 + +// Call .fill() first, stops valgrind warning about uninitialized memory reads. +Buffer(3.3).fill().toString(); // throws bad argument error in commit 43cb4ec +assert.equal(Buffer(-1).length, 0); +assert.equal(Buffer(NaN).length, 0); +assert.equal(Buffer(3.3).length, 3); +assert.equal(Buffer({length: 3.3}).length, 3); +assert.equal(Buffer({length: 'BAM'}).length, 0); + +// Make sure that strings are not coerced to numbers. +assert.equal(Buffer('99').length, 2); +assert.equal(Buffer('13.37').length, 5); + +// Ensure that the length argument is respected. +'ascii utf8 hex base64 binary'.split(' ').forEach(function(enc) { + assert.equal(Buffer(1).write('aaaaaa', 0, 1, enc), 1); +}); + +// Regression test, guard against buffer overrun in the base64 decoder. +var a = Buffer(3); +var b = Buffer('xxx'); +a.write('aaaaaaaa', 'base64'); +assert.equal(b.toString(), 'xxx'); + +// issue GH-3416 +Buffer(Buffer(0), 0, 0); + +[ 'hex', + 'utf8', + 'utf-8', + 'ascii', + 'binary', + 'base64', + 'ucs2', + 'ucs-2', + 'utf16le', + 'utf-16le' ].forEach(function(enc) { + assert.equal(Buffer.isEncoding(enc), true); + }); + +[ 'utf9', + 'utf-7', + 'Unicode-FTW', + 'new gnu gun' ].forEach(function(enc) { + assert.equal(Buffer.isEncoding(enc), false); + }); + + +// GH-5110 +(function() { + var buffer = new Buffer('test'), + string = JSON.stringify(buffer); + + assert.equal(string, '{"type":"Buffer","data":[116,101,115,116]}'); + + assert.deepEqual(buffer, JSON.parse(string, function(key, value) { + return value && value.type === 'Buffer' + ? new Buffer(value.data) + : value; + })); +})(); + +// issue GH-7849 +(function() { + var buf = new Buffer('test'); + var json = JSON.stringify(buf); + var obj = JSON.parse(json); + var copy = new Buffer(obj); + + assert(buf.equals(copy)); +})(); + +// issue GH-4331 +assert.throws(function() { + new Buffer(0xFFFFFFFF); +}, RangeError); +assert.throws(function() { + new Buffer(0xFFFFFFFFF); +}, RangeError); + + +// attempt to overflow buffers, similar to previous bug in array buffers +assert.throws(function() { + var buf = new Buffer(8); + buf.readFloatLE(0xffffffff); +}, RangeError); + +assert.throws(function() { + var buf = new Buffer(8); + buf.writeFloatLE(0.0, 0xffffffff); +}, RangeError); + +assert.throws(function() { + var buf = new Buffer(8); + buf.readFloatLE(0xffffffff); +}, RangeError); + +assert.throws(function() { + var buf = new Buffer(8); + buf.writeFloatLE(0.0, 0xffffffff); +}, RangeError); + + +// ensure negative values can't get past offset +assert.throws(function() { + var buf = new Buffer(8); + buf.readFloatLE(-1); +}, RangeError); + +assert.throws(function() { + var buf = new Buffer(8); + buf.writeFloatLE(0.0, -1); +}, RangeError); + +assert.throws(function() { + var buf = new Buffer(8); + buf.readFloatLE(-1); +}, RangeError); + +assert.throws(function() { + var buf = new Buffer(8); + buf.writeFloatLE(0.0, -1); +}, RangeError); + +// offset checks +var buf = new Buffer(0); + +assert.throws(function() { buf.readUInt8(0); }, RangeError); +assert.throws(function() { buf.readInt8(0); }, RangeError); + +var buf = new Buffer([0xFF]); + +assert.equal(buf.readUInt8(0), 255); +assert.equal(buf.readInt8(0), -1); + +[16, 32].forEach(function(bits) { + var buf = new Buffer(bits / 8 - 1); + + assert.throws(function() { buf['readUInt' + bits + 'BE'](0); }, + RangeError, + 'readUInt' + bits + 'BE'); + + assert.throws(function() { buf['readUInt' + bits + 'LE'](0); }, + RangeError, + 'readUInt' + bits + 'LE'); + + assert.throws(function() { buf['readInt' + bits + 'BE'](0); }, + RangeError, + 'readInt' + bits + 'BE()'); + + assert.throws(function() { buf['readInt' + bits + 'LE'](0); }, + RangeError, + 'readInt' + bits + 'LE()'); +}); + +[16, 32].forEach(function(bits) { + var buf = new Buffer([0xFF, 0xFF, 0xFF, 0xFF]); + + assert.equal(buf['readUInt' + bits + 'BE'](0), + (0xFFFFFFFF >>> (32 - bits))); + + assert.equal(buf['readUInt' + bits + 'LE'](0), + (0xFFFFFFFF >>> (32 - bits))); + + assert.equal(buf['readInt' + bits + 'BE'](0), + (0xFFFFFFFF >> (32 - bits))); + + assert.equal(buf['readInt' + bits + 'LE'](0), + (0xFFFFFFFF >> (32 - bits))); +}); + +// test for common read(U)IntLE/BE +(function() { + var buf = new Buffer([0x01, 0x02, 0x03, 0x04, 0x05, 0x06]); + + assert.equal(buf.readUIntLE(0, 1), 0x01); + assert.equal(buf.readUIntBE(0, 1), 0x01); + assert.equal(buf.readUIntLE(0, 3), 0x030201); + assert.equal(buf.readUIntBE(0, 3), 0x010203); + assert.equal(buf.readUIntLE(0, 5), 0x0504030201); + assert.equal(buf.readUIntBE(0, 5), 0x0102030405); + assert.equal(buf.readUIntLE(0, 6), 0x060504030201); + assert.equal(buf.readUIntBE(0, 6), 0x010203040506); + assert.equal(buf.readIntLE(0, 1), 0x01); + assert.equal(buf.readIntBE(0, 1), 0x01); + assert.equal(buf.readIntLE(0, 3), 0x030201); + assert.equal(buf.readIntBE(0, 3), 0x010203); + assert.equal(buf.readIntLE(0, 5), 0x0504030201); + assert.equal(buf.readIntBE(0, 5), 0x0102030405); + assert.equal(buf.readIntLE(0, 6), 0x060504030201); + assert.equal(buf.readIntBE(0, 6), 0x010203040506); +})(); + +// test for common write(U)IntLE/BE +(function() { + var buf = new Buffer(3); + buf.writeUIntLE(0x123456, 0, 3); + assert.deepEqual(buf.toJSON().data, [0x56, 0x34, 0x12]); + assert.equal(buf.readUIntLE(0, 3), 0x123456); + + buf = new Buffer(3); + buf.writeUIntBE(0x123456, 0, 3); + assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56]); + assert.equal(buf.readUIntBE(0, 3), 0x123456); + + buf = new Buffer(3); + buf.writeIntLE(0x123456, 0, 3); + assert.deepEqual(buf.toJSON().data, [0x56, 0x34, 0x12]); + assert.equal(buf.readIntLE(0, 3), 0x123456); + + buf = new Buffer(3); + buf.writeIntBE(0x123456, 0, 3); + assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56]); + assert.equal(buf.readIntBE(0, 3), 0x123456); + + buf = new Buffer(3); + buf.writeIntLE(-0x123456, 0, 3); + assert.deepEqual(buf.toJSON().data, [0xaa, 0xcb, 0xed]); + assert.equal(buf.readIntLE(0, 3), -0x123456); + + buf = new Buffer(3); + buf.writeIntBE(-0x123456, 0, 3); + assert.deepEqual(buf.toJSON().data, [0xed, 0xcb, 0xaa]); + assert.equal(buf.readIntBE(0, 3), -0x123456); + + buf = new Buffer(5); + buf.writeUIntLE(0x1234567890, 0, 5); + assert.deepEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]); + assert.equal(buf.readUIntLE(0, 5), 0x1234567890); + + buf = new Buffer(5); + buf.writeUIntBE(0x1234567890, 0, 5); + assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]); + assert.equal(buf.readUIntBE(0, 5), 0x1234567890); + + buf = new Buffer(5); + buf.writeIntLE(0x1234567890, 0, 5); + assert.deepEqual(buf.toJSON().data, [0x90, 0x78, 0x56, 0x34, 0x12]); + assert.equal(buf.readIntLE(0, 5), 0x1234567890); + + buf = new Buffer(5); + buf.writeIntBE(0x1234567890, 0, 5); + assert.deepEqual(buf.toJSON().data, [0x12, 0x34, 0x56, 0x78, 0x90]); + assert.equal(buf.readIntBE(0, 5), 0x1234567890); + + buf = new Buffer(5); + buf.writeIntLE(-0x1234567890, 0, 5); + assert.deepEqual(buf.toJSON().data, [0x70, 0x87, 0xa9, 0xcb, 0xed]); + assert.equal(buf.readIntLE(0, 5), -0x1234567890); + + buf = new Buffer(5); + buf.writeIntBE(-0x1234567890, 0, 5); + assert.deepEqual(buf.toJSON().data, [0xed, 0xcb, 0xa9, 0x87, 0x70]); + assert.equal(buf.readIntBE(0, 5), -0x1234567890); +})(); + +// test Buffer slice +(function() { + var buf = new Buffer('0123456789'); + assert.equal(buf.slice(-10, 10), '0123456789'); + assert.equal(buf.slice(-20, 10), '0123456789'); + assert.equal(buf.slice(-20, -10), ''); + assert.equal(buf.slice(0, -1), '012345678'); + assert.equal(buf.slice(2, -2), '234567'); + assert.equal(buf.slice(0, 65536), '0123456789'); + assert.equal(buf.slice(65536, 0), ''); + for (var i = 0, s = buf.toString(); i < buf.length; ++i) { + assert.equal(buf.slice(-i), s.slice(-i)); + assert.equal(buf.slice(0, -i), s.slice(0, -i)); + } + // try to slice a zero length Buffer + // see https://github.com/joyent/node/issues/5881 + SlowBuffer(0).slice(0, 1); +})(); + +// Regression test for #5482: should throw but not assert in C++ land. +assert.throws(function() { + Buffer('', 'buffer'); +}, TypeError); + +// Regression test for #6111. Constructing a buffer from another buffer +// should a) work, and b) not corrupt the source buffer. +(function() { + var a = [0]; + for (var i = 0; i < 7; ++i) a = a.concat(a); + a = a.map(function(_, i) { return i; }); + var b = Buffer(a); + var c = Buffer(b); + assert.equal(b.length, a.length); + assert.equal(c.length, a.length); + for (var i = 0, k = a.length; i < k; ++i) { + assert.equal(a[i], i); + assert.equal(b[i], i); + assert.equal(c[i], i); + } +})(); + + +assert.throws(function() { + new Buffer((-1 >>> 0) + 1); +}, RangeError); + +assert.throws(function() { + new SlowBuffer((-1 >>> 0) + 1); +}, RangeError); + +if (common.hasCrypto) { + // Test truncation after decode + // var crypto = require('crypto'); + + var b1 = new Buffer('YW55=======', 'base64'); + var b2 = new Buffer('YW55', 'base64'); + + assert.equal( + 1 /*crypto.createHash('sha1').update(b1).digest('hex')*/, + 1 /*crypto.createHash('sha1').update(b2).digest('hex')*/ + ); +} else { +// console.log('1..0 # Skipped: missing crypto'); +} + +// Test Compare +var b = new Buffer(1).fill('a'); +var c = new Buffer(1).fill('c'); +var d = new Buffer(2).fill('aa'); + +assert.equal(b.compare(c), -1); +assert.equal(c.compare(d), 1); +assert.equal(d.compare(b), 1); +assert.equal(b.compare(d), -1); +assert.equal(b.compare(b), 0); + +assert.equal(Buffer.compare(b, c), -1); +assert.equal(Buffer.compare(c, d), 1); +assert.equal(Buffer.compare(d, b), 1); +assert.equal(Buffer.compare(b, d), -1); +assert.equal(Buffer.compare(c, c), 0); + + +assert.throws(function() { + var b = new Buffer(1); + Buffer.compare(b, 'abc'); +}); + +assert.throws(function() { + var b = new Buffer(1); + Buffer.compare('abc', b); +}); + +assert.throws(function() { + var b = new Buffer(1); + b.compare('abc'); +}); + +// Test Equals +var b = new Buffer(5).fill('abcdf'); +var c = new Buffer(5).fill('abcdf'); +var d = new Buffer(5).fill('abcde'); +var e = new Buffer(6).fill('abcdef'); + +assert.ok(b.equals(c)); +assert.ok(!c.equals(d)); +assert.ok(!d.equals(e)); +assert.ok(d.equals(d)); + +assert.throws(function() { + var b = new Buffer(1); + b.equals('abc'); +}); + +// Regression test for https://github.com/nodejs/io.js/issues/649. +assert.throws(function() { Buffer(1422561062959).toString('utf8'); }); + +var ps = Buffer.poolSize; +Buffer.poolSize = 0; +assert.equal(Buffer(1).parent, undefined); +Buffer.poolSize = ps; + +// Test Buffer.copy() segfault +assert.throws(function() { + Buffer(10).copy(); +}); + +assert.throws(function() { + new Buffer(); +}, /must start with number, buffer, array or string/); + +assert.throws(function() { + new Buffer(null); +}, /must start with number, buffer, array or string/); + diff --git a/node_modules/buffer/test/slice.js b/node_modules/buffer/test/slice.js new file mode 100644 index 0000000..25c111c --- /dev/null +++ b/node_modules/buffer/test/slice.js @@ -0,0 +1,37 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('modifying buffer created by .slice() modifies original memory', function (t) { + if (!B.TYPED_ARRAY_SUPPORT) return t.end() + + var buf1 = new B(26) + for (var i = 0; i < 26; i++) { + buf1[i] = i + 97 // 97 is ASCII a + } + + var buf2 = buf1.slice(0, 3) + t.equal(buf2.toString('ascii', 0, buf2.length), 'abc') + + buf2[0] = '!'.charCodeAt(0) + t.equal(buf1.toString('ascii', 0, buf2.length), '!bc') + + t.end() +}) + +test('modifying parent buffer modifies .slice() buffer\'s memory', function (t) { + if (!B.TYPED_ARRAY_SUPPORT) return t.end() + + var buf1 = new B(26) + for (var i = 0; i < 26; i++) { + buf1[i] = i + 97 // 97 is ASCII a + } + + var buf2 = buf1.slice(0, 3) + t.equal(buf2.toString('ascii', 0, buf2.length), 'abc') + + buf1[0] = '!'.charCodeAt(0) + t.equal(buf2.toString('ascii', 0, buf2.length), '!bc') + + t.end() +}) diff --git a/node_modules/buffer/test/static.js b/node_modules/buffer/test/static.js new file mode 100644 index 0000000..68faa00 --- /dev/null +++ b/node_modules/buffer/test/static.js @@ -0,0 +1,31 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('Buffer.isEncoding', function (t) { + t.equal(B.isEncoding('HEX'), true) + t.equal(B.isEncoding('hex'), true) + t.equal(B.isEncoding('bad'), false) + t.end() +}) + +test('Buffer.isBuffer', function (t) { + t.equal(B.isBuffer(new B('hey', 'utf8')), true) + t.equal(B.isBuffer(new B([1, 2, 3], 'utf8')), true) + t.equal(B.isBuffer('hey'), false) + t.end() +}) + +test('Buffer.toArrayBuffer', function (t) { + var data = [1, 2, 3, 4, 5, 6, 7, 8] + if (typeof Uint8Array !== 'undefined') { + var result = new B(data).toArrayBuffer() + var expected = new Uint8Array(data).buffer + for (var i = 0; i < expected.byteLength; i++) { + t.equal(result[i], expected[i]) + } + } else { + t.pass('No toArrayBuffer() method provided in old browsers') + } + t.end() +}) diff --git a/node_modules/buffer/test/to-string.js b/node_modules/buffer/test/to-string.js new file mode 100644 index 0000000..2950d4d --- /dev/null +++ b/node_modules/buffer/test/to-string.js @@ -0,0 +1,233 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') + +test('utf8 buffer to base64', function (t) { + t.equal( + new B('Ձאab', 'utf8').toString('base64'), + '1YHXkGFi' + ) + t.end() +}) + +test('utf8 buffer to hex', function (t) { + t.equal( + new B('Ձאab', 'utf8').toString('hex'), + 'd581d7906162' + ) + t.end() +}) + +test('utf8 to utf8', function (t) { + t.equal( + new B('öäüõÖÄÜÕ', 'utf8').toString('utf8'), + 'öäüõÖÄÜÕ' + ) + t.end() +}) + +test('utf16le to utf16', function (t) { + t.equal( + new B(new B('abcd', 'utf8').toString('utf16le'), 'utf16le').toString('utf8'), + 'abcd' + ) + t.end() +}) + +test('utf16le to hex', function (t) { + t.equal( + new B('abcd', 'utf16le').toString('hex'), + '6100620063006400' + ) + t.end() +}) + +test('ascii buffer to base64', function (t) { + t.equal( + new B('123456!@#$%^', 'ascii').toString('base64'), + 'MTIzNDU2IUAjJCVe' + ) + t.end() +}) + +test('ascii buffer to hex', function (t) { + t.equal( + new B('123456!@#$%^', 'ascii').toString('hex'), + '31323334353621402324255e' + ) + t.end() +}) + +test('base64 buffer to utf8', function (t) { + t.equal( + new B('1YHXkGFi', 'base64').toString('utf8'), + 'Ձאab' + ) + t.end() +}) + +test('hex buffer to utf8', function (t) { + t.equal( + new B('d581d7906162', 'hex').toString('utf8'), + 'Ձאab' + ) + t.end() +}) + +test('base64 buffer to ascii', function (t) { + t.equal( + new B('MTIzNDU2IUAjJCVe', 'base64').toString('ascii'), + '123456!@#$%^' + ) + t.end() +}) + +test('hex buffer to ascii', function (t) { + t.equal( + new B('31323334353621402324255e', 'hex').toString('ascii'), + '123456!@#$%^' + ) + t.end() +}) + +test('base64 buffer to binary', function (t) { + t.equal( + new B('MTIzNDU2IUAjJCVe', 'base64').toString('binary'), + '123456!@#$%^' + ) + t.end() +}) + +test('hex buffer to binary', function (t) { + t.equal( + new B('31323334353621402324255e', 'hex').toString('binary'), + '123456!@#$%^' + ) + t.end() +}) + +test('utf8 to binary', function (t) { + /* jshint -W100 */ + t.equal( + new B('öäüõÖÄÜÕ', 'utf8').toString('binary'), + 'öäüõÖÄÜÕ' + ) + /* jshint +W100 */ + t.end() +}) + +test('utf8 replacement chars (1 byte sequence)', function (t) { + t.equal( + new B([ 0x80 ]).toString(), + '\uFFFD' + ) + t.equal( + new B([ 0x7F ]).toString(), + '\u007F' + ) + t.end() +}) + +test('utf8 replacement chars (2 byte sequences)', function (t) { + t.equal( + new B([ 0xC7 ]).toString(), + '\uFFFD' + ) + t.equal( + new B([ 0xC7, 0xB1 ]).toString(), + '\u01F1' + ) + t.equal( + new B([ 0xC0, 0xB1 ]).toString(), + '\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xC1, 0xB1 ]).toString(), + '\uFFFD\uFFFD' + ) + t.end() +}) + +test('utf8 replacement chars (3 byte sequences)', function (t) { + t.equal( + new B([ 0xE0 ]).toString(), + '\uFFFD' + ) + t.equal( + new B([ 0xE0, 0xAC ]).toString(), + '\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xE0, 0xAC, 0xB9 ]).toString(), + '\u0B39' + ) + t.end() +}) + +test('utf8 replacement chars (4 byte sequences)', function (t) { + t.equal( + new B([ 0xF4 ]).toString(), + '\uFFFD' + ) + t.equal( + new B([ 0xF4, 0x8F ]).toString(), + '\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xF4, 0x8F, 0x80 ]).toString(), + '\uFFFD\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xF4, 0x8F, 0x80, 0x84 ]).toString(), + '\uDBFC\uDC04' + ) + t.equal( + new B([ 0xFF ]).toString(), + '\uFFFD' + ) + t.equal( + new B([ 0xFF, 0x8F, 0x80, 0x84 ]).toString(), + '\uFFFD\uFFFD\uFFFD\uFFFD' + ) + t.end() +}) + +test('utf8 replacement chars on 256 random bytes', function (t) { + t.equal( + new B([ 152, 130, 206, 23, 243, 238, 197, 44, 27, 86, 208, 36, 163, 184, 164, 21, 94, 242, 178, 46, 25, 26, 253, 178, 72, 147, 207, 112, 236, 68, 179, 190, 29, 83, 239, 147, 125, 55, 143, 19, 157, 68, 157, 58, 212, 224, 150, 39, 128, 24, 94, 225, 120, 121, 75, 192, 112, 19, 184, 142, 203, 36, 43, 85, 26, 147, 227, 139, 242, 186, 57, 78, 11, 102, 136, 117, 180, 210, 241, 92, 3, 215, 54, 167, 249, 1, 44, 225, 146, 86, 2, 42, 68, 21, 47, 238, 204, 153, 216, 252, 183, 66, 222, 255, 15, 202, 16, 51, 134, 1, 17, 19, 209, 76, 238, 38, 76, 19, 7, 103, 249, 5, 107, 137, 64, 62, 170, 57, 16, 85, 179, 193, 97, 86, 166, 196, 36, 148, 138, 193, 210, 69, 187, 38, 242, 97, 195, 219, 252, 244, 38, 1, 197, 18, 31, 246, 53, 47, 134, 52, 105, 72, 43, 239, 128, 203, 73, 93, 199, 75, 222, 220, 166, 34, 63, 236, 11, 212, 76, 243, 171, 110, 78, 39, 205, 204, 6, 177, 233, 212, 243, 0, 33, 41, 122, 118, 92, 252, 0, 157, 108, 120, 70, 137, 100, 223, 243, 171, 232, 66, 126, 111, 142, 33, 3, 39, 117, 27, 107, 54, 1, 217, 227, 132, 13, 166, 3, 73, 53, 127, 225, 236, 134, 219, 98, 214, 125, 148, 24, 64, 142, 111, 231, 194, 42, 150, 185, 10, 182, 163, 244, 19, 4, 59, 135, 16 ]).toString(), + '\uFFFD\uFFFD\uFFFD\u0017\uFFFD\uFFFD\uFFFD\u002C\u001B\u0056\uFFFD\u0024\uFFFD\uFFFD\uFFFD\u0015\u005E\uFFFD\uFFFD\u002E\u0019\u001A\uFFFD\uFFFD\u0048\uFFFD\uFFFD\u0070\uFFFD\u0044\uFFFD\uFFFD\u001D\u0053\uFFFD\uFFFD\u007D\u0037\uFFFD\u0013\uFFFD\u0044\uFFFD\u003A\uFFFD\uFFFD\uFFFD\u0027\uFFFD\u0018\u005E\uFFFD\u0078\u0079\u004B\uFFFD\u0070\u0013\uFFFD\uFFFD\uFFFD\u0024\u002B\u0055\u001A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0039\u004E\u000B\u0066\uFFFD\u0075\uFFFD\uFFFD\uFFFD\u005C\u0003\uFFFD\u0036\uFFFD\uFFFD\u0001\u002C\uFFFD\uFFFD\u0056\u0002\u002A\u0044\u0015\u002F\uFFFD\u0319\uFFFD\uFFFD\uFFFD\u0042\uFFFD\uFFFD\u000F\uFFFD\u0010\u0033\uFFFD\u0001\u0011\u0013\uFFFD\u004C\uFFFD\u0026\u004C\u0013\u0007\u0067\uFFFD\u0005\u006B\uFFFD\u0040\u003E\uFFFD\u0039\u0010\u0055\uFFFD\uFFFD\u0061\u0056\uFFFD\uFFFD\u0024\uFFFD\uFFFD\uFFFD\uFFFD\u0045\uFFFD\u0026\uFFFD\u0061\uFFFD\uFFFD\uFFFD\uFFFD\u0026\u0001\uFFFD\u0012\u001F\uFFFD\u0035\u002F\uFFFD\u0034\u0069\u0048\u002B\uFFFD\uFFFD\uFFFD\u0049\u005D\uFFFD\u004B\uFFFD\u0726\u0022\u003F\uFFFD\u000B\uFFFD\u004C\uFFFD\uFFFD\u006E\u004E\u0027\uFFFD\uFFFD\u0006\uFFFD\uFFFD\uFFFD\uFFFD\u0000\u0021\u0029\u007A\u0076\u005C\uFFFD\u0000\uFFFD\u006C\u0078\u0046\uFFFD\u0064\uFFFD\uFFFD\uFFFD\uFFFD\u0042\u007E\u006F\uFFFD\u0021\u0003\u0027\u0075\u001B\u006B\u0036\u0001\uFFFD\uFFFD\uFFFD\u000D\uFFFD\u0003\u0049\u0035\u007F\uFFFD\uFFFD\uFFFD\uFFFD\u0062\uFFFD\u007D\uFFFD\u0018\u0040\uFFFD\u006F\uFFFD\uFFFD\u002A\uFFFD\uFFFD\u000A\uFFFD\uFFFD\uFFFD\u0013\u0004\u003B\uFFFD\u0010' + ) + t.end() +}) + +test('utf8 replacement chars for anything in the surrogate pair range', function (t) { + t.equal( + new B([ 0xED, 0x9F, 0xBF ]).toString(), + '\uD7FF' + ) + t.equal( + new B([ 0xED, 0xA0, 0x80 ]).toString(), + '\uFFFD\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xED, 0xBE, 0x8B ]).toString(), + '\uFFFD\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xED, 0xBF, 0xBF ]).toString(), + '\uFFFD\uFFFD\uFFFD' + ) + t.equal( + new B([ 0xEE, 0x80, 0x80 ]).toString(), + '\uE000' + ) + t.end() +}) + +test('utf8 don\'t replace the replacement char', function (t) { + t.equal( + new B('\uFFFD').toString(), + '\uFFFD' + ) + t.end() +}) diff --git a/node_modules/buffer/test/write.js b/node_modules/buffer/test/write.js new file mode 100644 index 0000000..4039d19 --- /dev/null +++ b/node_modules/buffer/test/write.js @@ -0,0 +1,131 @@ +if (process.env.OBJECT_IMPL) global.TYPED_ARRAY_SUPPORT = false +var B = require('../').Buffer +var test = require('tape') +var isnan = require('is-nan') + +test('buffer.write string should get parsed as number', function (t) { + var b = new B(64) + b.writeUInt16LE('1003', 0) + t.equal(b.readUInt16LE(0), 1003) + t.end() +}) + +test('buffer.writeUInt8 a fractional number will get Math.floored', function (t) { + // Some extra work is necessary to make this test pass with the Object implementation + + var b = new B(1) + b.writeInt8(5.5, 0) + t.equal(b[0], 5) + t.end() +}) + +test('writeUint8 with a negative number throws', function (t) { + var buf = new B(1) + + t.throws(function () { + buf.writeUInt8(-3, 0) + }) + + t.end() +}) + +test('hex of write{Uint,Int}{8,16,32}{LE,BE}', function (t) { + t.plan(2 * (2 * 2 * 2 + 2)) + var hex = [ + '03', '0300', '0003', '03000000', '00000003', + 'fd', 'fdff', 'fffd', 'fdffffff', 'fffffffd' + ] + var reads = [ 3, 3, 3, 3, 3, -3, -3, -3, -3, -3 ] + var xs = ['UInt', 'Int'] + var ys = [8, 16, 32] + for (var i = 0; i < xs.length; i++) { + var x = xs[i] + for (var j = 0; j < ys.length; j++) { + var y = ys[j] + var endianesses = (y === 8) ? [''] : ['LE', 'BE'] + for (var k = 0; k < endianesses.length; k++) { + var z = endianesses[k] + + var v1 = new B(y / 8) + var writefn = 'write' + x + y + z + var val = (x === 'Int') ? -3 : 3 + v1[writefn](val, 0) + t.equal( + v1.toString('hex'), + hex.shift() + ) + var readfn = 'read' + x + y + z + t.equal( + v1[readfn](0), + reads.shift() + ) + } + } + } + t.end() +}) + +test('hex of write{Uint,Int}{8,16,32}{LE,BE} with overflow', function (t) { + if (!B.TYPED_ARRAY_SUPPORT) { + t.pass('object impl: skipping overflow test') + t.end() + return + } + + t.plan(3 * (2 * 2 * 2 + 2)) + var hex = [ + '', '03', '00', '030000', '000000', + '', 'fd', 'ff', 'fdffff', 'ffffff' + ] + var reads = [ + undefined, 3, 0, NaN, 0, + undefined, 253, -256, 16777213, -256 + ] + var xs = ['UInt', 'Int'] + var ys = [8, 16, 32] + for (var i = 0; i < xs.length; i++) { + var x = xs[i] + for (var j = 0; j < ys.length; j++) { + var y = ys[j] + var endianesses = (y === 8) ? [''] : ['LE', 'BE'] + for (var k = 0; k < endianesses.length; k++) { + var z = endianesses[k] + + var v1 = new B(y / 8 - 1) + var next = new B(4) + next.writeUInt32BE(0, 0) + var writefn = 'write' + x + y + z + var val = (x === 'Int') ? -3 : 3 + v1[writefn](val, 0, true) + t.equal( + v1.toString('hex'), + hex.shift() + ) + // check that nothing leaked to next buffer. + t.equal(next.readUInt32BE(0), 0) + // check that no bytes are read from next buffer. + next.writeInt32BE(~0, 0) + var readfn = 'read' + x + y + z + var r = reads.shift() + if (isnan(r)) t.pass('equal') + else t.equal(v1[readfn](0, true), r) + } + } + } + t.end() +}) +test('large values do not imporoperly roll over (ref #80)', function (t) { + var nums = [-25589992, -633756690, -898146932] + var out = new B(12) + out.fill(0) + out.writeInt32BE(nums[0], 0) + var newNum = out.readInt32BE(0) + t.equal(nums[0], newNum) + out.writeInt32BE(nums[1], 4) + newNum = out.readInt32BE(4) + t.equal(nums[1], newNum) + out.writeInt32BE(nums[2], 8) + newNum = out.readInt32BE(8) + t.equal(nums[2], newNum) + t.end() +}) diff --git a/node_modules/builtins/.travis.yml b/node_modules/builtins/.travis.yml new file mode 100644 index 0000000..cc4dba2 --- /dev/null +++ b/node_modules/builtins/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/node_modules/builtins/History.md b/node_modules/builtins/History.md new file mode 100644 index 0000000..0eb45c4 --- /dev/null +++ b/node_modules/builtins/History.md @@ -0,0 +1,39 @@ + +0.0.7 / 2014-09-01 +================== + + * update .repository + +0.0.6 / 2014-09-01 +================== + + * add travis + * add test script + * add constants + +0.0.5 / 2014-06-27 +================== + + * add module + * publish to public npm + +0.0.4 / 2014-04-25 +================== + + * add timers + +0.0.3 / 2014-02-22 +================== + + * add buffer + +0.0.2 / 2014-02-11 +================== + + * add assert + +0.0.1 / 2014-02-11 +================== + + * add main + * initial commit diff --git a/node_modules/builtins/Readme.md b/node_modules/builtins/Readme.md new file mode 100644 index 0000000..96f4b1f --- /dev/null +++ b/node_modules/builtins/Readme.md @@ -0,0 +1,18 @@ + +# builtins + + List of node.js [builtin modules](http://nodejs.org/api/). + + [![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins) + +## Example + +```js +var builtins = require('builtins'); + +assert(builtins.indexOf('http') > -1); +``` + +## License + + MIT diff --git a/node_modules/builtins/builtins.json b/node_modules/builtins/builtins.json new file mode 100644 index 0000000..c52221d --- /dev/null +++ b/node_modules/builtins/builtins.json @@ -0,0 +1,31 @@ +[ + "assert", + "buffer", + "child_process", + "cluster", + "constants", + "crypto", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "module", + "net", + "os", + "path", + "punycode", + "querystring", + "repl", + "stream", + "string_decoder", + "timers", + "tls", + "tty", + "dgram", + "url", + "util", + "vm", + "zlib" +] diff --git a/node_modules/builtins/package.json b/node_modules/builtins/package.json new file mode 100644 index 0000000..8fdaa3b --- /dev/null +++ b/node_modules/builtins/package.json @@ -0,0 +1,14 @@ +{ + "name": "builtins", + "version": "0.0.7", + "description": "List of node.js builtin modules", + "repository": "juliangruber/builtins", + "license": "MIT", + "main": "builtins.json", + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "scripts": { + "test": "node -e \"require('./builtins.json')\"" + } +} \ No newline at end of file diff --git a/node_modules/bytes/History.md b/node_modules/bytes/History.md new file mode 100644 index 0000000..d60ce0e --- /dev/null +++ b/node_modules/bytes/History.md @@ -0,0 +1,97 @@ +3.1.2 / 2022-01-27 +================== + + * Fix return value for un-parsable strings + +3.1.1 / 2021-11-15 +================== + + * Fix "thousandsSeparator" incorrecting formatting fractional part + +3.1.0 / 2019-01-22 +================== + + * Add petabyte (`pb`) support + +3.0.0 / 2017-08-31 +================== + + * Change "kB" to "KB" in format output + * Remove support for Node.js 0.6 + * Remove support for ComponentJS + +2.5.0 / 2017-03-24 +================== + + * Add option "unit" + +2.4.0 / 2016-06-01 +================== + + * Add option "unitSeparator" + +2.3.0 / 2016-02-15 +================== + + * Drop partial bytes on all parsed units + * Fix non-finite numbers to `.format` to return `null` + * Fix parsing byte string that looks like hex + * perf: hoist regular expressions + +2.2.0 / 2015-11-13 +================== + + * add option "decimalPlaces" + * add option "fixedDecimals" + +2.1.0 / 2015-05-21 +================== + + * add `.format` export + * add `.parse` export + +2.0.2 / 2015-05-20 +================== + + * remove map recreation + * remove unnecessary object construction + +2.0.1 / 2015-05-07 +================== + + * fix browserify require + * remove node.extend dependency + +2.0.0 / 2015-04-12 +================== + + * add option "case" + * add option "thousandsSeparator" + * return "null" on invalid parse input + * support proper round-trip: bytes(bytes(num)) === num + * units no longer case sensitive when parsing + +1.0.0 / 2014-05-05 +================== + + * add negative support. fixes #6 + +0.3.0 / 2014-03-19 +================== + + * added terabyte support + +0.2.1 / 2013-04-01 +================== + + * add .component + +0.2.0 / 2012-10-28 +================== + + * bytes(200).should.eql('200b') + +0.1.0 / 2012-07-04 +================== + + * add bytes to string conversion [yields] diff --git a/node_modules/bytes/LICENSE b/node_modules/bytes/LICENSE new file mode 100644 index 0000000..63e95a9 --- /dev/null +++ b/node_modules/bytes/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2012-2014 TJ Holowaychuk +Copyright (c) 2015 Jed Watson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bytes/Readme.md b/node_modules/bytes/Readme.md new file mode 100644 index 0000000..5790e23 --- /dev/null +++ b/node_modules/bytes/Readme.md @@ -0,0 +1,152 @@ +# Bytes utility + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Build Status][ci-image]][ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```bash +$ npm install bytes +``` + +## Usage + +```js +var bytes = require('bytes'); +``` + +#### bytes(number|string value, [options]): number|string|null + +Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`. + +**Arguments** + +| Name | Type | Description | +|---------|----------|--------------------| +| value | `number`|`string` | Number value to format or string value to parse | +| options | `Object` | Conversion options for `format` | + +**Returns** + +| Name | Type | Description | +|---------|------------------|-------------------------------------------------| +| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. | + +**Example** + +```js +bytes(1024); +// output: '1KB' + +bytes('1KB'); +// output: 1024 +``` + +#### bytes.format(number value, [options]): string|null + +Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is + rounded. + +**Arguments** + +| Name | Type | Description | +|---------|----------|--------------------| +| value | `number` | Value in bytes | +| options | `Object` | Conversion options | + +**Options** + +| Property | Type | Description | +|-------------------|--------|-----------------------------------------------------------------------------------------| +| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. | +| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` | +| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. | +| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). | +| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. | + +**Returns** + +| Name | Type | Description | +|---------|------------------|-------------------------------------------------| +| results | `string`|`null` | Return null upon error. String value otherwise. | + +**Example** + +```js +bytes.format(1024); +// output: '1KB' + +bytes.format(1000); +// output: '1000B' + +bytes.format(1000, {thousandsSeparator: ' '}); +// output: '1 000B' + +bytes.format(1024 * 1.7, {decimalPlaces: 0}); +// output: '2KB' + +bytes.format(1024, {unitSeparator: ' '}); +// output: '1 KB' +``` + +#### bytes.parse(string|number value): number|null + +Parse the string value into an integer in bytes. If no unit is given, or `value` +is a number, it is assumed the value is in bytes. + +Supported units and abbreviations are as follows and are case-insensitive: + + * `b` for bytes + * `kb` for kilobytes + * `mb` for megabytes + * `gb` for gigabytes + * `tb` for terabytes + * `pb` for petabytes + +The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. + +**Arguments** + +| Name | Type | Description | +|---------------|--------|--------------------| +| value | `string`|`number` | String to parse, or number in bytes. | + +**Returns** + +| Name | Type | Description | +|---------|-------------|-------------------------| +| results | `number`|`null` | Return null upon error. Value in bytes otherwise. | + +**Example** + +```js +bytes.parse('1KB'); +// output: 1024 + +bytes.parse('1024'); +// output: 1024 + +bytes.parse(1024); +// output: 1024 +``` + +## License + +[MIT](LICENSE) + +[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci +[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci +[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master +[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master +[downloads-image]: https://badgen.net/npm/dm/bytes +[downloads-url]: https://npmjs.org/package/bytes +[npm-image]: https://badgen.net/npm/v/bytes +[npm-url]: https://npmjs.org/package/bytes diff --git a/node_modules/bytes/index.js b/node_modules/bytes/index.js new file mode 100644 index 0000000..6f2d0f8 --- /dev/null +++ b/node_modules/bytes/index.js @@ -0,0 +1,170 @@ +/*! + * bytes + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015 Jed Watson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = bytes; +module.exports.format = format; +module.exports.parse = parse; + +/** + * Module variables. + * @private + */ + +var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; + +var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; + +var map = { + b: 1, + kb: 1 << 10, + mb: 1 << 20, + gb: 1 << 30, + tb: Math.pow(1024, 4), + pb: Math.pow(1024, 5), +}; + +var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; + +/** + * Convert the given value in bytes into a string or parse to string to an integer in bytes. + * + * @param {string|number} value + * @param {{ + * case: [string], + * decimalPlaces: [number] + * fixedDecimals: [boolean] + * thousandsSeparator: [string] + * unitSeparator: [string] + * }} [options] bytes options. + * + * @returns {string|number|null} + */ + +function bytes(value, options) { + if (typeof value === 'string') { + return parse(value); + } + + if (typeof value === 'number') { + return format(value, options); + } + + return null; +} + +/** + * Format the given value in bytes into a string. + * + * If the value is negative, it is kept as such. If it is a float, + * it is rounded. + * + * @param {number} value + * @param {object} [options] + * @param {number} [options.decimalPlaces=2] + * @param {number} [options.fixedDecimals=false] + * @param {string} [options.thousandsSeparator=] + * @param {string} [options.unit=] + * @param {string} [options.unitSeparator=] + * + * @returns {string|null} + * @public + */ + +function format(value, options) { + if (!Number.isFinite(value)) { + return null; + } + + var mag = Math.abs(value); + var thousandsSeparator = (options && options.thousandsSeparator) || ''; + var unitSeparator = (options && options.unitSeparator) || ''; + var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; + var fixedDecimals = Boolean(options && options.fixedDecimals); + var unit = (options && options.unit) || ''; + + if (!unit || !map[unit.toLowerCase()]) { + if (mag >= map.pb) { + unit = 'PB'; + } else if (mag >= map.tb) { + unit = 'TB'; + } else if (mag >= map.gb) { + unit = 'GB'; + } else if (mag >= map.mb) { + unit = 'MB'; + } else if (mag >= map.kb) { + unit = 'KB'; + } else { + unit = 'B'; + } + } + + var val = value / map[unit.toLowerCase()]; + var str = val.toFixed(decimalPlaces); + + if (!fixedDecimals) { + str = str.replace(formatDecimalsRegExp, '$1'); + } + + if (thousandsSeparator) { + str = str.split('.').map(function (s, i) { + return i === 0 + ? s.replace(formatThousandsRegExp, thousandsSeparator) + : s + }).join('.'); + } + + return str + unitSeparator + unit; +} + +/** + * Parse the string value into an integer in bytes. + * + * If no unit is given, it is assumed the value is in bytes. + * + * @param {number|string} val + * + * @returns {number|null} + * @public + */ + +function parse(val) { + if (typeof val === 'number' && !isNaN(val)) { + return val; + } + + if (typeof val !== 'string') { + return null; + } + + // Test if the string passed is valid + var results = parseRegExp.exec(val); + var floatValue; + var unit = 'b'; + + if (!results) { + // Nothing could be extracted from the given string + floatValue = parseInt(val, 10); + unit = 'b' + } else { + // Retrieve the value and the unit + floatValue = parseFloat(results[1]); + unit = results[4].toLowerCase(); + } + + if (isNaN(floatValue)) { + return null; + } + + return Math.floor(map[unit] * floatValue); +} diff --git a/node_modules/bytes/package.json b/node_modules/bytes/package.json new file mode 100644 index 0000000..f2b6a8b --- /dev/null +++ b/node_modules/bytes/package.json @@ -0,0 +1,42 @@ +{ + "name": "bytes", + "description": "Utility to parse a string bytes to bytes and vice-versa", + "version": "3.1.2", + "author": "TJ Holowaychuk (http://tjholowaychuk.com)", + "contributors": [ + "Jed Watson ", + "Théo FIDRY " + ], + "license": "MIT", + "keywords": [ + "byte", + "bytes", + "utility", + "parse", + "parser", + "convert", + "converter" + ], + "repository": "visionmedia/bytes.js", + "devDependencies": { + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "files": [ + "History.md", + "LICENSE", + "Readme.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "lint": "eslint .", + "test": "mocha --check-leaks --reporter spec", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test" + } +} diff --git a/node_modules/call-bind/.eslintignore b/node_modules/call-bind/.eslintignore new file mode 100644 index 0000000..404abb2 --- /dev/null +++ b/node_modules/call-bind/.eslintignore @@ -0,0 +1 @@ +coverage/ diff --git a/node_modules/call-bind/.eslintrc b/node_modules/call-bind/.eslintrc new file mode 100644 index 0000000..dfa9a6c --- /dev/null +++ b/node_modules/call-bind/.eslintrc @@ -0,0 +1,16 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "func-name-matching": 0, + "id-length": 0, + "new-cap": [2, { + "capIsNewExceptions": [ + "GetIntrinsic", + ], + }], + "no-magic-numbers": 0, + }, +} diff --git a/node_modules/call-bind/.github/FUNDING.yml b/node_modules/call-bind/.github/FUNDING.yml new file mode 100644 index 0000000..c70c2ec --- /dev/null +++ b/node_modules/call-bind/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/call-bind +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bind/.nycrc b/node_modules/call-bind/.nycrc new file mode 100644 index 0000000..bdd626c --- /dev/null +++ b/node_modules/call-bind/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/node_modules/call-bind/CHANGELOG.md b/node_modules/call-bind/CHANGELOG.md new file mode 100644 index 0000000..c653f70 --- /dev/null +++ b/node_modules/call-bind/CHANGELOG.md @@ -0,0 +1,93 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.7](https://github.com/ljharb/call-bind/compare/v1.0.6...v1.0.7) - 2024-02-12 + +### Commits + +- [Refactor] use `es-define-property` [`09b76a0`](https://github.com/ljharb/call-bind/commit/09b76a01634440461d44a80c9924ec4b500f3b03) +- [Deps] update `get-intrinsic`, `set-function-length` [`ad5136d`](https://github.com/ljharb/call-bind/commit/ad5136ddda2a45c590959829ad3dce0c9f4e3590) + +## [v1.0.6](https://github.com/ljharb/call-bind/compare/v1.0.5...v1.0.6) - 2024-02-05 + +### Commits + +- [Dev Deps] update `aud`, `npmignore`, `tape` [`d564d5c`](https://github.com/ljharb/call-bind/commit/d564d5ce3e06a19df4d499c77f8d1a9da44e77aa) +- [Deps] update `get-intrinsic`, `set-function-length` [`cfc2bdc`](https://github.com/ljharb/call-bind/commit/cfc2bdca7b633df0e0e689e6b637f668f1c6792e) +- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`64cd289`](https://github.com/ljharb/call-bind/commit/64cd289ae5862c250a4ca80aa8d461047c166af5) +- [meta] add missing `engines.node` [`32a4038`](https://github.com/ljharb/call-bind/commit/32a4038857b62179f7f9b7b3df2c5260036be582) + +## [v1.0.5](https://github.com/ljharb/call-bind/compare/v1.0.4...v1.0.5) - 2023-10-19 + +### Commits + +- [Fix] throw an error on non-functions as early as possible [`f262408`](https://github.com/ljharb/call-bind/commit/f262408f822c840fbc268080f3ad7c429611066d) +- [Deps] update `set-function-length` [`3fff271`](https://github.com/ljharb/call-bind/commit/3fff27145a1e3a76a5b74f1d7c3c43d0fa3b9871) + +## [v1.0.4](https://github.com/ljharb/call-bind/compare/v1.0.3...v1.0.4) - 2023-10-19 + +## [v1.0.3](https://github.com/ljharb/call-bind/compare/v1.0.2...v1.0.3) - 2023-10-19 + +### Commits + +- [actions] reuse common workflows [`a994df6`](https://github.com/ljharb/call-bind/commit/a994df69f401f4bf735a4ccd77029b85d1549453) +- [meta] use `npmignore` to autogenerate an npmignore file [`eef3ef2`](https://github.com/ljharb/call-bind/commit/eef3ef21e1f002790837fedb8af2679c761fbdf5) +- [readme] flesh out content [`1845ccf`](https://github.com/ljharb/call-bind/commit/1845ccfd9976a607884cfc7157c93192cc16cf22) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`5b47d53`](https://github.com/ljharb/call-bind/commit/5b47d53d2fd74af5ea0a44f1d51e503cd42f7a90) +- [Refactor] use `set-function-length` [`a0e165c`](https://github.com/ljharb/call-bind/commit/a0e165c5dc61db781cbc919b586b1c2b8da0b150) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`9c50103`](https://github.com/ljharb/call-bind/commit/9c50103f44137279a817317cf6cc421a658f85b4) +- [meta] simplify "exports" [`019c6d0`](https://github.com/ljharb/call-bind/commit/019c6d06b0e1246ceed8e579f57e44441cbbf6d9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `safe-publish-latest`, `tape` [`23bd718`](https://github.com/ljharb/call-bind/commit/23bd718a288d3b03042062b4ef5153b3cea83f11) +- [actions] update codecov uploader [`62552d7`](https://github.com/ljharb/call-bind/commit/62552d79cc79e05825e99aaba134ae5b37f33da5) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`ec81665`](https://github.com/ljharb/call-bind/commit/ec81665b300f87eabff597afdc8b8092adfa7afd) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`35d67fc`](https://github.com/ljharb/call-bind/commit/35d67fcea883e686650f736f61da5ddca2592de8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`0266d8d`](https://github.com/ljharb/call-bind/commit/0266d8d2a45086a922db366d0c2932fa463662ff) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`43a5b28`](https://github.com/ljharb/call-bind/commit/43a5b28a444e710e1bbf92adb8afb5cf7523a223) +- [Deps] update `define-data-property`, `function-bind`, `get-intrinsic` [`780eb36`](https://github.com/ljharb/call-bind/commit/780eb36552514f8cc99c70821ce698697c2726a5) +- [Dev Deps] update `aud`, `tape` [`90d50ad`](https://github.com/ljharb/call-bind/commit/90d50ad03b061e0268b3380b0065fcaec183dc05) +- [meta] use `prepublishOnly` script for npm 7+ [`44c5433`](https://github.com/ljharb/call-bind/commit/44c5433b7980e02b4870007046407cf6fc543329) +- [Deps] update `get-intrinsic` [`86bfbfc`](https://github.com/ljharb/call-bind/commit/86bfbfcf34afdc6eabc93ce3d408548d0e27d958) +- [Deps] update `get-intrinsic` [`5c53354`](https://github.com/ljharb/call-bind/commit/5c5335489be0294c18cd7a8bb6e08226ee019ff5) +- [actions] update checkout action [`4c393a8`](https://github.com/ljharb/call-bind/commit/4c393a8173b3c8e5b30d5b3297b3b94d48bf87f3) +- [Deps] update `get-intrinsic` [`4e70bde`](https://github.com/ljharb/call-bind/commit/4e70bdec0626acb11616d66250fc14565e716e91) +- [Deps] update `get-intrinsic` [`55ae803`](https://github.com/ljharb/call-bind/commit/55ae803a920bd93c369cd798c20de31f91e9fc60) + +## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 + +### Commits + +- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) + +## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 + +### Commits + +- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) +- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) +- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) +- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) +- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) +- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) +- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) +- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) + +## v1.0.0 - 2020-10-30 + +### Commits + +- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) +- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) +- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) +- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) +- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) +- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) +- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) +- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) +- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) +- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/node_modules/call-bind/LICENSE b/node_modules/call-bind/LICENSE new file mode 100644 index 0000000..48f05d0 --- /dev/null +++ b/node_modules/call-bind/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Jordan Harband + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/call-bind/README.md b/node_modules/call-bind/README.md new file mode 100644 index 0000000..48e9047 --- /dev/null +++ b/node_modules/call-bind/README.md @@ -0,0 +1,64 @@ +# call-bind [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Robustly `.call.bind()` a function. + +## Getting started + +```sh +npm install --save call-bind +``` + +## Usage/Examples + +```js +const assert = require('assert'); +const callBind = require('call-bind'); +const callBound = require('call-bind/callBound'); + +function f(a, b) { + assert.equal(this, 1); + assert.equal(a, 2); + assert.equal(b, 3); + assert.equal(arguments.length, 2); +} + +const fBound = callBind(f); + +const slice = callBound('Array.prototype.slice'); + +delete Function.prototype.call; +delete Function.prototype.bind; + +fBound(1, 2, 3); + +assert.deepEqual(slice([1, 2, 3, 4], 1, -1), [2, 3]); +``` + +## Tests + +Clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/call-bind +[npm-version-svg]: https://versionbadg.es/ljharb/call-bind.svg +[deps-svg]: https://david-dm.org/ljharb/call-bind.svg +[deps-url]: https://david-dm.org/ljharb/call-bind +[dev-deps-svg]: https://david-dm.org/ljharb/call-bind/dev-status.svg +[dev-deps-url]: https://david-dm.org/ljharb/call-bind#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/call-bind.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/call-bind.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/call-bind.svg +[downloads-url]: https://npm-stat.com/charts.html?package=call-bind +[codecov-image]: https://codecov.io/gh/ljharb/call-bind/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/ljharb/call-bind/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/call-bind +[actions-url]: https://github.com/ljharb/call-bind/actions diff --git a/node_modules/call-bind/callBound.js b/node_modules/call-bind/callBound.js new file mode 100644 index 0000000..8374adf --- /dev/null +++ b/node_modules/call-bind/callBound.js @@ -0,0 +1,15 @@ +'use strict'; + +var GetIntrinsic = require('get-intrinsic'); + +var callBind = require('./'); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBind(intrinsic); + } + return intrinsic; +}; diff --git a/node_modules/call-bind/index.js b/node_modules/call-bind/index.js new file mode 100644 index 0000000..01c5b3d --- /dev/null +++ b/node_modules/call-bind/index.js @@ -0,0 +1,35 @@ +'use strict'; + +var bind = require('function-bind'); +var GetIntrinsic = require('get-intrinsic'); +var setFunctionLength = require('set-function-length'); + +var $TypeError = require('es-errors/type'); +var $apply = GetIntrinsic('%Function.prototype.apply%'); +var $call = GetIntrinsic('%Function.prototype.call%'); +var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); + +var $defineProperty = require('es-define-property'); +var $max = GetIntrinsic('%Math.max%'); + +module.exports = function callBind(originalFunction) { + if (typeof originalFunction !== 'function') { + throw new $TypeError('a function is required'); + } + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); +}; + +var applyBind = function applyBind() { + return $reflectApply(bind, $apply, arguments); +}; + +if ($defineProperty) { + $defineProperty(module.exports, 'apply', { value: applyBind }); +} else { + module.exports.apply = applyBind; +} diff --git a/node_modules/call-bind/package.json b/node_modules/call-bind/package.json new file mode 100644 index 0000000..5ba88ff --- /dev/null +++ b/node_modules/call-bind/package.json @@ -0,0 +1,95 @@ +{ + "name": "call-bind", + "version": "1.0.7", + "description": "Robustly `.call.bind()` a function", + "main": "index.js", + "exports": { + ".": "./index.js", + "./callBound": "./callBound.js", + "./package.json": "./package.json" + }, + "scripts": { + "prepack": "npmignore --auto --commentLines=auto", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "lint": "eslint --ext=.js,.mjs .", + "postlint": "evalmd README.md", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/call-bind.git" + }, + "keywords": [ + "javascript", + "ecmascript", + "es", + "js", + "callbind", + "callbound", + "call", + "bind", + "bound", + "call-bind", + "call-bound", + "function", + "es-abstract" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/ljharb/call-bind/issues" + }, + "homepage": "https://github.com/ljharb/call-bind#readme", + "devDependencies": { + "@ljharb/eslint-config": "^21.1.0", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "es-value-fixtures": "^1.4.2", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-strict-mode": "^1.0.1", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.4" + }, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "testling": { + "files": "test/index.js" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/node_modules/call-bind/test/callBound.js b/node_modules/call-bind/test/callBound.js new file mode 100644 index 0000000..c32319d --- /dev/null +++ b/node_modules/call-bind/test/callBound.js @@ -0,0 +1,54 @@ +'use strict'; + +var test = require('tape'); + +var callBound = require('../callBound'); + +test('callBound', function (t) { + // static primitive + t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); + t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); + + // static non-function object + t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); + t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); + t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); + t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); + + // static function + t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); + t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); + + // prototype primitive + t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); + t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); + + // prototype function + t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); + t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); + t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); + t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); + + t['throws']( + function () { callBound('does not exist'); }, + SyntaxError, + 'nonexistent intrinsic throws' + ); + t['throws']( + function () { callBound('does not exist', true); }, + SyntaxError, + 'allowMissing arg still throws for unknown intrinsic' + ); + + t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { + st['throws']( + function () { callBound('WeakRef'); }, + TypeError, + 'real but absent intrinsic throws' + ); + st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/call-bind/test/index.js b/node_modules/call-bind/test/index.js new file mode 100644 index 0000000..1fd4668 --- /dev/null +++ b/node_modules/call-bind/test/index.js @@ -0,0 +1,80 @@ +'use strict'; + +var callBind = require('../'); +var bind = require('function-bind'); +var gOPD = require('gopd'); +var hasStrictMode = require('has-strict-mode')(); +var forEach = require('for-each'); +var inspect = require('object-inspect'); +var v = require('es-value-fixtures'); + +var test = require('tape'); + +/* + * older engines have length nonconfigurable + * in io.js v3, it is configurable except on bound functions, hence the .bind() + */ +var functionsHaveConfigurableLengths = !!( + gOPD + && Object.getOwnPropertyDescriptor + && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable +); + +test('callBind', function (t) { + forEach(v.nonFunctions, function (nonFunction) { + t['throws']( + function () { callBind(nonFunction); }, + TypeError, + inspect(nonFunction) + ' is not a function' + ); + }); + + var sentinel = { sentinel: true }; + var func = function (a, b) { + // eslint-disable-next-line no-invalid-this + return [!hasStrictMode && this === global ? undefined : this, a, b]; + }; + t.equal(func.length, 2, 'original function length is 2'); + t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); + t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); + t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); + + var bound = callBind(func); + t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); + t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args'); + t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args'); + + var boundR = callBind(func, sentinel); + t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); + t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); + t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); + + var boundArg = callBind(func, sentinel, 1); + t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); + t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); + t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); + t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); + + t.test('callBind.apply', function (st) { + var aBound = callBind.apply(func); + st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); + st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + + var aBoundArg = callBind.apply(func); + st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); + st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); + st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); + + var aBoundR = callBind.apply(func, sentinel); + st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); + st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); + st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); + + st.end(); + }); + + t.end(); +}); diff --git a/node_modules/callsite/.npmignore b/node_modules/callsite/.npmignore new file mode 100644 index 0000000..f1250e5 --- /dev/null +++ b/node_modules/callsite/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/node_modules/callsite/History.md b/node_modules/callsite/History.md new file mode 100644 index 0000000..4994198 --- /dev/null +++ b/node_modules/callsite/History.md @@ -0,0 +1,10 @@ + +1.0.0 / 2013-01-24 +================== + + * remove lame magical getters + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/node_modules/callsite/Makefile b/node_modules/callsite/Makefile new file mode 100644 index 0000000..634e372 --- /dev/null +++ b/node_modules/callsite/Makefile @@ -0,0 +1,6 @@ + +test: + @./node_modules/.bin/mocha \ + --require should + +.PHONY: test \ No newline at end of file diff --git a/node_modules/callsite/Readme.md b/node_modules/callsite/Readme.md new file mode 100644 index 0000000..0dbd16a --- /dev/null +++ b/node_modules/callsite/Readme.md @@ -0,0 +1,44 @@ +# callstack + + Access to v8's "raw" `CallSite`s. + +## Installation + + $ npm install callsite + +## Example + +```js +var stack = require('callsite'); + +foo(); + +function foo() { + bar(); +} + +function bar() { + baz(); +} + +function baz() { + console.log(); + stack().forEach(function(site){ + console.log(' \033[36m%s\033[90m in %s:%d\033[0m' + , site.getFunctionName() || 'anonymous' + , site.getFileName() + , site.getLineNumber()); + }); + console.log(); +} +``` + +## Why? + + Because you can do weird, stupid, clever, wacky things such as: + + - [better-assert](https://github.com/visionmedia/better-assert) + +## License + + MIT diff --git a/node_modules/callsite/index.js b/node_modules/callsite/index.js new file mode 100644 index 0000000..d3ee6f8 --- /dev/null +++ b/node_modules/callsite/index.js @@ -0,0 +1,10 @@ + +module.exports = function(){ + var orig = Error.prepareStackTrace; + Error.prepareStackTrace = function(_, stack){ return stack; }; + var err = new Error; + Error.captureStackTrace(err, arguments.callee); + var stack = err.stack; + Error.prepareStackTrace = orig; + return stack; +}; diff --git a/node_modules/callsite/package.json b/node_modules/callsite/package.json new file mode 100644 index 0000000..348434e --- /dev/null +++ b/node_modules/callsite/package.json @@ -0,0 +1,11 @@ +{ + "name": "callsite" + , "version": "1.0.0" + , "description": "access to v8's CallSites" + , "keywords": ["stack", "trace", "line"] + , "author": "TJ Holowaychuk " + , "dependencies": {} + , "devDependencies": { "mocha": "*", "should": "*" } + , "main": "index" + , "engines": { "node": "*" } +} diff --git a/node_modules/camelcase/index.js b/node_modules/camelcase/index.js new file mode 100644 index 0000000..b46e100 --- /dev/null +++ b/node_modules/camelcase/index.js @@ -0,0 +1,27 @@ +'use strict'; +module.exports = function () { + var str = [].map.call(arguments, function (str) { + return str.trim(); + }).filter(function (str) { + return str.length; + }).join('-'); + + if (!str.length) { + return ''; + } + + if (str.length === 1 || !(/[_.\- ]+/).test(str) ) { + if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) { + return str; + } + + return str.toLowerCase(); + } + + return str + .replace(/^[_.\- ]+/, '') + .toLowerCase() + .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { + return p1.toUpperCase(); + }); +}; diff --git a/node_modules/camelcase/license b/node_modules/camelcase/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/camelcase/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/camelcase/package.json b/node_modules/camelcase/package.json new file mode 100644 index 0000000..34f75e7 --- /dev/null +++ b/node_modules/camelcase/package.json @@ -0,0 +1,38 @@ +{ + "name": "camelcase", + "version": "1.2.1", + "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar", + "license": "MIT", + "repository": "sindresorhus/camelcase", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert" + ], + "devDependencies": { + "ava": "0.0.4" + } +} diff --git a/node_modules/camelcase/readme.md b/node_modules/camelcase/readme.md new file mode 100644 index 0000000..516dc39 --- /dev/null +++ b/node_modules/camelcase/readme.md @@ -0,0 +1,56 @@ +# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) + +> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar` + + +## Install + +```sh +$ npm install --save camelcase +``` + + +## Usage + +```js +var camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> fooBar + +camelCase('foo_bar'); +//=> fooBar + +camelCase('Foo-Bar'); +//=> fooBar + +camelCase('--foo.bar'); +//=> fooBar + +camelCase('__foo__bar__'); +//=> fooBar + +camelCase('foo bar'); +//=> fooBar + +console.log(process.argv[3]); +//=> --foo-bar +camelCase(process.argv[3]); +//=> fooBar + +camelCase('foo', 'bar'); +//=> fooBar + +camelCase('__foo__', '--bar'); +//=> fooBar +``` + + +## Related + +See [`decamelize`](https://github.com/sindresorhus/decamelize) for the inverse. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/center-align/LICENSE b/node_modules/center-align/LICENSE new file mode 100644 index 0000000..65f90ac --- /dev/null +++ b/node_modules/center-align/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/center-align/README.md b/node_modules/center-align/README.md new file mode 100644 index 0000000..cbcf3be --- /dev/null +++ b/node_modules/center-align/README.md @@ -0,0 +1,74 @@ +# center-align [![NPM version](https://badge.fury.io/js/center-align.svg)](http://badge.fury.io/js/center-align) + +> Center-align the text in a string. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i center-align --save +``` + +## Usage + +```js +var centerAlign = require('center-align'); +``` + +**Example** + +If used on the following: + +``` +Lorem ipsum dolor sit amet, +consectetur adipiscing +elit, sed do eiusmod tempor incididunt +ut labore et dolore +magna aliqua. Ut enim ad minim +veniam, quis +``` + +The result would be: + +``` + Lorem ipsum dolor sit amet, + consectetur adipiscing +elit, sed do eiusmod tempor incididunt + ut labore et dolore + magna aliqua. Ut enim ad minim + veniam, quis +``` + +## Related projects + +* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text) +* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified) +* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align) +* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/center-align/issues/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 27, 2015._ \ No newline at end of file diff --git a/node_modules/center-align/index.js b/node_modules/center-align/index.js new file mode 100644 index 0000000..c6ed54a --- /dev/null +++ b/node_modules/center-align/index.js @@ -0,0 +1,16 @@ +/*! + * center-align + * + * Copycenter (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var utils = require('./utils'); + +module.exports = function centerAlign(val) { + return utils.align(val, function (len, longest) { + return Math.floor((longest - len) / 2); + }); +}; diff --git a/node_modules/center-align/package.json b/node_modules/center-align/package.json new file mode 100644 index 0000000..eee07ee --- /dev/null +++ b/node_modules/center-align/package.json @@ -0,0 +1,51 @@ +{ + "name": "center-align", + "description": "Center-align the text in a string.", + "version": "0.1.3", + "homepage": "https://github.com/jonschlinkert/center-align", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/center-align", + "bugs": { + "url": "https://github.com/jonschlinkert/center-align/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "utils.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + }, + "devDependencies": { + "mocha": "^2.2.0" + }, + "keywords": [ + "align", + "align-center", + "center", + "center-align", + "right", + "right-align", + "text", + "typography" + ], + "verb": { + "related": { + "description": "", + "list": [ + "align-text", + "right-align", + "justified", + "word-wrap" + ] + } + } +} diff --git a/node_modules/center-align/utils.js b/node_modules/center-align/utils.js new file mode 100644 index 0000000..aead6d2 --- /dev/null +++ b/node_modules/center-align/utils.js @@ -0,0 +1,40 @@ +'use strict'; + +/** + * Lazily-required module dependencies (makes the application + * faster) + */ + +var utils = require('lazy-cache')(require); + +/** + * Temporarily re-assign `require` to trick browserify and + * webpack into reconizing lazy dependencies. + * + * This tiny bit of ugliness has the huge dual advantage of + * only loading modules that are actually called at some + * point in the lifecycle of the application, whilst also + * allowing browserify and webpack to find modules that + * are depended on but never actually called. + */ + +var fn = require; +require = utils; + +/** + * Lazily required module dependencies + */ + +require('align-text', 'align'); + +/** + * Restore `require` + */ + +require = fn; + +/** + * Expose `utils` modules + */ + +module.exports = utils; diff --git a/node_modules/chalk/index.js b/node_modules/chalk/index.js new file mode 100644 index 0000000..2d85a91 --- /dev/null +++ b/node_modules/chalk/index.js @@ -0,0 +1,116 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} + +// use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = (function () { + var ret = {}; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + /* eslint-disable no-proto */ + builder.__proto__ = proto; + + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + var originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + ansiStyles.dim.open = originalDim; + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + + return ret; +} + +defineProps(Chalk.prototype, init()); + +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; diff --git a/node_modules/chalk/license b/node_modules/chalk/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/chalk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json new file mode 100644 index 0000000..2b5881e --- /dev/null +++ b/node_modules/chalk/package.json @@ -0,0 +1,70 @@ +{ + "name": "chalk", + "version": "1.1.3", + "description": "Terminal string styling done right. Much color.", + "license": "MIT", + "repository": "chalk/chalk", + "maintainers": [ + "Sindre Sorhus (sindresorhus.com)", + "Joshua Appelman (jbnicolai.com)", + "JD Ballard (github.com/qix-)" + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && mocha", + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "xo": { + "envs": [ + "node", + "mocha" + ] + } +} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md new file mode 100644 index 0000000..5cf111e --- /dev/null +++ b/node_modules/chalk/readme.md @@ -0,0 +1,213 @@ +

+
+
+ chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) +[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) +[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend `String.prototype` +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 + + +## Install + +``` +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +chalk.blue('Hello world!'); + +// combine styled and normal strings +chalk.blue('Hello') + 'World' + chalk.red('!'); + +// compose multiple styles using the chainable API +chalk.blue.bgRed.bold('Hello world!'); + +// pass in multiple arguments +chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); + +// nest styles +chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); + +// nest styles of the same type even (color, underline, background) +chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.`