Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@a-la/markers

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@a-la/markers - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

src/index.js

12

build/index.js

@@ -5,8 +5,4 @@ const { makeMarkers, makeCutRule, makePasteRule } = require('restream');

/**
* @typedef {import('restream').Rule} Rule
*/
/**
* Create a new set of rules, where service markers are used to exclude comments and strings from processing.
* @param {Rule[]} [rules] A set of rules to surround with markers. Typically, this will be done by `alamode`.
* @param {!Array<!_restream.Rule>} [rules] A set of rules to surround with markers. Typically, this will be done by `alamode`.
*/

@@ -78,2 +74,6 @@ const makeRules = (rules = []) => {

module.exports=makeRules
//# sourceMappingURL=index.js.map
/**
* @suppress {nonStandardJsDocs}
* @typedef {import('restream').Rule} _restream.Rule
*/

@@ -5,3 +5,2 @@ const commentsRe = /\/\*(?:[\s\S]+?)\*\//g

module.exports.commentsRe = commentsRe
module.exports.inlineCommentsRe = inlineCommentsRe
//# sourceMappingURL=index.js.map
module.exports.inlineCommentsRe = inlineCommentsRe

@@ -0,1 +1,8 @@

## 22 April 2019
### [1.1.0](https://github.com/a-la/markers/compare/v1.0.3...v1.1.0)
- [package] Publish `src` as a module.
- [deps] Update and unlock dependencies.
## 1 September 2018

@@ -2,0 +9,0 @@

{
"name": "@a-la/markers",
"version": "1.0.3",
"version": "1.1.0",
"description": "A set of service markers used by alamode, e.g., to cut and paste comments.",
"main": "build",
"main": "build/index.js",
"module": "src/index.js",
"scripts": {

@@ -13,12 +14,11 @@ "t": "zoroaster -a",

"lint": "eslint .",
"postpublish": "git push --follow-tags",
"doc": "NODE_DEBUG=doc doc documentary -o README.md",
"b": "alamode src -o build",
"doc": "NODE_DEBUG=doc doc -o README.md",
"b": "alamode src -o build -s",
"build": "yarn-s b doc",
"rec": "NODE_DEBUG=appshot appshot -T 23 -a Terminal -y 150 -f",
"e": "node example",
"e": "alanode",
"example/": "yarn e example/example.js"
},
"files": [
"build"
"build",
"src"
],

@@ -40,13 +40,12 @@ "repository": {

"devDependencies": {
"alamode": "1.3.0",
"catchment": "3.0.1",
"documentary": "1.10.0",
"alamode": "^1.9.3",
"catchment": "^3.3.0",
"documentary": "^1.24.1",
"eslint-config-artdeco": "1.0.1",
"snapshot-context": "2.0.4",
"yarn-s": "1.1.0",
"zoroaster": "2.4.0"
"zoroaster": "^3.11.6"
},
"dependencies": {
"restream": "3.1.1"
"restream": "^3.7.1"
}
}

@@ -15,6 +15,6 @@ # @a-la/markers

- [API](#api)
* [`makeRules(rules?: Rule[])`](#makerulesrules-rule-void)
- [TODO](#todo)
* [`makeRules(rules?: !Array<!_restream.Rule>): !Array<!_restream.Rule>`](#makerulesrules-array_restreamrule-array_restreamrule)
- [Copyright](#copyright)
## API

@@ -28,3 +28,3 @@

### `makeRules(`<br/>&nbsp;&nbsp;`rules?: Rule[],`<br/>`): void`
### `makeRules(`<br/>&nbsp;&nbsp;`rules?: !Array<!_restream.Rule>,`<br/>`): !Array<!_restream.Rule>`

@@ -37,4 +37,14 @@ This function will surround the rules with cut and paste rules for markers, to exclude from transforms:

- inline comments
- regexes
> **[!] Important** The current implementation does not support the following:
```js
// the // will be considered to be a comment and break the process
// because the string literal will not be complete without the closing `
const noLink = `https://${host}/test`
export { noLink }
```
```js
/* yarn example/ */

@@ -58,18 +68,26 @@ import makeRules from '@a-la/markers'

```
```js
Rules:
[ { re: /\/\*(?:[\s\S]+?)\*\//g,
[ { re: /\\[\\`'"\/]/g, replacement: [Function: replacement] },
{ re: /\/\*(?:[\s\S]+?)\*\//g,
replacement: [Function: replacement] },
{ re: /\/\/(.+)/gm, replacement: [Function: replacement] },
{ re: /`[\s\S]+?`/gm, replacement: [Function: replacement] },
{ re: /(["'])(.*?)\1/gm, replacement: [Function: replacement] },
{ re: /\[(.*?)\]/gm, replacement: [Function: replacement] },
{ re: /\/(.+?)\//gm, replacement: [Function: replacement] },
{ re: /`([\s\S]*?)`/gm, replacement: [Function: replacement] },
{ re: 'ALAMODE_RULE', replacement: [Function: replacement] },
{ re: /%%_RESTREAM_LITERALS_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_REGEXES_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_REGEXGROUPS_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_STRINGS_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_LITERALS_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_INLINECOMMENTS_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_COMMENTS_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] },
{ re: /%%_RESTREAM_ESCAPES_REPLACEMENT_(\d+)_%%/g,
replacement: [Function: replacement] } ]

@@ -80,3 +98,3 @@

{ name: 'literals',
re: /`[\s\S]+?`/gm,
re: /`([\s\S]*?)`/gm,
regExp: /%%_RESTREAM_LITERALS_REPLACEMENT_(\d+)_%%/g,

@@ -106,12 +124,46 @@ getReplacement: [Function: getDefaultReplacement],

map: {},
lastIndex: 0 },
escapes:
{ name: 'escapes',
re: /\\[\\`'"\/]/g,
regExp: /%%_RESTREAM_ESCAPES_REPLACEMENT_(\d+)_%%/g,
getReplacement: [Function: getDefaultReplacement],
map: {},
lastIndex: 0 },
regexes:
{ name: 'regexes',
re: /\/(.+?)\//gm,
regExp: /%%_RESTREAM_REGEXES_REPLACEMENT_(\d+)_%%/g,
getReplacement: [Function: getDefaultReplacement],
map: {},
lastIndex: 0 },
regexGroups:
{ name: 'regexGroups',
re: /\[(.*?)\]/gm,
regExp: /%%_RESTREAM_REGEXGROUPS_REPLACEMENT_(\d+)_%%/g,
getReplacement: [Function: getDefaultReplacement],
map: {},
lastIndex: 0 } }
```
## TODO
- [ ] Use negative lookahead in the strings regex to allow for escaping.
<p align="center"><a href="#table-of-contents"><img src=".documentary/section-breaks/-1.svg?sanitize=true"></a></p>
## Copyright
(c) [À La Mode][1] 2018
[1]: https://alamode.cc
<table>
<tr>
<th>
<a href="https://artd.eco">
<img src="https://raw.githubusercontent.com/wrote/wrote/master/images/artdeco.png" alt="Art Deco" />
</a>
</th>
<th>© <a href="https://artd.eco">Art Deco</a> for <a href="https://alamode.cc">À La Mode</a> 2019</th>
<th>
<a href="https://www.technation.sucks" title="Tech Nation Visa">
<img src="https://raw.githubusercontent.com/artdecoweb/www.technation.sucks/master/anim.gif"
alt="Tech Nation Visa" />
</a>
</th>
<th><a href="https://www.technation.sucks">Tech Nation Visa Sucks</a></th>
</tr>
</table>

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc