mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-02-04 14:00:49 +00:00
nhj
more
This commit is contained in:
6
unified-ai-platform/node_modules/expand-template/.travis.yml
generated
vendored
Normal file
6
unified-ai-platform/node_modules/expand-template/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 6
|
||||
- 8
|
||||
- 10
|
||||
21
unified-ai-platform/node_modules/expand-template/LICENSE
generated
vendored
Normal file
21
unified-ai-platform/node_modules/expand-template/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 Lars-Magnus Skog
|
||||
|
||||
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.
|
||||
26
unified-ai-platform/node_modules/expand-template/index.js
generated
vendored
Normal file
26
unified-ai-platform/node_modules/expand-template/index.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = function (opts) {
|
||||
var sep = opts ? opts.sep : '{}'
|
||||
var len = sep.length
|
||||
|
||||
var whitespace = '\\s*'
|
||||
var left = escape(sep.substring(0, len / 2)) + whitespace
|
||||
var right = whitespace + escape(sep.substring(len / 2, len))
|
||||
|
||||
return function (template, values) {
|
||||
Object.keys(values).forEach(function (key) {
|
||||
var value = String(values[key]).replace(/\$/g, '$$$$')
|
||||
template = template.replace(regExp(key), value)
|
||||
})
|
||||
return template
|
||||
}
|
||||
|
||||
function escape (s) {
|
||||
return [].map.call(s, function (char) {
|
||||
return '\\' + char
|
||||
}).join('')
|
||||
}
|
||||
|
||||
function regExp (key) {
|
||||
return new RegExp(left + key + right, 'g')
|
||||
}
|
||||
}
|
||||
29
unified-ai-platform/node_modules/expand-template/package.json
generated
vendored
Normal file
29
unified-ai-platform/node_modules/expand-template/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "expand-template",
|
||||
"version": "2.0.3",
|
||||
"description": "Expand placeholders in a template string",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ralphtheninja/expand-template.git"
|
||||
},
|
||||
"homepage": "https://github.com/ralphtheninja/expand-template",
|
||||
"scripts": {
|
||||
"test": "tape test.js && standard"
|
||||
},
|
||||
"keywords": [
|
||||
"template",
|
||||
"expand",
|
||||
"replace"
|
||||
],
|
||||
"author": "LM <ralphtheninja@riseup.net>",
|
||||
"license": "(MIT OR WTFPL)",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"standard": "^12.0.0",
|
||||
"tape": "^4.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user