Comparing version 0.0.1 to 0.0.2
@@ -122,3 +122,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
acc = acc.concat(subset.slice(0, locStartNextSubset)).concat([attachment]); | ||
acc = accumulateStrPrecedingNextSubset().concat([attachment]); | ||
} | ||
@@ -125,0 +125,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.farmLife=n():e.farmLife=n()}(this,function(){return function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0}),n.ensureAppended=n.ensurePrepended=n.append=n.prepend=void 0;var o=t(1),c=r(o),p=function(e){return null==e},u=function(e){return"string"==typeof e},i=function(e){return function(n,t,r){var o=[t,r];if(p(n)||!u(n))return"";if(o.some(p)||!o.every(u)||0===t.length||0===r.length)return n;var i=e.type,f=e.ensureAttached,d=(0,c["default"])(t),s=[];return function a(e){var n=e.search(d);if(n===-1)return s.length?s.concat(e).join(""):e;var o=n+t.length,c=e.slice(o),p=function(){return s.concat(e.slice(0,o))};if("prepend"===i){var u=n-r.length,l=0===n?s[s.length-1]:e.slice(u,n);if(f&&l===r)return s=p(),a(c);s=s.concat(e.slice(0,n)).concat([r]).concat(e.slice(n,o))}else{var y=o+r.length,h=e.slice(o,y);if(f&&h===r)return s=p(),a(c);s=s.concat(e.slice(0,o)).concat([r])}return a(c)}(n)}};n.prepend=i({type:"prepend"}),n.append=i({type:"append"}),n.ensurePrepended=i({type:"prepend",ensureAttached:!0}),n.ensureAppended=i({type:"append",ensureAttached:!0})},function(e,n){"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(t,"\\$&")}}])}); | ||
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.farmLife=n():e.farmLife=n()}(this,function(){return function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0}),n.ensureAppended=n.ensurePrepended=n.append=n.prepend=void 0;var o=t(1),p=r(o),u=function(e){return null==e},c=function(e){return"string"==typeof e},i=function(e){return function(n,t,r){var o=[t,r];if(u(n)||!c(n))return"";if(o.some(u)||!o.every(c)||0===t.length||0===r.length)return n;var i=e.type,f=e.ensureAttached,d=(0,p["default"])(t),s=[];return function a(e){var n=e.search(d);if(n===-1)return s.length?s.concat(e).join(""):e;var o=n+t.length,p=e.slice(o),u=function(){return s.concat(e.slice(0,o))};if("prepend"===i){var c=n-r.length,l=0===n?s[s.length-1]:e.slice(c,n);if(f&&l===r)return s=u(),a(p);s=s.concat(e.slice(0,n)).concat([r]).concat(e.slice(n,o))}else{var y=o+r.length,h=e.slice(o,y);if(f&&h===r)return s=u(),a(p);s=u().concat([r])}return a(p)}(n)}};n.prepend=i({type:"prepend"}),n.append=i({type:"append"}),n.ensurePrepended=i({type:"prepend",ensureAttached:!0}),n.ensureAppended=i({type:"append",ensureAttached:!0})},function(e,n){"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(t,"\\$&")}}])}); |
@@ -21,3 +21,3 @@ import escape from 'escape-string-regexp' | ||
return (function recur (subset) { | ||
let locFound = subset.search(needleEscaped) | ||
const locFound = subset.search(needleEscaped) | ||
if (locFound === -1) { | ||
@@ -57,5 +57,3 @@ return acc.length ? acc.concat(subset).join('') : subset | ||
acc = acc | ||
.concat(subset.slice(0, locStartNextSubset)) | ||
.concat([attachment]) | ||
acc = accumulateStrPrecedingNextSubset().concat([attachment]) | ||
} | ||
@@ -62,0 +60,0 @@ |
@@ -66,3 +66,3 @@ 'use strict'; | ||
acc = acc.concat(subset.slice(0, locStartNextSubset)).concat([attachment]); | ||
acc = accumulateStrPrecedingNextSubset().concat([attachment]); | ||
} | ||
@@ -69,0 +69,0 @@ |
{ | ||
"name": "farm-life", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Prepend/append string X (or ensure string X is prepended/appended) to each occurrence of string Y in string Z", | ||
@@ -21,4 +21,6 @@ "main": "lib/index.js", | ||
"babel-preset-es2015": "^6.9.0", | ||
"coveralls": "^2.11.12", | ||
"cross-env": "^1.0.8", | ||
"ghooks": "^1.3.2", | ||
"nyc": "^7.1.0", | ||
"rimraf": "^2.5.3", | ||
@@ -32,2 +34,4 @@ "standard": "^7.1.2", | ||
"check": "standard && npm test", | ||
"coverage": "nyc npm test", | ||
"report-coverage": "cat coverage/lcov.info | coveralls", | ||
"build:commonjs": "babel index.js --out-dir lib", | ||
@@ -77,2 +81,13 @@ "build:umd": "cross-env NODE_ENV=development webpack --display-modules index.js dist/farm-life.js", | ||
}, | ||
"nyc": { | ||
"reporter": [ | ||
"lcov", | ||
"text" | ||
], | ||
"lines": 100, | ||
"statements": 100, | ||
"functions": 100, | ||
"branches": 100, | ||
"check-coverage": true | ||
}, | ||
"config": { | ||
@@ -79,0 +94,0 @@ "ghooks": { |
@@ -8,2 +8,3 @@ # farm-life | ||
[![Build Status](https://travis-ci.org/danne931/farm-life.svg?branch=master)](https://travis-ci.org/danne931/farm-life) | ||
[![Coverage Status](https://coveralls.io/repos/github/danne931/farm-life/badge.svg)](https://coveralls.io/github/danne931/farm-life) | ||
[![npm version](https://img.shields.io/npm/v/farm-life.svg?style=flat-square)](https://www.npmjs.com/package/farm-life) | ||
@@ -10,0 +11,0 @@ [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15587
43
13
246