aboutsummaryrefslogtreecommitdiff
path: root/node_modules/reduce-function-call
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:43:05 +0800
committerruki <waruqi@gmail.com>2018-11-07 22:18:30 +0800
commit89e95b3f143682ed9a006991bacf45c9dcba4818 (patch)
tree4f44cf41b828577d583890bdd5a1c31e8491a6ba /node_modules/reduce-function-call
parentaa7f0199255277949790b41c56e8ec97dd4f0da4 (diff)
downloadxmake-docs-vuepress.tar.gz
xmake-docs-vuepress.zip
remove node_modulesvuepress
Diffstat (limited to 'node_modules/reduce-function-call')
-rwxr-xr-xnode_modules/reduce-function-call/CHANGELOG.md12
-rwxr-xr-xnode_modules/reduce-function-call/LICENSE20
-rwxr-xr-xnode_modules/reduce-function-call/README.md71
-rwxr-xr-xnode_modules/reduce-function-call/index.js74
-rwxr-xr-xnode_modules/reduce-function-call/package.json43
5 files changed, 0 insertions, 220 deletions
diff --git a/node_modules/reduce-function-call/CHANGELOG.md b/node_modules/reduce-function-call/CHANGELOG.md
deleted file mode 100755
index aa2e88b0..00000000
--- a/node_modules/reduce-function-call/CHANGELOG.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# 1.0.2 - 2016-11-28
-
-- Bump `balanced-match` dependency version
-([postcss-cssnext/#327](https://github.com/MoOx/postcss-cssnext/issues/327) - @wtgtybhertgeghgtwtg).
-
-# 1.0.1 - 2014-08-06
-
-* Fix issue with regex and nested call
-
-# 1.0.0 - 2014-08-06
-
-First release
diff --git a/node_modules/reduce-function-call/LICENSE b/node_modules/reduce-function-call/LICENSE
deleted file mode 100755
index 9abe4f54..00000000
--- a/node_modules/reduce-function-call/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 "MoOx" Maxime Thirouin
-
-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/reduce-function-call/README.md b/node_modules/reduce-function-call/README.md
deleted file mode 100755
index cc3dac9a..00000000
--- a/node_modules/reduce-function-call/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-# reduce-function-call [![Build Status](https://travis-ci.org/MoOx/reduce-function-call.png)](https://travis-ci.org/MoOx/reduce-function-call)
-
-> Reduce function calls in a string, using a callback
-
-## Installation
-
-```bash
-npm install reduce-function-call
-```
-
-## Usage
-
-```js
-var reduceFunctionCall = require("reduce-function-call")
-
-reduceFunctionCall("foo(1)", "foo", function(body) {
- // body === "1"
- return parseInt(body, 10) + 1
-})
-// "2"
-
-var nothingOrUpper = function(body, functionIdentifier) {
- // ignore empty value
- if (body === "") {
- return functionIdentifier + "()"
- }
-
- return body.toUpperCase()
-}
-
-reduceFunctionCall("bar()", "bar", nothingOrUpper)
-// "bar()"
-
-reduceFunctionCall("upper(baz)", "upper", nothingOrUpper)
-// "BAZ"
-
-reduceFunctionCall("math(math(2 + 2) * 4 + math(2 + 2)) and other things", "math", function(body, functionIdentifier, call) {
- try {
- return eval(body)
- }
- catch (e) {
- return call
- }
-})
-// "20 and other things"
-
-reduceFunctionCall("sha bla blah() blaa bla() abla() aabla() blaaa()", /\b([a-z]?bla[a-z]?)\(/, function(body, functionIdentifier) {
- if (functionIdentifier === "bla") {
- return "ABRACADABRA"
- }
- return functionIdentifier.replace("bla", "!")
-}
-// "sha bla !h blaa ABRACADABRA a! aabla() blaaa()"
-```
-
-See [unit tests](test/index.js) for others examples.
-
-## Contributing
-
-Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
-
-```bash
-git clone https://github.com/MoOx/reduce-function-call.git
-git checkout -b patch-1
-npm install
-npm test
-```
-
-## [Changelog](CHANGELOG.md)
-
-## [License](LICENSE-MIT)
diff --git a/node_modules/reduce-function-call/index.js b/node_modules/reduce-function-call/index.js
deleted file mode 100755
index c20effaa..00000000
--- a/node_modules/reduce-function-call/index.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Module dependencies
- */
-var balanced = require("balanced-match")
-
-/**
- * Expose `reduceFunctionCall`
- *
- * @type {Function}
- */
-module.exports = reduceFunctionCall
-
-/**
- * Walkthrough all expressions, evaluate them and insert them into the declaration
- *
- * @param {Array} expressions
- * @param {Object} declaration
- */
-
-function reduceFunctionCall(string, functionRE, callback) {
- var call = string
- return getFunctionCalls(string, functionRE).reduce(function(string, obj) {
- return string.replace(obj.functionIdentifier + "(" + obj.matches.body + ")", evalFunctionCall(obj.matches.body, obj.functionIdentifier, callback, call, functionRE))
- }, string)
-}
-
-/**
- * Parses expressions in a value
- *
- * @param {String} value
- * @returns {Array}
- * @api private
- */
-
-function getFunctionCalls(call, functionRE) {
- var expressions = []
-
- var fnRE = typeof functionRE === "string" ? new RegExp("\\b(" + functionRE + ")\\(") : functionRE
- do {
- var searchMatch = fnRE.exec(call)
- if (!searchMatch) {
- return expressions
- }
- if (searchMatch[1] === undefined) {
- throw new Error("Missing the first couple of parenthesis to get the function identifier in " + functionRE)
- }
- var fn = searchMatch[1]
- var startIndex = searchMatch.index
- var matches = balanced("(", ")", call.substring(startIndex))
-
- if (!matches || matches.start !== searchMatch[0].length - 1) {
- throw new SyntaxError(fn + "(): missing closing ')' in the value '" + call + "'")
- }
-
- expressions.push({matches: matches, functionIdentifier: fn})
- call = matches.post
- }
- while (fnRE.test(call))
-
- return expressions
-}
-
-/**
- * Evaluates an expression
- *
- * @param {String} expression
- * @returns {String}
- * @api private
- */
-
-function evalFunctionCall (string, functionIdentifier, callback, call, functionRE) {
- // allow recursivity
- return callback(reduceFunctionCall(string, functionRE, callback), functionIdentifier, call)
-}
diff --git a/node_modules/reduce-function-call/package.json b/node_modules/reduce-function-call/package.json
deleted file mode 100755
index 22564ff0..00000000
--- a/node_modules/reduce-function-call/package.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "reduce-function-call",
- "version": "1.0.2",
- "description": "Reduce function calls in a string, using a callback",
- "keywords": [
- "string",
- "reduce",
- "replacement",
- "function",
- "call",
- "eval",
- "interpret"
- ],
- "author": "MoOx",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/MoOx/reduce-function-call.git"
- },
- "files": [
- "CHANGELOG.md",
- "LICENSE",
- "README.md",
- "index.js"
- ],
- "dependencies": {
- "balanced-match": "^0.4.2"
- },
- "devDependencies": {
- "jscs": "^2.0.0",
- "jshint": "^2.8.0",
- "jshint-stylish": "^2.0.1",
- "npmpub": "^3.1.0",
- "tap-colorize": "^1.2.0",
- "tape": "^4.0.3"
- },
- "scripts": {
- "jscs": "jscs *.js **/*.js",
- "jshint": "jshint . --exclude node_modules --reporter node_modules/jshint-stylish/index.js",
- "test": "npm run jscs && npm run jshint && tape test | tap-colorize",
- "release": "npmpub"
- }
-}