New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

noop-tag

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

noop-tag - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

license

10

dist/index.d.ts

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

declare function noop(strings: TemplateStringsArray, ...exp: any[]): string;
declare const _default: typeof noop & {
default: typeof noop;
}
declare namespace _default {
export type type = noop;
}
export = _default;
declare const noop: (strings: TemplateStringsArray, ...expressions: unknown[]) => string;
export default noop;

31

dist/index.js

@@ -1,24 +0,11 @@

"use strict";
/* NOOP */
function noop(strings) {
var exp = [];
for (var _i = 1; _i < arguments.length; _i++) {
exp[_i - 1] = arguments[_i];
/* MAIN */
const noop = (strings, ...expressions) => {
let result = strings[0];
for (let i = 1, l = strings.length; i < l; i++) {
result += expressions[i - 1];
result += strings[i];
}
var lastIndex = strings.length - 1;
if (!lastIndex)
return strings[0];
var acc = '', part;
for (var i = 0; i < lastIndex; i++) {
part = strings[i];
if (part)
acc += part;
acc += exp[i];
}
part = strings[lastIndex];
return part ? acc += part : acc;
}
return result;
};
/* EXPORT */
module.exports = noop;
module.exports.default = noop;
Object.defineProperty(module.exports, "__esModule", { value: true });
export default noop;
{
"name": "noop-tag",
"repository": "github:fabiospampinato/noop-tag",
"description": "A noop template literal tag, useful for syntax highlighting hints.",
"version": "1.0.2",
"version": "2.0.0",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"benchmark": "node tasks/benchmark.js",
"clean:dist": "rimraf dist",
"clean:coverage": "rimraf coverage .nyc_output",
"clean": "npm run clean:dist && npm run clean:coverage",
"compile": "tsc --skipLibCheck && tstei",
"compile:watch": "tsc --skipLibCheck --watch",
"test": "ava",
"test:watch": "ava --watch",
"coverage": "nyc --reporter=html ava",
"report": "nyc report",
"report:html": "open coverage/index.html",
"prepublishOnly": "npm run clean && npm run compile && npm run coverage"
"benchmark": "tsex benchmark",
"benchmark:watch": "tsex benchmark --watch",
"clean": "tsex clean",
"compile": "tsex compile",
"compile:watch": "tsex compile --watch",
"test": "tsex test",
"test:watch": "tsex test --watch",
"prepublishOnly": "npm run clean && npm run compile && npm run test"
},
"ava": {
"files": [
"test/index.js"
]
},
"bugs": {
"url": "https://github.com/fabiospampinato/noop-tag/issues"
},
"license": "MIT",
"author": {
"name": "Fabio Spampinato",
"email": "spampinabio@gmail.com"
},
"repository": {
"type": "git",
"url": "https://github.com/fabiospampinato/noop-tag.git"
},
"keywords": [

@@ -45,13 +27,8 @@ "template",

],
"dependencies": {},
"devDependencies": {
"@types/node": "^13.5.0",
"ava": "^2.3.0",
"ava-spec": "^1.1.1",
"nyc": "^15.0.0",
"benchloop": "^1.3.1",
"rimraf": "^3.0.0",
"typescript": "^3.7.5",
"typescript-transform-export-interop": "^1.0.2"
"benchloop": "^1.3.2",
"fava": "^0.0.6",
"tsex": "^1.0.4",
"typescript": "^4.6.3"
}
}
/* NOOP */
/* MAIN */
function noop ( strings: TemplateStringsArray, ...exp: any[] ): string {
const noop = ( strings: TemplateStringsArray, ...expressions: unknown[] ): string => {
const lastIndex = strings.length - 1;
let result = strings[0];
if ( !lastIndex ) return strings[0];
for ( let i = 1, l = strings.length; i < l; i++ ) {
let acc = '',
part;
result += expressions[i - 1];
result += strings[i];
for ( let i = 0; i < lastIndex; i++ ) {
part = strings[i];
if ( part ) acc += part;
acc += exp[i];
}
part = strings[lastIndex];
return result;
return part ? acc += part : acc;
};
}
/* EXPORT */
export default noop;
/* IMPORT */
const {default: noop} = require ( '../dist' ),
benchmark = require ( 'benchloop' );
import benchmark from 'benchloop';
import noop from '../dist/index.js';

@@ -7,0 +7,0 @@ /* BENCHMARK */

/* IMPORT */
import {describe} from 'ava-spec';
import {default as noop} from '../dist';
import {describe} from 'fava';
import noop from '../dist/index.js';
/* NOOP TAG */
/* MAIN */

@@ -23,3 +23,5 @@ describe ( 'Noop Tag', it => {

tests.forEach ( ([ result, expected ]) => {
t.is ( result, expected );
});

@@ -26,0 +28,0 @@

{
"compilerOptions": {
"alwaysStrict": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"inlineSourceMap": false,
"jsx": "react",
"lib": ["dom", "scripthost", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020"],
"module": "commonjs",
"moduleResolution": "node",
"newLine": "LF",
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"outDir": "dist",
"pretty": true,
"strictNullChecks": true,
"target": "es5"
},
"include": [
"src"
],
"exclude": [
"node_modules"
]
"extends": "tsex/tsconfig.json"
}

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