diff options
| author | pack <pack@packgekko.xyz> | 2026-08-09 10:54:08 +0000 |
|---|---|---|
| committer | pack <pack@packgekko.xyz> | 2026-08-09 10:54:08 +0000 |
| commit | d3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch) | |
| tree | a2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/expand-template | |
| parent | 55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff) | |
| download | crud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz | |
stop tracking node_modules/
Diffstat (limited to 'node_modules/expand-template')
| -rw-r--r-- | node_modules/expand-template/.travis.yml | 6 | ||||
| -rw-r--r-- | node_modules/expand-template/LICENSE | 21 | ||||
| -rw-r--r-- | node_modules/expand-template/README.md | 43 | ||||
| -rw-r--r-- | node_modules/expand-template/index.js | 26 | ||||
| -rw-r--r-- | node_modules/expand-template/package.json | 29 | ||||
| -rw-r--r-- | node_modules/expand-template/test.js | 67 |
6 files changed, 0 insertions, 192 deletions
diff --git a/node_modules/expand-template/.travis.yml b/node_modules/expand-template/.travis.yml deleted file mode 100644 index 1335a77..0000000 --- a/node_modules/expand-template/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js - -node_js: - - 6 - - 8 - - 10 diff --git a/node_modules/expand-template/LICENSE b/node_modules/expand-template/LICENSE deleted file mode 100644 index 814aef4..0000000 --- a/node_modules/expand-template/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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.
\ No newline at end of file diff --git a/node_modules/expand-template/README.md b/node_modules/expand-template/README.md deleted file mode 100644 index b98aa48..0000000 --- a/node_modules/expand-template/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# expand-template - -> Expand placeholders in a template string. - -[](https://www.npmjs.com/package/expand-template) - -[](https://travis-ci.org/ralphtheninja/expand-template) -[](https://standardjs.com) - -## Install - -``` -$ npm i expand-template -S -``` - -## Usage - -Default functionality expands templates using `{}` as separators for string placeholders. - -```js -var expand = require('expand-template')() -var template = '{foo}/{foo}/{bar}/{bar}' -console.log(expand(template, { - foo: 'BAR', - bar: 'FOO' -})) -// -> BAR/BAR/FOO/FOO -``` - -Custom separators: - -```js -var expand = require('expand-template')({ sep: '[]' }) -var template = '[foo]/[foo]/[bar]/[bar]' -console.log(expand(template, { - foo: 'BAR', - bar: 'FOO' -})) -// -> BAR/BAR/FOO/FOO -``` - -## License -All code, unless stated otherwise, is dual-licensed under [`WTFPL`](http://www.wtfpl.net/txt/copying/) and [`MIT`](https://opensource.org/licenses/MIT). diff --git a/node_modules/expand-template/index.js b/node_modules/expand-template/index.js deleted file mode 100644 index e182837..0000000 --- a/node_modules/expand-template/index.js +++ /dev/null @@ -1,26 +0,0 @@ -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') - } -} diff --git a/node_modules/expand-template/package.json b/node_modules/expand-template/package.json deleted file mode 100644 index 9a09656..0000000 --- a/node_modules/expand-template/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "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" - } -} diff --git a/node_modules/expand-template/test.js b/node_modules/expand-template/test.js deleted file mode 100644 index ba6ed87..0000000 --- a/node_modules/expand-template/test.js +++ /dev/null @@ -1,67 +0,0 @@ -var test = require('tape') -var Expand = require('./') - -test('default expands {} placeholders', function (t) { - var expand = Expand() - t.equal(typeof expand, 'function', 'is a function') - t.equal(expand('{foo}/{bar}', { - foo: 'BAR', bar: 'FOO' - }), 'BAR/FOO') - t.equal(expand('{foo}{foo}{foo}', { - foo: 'FOO' - }), 'FOOFOOFOO', 'expands one placeholder many times') - t.end() -}) - -test('support for custom separators', function (t) { - var expand = Expand({ sep: '[]' }) - t.equal(expand('[foo]/[bar]', { - foo: 'BAR', bar: 'FOO' - }), 'BAR/FOO') - t.equal(expand('[foo][foo][foo]', { - foo: 'FOO' - }), 'FOOFOOFOO', 'expands one placeholder many times') - t.end() -}) - -test('support for longer custom separators', function (t) { - var expand = Expand({ sep: '[[]]' }) - t.equal(expand('[[foo]]/[[bar]]', { - foo: 'BAR', bar: 'FOO' - }), 'BAR/FOO') - t.equal(expand('[[foo]][[foo]][[foo]]', { - foo: 'FOO' - }), 'FOOFOOFOO', 'expands one placeholder many times') - t.end() -}) - -test('whitespace-insensitive', function (t) { - var expand = Expand({ sep: '[]' }) - t.equal(expand('[ foo ]/[ bar ]', { - foo: 'BAR', bar: 'FOO' - }), 'BAR/FOO') - t.equal(expand('[ foo ][ foo ][ foo]', { - foo: 'FOO' - }), 'FOOFOOFOO', 'expands one placeholder many times') - t.end() -}) - -test('dollar escape', function (t) { - var expand = Expand() - t.equal(expand('before {foo} after', { - foo: '$' - }), 'before $ after') - t.equal(expand('before {foo} after', { - foo: '$&' - }), 'before $& after') - t.equal(expand('before {foo} after', { - foo: '$`' - }), 'before $` after') - t.equal(expand('before {foo} after', { - foo: '$\'' - }), 'before $\' after') - t.equal(expand('before {foo} after', { - foo: '$0' - }), 'before $0 after') - t.end() -}) |