1.0.0 • Published 14 days ago

@rabiepenpm/magni-dolor-accusamus v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

@rabiepenpm/magni-dolor-accusamus Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

ES Proposal spec-compliant shim for String.prototype.replaceAll. Invoke its "shim" method to shim String.prototype.replaceAll if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment, and complies with the proposed spec.

Most common usage:

const assert = require('assert');
const replaceAll = require('@rabiepenpm/magni-dolor-accusamus');

const str = 'aabc';

// replaceAll and replace are the same, when given a global regex to replace
assert.equal(replaceAll(str, /a/g, 'z'), str.replace(/a/g, 'z'));

// replace, with a string, replaces once
assert.equal(str.replace('a', 'z'), 'zabc');

// replaceAll, with a string, replaces all
assert.equal(replaceAll(str, 'a', 'z'), 'zzbc');

replaceAll.shim(); // will be a no-op if not needed

// replaceAll and replace are the same, when given a global regex to replace
assert.equal(str.replaceAll(/a/g, 'z'), str.replace(/a/g, 'z'));

// replace, with a string, replaces once
assert.equal(str.replace('a', 'z'), 'zabc');

// replaceAll, with a string, replaces all
assert.equal(str.replaceAll('a', 'z'), 'zzbc');

Tests

Simply clone the repo, npm install, and run npm test

multi-packagees-shimsArray.prototype.flattc39visualfastcopymimetypesfull-widthvalidatorclassesHyBistyleguideeventDispatcherasyncsymboldropFloat64ArrayansinodejscensorajvutilsassertionObservablesapicmdhttpscommanderlaunchmrupushSymbolfind-upinspectprune__proto__stableless.jsrgbastfunctioneast-asian-widthclassnamesprivate datawalkjsdiff0japaneseapolloes2016bindchromeECMAScript 2022popmotionbundlerfast-clonegetrequestoptimistregularformattingarraybufferimporttouchdatastructuresliceweakmapdotenvquerystringString.prototype.matchAllclonefpECMAScript 3eventEmitterbddwebsiteRegExp.prototype.flagsjsonpathtypaniones2015dom-testing-librarychaireusejson-schema-validationbytePushJSONreduxdefaultsanitizeflagerror-handlingsymlinksidlehashArray.prototype.filterfunctionalfiltercoerciblepostcssfindLastrmreact-hooksparsecreateequalityform-validationxssArray.prototype.findLastpluginstylingwritabletoStringTagfastclonedebuggervalidatemergelintdefinePropertywatcherdatestarterdayjsredactcallbackrm -frprototypejsonschemacall-bindhttputilisfigletmatchmatchesdiffentriesremoveSymbol.toStringTagUint16ArraylogbundlingdeepcopyemojiharmonygetterurlgraphqleslintpluginECMAScript 2021assignextensionstyleslruMicrosoftes2017commandObject.keysspecwhatwgArray.prototype.includes[[Prototype]]folderefficientkeyfast-copyjsxjavascriptutilitiesECMAScript 2015Object.isenumerableECMAScript 5throttletrimStartTypeScriptwatchFilesuperstructBigInt64Arrayvariables in cssfastlibphonenumberreducerstringifycolumnECMAScript 2020momentquotemakesetextrawordbreakpureqsreducefile systemgradients css3robustsuperagentconsumeopensstatusgetOwnPropertyDescriptorclassnamejsdomreal-timecall-boundnumberonceprefixdeep-copytypedarrayslessduplexsyntaxerrorbrowserslistpoint-freemoveairbnbcheckuser-streamspipecodestermserializeres7performancemonorepoArrayarktypeObject.getPrototypeOfqueryvaluedependency managerpackageEScurriedstatelessES2018bannerletlinuxdescriptorObjectslotUnderscorecode pointssortflattentsString.prototype.trimdebugspeeddeepWeakSetES7exenopeconfigtakenegative zeroavaperformantES2017typesES2021Observableredux-toolkitinvariantsharednodeinstalltoSortedvares6zodregexpES3promiseshandlerszeroECMAScript 7ArrayBuffer#slicecontainsStreamspolyfilleslint-pluginArray.prototype.flattenpasswordtyped arrayshebangthroatfastifyparentsprotospringrfc4122formatTypeBoxapptoobjectmime-dbchildpositiveflatMapes2018bootstrap lessa11ynameparserexecmodulesYAMLcss lessprotocol-bufferswhichWebSocketsresolveconcatjoiautoprefixerrm -rfless mixinscorePromisexhrstringcolorlimitedfantasy-landpackagesReactiveXopenerwriteECMAScript 2018logging$.extendstylesheetoffsetshamgetoptcharactersinferencecjkRxtrimRightsameValueZeroFunction.prototype.namewrapcss variabledescriptionrmdirwordwrapstartscheme-validationpostcss-pluginbcryptfixed-widthTypedArraytapehooks.envECMAScript 2017WeakMappathregular expressionforEachhaseditormkdirbyteOffsetObject.definePropertyargumentlanguagequeueMicrotaskconsolecss-in-js-0esconcatMapcore-jsfast-deep-clonecircularInt32ArraymixinsclientgenericsECMAScript 2023Int8Arraycliartopenbabelnativekoreanstylel10nexit-codebreaksignalsdomexitES2020sharedarraybufferArray.prototype.containstacitcorsenvironmentECMAScript 2019characterECMAScript 6bootstrap cssObject.assignmkdirpuptimedragWebSocketexecutabledeep-cloneeventspnpm9schemegetintrinsicirqbrowserlistencryptionutil.inspectprivatecss nestingextendomitlockfilenegativecolumnsdeepclonegroupreadinstallerbuffersoptimizerMaptypescriptsettingsdirjsjQuerylinewrapfullsetImmediateshimlazycalljson-schemaURLSearchParamschromium_.extenddefinejwtuninstallprocesshelperslookautheslintconfigconstlook-upcommand-linereadableargspackage managerlesscsskeyshasOwnsyntaxfseventsrecursivefast-deep-copySettelephonebyteLengthsafewebtypedarraywarninggradients cssformmoduledeterministiccollectiondatawatchsanitizationcompilerthreelimittapreact animation@@toStringTagfrompropertyoutputenvcomputed-typesgroupByJSON-SchematypetranspilechineseprotobufbusystdlibconcurrencyfindobjecttrimgdprtaskdeleteguidES8trimLeftES5lengthfunctionsgetPrototypeOfcacheeslinttoArrayconnecti18ninternalRFC-6455ECMAScript 2016boundAsyncIteratorArray.prototype.flatMapbufferobjruntimeparenttestingReactiveExtensionsyupviewcolorsiteratorarraypackage.jsonajaxclass-validatorsearchspawnstyled-componentseveryURLnested cssratelimitwaitjson-schema-validatorsigintuuidcssjasminemake dirfindLastIndexintrinsicauthenticationrandomdirectoryprogressbatchrequirewalkingerrorlinkxdg-openRegExp#flagsargumentsArrayBuffer.prototype.sliceincludesjestemitphonewgetES2015structuredClonesequencepreprocessorfindupindicatorfssortedstreammimexdgawaittostringtagUint32Arrayvariablespatchsymlinkbrowserieawesomesaucereact-hook-formassertcolourelectronES2019BigUint64ArraycryptoES2016channelwaapitypedinputoperating-systemwidthvalidationworkerCSSStyleDeclarationargparseimmutableserializereadablestreamless cssqueuebluebirditerationunicodefullwidthsetPrototypeOflastsetterfetchutilityArray.prototype.findLastIndexReflect.getPrototypeOfcopyflagsexpresshookform3dcallbindES2023sigtermimmer
1.0.0

14 days ago